// JavaScript Document
//////////**************************************************/////////////
///Ajax Function//////////
function GetXmlHttpObject()
{ 
		var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
		objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp
}
//////Common Ajax Function////////
function main(id,tdName,optname)
  {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  	alert ("Browser does not support HTTP Request")
	 	 return
	  }

  if(tdName=="activ_id")
   {
	 document.getElementById(tdName);
	 url="dropdown.php";
	  url=url+"?"+id

	 if(optname=="category")
	 {
	  xmlHttp.onreadystatechange=matterState;
	 }
	  xmlHttp.open("GET",url,true)
      xmlHttp.send(null)
  
  } 
	  	
}
function matterState()	{
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 {
		//alert(xmlHttp.responseText);
		
		document.getElementById("activ_id").innerHTML=xmlHttp.responseText;
	}
}


//2nd
function maintwo(id,tdName)	
{
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  	alert ("Browser does not support HTTP Request")
	 	 return
	  }
	//at
  //alert(document.getElementById(id));
  if(tdName=="stateTd")
  {
	  url="/one2one/my_state.php";
	  url=url+"?country_name="+id
	  xmlHttp.onreadystatechange=matterStatetwo;
	  xmlHttp.open("GET",url,true)
      xmlHttp.send(null)
  }
}
  
  function matterStatetwo()	
  {
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 {
		//alert(xmlHttp.responseText);
		
		document.getElementById("stateTd").innerHTML=xmlHttp.responseText;
	}
}
function selectState(strName)
{
if(strName=="other")
{
	 maintwo(id="other","stateTd");
 }
}


function showOtherOption(strName,divtd)
{
var divtdId=document.getElementById(divtd);
if(strName=="Other")
		{			
			divtdId.style.display="block";
		}
		else
		{
			divtdId.style.display="none";
			
		}
}



