//TRIPLE DROP DOWN--AJAX//
function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
	function getState(countryId) {		
		
		var strURL="_getState.php?country="+countryId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('statediv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	function getCity(countryId,stateId) {		
		var strURL="_getCity.php?country="+countryId+"&state="+stateId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}


//////////_SUPPORT COUNTRY & STATE
	function supportState(countryId) {		
		
		var strURL="_supportState.php?countryx="+countryId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('_statediv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	function supportCity(countryId,stateId) {		
		var strURL="_supportCity.php?countryx="+countryId+"&states="+stateId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('_citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}


//GOOGLE-ANALYTICS//
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//GOOGLE PAGE TRACKER
var pageTracker = _gat._getTracker("UA-2450653-2");
pageTracker._initData();
pageTracker._trackPageview();

//-------------------------------------------------------------------------------------------------------------
//POLL VOTING..//
var xmlHttp

function getVote(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="poll_vote.php"
url=url+"?vote="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function site_changes(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="poll_vote.php"
url=url+"?s="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("poll").
 innerHTML=xmlHttp.responseText;
 } 
} 


//-------------------------------------------------------------------------------------------------------------
//SPIN..//

function getSpin(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_newescorts.php"
url=url+"?list_id="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=spinChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function spinChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("spin").
 innerHTML=xmlHttp.responseText;
 } 
} 
//END  SPIN //
// AD AJAX
function getAD(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_getad.php"
url=url+"?unit="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=adChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 
// AD conf AJAX
function getADconf(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_getad.php"
url=url+"?conf="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=adChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function adChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ad").
 innerHTML=xmlHttp.responseText;
 } 
} 
//AD END//

//FLAG PROVIDER//
function flagProvider(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_flag.php"
url=url+"?escortid="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=eidChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function eidChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("eid").
 innerHTML=xmlHttp.responseText;
 } 
} 
//FLAG PROVIDER END//

// SEND TO FRIEND AJAX
function getMSG(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_sendtofriend.php"
url=url+"?reset_email="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=sendmailChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function getPH(int)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_sendtofriend.php"
url=url+"?ph1="+int
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=sendmailChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function sendmailChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("sendmail").
 innerHTML=xmlHttp.responseText;
 } 
} 
//SEND TO FRIEND END//

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
return objXMLHttp
}

//-------------------------------------------------------------------------------------------------------------
//SUPPORT CHECKFIELDS//
<!-- Begin
function checkFields() {
if (document.form.msgg.value == "") {
missinginfo += "\n     - Message";

}

if ((document.form.emaile.value == "") || 
(document.form.emaile.value.indexOf('@') == -1) || 
(document.form.emaile.value.indexOf('.') == -1)) {
missinginfo += "\n     - Email address";
}


if (missinginfo != "") {
missinginfo =" \n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n " +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
//  End -->
//-----------------------------------------------------------------------COOKIE EMAIL LOGIN FORMS
var expDays = 100;

var exp = new Date(); 

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));



function getCookieVal (offset) {  

	var endstr = document.cookie.indexOf (";", offset);  

	if (endstr == -1) { endstr = document.cookie.length; }

	return unescape(document.cookie.substring(offset, endstr));

}



function GetCookie (name) {  

	var arg = name + "=";  

	var alen = arg.length;  

	var clen = document.cookie.length;  

	var i = 0;  

	while (i < clen) {    

		var j = i + alen;    

		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    

		i = document.cookie.indexOf(" ", i) + 1;    

		if (i == 0) break;   

	}  

	return null;

}



function SetCookie (name, value) {  

	var argv = SetCookie.arguments;  

	var argc = SetCookie.arguments.length;  

	var expires = (argc > 2) ? argv[2] : null;  

	var path = (argc > 3) ? argv[3] : null;  

	var domain = (argc > 4) ? argv[4] : null;  

	var secure = (argc > 5) ? argv[5] : false;  

	document.cookie = name + "=" + escape (value) + 

	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 

	((path == null) ? "" : ("; path=" + path)) +  

	((domain == null) ? "" : ("; domain=" + domain)) +    

	((secure == true) ? "; secure" : "");

}

function cookieForms() {  

	var mode = cookieForms.arguments[0];

	

	for(f=1; f<cookieForms.arguments.length; f++) {

		formName = cookieForms.arguments[f];

		

		if(mode == 'open') {	

			cookieValue = GetCookie('saved_'+formName);

			if(cookieValue != null) {

				var cookieArray = cookieValue.split('#cf#');

				

				if(cookieArray.length == document[formName].elements.length) {

					for(i=0; i<document[formName].elements.length; i++) {

					

						if(cookieArray[i].substring(0,6) == 'select') { document[formName].elements[i].options.selectedIndex = cookieArray[i].substring(7, cookieArray[i].length-1); }

						else if((cookieArray[i] == 'cbtrue') || (cookieArray[i] == 'rbtrue')) { document[formName].elements[i].checked = true; }

						else if((cookieArray[i] == 'cbfalse') || (cookieArray[i] == 'rbfalse')) { document[formName].elements[i].checked = false; }

						else { document[formName].elements[i].value = (cookieArray[i]) ? cookieArray[i] : ''; }

					}

				}

			}

		}

				

		if(mode == 'save') {	

			cookieValue = '';

			for(i=0; i<document[formName].elements.length; i++) {

				fieldType = document[formName].elements[i].type;

				

				if(fieldType == 'password') { passValue = ''; }

				else if(fieldType == 'checkbox') { passValue = 'cb'+document[formName].elements[i].checked; }

				else if(fieldType == 'radio') { passValue = 'rb'+document[formName].elements[i].checked; }

				else if(fieldType == 'select-one') { passValue = 'select'+document[formName].elements[i].options.selectedIndex; }

				else { passValue = document[formName].elements[i].value; }

			

				cookieValue = cookieValue + passValue + '#cf#';

			}

			cookieValue = cookieValue.substring(0, cookieValue.length-4); // Remove last delimiter

			

			SetCookie('saved_'+formName, cookieValue, exp);		

		}	

	}

}

//  End -->


//-----------------------------------------------------------------------------------------------------------------
// CSS POP OUT PAGE-----------//

function toggle(div_id) {
	var el = document.getElementById(div_id);
	if ( el.style.display == 'none' ) {	el.style.display = 'block';}
	else {el.style.display = 'none';}
}
function blanket_size(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
	var blanket = document.getElementById('blanket');
	blanket.style.height = blanket_height + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	popUpDiv_height=blanket_height/2-150;//150 is half popup's height
	popUpDiv.style.top = popUpDiv_height + 'px';
}
function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
			window_width = document.body.parentNode.clientWidth;
		} else {
			window_width = document.body.parentNode.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	window_width=window_width/2-150;//150 is half popup's width
	popUpDiv.style.left = window_width + 'px';
}
function popup(windowname) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket');
	toggle(windowname);		
}

//--------------------------------------------------------------------
//PRELOAD IMAGES///
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
