
var newwindow;
function ShowPopup(url)
{
	newwindow=window.open(url,'name','toolbar=no,location=no,resizable=yes,menubar=no,scrollbars=yes,width=550,height=500');
	if (window.focus) {newwindow.focus()}
}


var setMenuBehavior=function(){

function falseFunction(){return false;}
function isVisible(el){return el.style.display!="none";}
function setVisible(el,bVis){
if(bVis){
el.style.display="";

}else
el.style.display="none";
}
function setToggleFor(menu){
return function(evt){ setVisible(menu, !isVisible(menu)); }
}

function clean(menuDiv){
var spans=menuDiv.getElementsByTagName("span");
for(var ii=0; ii<spans.length; ii++){
if (spans[ii].className.substr(0, 8) != "sectLink"){
spans[ii].onclick=null;
spans[ii].onselectstart=null;
}
}
}

function setEvt(obj, evt, func){
if(obj[evt]) {
obj[evt]=function(f,g){
return function(){
f.apply(this,arguments);
return g.apply(this,arguments);
};
}(func, obj[evt]);
} else
obj[evt]=func;
}

return function(containerID){
var d=document, bCanRun=false;
var spans, container, el, links, ref,  hiliteLink

// test if the script can run
if(d.getElementById && d.getElementsByTagName){
container=d.getElementById(containerID);
if(container && container.nodeName &&
typeof container.parentNode!="undefined" &&
typeof container.nextSibling!="undefined"){
bCanRun = true;
}
}

if(bCanRun){
//set the behaviors for the submenu labels
spans=container.getElementsByTagName("span");

for(var ii=0; ii<spans.length; ii++){
el=spans[ii];
ref=location.href;

if(spans[ii].lastChild.href == ref && spans[ii].parentNode != null){
 	  spans[ii].id = spans[ii].name = "expanded"; 
el=spans[ii].parentNode;

el=el.parentNode;

//alert(spans[ii].parentNode);

setVisible(el, true);
continue;


}else{
while(el&&el.nodeName.toLowerCase()!="ul") el=el.nextSibling;
if(el){

setVisible(el, false);
}
}
}

//continue clean container and  evaluate menu structure
setEvt(window, "onunload", function(evt){clean(container);});
//show the current position
//ref=location.href.match(/([^\/]+)\??[^\/]+$/)[1];
ref=location.href

links=container.getElementsByTagName("a");
for(var j=0; j<links.length; j++){
if(links[j].href.indexOf(ref)!=-1){//link found

if(links[j].parentNode.className == "sectLink_2"){//hilite current link
	if(navigator.appName == "Microsoft Internet Explorer"){
	hiliteLink = links[j].parentNode.parentNode.childNodes[2].childNodes[0].childNodes[0];
	hiliteLink.id = hiliteLink.name = "current"; 
	}else{
	hiliteLink = links[j].parentNode.parentNode.childNodes[2].childNodes[1].childNodes[0];
	hiliteLink.id = hiliteLink.name = "current"; 
	}
}else{
	links[j].id = links[j].name  = "current";
}
el=links[j].parentNode;
//put down arrow on parent Node
el.parentNode.parentNode.childNodes[0].id = el.parentNode.parentNode.childNodes[0].name = "expanded";
while(el && el.id!=containerID){

if(el.nodeName.toLowerCase()=="ul") {

setVisible(el, true);
}

el=el.parentNode;
}

break;
}
}
}
}
}();
