var xmlHttp;

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;
}

/////////////////////////////////////
////////////////////////// Send Kiss //////////////
function joingrp(str)
{

//var ret=confirm("You have sent kiss successfully");
//if(ret==true){
ac_wait = document.getElementById("aa");

if (str.length==0)
{ 
document.getElementById("aa").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 

var url="../signup-validate_test.php"
url=url+"?kissId="+str
url=url+"&sid="+Math.random()
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedjoin

xmlHttp.send(null)
//}
}
function stateChangedjoin() 
{ 
if (xmlHttp.readyState==0 || xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3 )
{ 
//document.getElementById("aa").innerHTML='Loading';
}else if (xmlHttp.readyState==4){
document.getElementById("aa").innerHTML=xmlHttp.responseText;
} 
}
////////////////////////////////////////////////////
////////////////////////// Send Hug //////////////
function joingrp1(str)
{

//var ret=confirm("You have sent kiss successfully");
//if(ret==true){
ac_wait = document.getElementById("aa");

if (str.length==0)
{ 
document.getElementById("aa").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 

var url="../signup-validate_test.php"
url=url+"?hugId="+str
url=url+"&sid="+Math.random()
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedjoin1

xmlHttp.send(null)
//}
}
function stateChangedjoin1() 
{ 
if (xmlHttp.readyState==0 || xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3 )
{ 
//document.getElementById("aa").innerHTML='Loading';
}else if (xmlHttp.readyState==4){
document.getElementById("aa").innerHTML=xmlHttp.responseText;
} 
}
////////////////////////////////////////////////////
////////////////////////// Send Smack ///////////
function joingrp2(str)
{

//var ret=confirm("You have sent kiss successfully");
//if(ret==true){
ac_wait = document.getElementById("aa");

if (str.length==0)
{ 
document.getElementById("aa").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 

var url="../signup-validate_test.php"
url=url+"?smackId="+str
url=url+"&sid="+Math.random()
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedjoin2

xmlHttp.send(null)
//}
}
function stateChangedjoin2() 
{ 
if (xmlHttp.readyState==0 || xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3 )
{ 
//document.getElementById("aa").innerHTML='Loading';
}else if (xmlHttp.readyState==4){
document.getElementById("aa").innerHTML=xmlHttp.responseText;
} 
}
////////////////////////////////////////////////////
////////////////////////// Send Inner Circle Request ///////////
function joingrp3(str)
{
if (str.length==0)
{ 
document.getElementById("icid").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="../signup-validate_test.php"
url=url+"?innercircleId="+str
url=url+"&sid="+Math.random()
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=stateChangedjoin3
xmlHttp.send(null)
}
function stateChangedjoin3() 
{ 
if (xmlHttp.readyState==0 || xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3 )
{ 
//document.getElementById("aa").innerHTML='Loading';
}else if (xmlHttp.readyState==4){
document.getElementById("icid").innerHTML=xmlHttp.responseText;
} 
}
////////////////////////////////////////////////////

//-------- state ---------------
function getState(str)
{
if (str.length==0)
{ 
document.getElementById("txtHint").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="signup-validate_test.php"
url=url+"?stateId="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateCityCheck
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateCityCheck() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("stateCity").innerHTML=xmlHttp.responseText;
}
}
