var xmlHttp
var posvalue 
var value


// Client Side Sub category and Innser Sub Category Process Start

function ssut(url1,divids)
{		
	
	xmlHttp=GetXmlHttpObjectadd()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

// 	if(v==1)
// 	{
// 		document.getElementById('subcats').value=maincat;
// 	}



	var url;
	url=url1;

	xmlHttp.onreadystatechange=function()
	{
		
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 				
			document.getElementById(divids).innerHTML=xmlHttp.responseText;	
		} 
	};
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)			
} 



function chooseSubCategory(maincat,v,fg)
{		
	xmlHttp=GetXmlHttpObjectadd()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

// 	if(v==1)
// 	{
// 		document.getElementById('subcats').value=maincat;
// 	}

	var url;
	url="?do=showsubcat&maincat="+maincat+"&flag="+fg+"&rid="+Math.random();			
	xmlHttp.onreadystatechange=stateChanged1  
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)			
} 

function chooseSubCategory1(maincat,v)
{		
	xmlHttp=GetXmlHttpObjectadd()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	if(v==1)
	{
		document.getElementById('subcats').value=maincat;
	}

	var url;
	url="?do=showsubcat1&maincat="+maincat+"&rid="+Math.random();			
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)			
} 

function page_path_show1(maincat)
{	
// 	alert("sd");

	xmlHttp=GetXmlHttpObjectadd()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url;
	url="?do=pathshow&maincat="+maincat+"&rid="+Math.random();				
	xmlHttp.onreadystatechange=stateChanged2  
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)

}

function stateChanged1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 		
		document.getElementById('subcategory').innerHTML=xmlHttp.responseText;	
	} 
} 


function stateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 		
		document.getElementById('paths').innerHTML=xmlHttp.responseText;	
	} 
} 

// Client Side Sub category and Innser Sub Category Process End

//	id = idval, value = val, span or div id name = posval, distination file name = fname
function ajax(idval,val,posval,fname)
{
	posvalue = posval;
	value = val;
	
if(val.length==0)
{ 
document.getElementById(posvalue).innerHTML=""
return
}
xmlHttp=GetXmlHttpObjectadd()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
 
var url=fname
//url = "index.php?do=getstate"+"&countryid="+idval+"&val="+val+"&fname="+fname;
url=url+"&"+idval+"="+val+"&countryid="+val

xmlHttp.onreadystatechange=stateChangedadd  
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChangedadd() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		if(posvalue != "invitefriend")
		{	
			document.getElementById('sel').innerHTML=xmlHttp.responseText;
		}
			
		else
			alert(xmlHttp.responseText);
	} 
} 

function GetXmlHttpObjectadd()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}

function setState(id)
{
	document.getElementById("state_id").value = id;
}
