function retVal(sName)
{

  /*
   get last loc. of ?
   right: find first loc. of sName
   +2
   retrieve value before next &
  
  */
  
  var sURL = new String(window.location);
  var iQMark= sURL.lastIndexOf('?');
  var iLensName=sName.length;
  
  //retrieve loc. of sName
  var iStart = sURL.indexOf('?' + sName +'=') //limitation 1
  if (iStart==-1)
        {//not found at start
        iStart = sURL.indexOf('&' + sName +'=')//limitation 1
		if (iStart==-1)
		   {//not found at end
		    return 0; //not found
		   }   
        }
        
  iStart = iStart + + iLensName + 2;
  var iTemp= sURL.indexOf('&',iStart); //next pair start
  if (iTemp ==-1)
		{//EOF
		iTemp=sURL.length;
		}  
  return sURL.slice(iStart,iTemp ) ;
  sURL=null;//destroy String
}
function exp_coll(ind)

{
	
 s = document.getElementById("sp_" + ind);
 i = document.getElementById("im_" + ind);
 i2 = document.getElementById("im2_" + ind);
 if (s.style.display == 'none')
 {
   s.style.display = 'block';
   i.src = "images/minus.gif";
   i2.src = "images/spacer.gif";
 }
 else if (s.style.display == 'block')
 {
   s.style.display = 'none';
   i.src = "images/plus.gif";
   i2.src = "images/spacer.gif";
 }
}

function exp(ind)
{
 s = document.getElementById("sp_" + ind);
 i = document.getElementById("im_" + ind);
 i2 = document.getElementById("im2_" + ind);
 if (!(s && i && i2)) return false;
 s.style.display = 'block';
 i.src = "images/minus.gif";
 i2.src = "images/spacer.gif";
}

function coll(ind)
{

 s = document.getElementById("sp_" + ind);
 i = document.getElementById("im_" + ind);
 i2 = document.getElementById("im2_" + ind);
 if (!(s && i && i2)) return false;
 s.style.display = 'none';
 i.src = "images/plus.gif";
 i2.src = "images/spacer.gif";
}
if(document.location.href)
	var hrefString = document.location.href;
	
else
	var hrefString = document.location;

function coll_all()
{
  coll(1);
  coll(2);
  coll(3);
  coll(4);
  coll(5);
  coll(6);
  coll(7);
  coll(8);
  coll(9);
  coll(10);
  coll(11);
  coll(12);
  coll(13);
  
  
 
   
}
function exp_all()
{
 exp(0);
 exp(1);
 exp(2);
 exp(3);
 exp(4);
 exp(5);
 exp(6);
 exp(7);
 exp(8);
 exp(9);
 exp(10);
 exp(11);
 exp(12);
 exp(13);
 
 
}

function setCurrent(containerId) {
	var menu = document.getElementById(containerId)
	if ( menu!=null )
		setActiveMenu(menu.getElementsByTagName("a"), extractPageName(hrefString));
}

function extractPageName(hrefString)
{
	if(hrefString == "#") return "";

	var arr = hrefString.split('.');

	if(arr.length<2) return "";

	arr = arr[arr.length-2].split('/');
	return arr[arr.length-1].toLowerCase();
}

function setActiveMenu(arr, crtPage)
{
	for(var i=0; i < arr.length; i++)
		if(extractPageName(arr[i].href) == crtPage)
		{
			arr[i].className = "current";

			if(arr[i].href.search(/#/) != -1)
			    arr[i].className = "current blur";

			arr[i].href = "#";

		}else if(arr[i].href == "#") {
			arr[i].className = "current";
		}
		//for(var i=0; i < arr.length; i++)
		if((crtPage == "faculty") || (crtPage == "finance") || (crtPage == "general_managemnt") || (crtPage == "hrm") || (crtPage == "marketing") || (crtPage == "system"))
		{//alert(arr[i]);
			faculty.className = "current1";
		}
}
window.onload = coll_all