var align=0;
function expand(id,pid,mul,catagory)
{

document.getElementById(id).style.display="block";
document.getElementById(pid).style.backgroundColor="#dae8fd";
document.getElementById(pid).style.borderBottomStyle="outset";
document.getElementById(id).style.borderRightStyle="outset";
document.getElementById(pid).style.borderTopStyle="outset";
document.getElementById(pid).style.borderColor="#000000";
document.getElementById(id).style.borderBottomStyle="outset";
document.getElementById(id).style.borderTopStyle="outset";
document.getElementById(pid).style.borderLeftStyle="outset";
document.getElementById(pid).style.borderRightStyle="outset";
//document.getElementById(borderid).style.borderLeftStyle="double";

//for(i=2;i<=catagory;i++)
//    {
//        subid=id+i;
//      document.getElementById(subid).style.borderLeftStyle="outset";
//    }

}

function collapse(id,pid)
{ 
	document.getElementById(id).style.display="none";
	document.getElementById(pid).style.backgroundColor="";
	document.getElementById(pid).style.borderStyle="none";
		}

function focusitem()
{


   var val=rtrim(ltrim(document.getElementById('search').value," ")," ");
   if(val=="click for search")
       {
           document.getElementById('search').value=""
           document.getElementById('search').focus()
           document.getElementById('search').style.color="#000000"
       }
       
}

function lostfocus()
{
    var val=rtrim(ltrim(document.getElementById('search').value));
    if(val=="")
        {
          document.getElementById('search').value="click for search";
          document.getElementById('search').style.color="#cccccc";
        }
}
function doubleclick()
{
    var val=rtrim(ltrim(document.getElementById('search').value));
   if(val!="click for search" && val!="")
       {
     document.frmSearch.submit();

       }


}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}



//page refresh

var sURL = unescape(window.location.pathname);

function refresh()
{
    window.location.href = sURL;
}





function refresh()
{
    window.location.replace( sURL );
}





function refresh()
{
    window.location.reload( false );
}

function detectresolution()
{
    



}

function no_submenu(id)
{
    document.getElementById(id).style.border="0";

}

function refreshlist()
{
    path="refreshlist.php"
    if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {

    //alert(xmlhttp.responseText)
    document.getElementById("ul1").innerHTML=xmlhttp.responseText;
    }
  }



  xmlhttp.open("POST", path, true)
  xmlhttp.send(null)


}
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("ul1").innerHTML=xmlhttp.responseText;
    }
  }


  xmlhttp.open("POST",path,true)
  xmlhttp.send();
  }
}

function expand2(id)
{
document.getElementById(id).style.backgroundColor="#dae8fd";
document.getElementById(id).style.borderBottomStyle="outset";
document.getElementById(id).style.borderLeftStyle="outset";
document.getElementById(id).style.borderRightStyle="outset";
document.getElementById(id).style.borderTopStyle="outset";

}

function collapse2(pid)
{
	//document.getElementById(id).style.display="none";
	document.getElementById(pid).style.backgroundColor="";
	document.getElementById(pid).style.borderStyle="none";
		}
