var xmlHttp

function loadcap()
{
/*	if(document.fynd1.username.value=="")
		{
			alert("Please enter your UserName");
			document.fynd1.username.focus();
			return false;
		}
		if(document.fynd1.pass.value=="")
		{
			alert("Please enter the Password");
			document.fynd1.pass.focus();
			return false;s
		}
		usr = document.fynd1.username.value;
		pass = document.fynd1.pass.value;
*/

	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
  
	var url;
	url="cap.php";

	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
			document.getElementById("cap").innerHTML=xmlHttp.responseText;
	}
	if (xmlHttp.readyState==1)
	{ 
			document.getElementById("cap").innerHTML="loading....";
	} 
} 
function loadcap_ad()
{
/*	if(document.fynd1.username.value=="")
		{
			alert("Please enter your UserName");
			document.fynd1.username.focus();
			return false;
		}
		if(document.fynd1.pass.value=="")
		{
			alert("Please enter the Password");
			document.fynd1.pass.focus();
			return false;s
		}
		usr = document.fynd1.username.value;
		pass = document.fynd1.pass.value;
*/

	
	xmlHttpcc=GetXmlHttpObject()
	if (xmlHttpcc==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
  
	var url;
	url="capCHK.php";

	xmlHttpcc.onreadystatechange=stateChangedcc 
	xmlHttpcc.open("GET",url,true)
	xmlHttpcc.send(null)
} 

function stateChangedcc() 
{ 
	if (xmlHttpcc.readyState==4 || xmlHttpcc.readyState=="complete")
	{ 
			//document.getElementById("cap").innerHTML=xmlHttp.responseText;
			if(xmlHttpcc.responseText != "ok")
			{
				alert("Please verify security code...!");
				return false;
			}
	}
	if (xmlHttpcc.readyState==1)
	{ 
			document.getElementById("cap").innerHTML="Please wait....";
	} 
} 

function mostview(cid,scid,stid,citid,skey,act)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
  
	var url="http://www.fyndin.com/mostview.php";
	//var url="http://rglsaran/fynd/website_progressing/mostview.php";
	url=url+"?cid="+cid+"&scid="+scid+"&stid="+stid+"&cityid="+citid+"&act="+act+"&skey="+skey;

	xmlHttp.onreadystatechange=stateChanged1 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged1() 
{ 
	if (xmlHttp.readyState==1)
	{ 
		document.getElementById("txtHint").innerHTML = "<font class='green'>Loading</font><br><img src='http://www.fyndin.com/images/Loading.gif'>";
	} 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtHint").innerHTML = xmlHttp.responseText;
	} 
} 


function recent(cid,scid,stid,citid,skey,act)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
	alert ("Browser does not support HTTP Request")
	return
	} 
  
	var url="http://www.fyndin.com/recent.php";
	//var url="http://rglsaran/fynd/website_progressing/recent.php";
	url=url+"?cid="+cid+"&scid="+scid+"&stid="+stid+"&cityid="+citid+"&act="+act+"&skey="+skey;

	xmlHttp.onreadystatechange=stateChanged1 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged1() 
{ 
	if (xmlHttp.readyState==1)
	{ 
		document.getElementById("txtHint").innerHTML = "<font class='green'>Loading</font><br><img src='http://www.fyndin.com/images/Loading.gif'>";
	} 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtHint").innerHTML = xmlHttp.responseText;
	} 
} 


function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 

