var ajaxConn = new XHConn();
var idSpliter='<!ids!>';
var rowSpliter='<!rows!>';
/*var siteUrl=window.location.href;
siteUrl=siteUrl.substring(0,siteUrl.lastIndexOf('/'))+"/";*/

//var siteUrl="http://192.168.0.21/explore/";


var bc_url = self.location.href;
bc_url = bc_url.toLowerCase();
var siteUrl = '';

// determine the server   
var bc_local = 'localhost/';
var bc_ip = '192.168.0.13/';
var bc_live  = 'vertexplus.in/explore/';
var bc_live1  = 'www.vertexplus.in/explore/';
var bc_behind  = 'behindcity.com/explore/';
var bc_behind1  = 'www.behindcity.com/explore/';
var bc_behind2  = 'behindcity.com/';
var bc_behind3  = 'www.behindcity.com/';

if(bc_url.lastIndexOf(bc_local) > 1)
	siteUrl = "http://localhost/explore/";
else if(bc_url.lastIndexOf(bc_ip) > 1)
	siteUrl = "http://192.168.0.13/explore/";
else if(bc_url.lastIndexOf(bc_live1) > 1)
	siteUrl = "http://www.vertexplus.in/explore/";
else if(bc_url.lastIndexOf(bc_live) > 1)
	siteUrl = "http://vertexplus.in/explore/";
else if(bc_url.lastIndexOf(bc_behind1) > 1)
	siteUrl = "http://www.behindcity.com/explore/";
else if(bc_url.lastIndexOf(bc_behind) > 1)
	siteUrl = "http://behindcity.com/explore/";
else if(bc_url.lastIndexOf(bc_behind3) > 1)
	siteUrl = "http://www.behindcity.com/explore/";
else if(bc_url.lastIndexOf(bc_behind2) > 1)
	siteUrl = "http://behindcity.com/explore/";


//alert(siteUrl)


var cityVal=0;

function fillCity123()
{
	var country=getObj("country").value;
	/*if(getObj("hidcountry").value!=country)
	{
		getObj("hidcityindex").value=0;
	}
	getObj("hidcountry").value=country;*/
	var mode=getObj("hidmode").value;
	//ShowLoadingModal();
	ajaxConn.connect(siteUrl+"city.php", "POST", "country="+country+"&mode="+mode,fnWhenDone_fillCity);
}



function fillCity(country,city)
{
	//getObj("citytext").value="";
	//var country=getObj("country").value;
	/*if(getObj("hidcountry").value!=country)
	{
		getObj("hidcityindex").value=0;
	}
	getObj("hidcountry").value=country;*/
	var mode=getObj("hidmode").value;
	//ShowLoadingModal();
	if(city!="")
		cityVal=city;
	if (country != "")
		ajaxConn.connect(siteUrl+"city.php", "POST", "country="+country+"&mode="+mode,fnWhenDone_fillCity);
}

function fnWhenDone_fillCity(XML)
{
	var arrStatus=XML.responseText.split(",");
	emptyList("city");
	
	var optionObject=new Option("Select City");
	var optionRank=getObj("city").options.length;
	getObj("city").options[optionRank]=optionObject;
	getObj("city").options[optionRank].value=0;
	
	for(k=0;k<(arrStatus.length-1);k++)
	{
		var optionObject=new Option(arrStatus[k]);
		var optionRank=getObj("city").options.length;
		getObj("city").options[optionRank]=optionObject;
		getObj("city").options[optionRank].value=arrStatus[k];
		if(cityVal==arrStatus[k])
			getObj("city").options[optionRank].selected=true;
	}
	/*if(getObj("hidcityindex").value!="" && getObj("hidcityindex").value!=0 && getObj("hidcityindex").value<getObj("city").options.length)
	{
		getObj("city").selectedIndex=getObj("hidcityindex").value;
		//getCityDetails();
	}*/
	//HideLoadingModal();
}

function emptyList(recevierObj)
{
	for(i=1;i<(getObj(recevierObj).options.length+1);i++)
	{
		getObj(recevierObj).remove(i-1);
		i--;
	}
}

function formsubmit1(btnnum)
{
	if(btnnum==1)
	{
		getObj("hidcity").value=getObj("city").value;
		//getObj("hidcityindex").value=getObj("city").selectedIndex;
		//getObj("hidcountry").value=getObj("country").value;
		document.form1.action="citydetails.php?num=1";
	}
	if(btnnum==2)
	{
		
		if((parseInt(getObj("city").selectedIndex)+1)<getObj("city").options.length)
		{
			//getObj("hidcountry").value=getObj("country").value;
			//getObj("hidcityindex").value=parseInt(getObj("city").selectedIndex)+1;
			getObj("hidcity").value=getObj("city").options[parseInt(getObj("city").selectedIndex)+1].value;
		}
		else
		{
			//getObj("hidcityindex").value=0;
			getObj("hidcity").value="";
			//getObj("hidcountry").value="";
		}
		
		document.form1.action="citydetails.php?num=2";
	}
	document.form1.submit();
}


function getCountryDetails(btnnum)
{
	if(btnnum==1)
	{
		getObj("hidcountry").value=getObj("country").options[getObj("country").selectedIndex].text;
		//getObj("hidcityindex").value=getObj("city").selectedIndex;
		//getObj("hidcountry").value=getObj("country").value;
		document.form1.action="countrydetails.php?num=1";
	}
	if(btnnum==2)
	{
		
		if((parseInt(getObj("country").selectedIndex)+1)<getObj("country").options.length)
		{
			//getObj("hidcountry").value=getObj("country").value;
			//getObj("hidcityindex").value=parseInt(getObj("city").selectedIndex)+1;
			getObj("hidcountry").value=getObj("country").options[parseInt(getObj("country").selectedIndex)+1].text;
		}
		else
		{
			//getObj("hidcityindex").value=0;
			getObj("hidcountry").value="";
			//getObj("hidcountry").value="";
		}
		
		document.form1.action="countrydetails.php?num=2";
	}
	document.form1.submit();
}

function editCountryDetail(btnnum)
{
	if(btnnum==1)
	{
		getObj("hidcountry").value=getObj("country").value;
		//getObj("hidcityindex").value=getObj("city").selectedIndex;
		//getObj("hidcountry").value=getObj("country").value;
		document.form1.action="editcountrydetails.php?num=1";
	}
	if(btnnum==2)
	{
		
		if((parseInt(getObj("country").selectedIndex)+1)<getObj("country").options.length)
		{
			//getObj("hidcountry").value=getObj("country").value;
			//getObj("hidcityindex").value=parseInt(getObj("city").selectedIndex)+1;
			getObj("hidcountry").value=getObj("country").options[parseInt(getObj("country").selectedIndex)+1].value;
		}
		else
		{
			//getObj("hidcityindex").value=0;
			getObj("hidcountry").value="";
			//getObj("hidcountry").value="";
		}
		
		document.form1.action="editcountrydetails.php?num=2";
	}
	document.form1.submit();
}


function editcitydetails(btnnum)
{
	if(btnnum==1)
	{
		getObj("hidcity").value=getObj("city").value;
		//getObj("hidcityindex").value=getObj("city").selectedIndex;
		//getObj("hidcountry").value=getObj("country").value;
		document.form1.action="editcitydetails.php?num=1";
	}
	if(btnnum==2)
	{
		
		if((parseInt(getObj("city").selectedIndex)+1)<getObj("city").options.length)
		{
			//getObj("hidcountry").value=getObj("country").value;
			//getObj("hidcityindex").value=parseInt(getObj("city").selectedIndex)+1;
			getObj("hidcity").value=getObj("city").options[parseInt(getObj("city").selectedIndex)+1].value;
		}
		else
		{
			//getObj("hidcityindex").value=0;
			getObj("hidcity").value="";
			//getObj("hidcountry").value="";
		}
		
		document.form1.action="editcitydetails.php?num=2";
	}
	document.form1.submit();
}
/*
function getCityDetails()
{
	getObj("citytext").value="";
	var country=getObj("country").value;
	var city=getObj("city").value;
	getObj("hidcountry").value=getObj("country").value;
	getObj("hidcity").value=getObj("city").value;
	getObj("hidcityindex").value=getObj("city").selectedIndex;
	//ShowLoadingModal();
	ajaxConn.connect(siteUrl+"citydetails.php", "POST", "country="+country+"&city="+city,fnWhenDone_getCityDetails);	
}

function fnWhenDone_getCityDetails(XML)
{
	var citydetail=XML.responseText;
	getObj("citytext").value=citydetail;
	getObj("divcity").innerHTML=citydetail;
	//HideLoadingModal();
}

*/

function fillCityReg()
{
	var country=getObj("country").value;
	var region=getObj("region").value;
	var hidcountry=getObj("hidcountryname").value;
	ShowLoadingModal("city",30,"City");
	//var mode=getObj("hidmode").value;
	
	ajaxConn.connect(siteUrl+"cityfill.php", "POST", "country="+country+"&region="+region+"&hidcountryname="+hidcountry,fnWhenDone_fillCityReg);
	
}

function fnWhenDone_fillCityReg(XML)
{
	var arrStatus=XML.responseText.split(",");
	
	emptyList("city");
	
	var optionObject=new Option("Select City");
	var optionRank=getObj("city").options.length;
	getObj("city").options[optionRank]=optionObject;
	getObj("city").options[optionRank].value=0;
	
	for(k=0;k<(arrStatus.length-1);k++)
	{
		var optionObject=new Option(arrStatus[k]);
		var optionRank=getObj("city").options.length;
		getObj("city").options[optionRank]=optionObject;
		getObj("city").options[optionRank].value=arrStatus[k];
		if(cityVal==arrStatus[k])
			getObj("city").options[optionRank].selected=true;
		
	}
	HideLoadingModal();	
}

function formsubmituser(mode,formType)
{
	if(getObj("country").value==0)
	{
		alert('Please select country');
		return false;
	}
	if(formType==1)
	{
		if(getObj("region").value==0)
		{
			alert('Please select region');
			return false;
		}
		if(getObj("city").value==0)
		{
			alert('Please select city');
			return false;
		}
	}
	
	getObj("hidcountry").value=getObj("country").value;
	var coname=strReplaceAll(getObj("country").options[getObj("country").selectedIndex].text," ","-");
	var rname=strReplaceAll(getObj("region").options[getObj("region").selectedIndex].text," ","-");
	var ciname=strReplaceAll(getObj("city").value," ","-");
	//alert(coname)
	getObj("hidcity").value=getObj("city").value;
	getObj("mode").value=mode;
	getObj("hidcountryname").value=getObj("country").options[getObj("country").selectedIndex].text;
	if(mode=="country")
	{
		if(getObj("country").value!=0)
			document.form1.action=siteUrl+coname.toLowerCase();
		else
			document.form1.action=siteUrl+getObj("continent").value;
	}
	if(mode=="city")
	{
		if(getObj("city").value!=0)
			document.form1.action=siteUrl+coname.toLowerCase()+"/"+ciname.toLowerCase();
		else
			document.form1.action=siteUrl+coname.toLowerCase();
	}
	
	document.form1.submit();
}

function searchDetails()
{
	if(getObj("country").value==0)
	{
		alert('Please select country');
		return false;
	}
		
	getObj("hidcountry").value=getObj("country").value;
	//var contName=getObj("tmpcontinentname").value;
	var coname=strReplaceAll(getObj("country").options[getObj("country").selectedIndex].text," ","-");
	var rname="";
	var ciname="";
	getObj("hidcity").value="";
	if(getObj("region").selectedIndex!=0)
	{
		rname=strReplaceAll(getObj("region").options[getObj("region").selectedIndex].text," ","-");
	}	
	
	if(getObj("city").selectedIndex!=0)
	{
		
		ciname=strReplaceAll(getObj("city").value," ","-");
		//alert(ciname)
		getObj("hidcity").value=getObj("city").value;
		//alert(getObj("hidcity").value)
	}
	
	
	//getObj("mode").value=mode;
	getObj("hidcountryname").value=getObj("country").options[getObj("country").selectedIndex].text;
	
	if(getObj("country").selectedIndex!=0)
	{
		getObj("mode").value="country";
		document.form1.action=siteUrl+coname.toLowerCase()+"/";
	}
	
	if(getObj("region").selectedIndex!=0)
	{
		getObj("mode").value="country";
		getObj("hdregionname").value=getObj("region").options[getObj("region").selectedIndex].text;
		document.form1.action=siteUrl+coname.toLowerCase()+"/"+rname.toLowerCase()+"/";
	}
	
	if(getObj("city").selectedIndex!=0)
	{
		getObj("mode").value="city";
	
		document.form1.action=siteUrl+coname.toLowerCase()+"/"+rname.toLowerCase()+"/"+ciname.toLowerCase()+"/";
	}
	
	document.form1.submit();
}


function countryPost()
{	
	getObj("hidcountry").value=getObj("country").value;
	var coname=strReplaceAll(getObj("country").options[getObj("country").selectedIndex].text," ","-");
	getObj("hidcity").value="";
	getObj("hidcountryname").value=getObj("country").options[getObj("country").selectedIndex].text;
	if(getObj("country").selectedIndex!=0)
	{
		getObj("mode").value="country";
		document.form1.action=siteUrl+coname.toLowerCase()+"/";
	}
	document.form1.submit();
}

function fillCityDetails(country,city,region,hidcountry)
{
	//ShowLoadingModal();
	if(city!="")
		cityVal=city;
	if (country != "")
		ajaxConn.connect(siteUrl+"cityfill.php", "POST", "country="+country+"&region="+region+"&hidcountryname="+hidcountry,fnWhenDone_fillCityDetails);
}

function fnWhenDone_fillCityDetails(XML)
{
	var arrStatus=XML.responseText.split(",");
	emptyList("city");
	
	var optionObject=new Option("Select City");
	var optionRank=getObj("city").options.length;
	getObj("city").options[optionRank]=optionObject;
	getObj("city").options[optionRank].value=0;
	
	for(k=0;k<(arrStatus.length-1);k++)
	{
		var optionObject=new Option(arrStatus[k]);
		var optionRank=getObj("city").options.length;
		getObj("city").options[optionRank]=optionObject;
		
		getObj("city").options[optionRank].value=arrStatus[k];
		//alert(cityVal.toLowerCase())
		//alert(getObj("city").options[optionRank].value.toLowerCase())
		if(cityVal!=0)
		{
			if(cityVal.toLowerCase()==arrStatus[k].toLowerCase())
				getObj("city").options[optionRank].selected=true;
		}
		
	}
	//HideLoadingModal();
}
function submitlogin()

{
		document.login.submit();
}



function search_Focus()
{
	if(getObj("searchcity").value=="Type your city name")
		getObj("searchcity").value="";
}

function search_Blur()
{
		if(getObj("searchcity").value=="")
			getObj("searchcity").value="Type your city name";
}

function fillCountry(continent)
{
	getObj("divcountry").innerHTML="<div  class=loading_text>Loading Countries...</div>";
	ajaxConn.connect(siteUrl+"country.php", "POST", "continent="+continent,fnWhenDone_fillCountry);
}

function fnWhenDone_fillCountry(XML)
{
	getObj("divcountry").innerHTML=XML.responseText;
	if(getObj("divcountry").offsetHeight>270)
	{
		getObj("frmcountry").style.height=getObj("divcountry").offsetHeight;
	}
	else
		getObj("frmcountry").style.height=270;
}

function frmSubmit(countryCode,countryName)
{
	getObj("country").value=countryCode;
	getObj("hidcountryname").value=countryName;
	contName=getObj("tmpcontinentname").value;
	document.form1.action=siteUrl+strReplaceAll(countryName.toLowerCase()," ","-")+"/";
	document.form1.submit();
}
			
function fillRegionByCountry()
{
	var country=getObj("country").value;
	ShowLoadingModal("region",30,"Region");
	getObj("hidcountry").value=getObj("country").value;
	getObj("hidcountryname").value=getObj("country").options[getObj("country").selectedIndex].text;

	ajaxConn.connect(siteUrl+"region.php", "POST", "country="+country,fnWhenDone_fillRegionByCountry);
}

function fnWhenDone_fillRegionByCountry(XML)
{
	emptyList("region");
	emptyList("city");
	var arrRegion=XML.responseText.split(rowSpliter);
	
	var optionObject=new Option("Select Region");
	var optionRank=getObj("region").options.length;
	getObj("region").options[optionRank]=optionObject;
	getObj("region").options[optionRank].value=0;
	
	for(k=0;k<(arrRegion.length-1);k++)
	{
		var arrRegionText=new Array();
		arrRegionText=arrRegion[k].split(idSpliter);
		
		var optionObject=new Option(arrRegionText[1]);
		var optionRank=getObj("region").options.length;
		getObj("region").options[optionRank]=optionObject;
		getObj("region").options[optionRank].value=arrRegionText[0];
	}
	
	var optionObject=new Option("Select City");
	var optionRank=getObj("city").options.length;
	getObj("city").options[optionRank]=optionObject;
	getObj("city").options[optionRank].value=0;
		
	HideLoadingModal();
}

/*****************************************************************************************************************************/
/*function fillCountry(continent)
{
	getObj("divcountry").innerHTML="<div  class=loading_text>Loading Countries...</div>";
	ajaxConn.connect(siteUrl+"country.php", "POST", "continent="+continent,fnWhenDone_fillCountry);
}

function fnWhenDone_fillCountry(XML)
{
	getObj("divcountry").innerHTML=XML.responseText;
	if(getObj("divcountry").offsetHeight>270)
	{
		getObj("frmcountry").style.height=getObj("divcountry").offsetHeight;
	}
	else
		getObj("frmcountry").style.height=270;
}*/


function showCountryNav(conCode,conName)
{
	var sconame=window.parent.document.getElementById("hidcountryname").value;
	var scityname=window.parent.document.getElementById("hidcity").value;
	getObj("frmNavigation").src="countrynav.php?continent="+conCode+"&continentname="+conName+"&couname="+sconame+"&cityname="+scityname;
	
	
}

function showRegionNav(conCode,conName,cCode,cName)
{
	getObj("frmNavigation").src="regionnav.php?continent="+conCode+"&continentname="+conName+"&country="+cCode+"&countryname="+cName;
	
}

function showCityNav(conCode,conName,cCode,cName,rCode,rName)
{
	var scityname=window.parent.document.getElementById("hidcity").value;
	getObj("frmNavigation").src="citynav.php?continent="+conCode+"&continentname="+conName+"&country="+cCode+"&countryname="+cName+"&region="+rCode+"&regionname="+ rName+"&cityname="+scityname;
	
}

function postCityNav(rCode,rName,cName)
{
	cityVal=cName;
	for(a=0;a<(getObj("region").options.length-1);a++)
	{
		if(getObj("region").options[a].value==rCode)
		{
			getObj("region").options[a].selected=true;
			
		}
	}
	fillCityReg();
	formsubmitNav('city');
	//getObj("region").selectedIndex=2;
}

function formsubmitNav(mode)
{
	
	getObj("hidcountry").value=getObj("country").value;
	var coname=strReplaceAll(getObj("country").options[getObj("country").selectedIndex].text," ","-");
	var rname=strReplaceAll(getObj("region").options[getObj("region").selectedIndex].text," ","-");
	var ciname=strReplaceAll(cityVal," ","-");
	
	getObj("hidcity").value=cityVal;
	getObj("mode").value=mode;
	getObj("hidcountryname").value=getObj("country").options[getObj("country").selectedIndex].text;
	if(mode=="country")
	{
		if(getObj("country").value!=0)
			window.parent.form1.action=siteUrl+coname.toLowerCase();
		else
			window.parent.form1.action=siteUrl+getObj("continent").value;
	}
	if(mode=="city")
	{
		if(getObj("city").options[getObj("city").selectedIndex].text!=0)
			window.parent.form1.action=siteUrl+coname.toLowerCase()+"/"+ciname.toLowerCase();
		else
			window.parent.form1.action=siteUrl+coname.toLowerCase();
	}
	
	window.parent.form1.submit();
}

function submitCity(countryCode,countryName,rCode,cityname)
{
	getObj("country").value=countryCode;
	getObj("hidcountryname").value=countryName;
	getObj("region").value=rCode;
	getObj("hidcity").value=cityname;
	var rgName = getObj("regionname").value;
		
	document.form1.action=siteUrl+strReplaceAll(countryName.toLowerCase()," ","-")+"/"+strReplaceAll(rgName.toLowerCase()," ","-")+"/"+strReplaceAll(cityname.toLowerCase()," ","-")+"/";
	document.form1.submit();
}
function citySearch()
{
	var searchVal=getObj("searchcity").value;
	if(searchVal==0 || searchVal=="Type your city name")
	{
		alert('Please enter city name');
		return false;
	}
	if(searchVal.length<3)
	{
		alert('Please enter minimum 3 characters for city search');
		getObj("searchcity").focus();
		return false;
	}
	document.formsearch.submit();
	//window.location.href="searchResult.php?searchcity="+searchVal;
}


function clickFirst()
{
	var totalDivCount=getObj("hiddivcount").value;
	var currDivNum=getObj("hidcurrdivnum").value;
	getObj("divpage"+currDivNum).style.display="none";
	var nextDivNum=1;
	getObj("divpage"+nextDivNum).style.display="block";
	getObj("hidcurrdivnum").value=nextDivNum;

	getObj("afirst").style.display="none";
	getObj("aprevious").style.display="none";
	getObj("anext").style.display="block";
	getObj("alast").style.display="block";
	
	var totalRecord=getObj("hidtotalrec").value;
	var lastSRec = (parseInt(nextDivNum)*20);
	var firstSRec = parseInt(lastSRec)-19;
	if(lastSRec>totalRecord)
		lastSRec=totalRecord;
	
	getObj("numrecord").innerHTML= firstSRec+ " to "+lastSRec+" of "+totalRecord;
}

function clickPervious()
{
	var totalDivCount=getObj("hiddivcount").value;
	var currDivNum=getObj("hidcurrdivnum").value;
	getObj("divpage"+currDivNum).style.display="none";
	var nextDivNum=parseInt(currDivNum)-1;
	getObj("divpage"+nextDivNum).style.display="block";
	getObj("hidcurrdivnum").value=nextDivNum;
	if(nextDivNum==1)
	{
		getObj("afirst").style.display="none";
		getObj("aprevious").style.display="none";
	}
	else
	{
		getObj("afirst").style.display="block";
		getObj("aprevious").style.display="block";	
	}
	getObj("anext").style.display="block";
	getObj("alast").style.display="block";
	
	var totalRecord=getObj("hidtotalrec").value;
	var lastSRec = (parseInt(nextDivNum)*20);
	var firstSRec = parseInt(lastSRec)-19;
	if(lastSRec>totalRecord)
		lastSRec=totalRecord;
	
	getObj("numrecord").innerHTML= firstSRec+ " to "+lastSRec+" of "+totalRecord;
}

function clickNext()
{
	var totalDivCount=getObj("hiddivcount").value;
	
	var currDivNum=getObj("hidcurrdivnum").value;
	getObj("divpage"+currDivNum).style.display="none";
	var nextDivNum=parseInt(currDivNum)+1;
	getObj("divpage"+nextDivNum).style.display="block";
	getObj("hidcurrdivnum").value=nextDivNum;	
	
	if(nextDivNum==totalDivCount)
	{
		getObj("anext").style.display="none";
		getObj("alast").style.display="none";
	}
	else
	{
		getObj("anext").style.display="block";
		getObj("alast").style.display="block";	
	}
	getObj("afirst").style.display="block";
	getObj("aprevious").style.display="block";
	
	var totalRecord=getObj("hidtotalrec").value;
	var lastSRec = (parseInt(nextDivNum)*20);
	var firstSRec = parseInt(lastSRec)-19;
	if(lastSRec>totalRecord)
		lastSRec=totalRecord;
	
	getObj("numrecord").innerHTML= firstSRec+ " to "+lastSRec+" of "+totalRecord;
}

function clickLast()
{
	var totalDivCount=getObj("hiddivcount").value;
	var currDivNum=getObj("hidcurrdivnum").value;
	getObj("divpage"+currDivNum).style.display="none";
	var nextDivNum=totalDivCount;
	getObj("divpage"+nextDivNum).style.display="block";
	getObj("hidcurrdivnum").value=nextDivNum;
	
	getObj("afirst").style.display="block";
	getObj("aprevious").style.display="block";
	getObj("anext").style.display="none";
	getObj("alast").style.display="none";
	
	var totalRecord=getObj("hidtotalrec").value;
	var lastSRec = (parseInt(nextDivNum)*20);
	var firstSRec = parseInt(lastSRec)-19;
	if(lastSRec>totalRecord)
		lastSRec=totalRecord;
	
	getObj("numrecord").innerHTML= firstSRec+ " to "+lastSRec+" of "+totalRecord;
}

function chkcityname()
{
	var searchVal=getObj("searchcity").value;
	if(searchVal==0 || searchVal=="Type your city name")
	{
		alert('Please enter city name');
		return false;
	}
	if(searchVal.length<3)
	{
		alert('Please enter minimum 3 characters for city search');
		getObj("searchcity").focus();
		return false;
	}
}

function submitSearch(countryCode,countryName,rCode,cityname,rgName)
{
	//alert(countryCode)
	getObj("country").value=countryCode;
	getObj("hidcountryname").value=countryName;
	getObj("hidregioncode").value=rCode;
	getObj("hidcity").value=cityname;
	getObj("mode").value="city";
	//var city="city";
	//window.location.href="details.php?mode="+city+"&country="+countryCode+"&hidcountryname="+countryName+"&region="+rCode+"&hidcity="+//cityname;
	document.form1.action=siteUrl+strReplaceAll(countryName.toLowerCase()," ","-")+"/"+strReplaceAll(rgName.toLowerCase()," ","-")+"/"+strReplaceAll(cityname.toLowerCase()," ","-")+"/";
	document.form1.submit();
}
function showCityAlpha(stalpha, continent, country, region, continentname, countryname, regionname,curcountry,cityname)
{

	getObj("frmNavigation").src="citynav.php?continent="+continent+"&continentname="+continentname+"&country="+country+"&countryname="+countryname+"&region="+region+"&regionname="+ regionname+"&cityname="+cityname+"&curcountry="+curcountry+"&stalpha="+stalpha;

	//ajaxConn.connect(siteUrl+"cityalpha.php", "POST", "country="+country+"&region="+region+"&tbl_country="+tbl_country+"&stalpha="+stalpha,fnWhenDone_showCityAlpha);
}
function fnWhenDone_showCityAlpha(XML)
{
	getObj("cityalpha").innerHTML=XML.responseText;
}