<!--
// Get the HTTP Object

function addToFavorites() { 
	var urlAddress 	= "http://www.besttimetogo.com"; 
	var pageName = "Best Time To Go! - BestTimeToGo.com"; 
	if (window.external) { 
		window.external.AddFavorite(urlAddress,pageName) 
	} else { 
		alert("Sorry! Your browser doesn't support this function."); 
	} 
} 

function city_window(win_name, URL, lt, tp) { 
	msgWindow=window.open(URL,win_name,'toolbar=yes,width=1024,height=768,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes'+',left='+lt+',top='+tp);
}

function open_window(win_name, URL, lt, tp) { 
	alert("test");
}

function checkRequiredField(fieldname) {
	if (document.getElementById(fieldname).value==""){
		document.getElementById(fieldname).className = 'missingfield'; 
	} else {
		document.getElementById(fieldname).className = 'normalfield'; 		
	}
}

function ClearList(OptionList, TitleName) {
	OptionList.length = 0;
	OptionList.options[0] = new Option(TitleName, '', true, true);
	// added by cwl to ensure consistent widths of pull-down menus
	OptionList.options[1] = new Option ('-------------------------','');
}

function LoadCountrys(country_field, Index, selectedCountry) {
	var CountrySelected = false;
	var tmp = '';
	var xtmp = 0;
		if (Index > 0) {
			var CurrentCountryNames = CountryNames[Index - 1].split('||');
			var CurrentContinentCountrys = ContinentCountrys[Index - 1].split('||');
			for (var i=0; i<CurrentCountryNames.length; i++) {
				country_field.options[i] = new Option(CurrentCountryNames[i], CurrentContinentCountrys[i], false, false);
				//tmp += CurrentContinentCountrys[i] + ' = ' + selectedCountry + '/';

					if(CurrentContinentCountrys[i] == selectedCountry) {
							    xtmp = i;
								//country_field.options[i].selected = true;
								//CountrySelected = true;
								//alert(CurrentContinentCountrys[i] + ' = ' + selectedCountry);
					}
			}
			//if(!CountrySelected)
			//country_field.options[1].selected = true;
			//country_field.options[xtmp+3].selected = true;
			//alert(xtmp);
		}
		// added by cwl to ensure consistent widths of pull-down menus
		country_field.options[i] = new Option ('----------------','');
		country_field.options[xtmp].selected = true;
}



	// not done yet.

function LoadCitys(city_field, CIndex, PIndex, selectedCity) {
	var xtmp = 0;
	if ((PIndex >= 0) && ( CIndex > 0) ) {
		if (CityNames[CIndex - 1 + '_' + PIndex]) {
			var CurrentCityNames = CityNames[CIndex - 1 + '_' + PIndex ].split('||');
			var CurrentCityValue = CityValues[CIndex - 1 + '_' + PIndex ].split('||');
			for (var i=0; i<CurrentCityNames.length; i++){
				city_field.options[i] = new Option(CurrentCityNames[i], CurrentCityValue[i], false, false);
				if(CurrentCityValue[i] == selectedCity) {
				    xtmp = i;
					//country_field.options[i].selected = true;
					//CountrySelected = true;
					//alert(CurrentContinentCountrys[i] + ' = ' + selectedCountry);
				}
			}
		 } else {
			var i = 0;
			city_field.options[i] = new Option('', '', false, false);
			i++;
		 }
		 //city_field.options[0].selected = true;
		 city_field.options[xtmp].selected = true;
	}
	city_field.options[i] = new Option ('----------------','');
}

function LoadTypes(Index) { // ClearList(document.search.segmentlist, '-- Continent --');
    city_field = document.search.city_id;
    continent_field = document.search.continent_id;
    country_field = document.search.country_id;
	if (Index > 0) {
		var CurrentSegments = Segments[Index - 1].split('||');
		for (var i=0; i<CurrentSegments.length; i++)
			document.search.segmentlist.options[i+1] = new Option(CurrentSegments[i], CurrentSegments[i], false, false);
		document.search.segmentlist.options[0].selected = true;
	}
}

function ChangeCountrys(continent_field, country_field, CalledFromOnLoad, selectedCountry) { // Clear both of the lists first then add the options if valid Make has been selected. -GDC
	// cwl added to trap when user chooses the last item in the list (the equal signs)
	if (continent_field.selectedIndex == (continent_field.length - 1)) {
		// reset to first continent_id in the list
		continent_field.selectedIndex = 1;
	}

	if (country_field.selectedIndex == (country_field.length - 1)) {
		// reset to first continent_id in the list
		country_field.selectedIndex = 0;
	}

	var CurrIndex = country_field.selectedIndex;
		ClearList(country_field, '-- Select Country --');
		LoadCountrys(country_field, continent_field.selectedIndex, selectedCountry);
}


function ChangeCitys(continent_field, country_field, city_field, CalledFromOnLoad, selectedCity) { // Clear both of the lists first then add the options if valid Make has been selected. -GDC
	// cwl added to trap when user chooses the last item in the list (the equal signs)
		if (continent_field.selectedIndex == (continent_field.length - 1)) {
			// reset to first continent_id in the list
			continent_field.selectedIndex = 1;
		}

		if (country_field.selectedIndex == (country_field.length - 1)) {
			// reset to first continent_id in the list
			country_field.selectedIndex = 0;
		}

		ClearList(city_field, '-- Select City --');
		LoadCitys(city_field, continent_field.selectedIndex, country_field.selectedIndex, selectedCity);
		if (CalledFromOnLoad == 1) {
			var CurrIndex =city_field.selectedIndex;
			city_field.selectedIndex = CurrIndex;
		}

		if (city_field.selectedIndex == (city_field.length - 1)) {
			// reset to first continent_id in the list
			city_field.selectedIndex = 0;
		}
}
	/* These next functions were imported to use in the drop-down search suggestion boxes. */

function getObj(objID) {
    if (document.getElementById) {return document.getElementById(objID);}
    else if (document.all) {return document.all[objID];}
    else if (document.layers) {return document.layers[objID];}
}







function checkClick(e) { 
	e?evt=e:evt=event;
	CSE=evt.target?evt.target:evt.srcElement;
	if (getObj('fc'))
		if (!isChild(CSE,getObj('fc')))
			getObj('fc').style.display='none';
}


function isChild(s,d) {
	while(s) {
		if (s==d) 
			return true;
		s=s.parentNode;
	}
	return false;
}







function Left(obj)



{



	var curleft = 0;



	if (obj.offsetParent)



	{



		while (obj.offsetParent)



		{



			curleft += obj.offsetLeft;



			obj = obj.offsetParent;



		}



	}



	else if (obj.x)



		curleft += obj.x;



	return curleft;



}







function Top(obj)



{



	var curtop = 0;



	if (obj.offsetParent)



	{



		while (obj.offsetParent)



		{



			curtop += obj.offsetTop;



			obj = obj.offsetParent;



		}



	}



	else if (obj.y)



		curtop += obj.y;



	return curtop;



}







//Added for registration.php



function display_help(object,text){



	var myS = document.getElementById('reghelp').style;



	//alert(Top(object));



	myS.top = String(Top(object)) + 'px';



	myS.left = String(Left(object) + 160) + 'px';



	myS.display = 'block';



	document.getElementById('help_text').innerHTML = text;	



}







//Added to enable animation of DIVs	







var currentMovements = new Array();







function toNumber(myStr){



	newString = '';



	myStr = String(myStr);



	valids = "0123456789";



	for(nn=0;nn<myStr.length;nn++){



		if(valids.indexOf(myStr.substr(nn,1))>-1) newString += String(myStr.substr(nn,1));



		//if(Number()!==false) 



	}



	//alert(myStr + "\n" + newString);



	return Number(newString);



}







function start_moving(myDiv,givenSpeed,initW,finalW,initH,finalH){



	if(currentMovements[myDiv]){



		//alert('Called on ' + myDiv + "\r" + currentMovements[myDiv]['timeout']);



		delete currentMovements[myDiv];



	}



	//clearTimeout(currentMovements[myDiv]['timeout']);



	initW = toNumber(initW);



	initH = toNumber(initH);



	finalW = toNumber(finalW);



	finalH = toNumber(finalH);



	currentMovements[myDiv] = new Array();



	currentMovements[myDiv]['initial_width'] = initW;



	currentMovements[myDiv]['final_width'] = finalW;



	currentMovements[myDiv]['initial_height'] = initH;



	currentMovements[myDiv]['final_height'] = finalH;



	currentMovements[myDiv]['speed'] = givenSpeed;



	currentMovements[myDiv]['num'] = 0;



	//alert(currentMovements);



	currentMovements[myDiv]['timeout'] = setTimeout('keep_moving(\'' + myDiv + '\')',currentMovements[myDiv]['speed']);



}



function keep_moving(myDiv){



	//clearTimeout(currentMovements[myDiv]['timeout']);



	//alert('Attempting ' + myDiv + "\r" + currentMovements[myDiv]['num']);



	if(document.getElementById(myDiv)){



	currentMovements[myDiv]['num'] = Math.round(currentMovements[myDiv]['num']*100)/100 + 1/24;



	



	if (currentMovements[myDiv]['num']<1) {



		if(Math.abs(currentMovements[myDiv]['final_width']-currentMovements[myDiv]['initial_width'])>1){



			document.getElementById(myDiv).style.width = (Number(currentMovements[myDiv]['initial_width']) + Number(Math.round((currentMovements[myDiv]['final_width']-currentMovements[myDiv]['initial_width'])*(1/2-Math.cos(currentMovements[myDiv]['num']*3.14159265389793)/2)))) + 'px';



		} else {



			document.getElementById(myDiv).style.width = currentMovements[myDiv]['final_width'] + 'px';



		}



		//if(currentMovements[myDiv]['final_height']-currentMovements[myDiv]['initial_height']<0) alert(myDiv + (Number(currentMovements[myDiv]['initial_height']) + Math.round((currentMovements[myDiv]['final_height']-currentMovements[myDiv]['initial_height'])*(1/2-Math.cos(currentMovements[myDiv]['num']*3.14159265389793)/2))));



		//alert("I -> " + currentMovements[myDiv]['initial_height'] + "\nD -> " + currentMovements[myDiv]['final_height'] + "\nR -> " + (currentMovements[myDiv]['final_height'] - currentMovements[myDiv]['initial_height']));



		if(Math.abs(currentMovements[myDiv]['final_height']-currentMovements[myDiv]['initial_height'])>1){



			//alert(Number(currentMovements[myDiv]['initial_height']) + Number(Math.round((currentMovements[myDiv]['final_height']-currentMovements[myDiv]['initial_height'])*(1/2-Math.cos(currentMovements[myDiv]['num']*3.14159265389793)/2))));



			document.getElementById(myDiv).style.height = (Number(currentMovements[myDiv]['initial_height']) + Number(Math.round((currentMovements[myDiv]['final_height']-currentMovements[myDiv]['initial_height'])*(1/2-Math.cos(currentMovements[myDiv]['num']*3.14159265389793)/2)))) + 'px';



		} else {



			//alert('no' + "\n" + get_height(myDiv) + "\n" + currentMovements[myDiv]['final_height']);



			document.getElementById(myDiv).style.height = currentMovements[myDiv]['final_height'] + 'px';



		}



		



		 



	} else {



		currentMovements[myDiv]['num'] = 0;



		clearTimeout(currentMovements[myDiv]['timeout']);



		currentMovements[myDiv]['initial_width'] = currentMovements[myDiv]['final_width'];



		currentMovements[myDiv]['initial_height'] = currentMovements[myDiv]['final_height'];



		currentMovements[myDiv]['speed'] = 10000000000;



		document.getElementById(myDiv).style.width = currentMovements[myDiv]['final_width'] + 'px';



		document.getElementById(myDiv).style.height = currentMovements[myDiv]['final_height'] + 'px';



	}



	



	document.getElementById(myDiv).style.display = '';



	currentMovements[myDiv]['timeout'] = setTimeout('keep_moving(\'' + myDiv + '\')',currentMovements[myDiv]['speed']);



	} else {



		



	document.getElementById(myDiv).style.display = '';



	delete currentMovements[myDiv];



	clearTimeout(currentMovements[myDiv]['timeout']);



	}



}



function get_width(id){



	return toNumber(document.getElementById(id).style.width);



}



function get_height(id){



	return toNumber(document.getElementById(id).style.height);



}







		function showonly(selectObj){



			var opts = selectObj.options;



			for(i=0;i<opts.length;i++){



				if(document.getElementById(opts[i].value)) document.getElementById(opts[i].value).style.display='none';



			}



			if(document.getElementById(opts[selectObj.selectedIndex].value)) document.getElementById(opts[selectObj.selectedIndex].value).style.display='';



		}



		



		function update_prospects(prospect){



		    $('prospects_div').style.display='none';



			new Ajax.Request('ajax_find_prospects.php?prospect=' + escape(prospect),



			  {



				method:'get',



				onSuccess: function(transport){



				  var response = transport.responseText || "";



				  $('prospects_div').style.display='';



				  $('prospects_text').innerHTML = response;



				  return false;



				},



				onFailure: function(){ $(section).innerHTML = '';



				return false; }



			  });



		}







/* Added to work with Prototype.js */







function ajaxGet(url, section){



	//$(section).innerHTML = '<img src="/images/indicator_mozilla_blu.gif" />';



	new Ajax.Request(url,



  {



    method:'get',



    onSuccess: function(transport){



      var response = transport.responseText || "";



      $(section).innerHTML = response;

	  if($(section).disabled) $(section).disabled = false;



	  return false;



    },



    onFailure: function(){ $(section).innerHTML = '';



	return false; }



  });



}







function update_countries_list(countries_list_id, continent_id){



	var myList = document.getElementById(countries_list_id);



	while(myList.options.length>0){



		myList.remove(0);



	}



	new Ajax.Request('ajax_country_list.php?ajax=1&continent_id=' + continent_id,



  {



    method:'get',



    onSuccess: function(transport){



      var response = transport.responseText || "";



	  myArray = response.split("::");



	  //alert(myArray);



	  for(i=0;i<myArray.length;i+=2){



		newOpt = document.createElement('option');



		newOpt.value = myArray[i];



		newOpt.text = myArray[i+1];



		myList.add(newOpt,null);



	  }



	  return false;



    },



    onFailure: function(){ $('continent_listing').style.backgroundImage = 'url(/images/map_all.jpg)';



	//alert('bad');



	return false; }



  });



}







function update_cities_list(cities_list_id, country_id){



	var myList = document.getElementById(cities_list_id);



	while(myList.options.length>0){



		myList.remove(0);



	}



	new Ajax.Request('ajax_city_list.php?ajax=1&country_id=' + country_id,



  {



    method:'get',



    onSuccess: function(transport){



      var response = transport.responseText || "";



	  myArray = response.split("::");



	  for(i=0;i<myArray.length;i+=2){



		newOpt = document.createElement('option');



		newOpt.value = myArray[i];



		newOpt.text = myArray[i+1];



		myList.add(newOpt,null);



	  }



	  return false;



    },



    onFailure: function(){ $('continent_listing').style.backgroundImage = 'url(/images/map_all.jpg)';



	//alert('bad');



	return false; }



  });



}











function find_countries(continent_id){



	//start_moving('continent_chosen',10,get_width('continent_chosen'),get_width('continent_chosen'),get_height('continent_chosen'),0);



	start_moving('countries_listing',1,get_width('countries_listing'),460,get_height('countries_listing'),get_height('countries_listing'));



	



	start_moving('cities_listing',1,get_width('cities_listing'),0,get_height('cities_listing'),get_height('cities_listing'));



	$('cities_listing').innerHTML = '';



	$('continent_listing').style.backgroundImage = 'url(/images/map_loading.jpg)';



	$('continent_listing').innerHTML = '';



	new Ajax.Request('ajax_country_list.php?continent_id=' + continent_id,



  {



    method:'get',



    onSuccess: function(transport){



      var response = transport.responseText || "";



	  start_moving('continent_chosen',10,get_width('continent_chosen'),get_width('continent_chosen'),get_height('continent_chosen'),200);



	  $('continent_listing').style.backgroundImage = 'url(/images/map_all.jpg)';



	  $('continent_listing').innerHTML = '<img src="/images/map_all.jpg" width="460" height="211" border=0 usemap="#Map" name="Image101" id="Image101">';



      $('countries_listing').innerHTML = response;



	  //alert(response);



	  return false;



    },



    onFailure: function(){ $('continent_listing').style.backgroundImage = 'url(/images/map_all.jpg)';



	//alert('bad');



	return false; }



  });



}



function find_cities(country_id){



	start_moving('countries_listing',1,get_width('countries_listing'),460,get_height('countries_listing'),get_height('countries_listing'));



	start_moving('cities_listing',1,get_width('cities_listing'),0,get_height('cities_listing'),get_height('cities_listing'));



	$('cities_listing').innerHTML = '';



	new Ajax.Request('ajax_city_list.php?country_id=' + country_id,



  {



    method:'get',



    onSuccess: function(transport){



      var response = transport.responseText || "";



	  start_moving('countries_listing',10,get_width('countries_listing'),230,get_height('countries_listing'),get_height('countries_listing'));



	  start_moving('cities_listing',10,get_width('cities_listing'),230,get_height('cities_listing'),get_height('cities_listing'));



      $('cities_listing').innerHTML = response;



	  //alert(response);



	  return false;



    },



    onFailure: function(){



	//alert('bad');



	return false; }



  });



}







function quick_login(loginForm){



	new Ajax.Request('login.php?quick_login=true&' + loginForm.serialize(),



  {



    method:'get',



    onSuccess: function(transport){



      var response = transport.responseText || "";



	  $('login_form').innerHTML = response;



	  return false;



    },



    onFailure: function(){ return false; }



  });



}











/* Added to work with the drop-down suggestion box for the search bars */







//document.write('<div id="sb" style="z-index:99;position:absolute;width:300px;border:1px solid black;background-color:white;display:none;top:0px;left:0px;"></div>');



var currentObj = new Object();



var sugs = 0;



function startsuggest(givenObj){



	currentObj = givenObj;



	clearTimeout(sugs);



	sugs = setTimeout("suggest(false);",30);



}



function startsuggestb(givenObj,idid){



	currentObj = givenObj;



	clearTimeout(sugs);



	sugs = setTimeout("suggestb(false,'"+idid+"');",30);



}



function suggest(givenObj){



	if(!givenObj){



		givenObj = currentObj;



	} else {



		currentObj = givenObj;



	}



	if(givenObj.value!=""){



	getObj('sb').innerHTML = '';



	getObj('sb').style.top = Top(givenObj)+givenObj.offsetHeight + 'px';	



	getObj('sb').style.left = Left(givenObj) + 'px';



	ajaxGet('ajax_suggest.php?q=' + givenObj.value,'sb');



	eva = setTimeout('evaluate_fill()',300);



	}



}



function login_box_show(){

	var login = getObj('ajax_login_box');

	var link = getObj('link_login_box');

	login.style.display = '';	

	login.style.left = Left(link) + link.offsetWidth - login.offsetWidth + 'px';

	login.style.top = Top(link)+link.offsetHeight + 'px';

	return false;

}



function suggestb(givenObj,idid){



	if(!givenObj){



		givenObj = currentObj;



	} else {



		currentObj = givenObj;



	}



	if(givenObj.value!=""){



	getObj('sb').innerHTML = '';



	getObj('sb').style.top = Top(givenObj)+givenObj.offsetHeight + 'px';	



	getObj('sb').style.left = Left(givenObj) + 'px';



	ajaxGet('ajax_suggestb.php?q=' + givenObj.value + '&idid=' + idid,'sb');



	eva = setTimeout('evaluate_fill()',300);



	}



}



function evaluate_fill(){



	getObj('sb').style.display = (getObj('sb').innerHTML != "")?'':'none';



}



function stopsuggesting(){



	getObj('sb').style.top = 0;



	getObj('sb').style.left = 0;



	getObj('sb').style.display = 'none';



	//getObj('sb').innerHTML = '';



}



function stopsuggesting_countdown(){



	stopsug = setTimeout('stopsuggesting()',500);



}







function attachmouse(event){



	//alert("C: " + event.screenX + ', ' + event.screenY);



	document.getElementById('mouseover').style.left = (event.screenX + 10) + 'px';



	document.getElementById('mouseover').style.top = (event.screenY - document.getElementById('mobox').clientHeight*2) + 'px';



}







function motext(text){
	document.getElementById('map_footer').innerHTML = text;
}



function header_look (new_text) {
	original_text = "Zoom In On Your Destination";
	document.getElementById('map_heading').innerHTML = (new_text.length > 0) ? '<div style="float:right; text-align:right; width:60px;"><a href="#" onClick="map_goback(); return false;">[back]</a></div>' + new_text : original_text;
}



function modrop(){
	document.getElementById('map_footer').innerHTML='';
}



function map_goback(){



	GUnload();



	document.getElementById('front_map').style.display='block';



	document.getElementById('googlemap').style.display='none';



	//document.getElementById('front_map').style.backgroundImage = 'none';



	//start_moving('front_map',10,get_width('front_map'),get_width('front_map'),get_height('front_map'),241);



	//document.getElementById('front_map').innerHTML = store;



	header_look('');



}



function map_zoomin(continent_id){
	document.getElementById('front_map').style.display='none';
	document.getElementById('googlemap').style.display='block';
	load(continent_id);
	/*
	start_moving('front_map',10,get_width('front_map'),get_width('front_map'),get_height('front_map'),400);
	store = document.getElementById('front_map').innerHTML;
	document.getElementById('front_map').innerHTML = '';
	modrop();
	document.getElementById('front_map').style.backgroundImage = 'url(/images/worldmap_loading.jpg)';
	ajaxGet('ajax_zoom.php?maptop=' + Top(document.getElementById('front_map')) + '&mapleft=' + Left(document.getElementById('front_map')) + '&continent_id=' + continent_id,'front_map');
	//document.getElementById('front_map').innerHTML = '';
	*/
}



var store = "";







    //<![CDATA[



function ajax_cityInfo(city_id,city_name){



	new Ajax.Request('ajax_cityinfo.php?city_id=' + city_id,



	  {

		method:'get',

		onSuccess: function(transport){

			var response = transport.responseText || "";

			alert(response);

			return response;

		},

	onFailure: function(){ return false; }});

}

function admin_panel_load(lat,lon){
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("googlemap"));
		var mapTypeControl = new GMapTypeControl();
		var mapSizeControl = new GSmallZoomControl();

		var topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10));
		var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10));
		var topLeft = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10,10));
		var bottomLeft = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(10,10));

		map.addControl(mapTypeControl, topRight);
		map.addControl(mapSizeControl, topLeft);
		geocoder = new GClientGeocoder();
		
		var point = new GLatLng(lat,lon);
		map.setCenter(point, 7);

		var hereIcon = new GIcon(G_DEFAULT_ICON);
		var marker = new GMarker(point, {draggable:true, icon: hereIcon});

		GEvent.addListener(marker, "dragstart", function() { map.closeInfoWindow(); });
		GEvent.addListener(marker, "dragend", function() {
			placePoint = marker.getPoint();
			marker.openInfoWindowHtml("Updated!");
			document.getElementById('lat_field').value = marker.getPoint().lat();
			document.getElementById('lon_field').value = marker.getPoint().lng();
		  });
		map.addOverlay(marker);
	}
}


function showAddress(address) {

  if(geocoder){

	  geocoder.getLatLng(

		address,

		function(point) {

		  if (!point) {

			alert(address + " not found");

		  } else {

			map.setCenter(point, 14);

						

			var hereIcon = new GIcon(G_DEFAULT_ICON);

			

			var marker = new GMarker(point, {draggable:true, icon: hereIcon});

			placePoint = marker.getPoint();

			GEvent.addListener(marker, "dragstart", function() { map.closeInfoWindow(); });

			

			GEvent.addListener(marker, "dragend", function() {

				placePoint = marker.getPoint();

				marker.openInfoWindowHtml("Updated!");

				document.getElementById('lat_field').value = marker.getPoint().lat();

				document.getElementById('lon_field').value = marker.getPoint().lng();

			});

			map.addOverlay(marker);

			document.getElementById('lat_field').value = point.lat();

			document.getElementById('lon_field').value = point.lng();

		  

		  }

		}

	  );

  }

  return false;

}



function load(continent_id) {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("googlemap"));
		var mapTypeControl = new GMapTypeControl();
		var mapSizeControl = new GSmallZoomControl();
		
		var topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,10));
		var bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10));
		var topLeft = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10,10));
		var bottomLeft = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(10,10));

		map.addControl(mapTypeControl, topRight);
		map.addControl(mapSizeControl, topLeft);
		//map.setCenter(new GLatLng(0, 0), 1);

		if(continent_id==1) map.setCenter(new GLatLng(5.6, 24), 3); //Africa
		if(continent_id==5) map.setCenter(new GLatLng(39, -95), 3); //North America
		if(continent_id==6) map.setCenter(new GLatLng(-13, -56), 3); //South America
		if(continent_id==7) map.setCenter(new GLatLng(52.4, 14.76), 3); //Europe
		if(continent_id==4) map.setCenter(new GLatLng(33.14, 43.2), 3); //Middleeast
		if(continent_id==2) map.setCenter(new GLatLng(46.7, 106.7), 3); //Asia
		if(continent_id==3 || continent_id==9) map.setCenter(new GLatLng(-18.5, 142.9), 3); //Australia
		if(continent_id==8) map.setCenter(new GLatLng(20.6, -76), 4); //Carrib
		geocoder = new GClientGeocoder();
		
		new Ajax.Request('ajax_front.php?continent_id=' + continent_id,
	{
	method:'get',
		onSuccess: function(transport) {
			var response = transport.responseText || "";
			// alert("Response: " + response);
			myArray = response.split("::");
			var hereIcon = new GIcon(G_DEFAULT_ICON);
			//hereIcon.image = "http://www.besttimetogo.com/images/small.gif";
			//hereIcon.iconSize = new GSize(9,32);
			//hereIcon.shadowSize = new GSize(9,13);
		
			var plots = new Array();
			for(i=0;i<myArray.length;i+=4){
				lat = myArray[i+0];
				lon = myArray[i+1];
				cid = myArray[i+2];
				cname = myArray[i+3];
				if(cname.length>0) {
					var point = new GLatLng(Number(lat), Number(lon));
					var markerOptions = {draggable:false, icon: hereIcon};
					plots[cid] = new GMarker(point,markerOptions);
					plots[cid].cid = cid;
					plots[cid].cname = cname;
					GEvent.addListener(plots[cid], "click", function() {
						//this.openInfoWindowHtml(ajax_cityInfo(this.cid,this.cname));
						this.openInfoWindowHtml("<a href=\"view.php?city_id=" + this.cid + "\">" + this.cname + "</a>");
					});
					map.addOverlay(plots[cid]);
				}
			}
			return false;
		},
		onFailure: function(){ alert('???'); return false; }});
		}
}
//-->
