var xmlHttp
function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest()	}
	else if (window.ActiveXObject)	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")	}
	if (objXMLHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	return objXMLHttp
}
///////////////// NO CHANGE ABOVE/////////////////////


//////////////// GET SUBCATEGORY WITH CATEGOEY//////////////////////
function showHintother(str,prs,element,suggested)
{
	
	xmlHttp3=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="getsubcat.php"
	
	url=url+"?id="+str+"&selected="+prs+"&types=subcatother&suggested="+suggested;
	xmlHttp3.onreadystatechange=function stateChanged() { 
		if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")	{ 
			document.getElementById(element).innerHTML=xmlHttp3.responseText } }  
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
} 

///////////////GET SUBCAT////////////////////////////////
function show_regions(str,prs,element)
{
	xmlHttp3=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="show_regions.php"
	url=url+"?id="+str+"&selected="+prs+"&types=region"
	xmlHttp3.onreadystatechange=function stateChanged() { 
		if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")	{ 
			document.getElementById(element).innerHTML=xmlHttp3.responseText } }  
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
} 

function show_regions_front(str,prs,element)
{
	xmlHttp3=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="show_regions.php"
	url=url+"?id="+str+"&selected="+prs+"&types=region_front"
	xmlHttp3.onreadystatechange=function stateChanged() { 
		if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")	{ 
			document.getElementById(element).innerHTML=xmlHttp3.responseText } }  
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
} 

function show_regions_account(str,prs,element)
{
	xmlHttp3=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="show_regions.php"
	url=url+"?id="+str+"&selected="+prs+"&types=region_account"
	xmlHttp3.onreadystatechange=function stateChanged() { 
		if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")	{ 
			document.getElementById(element).innerHTML=xmlHttp3.responseText } }  
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
} 


function show_cities(str,prs,element)
{
	xmlHttp4=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="show_cities.php"
	url=url+"?id="+str+"&selected="+prs+"&types=city"
	xmlHttp4.onreadystatechange=function stateChanged() { 
		if (xmlHttp4.readyState==4 || xmlHttp4.readyState=="complete")	{ 
			document.getElementById(element).innerHTML=xmlHttp4.responseText } }  
	xmlHttp4.open("GET",url,true)
	xmlHttp4.send(null)
} 

function show_cities_account(str,prs,element)
{
	xmlHttp4=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="show_cities.php"
	url=url+"?id="+str+"&selected="+prs+"&types=cityaccount"
	xmlHttp4.onreadystatechange=function stateChanged() { 
		if (xmlHttp4.readyState==4 || xmlHttp4.readyState=="complete")	{ 
			document.getElementById(element).innerHTML=xmlHttp4.responseText } }  
	xmlHttp4.open("GET",url,true)
	xmlHttp4.send(null)
} 


function show_search(fromage,toage,country,distance,element)
{
	//alert(fromage +'\n'+ toage +'\n'+ country +'\n'+ distance +'\n'+ element);
	//return false
	xmlHttp5=GetXmlHttpObject()
	document.getElementById(element).innerHTML="Please Wait";

	var url="getsubcat.php"
	url=url+"?fromage="+fromage+"&toage="+toage+"&country="+country+"&distance="+distance+"&types=home_search"
	xmlHttp5.onreadystatechange=function stateChanged() { 
		if (xmlHttp5.readyState==4 || xmlHttp5.readyState=="complete")	{ //alert(xmlHttp5.responseText);
			document.getElementById(element).innerHTML=xmlHttp5.responseText } }  
	xmlHttp5.open("GET",url,true)
	xmlHttp5.send(null)
} 
function send_charm(touid,element)
{
	
	xmlHttp6=GetXmlHttpObject()
	document.getElementById(element).innerHTML="";
	var url="sendcharm.php"
	url=url+"?touid=" + touid;
	xmlHttp6.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp6.readyState==4 || xmlHttp6.readyState=="complete")	
		{ 
			if(xmlHttp6.responseText==2)
			{
				fireMyPopup2();
			}
			if(xmlHttp6.responseText==1)
			{
				fireMyPopup();
			}
			
			//document.getElementById(element).innerHTML=xmlHttp6.responseText 
		} 
	}  
	xmlHttp6.open("GET",url,true)
	xmlHttp6.send(null)
} 
function send_charm_male(touid,element)
{
	xmlHttp6=GetXmlHttpObject()
	document.getElementById(element).innerHTML="";
	var url="sendcharm_male.php"
	url=url+"?touid=" + touid;
	xmlHttp6.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp6.readyState==4 || xmlHttp6.readyState=="complete")	{ //alert(xmlHttp5.responseText);
			document.getElementById(element).innerHTML=xmlHttp6.responseText } 
	}  
	xmlHttp6.open("GET",url,true)
	xmlHttp6.send(null)
} 
function showphoto(id,element)
{
	xmlHttp7=GetXmlHttpObject()
	document.getElementById(element).innerHTML="<img src='images/loading.gif' width='494' height='300' border='0'>";
	var url="showphoto.php"
	url=url+"?id="+id+"&types=showphoto";
	xmlHttp7.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp7.readyState==4 || xmlHttp7.readyState=="complete")	
		{ 
			document.getElementById(element).innerHTML=xmlHttp7.responseText 
		} 
	}  
	xmlHttp7.open("GET",url,true)
	xmlHttp7.send(null)
} 
function check_wink(element)
{
	xmlHttp8=GetXmlHttpObject()
	document.getElementById(element).innerHTML="";
	var url="check_wink.php"
	//url=url+"?id="+id+"&types=showphoto";
	xmlHttp8.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp8.readyState==4 || xmlHttp8.readyState=="complete")	
		{ 
			document.getElementById(element).innerHTML=xmlHttp8.responseText 
		
			if(xmlHttp8.responseText!='none')
			{
				fireMyPopup_checkwink(xmlHttp8.responseText);
			}
			else
			{
			}
			
		} 
	}  
	xmlHttp8.open("GET",url,true)
	xmlHttp8.send(null)
} 
function check_time(element)
{
	xmlHttp9=GetXmlHttpObject()
	document.getElementById(element).innerHTML="";
	var url="check_time.php"
	//url=url+"?id="+id+"&types=showphoto";
	xmlHttp9.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp9.readyState==4 || xmlHttp9.readyState=="complete")	
		{ 
			document.getElementById(element).innerHTML=xmlHttp9.responseText 
		
			if(xmlHttp9.responseText=='1')
			{
				//alert('ddddddddd');
				window.location.href='home.php';
				//fireMyPopup_checkwink(xmlHttp8.responseText);
			}
			else
			{
			}
			
		} 
	}  
	xmlHttp9.open("GET",url,true)
	xmlHttp9.send(null)
}
function check_tot_winks(element,oldwinks)
{
	xmlHttp10=GetXmlHttpObject()
	document.getElementById(element).innerHTML="&nbsp;&nbsp;<strong>" + oldwinks + "</strong>";
	var url="check_tot_winks.php"
	//url=url+"?id="+id+"&types=showphoto";
	xmlHttp10.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp10.readyState==4 || xmlHttp10.readyState=="complete")	
		{ 
			document.getElementById(element).innerHTML=xmlHttp10.responseText 
			
		} 
	}  
	xmlHttp10.open("GET",url,true)
	xmlHttp10.send(null)
} 
function check_tot_emails(element,oldmails)
{
	xmlHttp11=GetXmlHttpObject()
	document.getElementById(element).innerHTML="&nbsp;&nbsp;<strong>" + oldmails + "</strong>";
	var url="check_tot_emails.php"
	//url=url+"?id="+id+"&types=showphoto";
	xmlHttp11.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp11.readyState==4 || xmlHttp11.readyState=="complete")	
		{ 
			document.getElementById(element).innerHTML=xmlHttp11.responseText 
			
		} 
	}  
	xmlHttp11.open("GET",url,true)
	xmlHttp11.send(null)
} 
function check_tot_online(element,oldonline)
{
	xmlHttp12=GetXmlHttpObject()
	document.getElementById(element).innerHTML="&nbsp;&nbsp;<strong>" + oldonline + "</strong>";
	var url="check_tot_online.php"
	//url=url+"?id="+id+"&types=showphoto";
	xmlHttp12.onreadystatechange=function stateChanged() 
	{ 
		if (xmlHttp12.readyState==4 || xmlHttp12.readyState=="complete")	
		{ 
			if(xmlHttp12.responseText!='')
				document.getElementById(element).innerHTML=xmlHttp12.responseText 
			
		} 
	}  
	
	xmlHttp12.open("GET",url,true)
	xmlHttp12.send(null)
} 




//////////////// GET STATE //////////////////////

