
var xmlHttp
function showPType(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax1.php";
url=url+"?q="+str;
//url=url+"?cm="+cm;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function showPType1(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax2.php";
url=url+"?p_cat="+str;
//url=url+"?cm="+cm;
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged() 
{ 

if (xmlHttp.readyState==4)
{ 
//x.close();
//document.f.cty.style.visibility="hidden";
document.getElementById("p_type").innerHTML=xmlHttp.responseText;

}
}

function showP_Locality(str,agent_id,list_type,p_cat,p_type)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax3.php";
url=url+"?p_city="+str;
url=url+"&agent_id="+agent_id+"&list_type="+list_type+"&p_cat="+p_cat+"&p_type="+p_type;
//url=url+"&p_cat="+p_cat;
xmlHttp.onreadystatechange=stateChanged12;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged12() 
{ 

if (xmlHttp.readyState==4)
{ 
//x.close();
//document.f.cty.style.visibility="hidden";
document.getElementById("locality").innerHTML=xmlHttp.responseText;

}
}

function Outlet_Dist(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax1.php";
url=url+"?state="+str;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged13;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged13() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("distt_div").innerHTML=xmlHttp.responseText;

}
}

function Outlet_City(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax2.php";
url=url+"?distt="+str;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged14;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged14() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("city_div").innerHTML=xmlHttp.responseText;

}
}

function Outlet_Cat(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax3.php";
url=url+"?city="+str;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged15;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged15() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("catdiv").innerHTML=xmlHttp.responseText;

}
}



// Agents Search-----------------------------------
function Agent_City(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax_agnt2.php";
url=url+"?state="+str;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged16;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged16() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("city_div").innerHTML=xmlHttp.responseText;

}
}

function Agent_Locality(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax_agnt3.php";
url=url+"?city="+str;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged17;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged17()
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("locality_div").innerHTML=xmlHttp.responseText;

}
}
//------------------------------------------------

//---------AdminCP - add Advertisemnt-------
function Adv_Cat(str,mode)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajaxA.php";
url=url+"?ad_type="+str+"&mode="+mode;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged18;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged18() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("div_cat").innerHTML=xmlHttp.responseText;

}
}

function Adv_SubCat(str,mode,ad_type)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajaxA.php";
url=url+"?cat_name="+str+"&mode="+mode+"&ad_type="+ad_type;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged19;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged19() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("div_subcat").innerHTML=xmlHttp.responseText;

}
}

//--------------------------------------
//----------------Function for SEND SMS to MEMBERS------
function fillSMS(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax1.php";
url=url+"?sno="+str+"&ctype=sms";
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged20;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged20() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("SMS_div").innerHTML=xmlHttp.responseText;

}
}

//---------------------------------------------

// EventGuide Search-------------------------------
function Event_City(str)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax1.php";
url=url+"?cat_name="+str;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged21;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged21() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("cityDiv").innerHTML=xmlHttp.responseText;

}
}
// ------------------------------------------------
// adminCP- Display Name in Add Meember page------------------------
function disp_name(str,str1)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax5.php";
url=url+"?id="+str+"&md="+str1;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged22;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged22() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("dispnmDiv").innerHTML=xmlHttp.responseText;

}
}
//-----------------------------------------------
//ADMINCP FUNCTION FOR AUTOS--------------------
function disp_a_make(str,str1,str2)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax6.php";
url=url+"?cat_id="+str+"&md="+str1+"&df="+str2;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged23;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged23() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("makeDiv").innerHTML=xmlHttp.responseText;
}
}

function disp_a_model(str,str1,str2)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax6.php";
url=url+"?make_id="+str+"&md="+str1+"&df="+str2;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged24;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged24() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("modelDiv").innerHTML=xmlHttp.responseText;
}
}

function disp_a_version(str,str1)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax6.php";
url=url+"?model_id="+str+"&md="+str1;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged25;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged25() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("versionDiv").innerHTML=xmlHttp.responseText;
}
}

//----------------------------------------------
function stateChanged11() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("subcat_name").innerHTML=xmlHttp.responseText;

}
}

//--ajax bx for infomedia/index.php

function getSubCat(str,str1)
{ 
	if(str=="")
	return;
	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	  
	var url="ajaxDmenu.php";
	url=url+"?cat_name="+str+"&ctype="+str1;
	xmlHttp.onreadystatechange=stateChanged26;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged26() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("subcatdiv").innerHTML=xmlHttp.responseText;
	}
}


//--ajax bx for infomedia/index.php

function getCty(str,str1,str2)
{ 
	if(str=="")
	return;
	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	  
	var url="ajaxDmenu.php";
	url=url+"?subcat_name="+str+"&cat_name="+str1+"&ctype="+str2;
	xmlHttp.onreadystatechange=stateChanged27;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged27() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("ctydiv").innerHTML=xmlHttp.responseText;
	}
}

function fillEmail(str)
{ 
	if(str=="")
	return;
	xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  	alert ("Your browser does not support AJAX!");
  	return;
  } 
 var url="ajax1.php";
 url=url+"?sno="+str+"&ctype=email";
 xmlHttp.onreadystatechange=stateChanged28;
 xmlHttp.open("GET",url,true);
 xmlHttp.send(null);
}

function stateChanged28() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("Email_div").innerHTML=xmlHttp.responseText;
	}
}


function fillsubcat(str,str1)
{ //alert("this is called");
	if(str=="")
	return;
	xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  	alert ("Your browser does not support AJAX!");
  	return;
  } 
 var url="ajaxDmenu.php";
 url=url+"?cat_id="+str+"&ctype="+str1;
 xmlHttp.onreadystatechange=stateChanged29;
 xmlHttp.open("GET",url,true);
 xmlHttp.send(null);
}

function stateChanged29() 
{ 
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("subcat_name").innerHTML=xmlHttp.responseText;
	}
}


// Still This function is not using anywhere.-------------
function Outlet_Cat1(str,str1)
{ 
if(str=="")
return;
xmlHttp=GetXmlHttpObject();

if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="ajax4.php";
url=url+"?city="+str+"&distt="+str1;
//url=url+"&mode="+mode;
xmlHttp.onreadystatechange=stateChanged33;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged33() 
{ 

if (xmlHttp.readyState==4)
{ 
//document.f.state.style.visibility="hidden";
document.getElementById("catdiv").innerHTML=xmlHttp.responseText;

}
}


// function used to send invitation letter
function invite_friend(pid,pname,pemail,pmobile,fname,femail,fmobile,ctype)
{
	if(pid=="")
	return;
	xmlHttp=GetXmlHttpObject();
	
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="ajax_reffer.php";
	url=url+"?ctype="+ctype+"&id="+pid+"&pname="+pname+"&pemail="+pemail+"&pmobile="+pmobile+"&fname="+fname+"&femail="+femail+"&fmobile="+fmobile;
	xmlHttp.onreadystatechange=stateChanged34;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged34() 
{ 
	
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById('letter_box_message').style.display="block";
		document.getElementById("message_for_letter").innerHTML=xmlHttp.responseText;
		document.getElementById('progress').style.display="none";
		
	}
}


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