var xmlHttp


function AddToCart(strRegNo) {
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}        
	var url="phpajax_addtocart.php"
	url=url+"?txtRegNo="+strRegNo
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=AddedToCart
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function AddedToCart() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")    	{
		alert("Added to/Removed from Favourites")
	}
} 

function ShowNewRegns(strCount) {
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}        
	var url="phpajax_newregns.php"
	url=url+"?lngCount="+strCount
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=bodyLoaded
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function bodyLoaded() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")    	{
		document.getElementById("divNewRregns").innerHTML=xmlHttp.responseText
	}
} 



/* For Displaying the Caste When Religion is Selected in the Registrations Form */
function visible(str) { 
//var st=str;
//alert(st);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	
	var url="displaymsg.php"
	url=url+"?c="+str
	///alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=state
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function visible1(str) { 
//var st=str;
//alert(st);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	
	var url="displaymsg1.php"
	url=url+"?c="+str
	///alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=state1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}



function visible2(str) { 
//var st=str;
//alert(st);
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	
	var url="displaymsg2.php"
	url=url+"?c="+str
	///alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=state2
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}


/* For Displaying the Caste When Religion is Selected in the Registrations Form */
function ShowCastes(str) { 
//var st=str.value;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	
	var url="loadcaste.php"
	url=url+"?c="+str
	///alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

/* For Displaying the Caste When partner Religion is Selected in the Registrations Form */
function ShowCastes2(str) { 
//var st=str.value;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	
	var url="loadcaste1.php"
	url=url+"?c="+str
	//alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangedpartner
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function ShowCastes1(str) { 
//var st=str.value;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (st);
	
	var url="loadcaste.php"
	url=url+"?c="+str
	//alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangednew
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function ShowQuali(str) { 
//var st=str.value;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	
	var url="loadquali.php"
	url=url+"?c="+str
	//alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangedquali
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function ShowQualif(str,str1) { 
//var st=str.value;
document.getElementById("quaf").innerHTML='';
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	//alert (str1);
	var url="loadqualif.php"
	url=url+"?c="+str+"&no="+str1
	//alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangedqualif
	// alert(xmlhttp.responseText)

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function AvailableShow(str) { 
//var st=str.value;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	//alert (str1);
	var url="loadable.php"
	url=url+"?c="+str
	//alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangedable1
	// alert(xmlhttp.responseText)

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function ShowUser(str) { 
//var st=str.value;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}     
	//alert (str);
	//alert (str1);
	var url="loaduser.php"
	url=url+"?c="+str
	//alert(url);
	//url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChangeduser
	// alert(xmlhttp.responseText)

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChangeduser() 
{
	//document.getElementById('quaf').style.display='block';
	//alert(xmlHttp.readyState)
	//alert(xmlHttp.readyState)
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("user").innerHTML=xmlHttp.responseText
		
		
	}
}

function state() 
{
	document.getElementById('msg').style.display='block';
	//alert(xmlHttp.readyState)
	//alert(xmlHttp.readyState)
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("msg").innerHTML=xmlHttp.responseText
		
		
	}
}
function state1() 
{
	document.getElementById('msg').style.display='block';
	//alert(xmlHttp.readyState)
	//alert(xmlHttp.readyState)
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("msg").innerHTML=xmlHttp.responseText
		
		
	}
}
function state2() 
{
	document.getElementById('msg').style.display='block';
	//alert(xmlHttp.readyState)
	//alert(xmlHttp.readyState)
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("msg").innerHTML=xmlHttp.responseText
		
		
	}
}

function stateChangedable1() 
{
	//document.getElementById('quaf').style.display='block';
	//alert(xmlHttp.readyState)
	//alert(xmlHttp.readyState)
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("able").innerHTML=xmlHttp.responseText
		
		
	}
}

function stateChangedqualif() 
{
	document.getElementById('quaf').style.display='block';
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("quaf").innerHTML=xmlHttp.responseText
		
		
	}
}
function stateChangedquali() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("qua").innerHTML=xmlHttp.responseText
		
		
	}
}
function stateChangednew() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("castes").innerHTML=xmlHttp.responseText
		
			document.getElementById("caste1").style.display="none"
	}
}
function stateChanged() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("caste").innerHTML=xmlHttp.responseText
		
			document.getElementById("caste1").style.display="none"
	}
} 
function stateChangedpartner() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("caste2").innerHTML=xmlHttp.responseText
		
		document.getElementById("caste12").style.display="none"
	}
} 


/* For Displaying the family info table in the Registrations Form */
function Showfamily(str,str1,str2,str3) { 
alert(str1);
//exit;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}        
	var url="loadfamily.php"
	url=url+"?c="+str+"&o="+str1+"&id="+str2+"&value="+str3
	//url=url+"&cnt="
	
	//alert(url);
	
	xmlHttp.onreadystatechange=stateChanged11
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
/* For Displaying the family info table in the Registrations Form */
function Showfamily1(str,str1,str2,str3) { 
//alert(str1);
//exit;
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}        
	var url="loadfamily.php"
	url=url+"?c="+str+"&o="+str1+"&id="+str2+"&value="+str3
	//url=url+"&cnt="
	
	//alert(url);
	
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged1() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")    	{
		document.getElementById("family").innerHTML=xmlHttp.responseText
		document.getElementById("family1").style.display="none";
	}
}
function stateChanged11() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")    	{
		document.getElementById("family").innerHTML=xmlHttp.responseText
		
	}
}
/* End of Functions For Displaying the Caste When Religion is Selected in the Registrations Form */

/* For Displaying the horoscope info table in the Registrations Form */
function Showage(str) {
	//alert("dd");
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}        
	var url="age1.php"
	url=url+"?c="+str
	//url=url+"&sid="+Math.random()
	//alert(url);
	xmlHttp.onreadystatechange=stateChangedage
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChangedage() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")    	{
		document.getElementById("age").innerHTML=xmlHttp.responseText
		//document.getElementById("h1").style.display="none";
	}
} 
/* For Displaying the horoscope info table in the Registrations Form */
function Showhoroscope(str,rid,h) { 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) 	{
		alert ("Browser does not support HTTP Request")
		return
	}        
	var url="horoscope.php"
	url=url+"?c="+str+"&regid="+rid+"&h="+h
	//url=url+"&sid="+Math.random()
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged2() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")    	{
		document.getElementById("horoscope").innerHTML=xmlHttp.responseText
		document.getElementById("h1").style.display="none";
	}
} 



function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
    	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	 catch (e)
    	{
		// Internet Explorer
		try
      		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
	}
	return xmlHttp;
}
