var xmlHttp
function showProducts(str,cid,pcid,show,totNum,del,parid,subid,level)
{
if (str.length==0 && cid.length==0)
{ 
return
}
xmlHttp=GetXmlHttpObject5()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="php/showProducts.php"
id		=str
cid		=cid
pcid	=pcid
clearpcid	=pcid
show	=show
totNum	=totNum
totnums	=totNum
del		=del
parid		=parid
parids		=parid
subid		=subid
subids		=subid
level		=level
levels		=level
pagePid		=cid

//--- This portion will be hide/show the Category

show	=document.getElementById("CATSHOW").value;
ecid	=document.getElementById("cid").value;
if(show=='0' && cid==ecid)
{
	show=1;
	document.getElementById("CATSHOW").value=1;
	document.getElementById("cid").value=cid;
}
else
{
	show=0;
	document.getElementById("CATSHOW").value=0;
	document.getElementById("cid").value=cid;
}
url=url+"?id="+id+"&cid="+cid+"&pcid="+pcid+"&show="+show+"&totNum="+totNum+"&del="+del+"&parid="+parid+"&subid="+subid+"&level="+level
//alert(url);
url=url+"&stid="+Math.random()
xmlHttp.onreadystatechange=stateChanged5 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged5() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{	
	if(clearpcid==0)
	{
		for(i=1;i<=totnums;i++)
		{
			var txtProducts="txtProducts"+i
			document.getElementById(txtProducts).innerHTML="<input id=CATSHOW"+i+" name=CATSHOW"+i+" type=hidden value=1>";
		}
	}
	else
	{
		for(i=1;i<=totnums;i++)
		{
			var txtProducts="txtProducts"+parids+i
			document.getElementById(txtProducts).innerHTML="<input id=CATSHOW"+i+" name=CATSHOW"+i+" type=hidden value=1>";
		}
	}
	var txtProducts="txtProducts"+id
	document.getElementById(txtProducts).innerHTML=xmlHttp.responseText
	showProductsDetails(levels,pagePid);
} 
} 

function GetXmlHttpObject5()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 

