//first preload images
var preloaded = new Array();
function preload_images() {
    for (var i = 0; i < arguments.length; i++){
        preloaded[i] = document.createElement('img');
        preloaded[i].setAttribute('src',arguments[i]);
    };
};
preload_images(
	'images/maps/phuket_patong.gif',
	'images/maps/phuket_chalong.gif',
	'images/maps/phuket_kamala.gif',
	'images/maps/phuket_capepanwa.gif',
	'images/maps/phuket_karon.gif',
	'images/maps/phuket_kata.gif',
	'images/maps/phuket_town.gif',
	'images/maps/phuket_naiharn.gif',
	'images/maps/phuket_rawai.gif',
	'images/maps/phuket_surin.gif',
	'images/maps/phuket_phangngabay.gif',
	'images/maps/phuket_choengtalay.gif',
	'images/maps/phuket_naiyang.gif',
	'images/maps/lanta.gif',
	'images/maps/phiphi.gif',
	'images/maps/racha.gif',
	'images/maps/similans.gif',
	'images/maps/yao_YaiNoi.gif'
);
//end preload

function doButtons(picimage) {
switch(picimage) {
	case 'Patong':
		picimage = 'phuket_patong.gif';
		theText = "Patong is on the West Coast. Great place for partying and nightlife";
		break;
	case 'Kata':
		picimage = 'phuket_kata.gif';
		theText = "Kata is on the West Coast- southern end. Great beaches. Popular Phuket destination.";
		break;
	case 'Karon':
		picimage = 'phuket_karon.gif';
		theText = "Karon, with a long stretch of beach, is just north of Kata.";
		break;
	case 'Surin':
		picimage = 'phuket_surin.gif';
		theText = "Surin is a quiet beach with a mix of local and tourists. Great food along the beach.";
		break;
	case 'Kamala':
		picimage = 'phuket_kamala.gif';
		theText = "Kamala is north of Patong and a fair bit more quiet.";
		break;
	case 'Choeng-Talay':
		picimage = 'phuket_choengtalay.gif';
		theText = "Choeng Talay is home to Bang Tao Beach.";
		break;
	case 'Nai-Harn':
		picimage = 'phuket_naiharn.gif';
		theText = "Nai Harn is at the southern end of Phuket, great beach.";
		break;
	case 'Cape-Panwa':
		picimage = 'phuket_capepanwa.gif';
		theText = "Cape Panwa is a quiet part of the Phuket Island, lots of locals, 10 minutes to Phuket Town.";
		break;
	case 'Phang-Nga-Bay':
		picimage = 'phuket_phangngabay.gif';
		theText = "Most of Phang Nga Bay is part of the Thai national park system. Great scenery.";
		break;
	case 'Chalong':
		picimage = 'phuket_chalong.gif';
		theText = "Chalong is one of the launching points for Phang Nga Bay. Many great Thai and intl restaurants.";
		break;
	case 'Rawai':
		picimage = 'phuket_rawai.gif';
		theText = "Rawai, down at the southern end of the island, is home to many great restaurants, great local scene.";
		break;
	case 'Phuket-Town':
		picimage = 'phuket_town.gif';
		theText = "Phuket Town: great food and interesting local scene. Plenty of affordable accommodation.";
		break;
	case 'Koh-Lanta':
		picimage = 'lanta.gif';
		theText = "Koh Lanta: off the beaten path and everything from bungalows to luxury.";
		break;
	case 'Koh-Phi-Phi':
		picimage = 'phiphi.gif';
		theText = "Koh Phi Phi or just Phi Phi: fun night life and great diving in the area. Epic scenary";
		break;
	case 'Koh-Racha':
		picimage = 'racha.gif';
		theText = "Koh Racha: a little jewel of an island with some nice resorts.";
		break;
	case 'Similans':
		picimage = 'similans.gif';
		theText = "The Similans: not much in the way of accommodation but there are some great dives.";
		break;
	case 'Koh-Yao':
		picimage = 'yao_YaiNoi.gif';
		theText = "Koh Yao Noi/Yai: two islands about an hour's boat ride from Phuket or Krabi.";
		break;
		
	case 'Nai-Yang':
		picimage = 'phuket_naiyang.gif';
		theText = "Nai Yang Beach: nice beach and national park next to the airport.";
		break;	
		
	case 'Phuket-Island':
		picimage = 'phuket_area.gif';
		theText = "Beautiful Phuket Island.";
		break;
}
document['picture'].src= 'images/maps/' + picimage;
document.getElementById('headtext').innerHTML=theText;
}