function flagError(err) {
	sError = ""
	for (var i in err) sError = sError + i + '=' + err[i] + '&';
	if (sDomain=="localhost") {
		/*alert("error on page");*/
		alert(sError);
	} else {
		sURL = sRootURL+'/500.php?Errortype=Javascript&error=' + escape(sError)
		var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0");
		request.open("GET", sURL, true);
		request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		request.send(null);
	}
}

function DisplayProducts(sCategory) {
	sObj=document.getElementById(sCategory);
	nHeight=sObj.offsetHeight;
	sObj.style.height="0px";
	sObj.style.visibility="visible";
	sObj.style.position="relative";
	document.getElementById(sCategory+"_switch").style.display="none";
	setTimeout("OpenCategory(sObj, "+nHeight+")",50);
}

function OpenCategory(sObj, nHeight) {
	
	if ((nHeight-sObj.offsetHeight) > 50) {
		sObj.style.height=(sObj.offsetHeight+50)+"px";
	} else {
		sObj.style.height=nHeight+"px";
	}
	if (sObj.offsetHeight<nHeight) {
		setTimeout("OpenCategory(sObj, "+nHeight+")",50);
	}
}
