var strNewThrobberImg='<img src="smallgreythrober.gif" />';var strNewThrobberAdminImg='<img src="smallgreythrober.gif" />';function createXMLHttpObject()
{var xmlHttp;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{alert("Your browser does not support AJAX!");return false;}}}
if(xmlHttp.overrideMimeType)
{xmlHttp.overrideMimeType('text/xml');}
return xmlHttp;}
function makeRequest(requestURL,method,params,resDivId,throbberDivId)
{var xmlhttp=createXMLHttpObject();xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4)
{document.getElementById(resDivId).innerHTML=xmlhttp.responseText;}}
xmlhttp.open(method,requestURL,true);if(method=='POST')
{xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",params.length);xmlhttp.setRequestHeader("Connection","close");}
xmlhttp.send(params);}
function fnAJXGetSubCategory(intCatId,strSubCat,resDivId,throbberDivId)
{if((intCatId!=''))
{strArgs="cid="+intCatId+"&scname="+strSubCat+"&act=getProdSubCat&sesid="+Math.random();xmlHTTP=createXMLHttpObject();xmlHTTP.open("GET",strAjaxFileName+strArgs,true);xmlHTTP.onreadystatechange=function()
{if(xmlHTTP.readyState==4)
{if(xmlHTTP.status==200)
{var strString=xmlHTTP.responseText;if(strString!="0")
{if(strString=='')
{strString='<select name="lstProdSubCat" id="lstProdSubCat"><option value="">--- All Sub Categories ---</option></select>';}
document.getElementById(resDivId).innerHTML=strString;}}
else
{alert('Error:AJAX request status = '+xmlHTTP.status);}}
else
{document.getElementById(throbberDivId).innerHTML=strNewThrobberAdminImg;}}
xmlHTTP.send("");}
else
{return false;}
return true;}
