// JavaScript Document
var xmlHttp

function getsubcat(main_cat,pro_id,div_id)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
	alert ("Browser does not support HTTP Request")
	return
}

var url="ajaxsubcat.php"//here have category's  subcategory tree
url=url+"?main_cat="+main_cat+"&pro_id="+pro_id+"&div_id="+div_id;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=getshortname;

xmlHttp.send(null)
}

function getshortname() 
{ 
	//alert(xmlHttp.readyState);	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var results = xmlHttp.responseText;
var finel_result = results.split("@");/// get div id
//alert(results);
document.getElementById("divfeature").style.display='none';

document.getElementById("divsub"+finel_result[1]).innerHTML =finel_result[0] ;	
} 
} 


function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
//// this for show category features///
function show_pro_feature(cat_id,pro_id)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
	alert ("Browser does not support HTTP Request")
	return
}

var url="ajaxsubfeature.php"//the category's fetures list
url=url+"?cat_id="+cat_id+"&pro_id="+pro_id;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=getproductfeature ;

xmlHttp.send(null)
}

function getproductfeature() 
{ 
	//alert(xmlHttp.readyState);	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var results = xmlHttp.responseText;
document.getElementById("divfeature").style.display='block';
document.getElementById("divfeature").innerHTML =xmlHttp.responseText ;
} 
} 
///// only for category path with alll su categories

function get_category_path(cat_id)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
	alert ("Browser does not support HTTP Request")
	return
}

var url="http://www.reviewsgoldmine.com/ajaxsubcat1.php"//the category's fetures list
url=url+"?cat_id="+cat_id;
//alert (url);
xmlHttp.open("GET",url,true);                                                                                                                                                                                            
xmlHttp.onreadystatechange=getcateegorypath ;

xmlHttp.send(null)
}

function getcateegorypath() 
{ 
	//alert(xmlHttp.readyState);	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var results = xmlHttp.responseText;
document.getElementById("cat_name").innerHTML =xmlHttp.responseText
} 
} 



///// only for category path with alll su categories

function get_category_nameonly(cat_id)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
	alert ("Browser does not support HTTP Request")
	return
}

var url="ajaxsubcatname.php"//the category's fetures list
url=url+"?cat_id="+cat_id;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=getcateegoryname ;

xmlHttp.send(null)
}

function getcateegoryname() 
{ 
	//alert(xmlHttp.readyState);	
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
var results = xmlHttp.responseText;
document.getElementById("pathcat_name").innerHTML =xmlHttp.responseText
} 
} 


