/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
var xmlHttp

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function catstateChanged()
{
document.getElementById("catdisplay_area").innerHTML="<img src='images/loading.gif' /> Requesting content..."
if (xmlHttp.readyState==4 && xmlHttp.status==200){
document.getElementById("catdisplay_area").innerHTML=xmlHttp.responseText
}
}

function showajax(str){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="ajax.catalog.php";
url=url+"?cPath=" + str;
url=url+"&sid="+Math.random();
//document.write(url)
xmlHttp.onreadystatechange=catstateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function show(id){
	var ul='ul_' + id;
    var subElement;
	var theimage;
	var imageid = "img_"+id;

	subElement = document.getElementById(ul);
	theimage = document.getElementById(imageid);
	if(subElement.style.display == 'block'){
		//collapse...
		subElement.style.display = 'none';
        theimage.src = 'images/arrow_show_down.gif';
	}else{
		//expand/display...
		subElement.style.display = 'block';
        theimage.src = "images/arrow_show_up.gif";
	}
}