// JavaScript Document



// == set up a default value for the id ==
var id =-1;

// == have we been passed an id ? ==
var query = location.search.substring(1);
var pairs = query.split("&");
for (var i=0; i<pairs.length; i++) {
  var pos = pairs[i].indexOf("=");
  var argname = pairs[i].substring(0,pos).toLowerCase();
  var value = pairs[i].substring(pos+1).toLowerCase();
  if (argname == "id") {id = parseInt(value);}
}
var thaiIcon = new GIcon();
	thaiIcon.image = "http://www.thailandkartan.se/gimage/th.png";
	thaiIcon.iconSize = new GSize(20, 15);
	thaiIcon.iconAnchor = new GPoint(6, 6);
	thaiIcon.infoWindowAnchor = new GPoint(5, 1);
var northIcon = new GIcon();
	northIcon.image = "http://www.thailandkartan.se/gimage/sv.png";
	northIcon.iconSize = new GSize(20, 15);
	northIcon.iconAnchor = new GPoint(6, 6);
	northIcon.infoWindowAnchor = new GPoint(5, 1);
var baseIcon = new GIcon();
	baseIcon.image = "http://www.thailandkartan.se/gimage/mm_20_red.png";
	baseIcon.iconSize = new GSize(12, 20);
	baseIcon.iconAnchor = new GPoint(6, 20);
	baseIcon.infoWindowAnchor = new GPoint(5, 1);
var atmIcon = new GIcon(); 
	atmIcon.image = "http://www.thailandkartan.se/gimage/ATM.png";
	atmIcon.iconSize = new GSize(20, 15);
	atmIcon.iconAnchor = new GPoint(6, 6);
	atmIcon.infoWindowAnchor = new GPoint(5, 1);
var elevenIcon = new GIcon();
	elevenIcon.image = "http://www.thailandkartan.se/gimage/7eleven.png";
	elevenIcon.iconSize = new GSize(20, 20);
	elevenIcon.iconAnchor = new GPoint(6, 6);
	elevenIcon.infoWindowAnchor = new GPoint(5, 1);
var divingflagIcon = new GIcon();
	divingflagIcon.image = "http://www.thailandkartan.se/gimage/divingflag.png";
	divingflagIcon.iconSize = new GSize(18, 18);
	divingflagIcon.iconAnchor = new GPoint(6, 6);
	divingflagIcon.infoWindowAnchor = new GPoint(5, 1);
var golfIcon = new GIcon();
	golfIcon.image = "http://www.thailandkartan.se/gimage/golf.png";
	golfIcon.iconSize = new GSize(20, 20);
	golfIcon.iconAnchor = new GPoint(6, 6);
	golfIcon.infoWindowAnchor = new GPoint(5, 1);
var northIcon = new GIcon();
	northIcon.image = "http://www.thailandkartan.se/gimage/mm_20_udon.png";
	northIcon.iconSize = new GSize(10, 17);
	northIcon.iconAnchor = new GPoint(6, 6);
	northIcon.infoWindowAnchor = new GPoint(5, 1);
var centralIcon = new GIcon();
	centralIcon.image = "http://www.thailandkartan.se/gimage/mm_20_phuket.png";
	centralIcon.iconSize = new GSize(10, 17);
	centralIcon.iconAnchor = new GPoint(6, 6);
	centralIcon.infoWindowAnchor = new GPoint(5, 1);
var northeasternIcon = new GIcon();
	northeasternIcon.image = "http://www.thailandkartan.se/gimage/mm_20_northeastern.png";
	northeasternIcon.iconSize = new GSize(10, 17);
	northeasternIcon.iconAnchor = new GPoint(6, 6);
	northeasternIcon.infoWindowAnchor = new GPoint(5, 1);
var eastIcon = new GIcon();
	eastIcon.image = "http://www.thailandkartan.se/gimage/mm_20_east.png";
	eastIcon.iconSize = new GSize(10, 17);
	eastIcon.iconAnchor = new GPoint(6, 6);
	eastIcon.infoWindowAnchor = new GPoint(5, 1);
var southIcon = new GIcon();
	southIcon.image = "http://www.thailandkartan.se/gimage/mm_20_south.png";
	southIcon.iconSize = new GSize(10, 17);
	southIcon.iconAnchor = new GPoint(6, 6);
	southIcon.infoWindowAnchor = new GPoint(5, 1);	
var btsIcon = new GIcon();
	btsIcon.image = "http://www.thailandkartan.se/gimage/bts.png";
	btsIcon.iconSize = new GSize(20, 20);
	btsIcon.iconAnchor = new GPoint(6, 6);
	btsIcon.infoWindowAnchor = new GPoint(5, 1);
var mrtIcon = new GIcon();
	mrtIcon.image = "http://www.thailandkartan.se/gimage/mrta.png";
	mrtIcon.iconSize = new GSize(18, 20);
	mrtIcon.iconAnchor = new GPoint(6, 6);
	mrtIcon.infoWindowAnchor = new GPoint(5, 1);
var storeIcon = new GIcon();
	storeIcon.image = "http://www.thailandkartan.se/gimage/mm_20_red.png";
	storeIcon.iconSize = new GSize(12, 20);
	storeIcon.iconAnchor = new GPoint(6, 20);
	storeIcon.infoWindowAnchor = new GPoint(5, 1);
var shoppingIcon = new GIcon();
	shoppingIcon.image = "http://www.thailandkartan.se/gimage/shopping.png";
	shoppingIcon.iconSize = new GSize(20, 20);
	shoppingIcon.iconAnchor = new GPoint(6, 20);
	shoppingIcon.infoWindowAnchor = new GPoint(5, 1);
var planeIcon = new GIcon();
	planeIcon.image = "http://www.thailandkartan.se/gimage/flyg.png";
	planeIcon.iconSize = new GSize(22, 22);
	planeIcon.iconAnchor = new GPoint(6, 20);
	planeIcon.infoWindowAnchor = new GPoint(5, 1);
var trainIcon = new GIcon();
	trainIcon.image = "http://www.thailandkartan.se/gimage/train.png";
	trainIcon.iconSize = new GSize(18, 20);
	trainIcon.iconAnchor = new GPoint(6, 20);
	trainIcon.infoWindowAnchor = new GPoint(5, 1);
var busIcon = new GIcon();
	busIcon.image = "http://www.thailandkartan.se/gimage/buss.png";
	busIcon.iconSize = new GSize(26, 20);
	busIcon.iconAnchor = new GPoint(6, 20);
	busIcon.infoWindowAnchor = new GPoint(5, 1);
var clubIcon = new GIcon();
	clubIcon.image = "http://www.thailandkartan.se/gimage/mm_20_bar.png";
	clubIcon.iconSize = new GSize(18, 20);
	clubIcon.iconAnchor = new GPoint(6, 20);
	clubIcon.infoWindowAnchor = new GPoint(5, 1);
var attractionIcon = new GIcon();
	attractionIcon.image = "http://www.thailandkartan.se/gimage/attraction.png";
	attractionIcon.iconSize = new GSize(26, 20);
	attractionIcon.iconAnchor = new GPoint(6, 20);
	attractionIcon.infoWindowAnchor = new GPoint(5, 1);
var foodIcon = new GIcon();
	foodIcon.image = "http://www.thailandkartan.se/gimage/mm_20_food.png";
	foodIcon.iconSize = new GSize(22, 22);
	foodIcon.iconAnchor = new GPoint(6, 20);
	foodIcon.infoWindowAnchor = new GPoint(5, 1);
var spaIcon = new GIcon();
	spaIcon.image = "http://www.thailandkartan.se/gimage/spa.png";
	spaIcon.iconSize = new GSize(27, 27);
	spaIcon.shadowSize = new GSize(27, 27);
	spaIcon.iconAnchor = new GPoint(6, 20);
	spaIcon.infoWindowAnchor = new GPoint(5, 1);
var sportIcon = new GIcon();
	sportIcon.image = "http://www.thailandkartan.se/gimage/mm_20_white.png";
	sportIcon.iconSize = new GSize(12, 20);
	sportIcon.iconAnchor = new GPoint(6, 20);
	sportIcon.infoWindowAnchor = new GPoint(5, 1);
var uniIcon = new GIcon();
	uniIcon.image = "http://www.thailandkartan.se/gimage/mm_20_blue.png";
	uniIcon.iconSize = new GSize(12, 20);
	uniIcon.iconAnchor = new GPoint(6, 20);
	uniIcon.infoWindowAnchor = new GPoint(5, 1);
var hotelIcon = new GIcon();
	hotelIcon.image = "http://www.thailandkartan.se/gimage/lyx.png";
	hotelIcon.iconSize = new GSize(20, 20);
	hotelIcon.iconAnchor = new GPoint(6, 6);
	hotelIcon.infoWindowAnchor = new GPoint(5, 1);
var hotelIcon2 = new GIcon();
	hotelIcon2.image = "http://www.thailandkartan.se/gimage/budget.png";
	hotelIcon2.iconSize = new GSize(20, 20);
	hotelIcon2.iconAnchor = new GPoint(6, 6);
	hotelIcon2.infoWindowAnchor = new GPoint(5, 1);
var hotelIcon3 = new GIcon();
	hotelIcon3.image = "http://www.thailandkartan.se/gimage/mellan.png";
	hotelIcon3.iconSize = new GSize(20, 20);
	hotelIcon3.iconAnchor = new GPoint(6, 6);
	hotelIcon3.infoWindowAnchor = new GPoint(5, 1);
var hotelIcon4 = new GIcon();
	hotelIcon4.image = "http://www.thailandkartan.se/gimage/low-price.png";
	hotelIcon4.iconSize = new GSize(20, 20);
	hotelIcon4.iconAnchor = new GPoint(6, 6);
	hotelIcon4.infoWindowAnchor = new GPoint(5, 1);
var areaIcon = new GIcon();
	areaIcon.image = "http://www.thailandkartan.se/gimage/mm_20_area.png";
	areaIcon.iconSize = new GSize(12, 20);
	areaIcon.iconAnchor = new GPoint(6, 20);
	areaIcon.infoWindowAnchor =new GPoint(5, 1);
var tempelIcon = new GIcon();
	tempelIcon.image = "http://www.thailandkartan.se/gimage/tempel.png";
	tempelIcon.iconSize = new GSize(20, 20);
	tempelIcon.iconAnchor = new GPoint(6, 20);
	tempelIcon.infoWindowAnchor =new GPoint(5, 1);
var pierIcon = new GIcon();
	pierIcon.image = "http://www.thailandkartan.se/gimage/anchor.png";
	pierIcon.iconSize = new GSize(20, 20);
	pierIcon.iconAnchor = new GPoint(6, 20);
	pierIcon.infoWindowAnchor =new GPoint(5, 1);
var b1Icon = new GIcon();
	b1Icon.image = "http://www.kohchang.se/pic/White-Sand-Beach.png";
	b1Icon.iconSize = new GSize(120, 20);
	b1Icon.iconAnchor = new GPoint(120, 20);
	b1Icon.infoWindowAnchor =new GPoint(5, 1);
var b2Icon = new GIcon();
	b2Icon.image = "http://www.kohchang.se/pic/Klong-Prao-Beach.png";
	b2Icon.iconSize = new GSize(120, 20);
	b2Icon.iconAnchor = new GPoint(120, 20);
	b2Icon.infoWindowAnchor =new GPoint(5, 1);
var b3Icon = new GIcon();
	b3Icon.image = "http://www.kohchang.se/pic/Kai-Bae-Beach.png";
	b3Icon.iconSize = new GSize(120, 20);
	b3Icon.iconAnchor = new GPoint(120, 20);
	b3Icon.infoWindowAnchor =new GPoint(5, 1);
var b4Icon = new GIcon();
	b4Icon.image = "http://www.kohchang.se/pic/Lonely-Beach.png";
	b4Icon.iconSize = new GSize(120, 20);
	b4Icon.iconAnchor = new GPoint(120, 20);
	b4Icon.infoWindowAnchor =new GPoint(5, 1);
var b5Icon = new GIcon();
	b5Icon.image = "http://www.kohchang.se/pic/Bang-Bao-bay.png";
	b5Icon.iconSize = new GSize(120, 20);
	b5Icon.iconAnchor = new GPoint(60, 00);
	b5Icon.infoWindowAnchor =new GPoint(5, 1);
var b6Icon = new GIcon();
	b6Icon.image = "http://www.kohchang.se/pic/Salak-Phet-Bay.png";
	b6Icon.iconSize = new GSize(120, 20);
	b6Icon.iconAnchor = new GPoint(60, 00);
	b6Icon.infoWindowAnchor =new GPoint(5, 1);
var markers;
var infoHtml;
var map;
var smap; 
function onLoad() {var panel = document.getElementById('panel');
var CategoryCurr = "";var CategoryNew = "";
var html = "";
var layerTerCross = [ G_PHYSICAL_MAP.getTileLayers()[0]];
var mtTerCross = new GMapType(G_PHYSICAL_MAP.getProjection());
		
map = new GMap2(document.getElementById("map"));
map.addControl(new GOverviewMapControl(new GSize(150,150)));
map.addMapType(G_PHYSICAL_MAP);
map.setMapType(G_PHYSICAL_MAP);
map.setCenter(new GLatLng(12.03,102.32), 10);
map.addControl(new GScaleControl());
map.addControl(new GSmallMapControl());
var mapControl = new GHierarchicalMapTypeControl();  <!-- G_NORMAL_MAP  G_SATELLITE_MAP G_HYBRID_MAP  G_PHYSICAL_MAP  -->
map.addControl(mapControl);


var request = GXmlHttp.create();
request.open("GET", "kct.xml", true);
request.onreadystatechange = function() {if (request.readyState == 4) 
    
{var xmlDoc = request.responseXML;
	var markerElements = xmlDoc.documentElement.getElementsByTagName("marker");
markers = new Array( markerElements.length );
infoHtml = new Array( markerElements.length );

for (var i = 0; 
i < markerElements.length; i++) {
	var Lat = parseFloat(markerElements[i].getAttribute("lat"));
	var Lng = parseFloat(markerElements[i].getAttribute("lng"));
	var Descr = markerElements[i].getAttribute("descr");
	var Url = markerElements[i].getAttribute("url");
	var Addr = markerElements[i].getAttribute("addr");
	var Phone = markerElements[i].getAttribute("phone");
	var Fax = markerElements[i].getAttribute("fax");
	var Img = markerElements[i].getAttribute("img");
	var ref = markerElements[i].getAttribute("ref");
       
CategoryNew = markerElements[i].getAttribute("category");  
    if (CategoryNew == "Uttagsautomater") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), atmIcon);} 
	if (CategoryNew == "Beach1") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), b1Icon);}
	if (CategoryNew == "Beach2") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), b2Icon);}
	if (CategoryNew == "Beach3") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), b3Icon);}
	if (CategoryNew == "Beach4") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), b4Icon);}
	if (CategoryNew == "Beach5") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), b5Icon);}
	if (CategoryNew == "Beach6") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), b6Icon);}
	if (CategoryNew == "Thai Ambassaden Sthlm") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), thaiIcon);} 
	if (CategoryNew == "SV Ambassaden BBK") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), northIcon);} 
	if (CategoryNew == "Diving Flag") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), divingflagIcon);} 
	if (CategoryNew == "7eleven") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), elevenIcon);} 
    if (CategoryNew == "South") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), southIcon);} 
	if (CategoryNew == "Northeastern") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), northeasternIcon);} 
	if (CategoryNew == "East") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), eastIcon);} 
	if (CategoryNew == "Central") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), centralIcon);} 
    if (CategoryNew == "North") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), northIcon);} 
	if (CategoryNew == "Silom Skytrain") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), btsIcon);} 
	if (CategoryNew == "Sukhumvit Skytrain") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), btsIcon);}
	if (CategoryNew == "Tunnelbana") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), mrtIcon);} 
	if (CategoryNew == "Fashion Shops") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), storeIcon);}
	if (CategoryNew == "Bars and Clubs") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), clubIcon);}
	if (CategoryNew == "Restaurants") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), foodIcon);}
	if (CategoryNew == "Spas") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), spaIcon);}
	if (CategoryNew == "Sports") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), sportIcon);}
	if (CategoryNew == "Golfbanor i Thailand") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), golfIcon);}
	if (CategoryNew == "Hotell Lyx") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), hotelIcon);}
	if (CategoryNew == "Hotell Mellan") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), hotelIcon3);}
	if (CategoryNew == "Hotell Budget") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), hotelIcon2);}
	if (CategoryNew == "Hotell billiga") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), hotelIcon4);}
	if (CategoryNew == "Areas") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), areaIcon);}
	if (CategoryNew == "Air Port") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), planeIcon);}
	if (CategoryNew == "Train Station") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), trainIcon);}
	if (CategoryNew == "Bus Station") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), busIcon);}
	if (CategoryNew == "Shopping") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), shoppingIcon);}
	if (CategoryNew == "Attraction") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), attractionIcon);}
	if (CategoryNew == "Tempel") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), tempelIcon);}
	if (CategoryNew == "Pier") {markers[i] = new GMarker( new GPoint( parseFloat(Lng), parseFloat(Lat) ), pierIcon);}
	
infoHtml[i] = "<font face='verdana, tahoma' size='-1'><b>" + Descr + "</b><br>Address:" + Addr + "<br>";
	if (markerElements[i].getAttribute("phone") != null){infoHtml[i] += "<font face='verdana, tahoma' size='-1'>Tel:" + Phone + "<br>";}
if (markerElements[i].getAttribute("fax") != null)infoHtml[i] += "<font face='verdana, tahoma' size='-1'>Fax:" + Fax + "<br>";
	if (markerElements[i].getAttribute("url") != null){infoHtml[i] += "<a href='http://" + Url + "' target=_new>" + Url + "</a><br>";}infoHtml[i] += "</font>";
	if (markerElements[i].getAttribute("img") != null){infoHtml[i] += "<a href='http://" + ref + "' target=_new><img src='http://" + Img + "' width='300' height='200' vspace='3'  border='0'></a><br>Klicka på bilden för översyn";	}

GEvent.addListener( markers[i], 'click', makeOpenerCaller(i) );
map.addOverlay( markers[i] ); 

	if (CategoryCurr != CategoryNew) {
	// ==  if (CategoryNew == "Beach1") {html = "<br><img src='http://www.kohchang.se/pic/White-Sand-Beach.png' align='middle' width='20'> ";}
	// ==  if (CategoryNew == "Beach2") {html = "<br><img src='http://www.kohchang.se/pic/Klong-Prao-Beach.png' align='middle' width='20'> ";}
	// ==  if (CategoryNew == "Beach3") {html = "<br><img src='http://www.kohchang.se/pic/Kai-Bae-Beach.png' align='middle' width='20'> ";}
	 // ==   if (CategoryNew == "Beach4") {html = "<br><img src='http://www.kohchang.se/pic/Kai-Bae-Beach.png' align='middle' width='20'> ";}
	 // ==   if (CategoryNew == "Beach5") {html = "<br><img src='http://www.kohchang.se/pic/Bang-Bao-bay.png' align='middle' width='20'> ";}
	 // ==   if (CategoryNew == "Beach6") {html = "<br><img src='http://www.kohchang.se/pic/Salak-Phet-Bay.png' align='middle' width='20'> ";}
	if (CategoryNew == "Uttagsautomater") {html = "<br><img src='http://www.thailandkartan.se/gimage/ATM.png' align='middle' width='18'> ";}
	if (CategoryNew == "SV Ambassaden BBK") {html = "<br><img src='http://www.thailandkartan.se/gimage/sv.png' align='middle' width='20'> ";}
	if (CategoryNew == "Thai Ambassaden Sthlm") {html = "<br><img src='http://www.thailandkartan.se/gimage/th.png' align='middle' width='20'> ";}
	if (CategoryNew == "7eleven") {html = "<br><img src='http://www.thailandkartan.se/gimage/7eleven.png' align='middle' width='18'> ";}
	if (CategoryNew == "Diving Flag") {html = "<br><img src='http://www.thailandkartan.se/gimage/divingflag.png' align='middle' width='16'> ";}
	if (CategoryNew == "North") {html = "<br><img src='http://www.thailandkartan.se/gimage/yello.png' align='middle' width='10'> ";}
	if (CategoryNew == "Northeastern") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_northeastern.png' align='middle' width='10'> ";}
	if (CategoryNew == "South") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_south.png' align='middle' width='10'> ";}
	if (CategoryNew == "East") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_east.png' align='middle' width='10'> ";}
	if (CategoryNew == "Central") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_phuket.png' align='middle' width='10'> ";}
	if (CategoryNew == "Silom Skytrain") {html = "<br><img src='http://www.thailandkartan.se/gimage/bts.png' align='middle' width='20'> ";} 
	if (CategoryNew == "Sukhumvit Skytrain") {html = "<br><img src='http://www.thailandkartan.se/gimage/bts.png' align='middle' width='20'> ";} 
	if (CategoryNew == "Tunnelbana") {html = "<br><img src='http://www.thailandkartan.se/gimage/mrta.png' align='middle' width='20'> ";} 
	if (CategoryNew == "Shopping") {html = "<br><img src='http://www.thailandkartan.se/gimage/shopping.png' align='middle' width='20'> ";} 
	if (CategoryNew == "Train Station") {html = "<br><img src='http://www.thailandkartan.se/gimage/train.png' align='middle' width='20'> ";} 
	if (CategoryNew == "Bus Station") {html = "<br><img src='http://www.thailandkartan.se/gimage/buss.png' align='middle' width='26'> ";} 
	if (CategoryNew == "Air Port") {html = "<br><img src='http://www.thailandkartan.se/gimage/flyg.png' align='middle' width='22'> ";} 
	if (CategoryNew == "Fashion Shops") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_red.png' align='middle'> ";}
	if (CategoryNew == "Bars and Clubs") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_bar.png' align='middle' width='20'> ";}
	if (CategoryNew == "Restaurants") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_food.png' align='middle' width='20'> ";}
	if (CategoryNew == "Spas") {html = "<br><img src='http://www.thailandkartan.se/gimage/spa.png' align='middle' width='20'> ";}
	if (CategoryNew == "Sports") {html = "<br><img src='http://www.thailandkartan.se/gimage/mm_20_white.png' align='middle'> ";}
	if (CategoryNew == "Golfbanor i Thailand") {html = "<br><img src='http://www.thailandkartan.se/gimage/golf.png' align='middle'> ";}
	if (CategoryNew == "Hotell billiga") {html = "<br><img src='http://www.thailandkartan.se/gimage/low-price.png' align='middle' width='20'> ";}
	if (CategoryNew == "Hotell Budget") {html = "<br><img src='http://www.thailandkartan.se/gimage/budget.png' align='middle' width='20'> ";}
	if (CategoryNew == "Hotell Mellan") {html = "<br><img src='http://www.thailandkartan.se/gimage/mellan.png' align='middle' width='20'> ";}
	if (CategoryNew == "Hotell Lyx") {html = "<br><img src='http://www.thailandkartan.se/gimage/lyx.png' align='middle' width='20'> ";}
	if (CategoryNew == "Attraction") {html = "<br><img src='http://www.thailandkartan.se/gimage/attraction.png' align='middle' width='26'> ";}
	if (CategoryNew == "Tempel") {html = "<br><img src='http://www.thailandkartan.se/gimage/tempel.png' align='middle' width='20'> ";}
	if (CategoryNew == "Pier") {html = "<br><img src='http://www.thailandkartan.se/gimage/anchor.png' align='middle' width='20'> ";}
	if (CategoryNew == "Areas") {html = "";}html += "<b>" + CategoryNew + "</b><br>";CategoryCurr = CategoryNew;}
	
	
html += "&nbsp;&nbsp;-<a href='javascript:opener(" + i + ")'>" + Descr + "</a><br>";panel.innerHTML += html;html = ""; }
        GEvent.trigger(markers[id],"click");
	}
}

request.send(null);}
function onMapMove(){
	if (document.getElementById("ToggleSmap").checked) 
{smap.centerAndZoom(map.getCenterLatLng(),smap.getZoomLevel()); }}

function onMapZoom(oldZoom, newZoom){
	if (document.getElementById("ToggleSmap").checked) {
	if(newZoom == 0){smap.centerAndZoom(map.getCenterLatLng(),0);}
	else{smap.centerAndZoom(map.getCenterLatLng(),newZoom-1);} }}

function createMarker(point, html) {
	var marker = new GMarker(point, baseIcon);
	
GEvent.addListener(marker, "click", 
function() {marker.openInfoWindowHtml(html);});
return marker;}function opener(i){markers[i].openInfoWindowHtml( infoHtml[i] );}


function makeOpenerCaller( i ){return function() { opener( i ); };}function zoom(Lng, Lat) {
	if (map.getZoomLevel() != 0) {map.centerAndZoom(new GPoint(Lng, Lat), map.getZoomLevel()-1);}}

function toggleSMap() {
	if (document.getElementById("ToggleSmap").checked) {onMapMove();document.getElementById("smap").style.display = "block";document.getElementById("map").style.width = "00px";} 
	else {document.getElementById("smap").style.display = "none";document.getElementById("map").style.width = "500px";}}
