// Rev. 22/09/2005

function ToggleAll(item)
  {
	for(i=1; i<5; i++)
	  {
		
		obj=document.getElementById(i);
		if (i != item)
		  obj.style.display="none";
		else
		   {
		     if (obj.style.display == "block")
			    {
					document.getElementById("infoAbout").style.display = "block" //window.location.href="index.asp"
			 		obj.style.display="none";
				}
			 else
			 	{
					obj.style.display="block";
					document.getElementById("infoAbout").style.display = "none"
				}//window.location.href="index.asp"*/
		   }
	  
	  }
  }


function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
   } else {
      obj.style.display="block";
   }
}

function Expand() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
     key=document.getElementById("x" + divs[i].id);
   }
}

function Collapse() {
   divs=document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
     key=document.getElementById("x" + divs[i].id);
   }
}




function SetFrame()
   {   
  	var pgwidth = screen.width;
	var pgheight = screen.height;
	//document.write("it is scrolling:" + top.document.contentWindow.document.body.scrollHeight);
	if (pgwidth == 800)
	 	top.document.getElementById('frmContent').height= pgheight - 280;
		//resize the frame according to the content
		
	 else
	 	top.document.getElementById('frmContent').height= pgheight - 326;
		
/*		var f = document.getElementById("frmContent");
                function resize() {
                    var h = "";
                    var w = "";
                    if (f.contentDocument) {
                        h = f.contentDocument.documentElement.offsetHeight + 20 + "px";
                        // can't find anything for Opera and Firefox that works for the width. OffetWidth doesn't work right either.
                        w = f.contentDocument.defaultView.getComputedStyle(f.contentDocument.documentElement,"").getPropertyValue("width");
                    } else if (f.contentWindow) {
                        h = f.contentWindow.document.body.scrollHeight + 5 + "px";
                        w = f.contentWindow.document.body.scrollWidth + 8 + "px";
                    } else {
                        return;
                    }
                    f.setAttribute("width", w);
                    f.setAttribute("height",h);
                    f.parentNode.setAttribute("width",w);
                    f.parentNode.setAttribute("height",h);
                }
                if (window.addEventListener) {
                    f.onload = resize;
                } else if (f.attachEvent) {
                    f.attachEvent("onload", resize);
                } else {
                    return;
                }
                resize();
		*/
   }




function SetContent(strpage, iID, strTitle)
   {
    if (strpage.indexOf('#') > 0)
	    {
			parent.frames['frmContent'].location.href = strpage.split("#")[0] + "&PageName=" +  strTitle + "#" + strpage.split("#")[1];}
	else        
		parent.frames['frmContent'].location.href = strpage + "&PageName=" +  strTitle;
	SetFrame();	
	document.getElementById('aPrinter').href = "javascript: popup(" + iID + ", '" + strTitle + "');"
	document.getElementById('aPrinter').onclick = "#"
   }
   
function dynamictoggle(item, myarray)
 {
  for(i=0; i < myarray.length; i++)
  	 {
	    obj=document.getElementById(myarray[i]);
		if (myarray[i] == item) 
	 		{
				if (obj.style.display=="block")
					obj.style.display="none";
				else
					obj.style.display="block";
			}
		else
		   	obj.style.display="none";
	 }
 
 }

function onHover(thename)
  {
	document.getElementById(thename).className = 'bg-title-hover';
	document.getElementById("tr" + thename).className = 'bg-title-hover';  
	document.getElementById("tr" + thename).style.cursor = "hand"
	  
  }

function offHover(thename)
  {
	document.getElementById(thename).className = 'bg-title';
	document.getElementById("tr" + thename).className = 'bg-title';  
	  
  }
