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;
}

//-------- email check---------------
function emailcheck(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="my/signup-validate.php"
url=url+"?email="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=emailchk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function emailchk() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
 if(xmlHttp.responseText!="")
   {
     document.getElementById("signupemid").innerHTML=xmlHttp.responseText;
	 document.frmreg.email.value="";
	 document.frmreg.email.focus();
   }
   else
   {
	 document.getElementById("signupemid").innerHTML=xmlHttp.responseText;
   }
}
}
//-------- user id check---------------
function usercheck(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="my/signup-validate.php"
url=url+"?username="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=userchk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function userchk() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
 if(xmlHttp.responseText!="")
   {
     document.getElementById("signupuserid").innerHTML=xmlHttp.responseText;
	 document.frmreg.username.value="";
	 document.frmreg.username.focus();
   }
   else
   {
	 document.getElementById("signupuserid").innerHTML=xmlHttp.responseText;
   }
}
}
/*--------EDIT EMAIL CHAEK------------->*/
function checkeditemail(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="my/signup-validate.php"
url=url+"?eemail="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=chkeditemailchk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function chkeditemailchk() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
 if(xmlHttp.responseText!="")
   {
     document.getElementById("editeemid").innerHTML=xmlHttp.responseText;
	 document.frmemail.eemail.value="";
	 document.frmemail.eemail.focus();
   }
   else
   {
	 document.getElementById("editeemid").innerHTML=xmlHttp.responseText;
   }
}
}
//-------- country---------------
function getcountry(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?conid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=constatechk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function constatechk() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
  //var a=xmlHttp.responseText.split(",");
document.getElementById("constate").innerHTML=xmlHttp.responseText; 
/*document.getElementById("concode").innerHTML=a[1];*/
}
}
//-------- state and city---------------
function getstatecity(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?stid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=statecitychk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

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



//-------- country---------------
function getcountry1(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?conid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=constatechk1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function constatechk1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
  //var a=xmlHttp.responseText.split(",");
document.getElementById("constate").innerHTML=xmlHttp.responseText; 
/*document.getElementById("concode").innerHTML=a[1];*/
}
}
//-------- state and city---------------
function getstatecity1(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?stid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=statecitychk1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function statecitychk1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("statecity").innerHTML=xmlHttp.responseText; 
}
}
//-------- subcategory---------------
function getsubcat(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?catid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=subcatchk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function subcatchk() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("sbcat").innerHTML=xmlHttp.responseText 
}
}

//-------- get subcategory display by category---------------
function getchield(str)
{
	//alert(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?subbid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=childget
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function childget() 
{ 
//var ss=str;
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("4").innerHTML=xmlHttp.responseText 
}
}

//--------Article subcategory---------------
function articlesubcat(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="http://www.kcpitmaster.com/my/signup-validate.php"
url=url+"?acatid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=artsubcatchk
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function artsubcatchk() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("artsbcat").innerHTML=xmlHttp.responseText 
}
}

//-------- get child detail---------------
function getalbumphoto(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="my/ajaxphoto.php"
url=url+"?cid="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=photoget
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function photoget() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("gtphoto").innerHTML=xmlHttp.responseText 
}
}
