function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function hideAllDivs(){
  objElement = document.getElementById('connected').style;
  objElement.display = "none";
  objElement = document.getElementById('enhanced').style;
  objElement.display = "none";
  objElement = document.getElementById('empowered').style;
  objElement.display = "none";
}

function showDiv(strDivName){
  hideAllDivs();
  objElement = document.getElementById(strDivName).style;
  objElement.display = "";
}

function displayNav(strNav,action){
  objElement = document.getElementById(strNav).style;
  if(action=='show'){
	  objElement.display = "";
  } else if(action=='hide') {
	  objElement.display = "none";
  }
}

function retVal(sName)
{
  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
}

var param = retVal('print');
var cssfile = (param==1)? "res/styles_print.css" : "res/styles.css"; 
document.write('<link href="'+cssfile+'" type="text/css" rel="stylesheet">'); 

function displayPrintBt(pr){
	objElement = document.getElementById('printv').style;
	if(pr==0){
		objElement.display = "block";
	}
}

function displayPrintVersion(){
	var pageURL = new String(window.location) + '?print=1';
	location.href=pageURL;
}


       function showHideAll(divname, status) {
        if (status == "hide") {
            for(i=1; i<=1000; i++) {
                if (document.getElementById(divname+i)) {
                    document.getElementById(divname+i).style.display = "none";
                }
                else {
                    i=1000;
                }
            }
        }
        if (status == "show") {
            for(i=1; i<=1000; i++) {
                if (document.getElementById(divname+i)) {
                    document.getElementById(divname+i).style.display = "block";
                }
                else {
                    i=1000;
                }
            }
        }
    }

	function divState(divname){
		var status = document.getElementById(divname).style.display;

		if(status == "block"){
			document.getElementById(divname).style.display = "none";
		}
		if(status == "none"){
			document.getElementById(divname).style.display = "block";
  		}
	}
	function printFAQ(divname){
        showHideAll('A','show');
        window.print();
    }
	function clickPrint() {
		window.print();
	}
    function clickBookmark(title, url){
        if(window.sidebar){ // Firefox
          window.sidebar.addPanel(title, url,'');
        }else if(window.opera){ //Opera
          var a = document.createElement("A");
          a.rel = "sidebar";
          a.target = "_search";
          a.title = title;
          a.href = url;
          a.click();
        } else if(document.all){ //IE
          window.external.AddFavorite(url, title);
        }
      }
	  
//=======================================================
     //detect browser settings for showing and hiding DIVs
     isNS4 = (document.layers) ? true : false;
     isIE4 = (document.all && !document.getElementById) ? true : false;
     isIE5 = (document.all && document.getElementById) ? true : false;
     isNS6 = (!document.all && document.getElementById) ? true : false;
//=======================================================

function switchDiv(strDivName,bolVisible){
 //identify the element based on browser type
 if (isNS4) {
   objElement = document.layers[strDivName];
 } else if (isIE4) {
   objElement = document.all[strDivName].style;
 } else if (isIE5 || isNS6) {
   objElement = document.getElementById(strDivName).style;
 }
 
 if(isNS4){
     if(!bolVisible) {
       objElement.visibility ="hidden"
     } else {
       objElement.visibility ="visible"
     }     
 }else if(isIE4){
     if(!bolVisible) {
       objElement.visibility = "hidden";
     } else {
       objElement.visibility = "visible";
     }
 } else if (isIE5 || isNS6) {
      if(!bolVisible){
         objElement.display = "none";
      } else {
        objElement.display = "";
        }
      }
}

function hideAllFaq(){
		switchDiv("AA12",false);
		switchDiv("BB12",false);
		switchDiv("CC12",false);
		switchDiv("DD12",false);
		switchDiv("EE12",false);
		switchDiv("FF12",false);
}
function hideAllFaqTrue(){
		switchDiv("AA11",true);
		switchDiv("BB11",true);
		switchDiv("CC11",true);
		switchDiv("DD11",true);
		switchDiv("EE11",true);
		switchDiv("FF11",true);

}
function hideAllFaqAll(){
		switchDiv("AA12",true);
		switchDiv("BB12",true);
		switchDiv("CC12",true);
		switchDiv("DD12",true);
		switchDiv("EE12",true);
		switchDiv("FF12",true);
}
function hideAllFaqFalse(){
		switchDiv("AA11",false);
		switchDiv("BB11",false);
		switchDiv("CC11",false);
		switchDiv("DD11",false);
		switchDiv("EE11",false);
		switchDiv("FF11",false);
}
function hideNewProjectLoad(){
		switchDiv("projectdivnew1",true);
}
function hideNewProject(){
		switchDiv("projectdivnew1",false);
		switchDiv("projectdivnew2",false);
		switchDiv("projectdivnew3",false);
		switchDiv("projectdivnew4",false);
		switchDiv("projectdivnew5",false);
		switchDiv("projectdivnew6",false);
		switchDiv("projectdivnew7",false);
		switchDiv("projectdivnew8",false);
		switchDiv("projectdivnew9",false);
		switchDiv("projectdivnew10",false);
		switchDiv("projectdivnew11",false);
		switchDiv("projectdivnew12",false);
		switchDiv("projectdivnew13",false);
		switchDiv("projectdivnew14",false);
		switchDiv("projectdivnew15",false);
		switchDiv("projectdivnew16",false);
		switchDiv("projectdivnew17",false);
		switchDiv("projectdivnew18",false);
		switchDiv("projectdivnew19",false);
		switchDiv("projectdivnew20",false);
		switchDiv("projectdivnew21",false);
		switchDiv("projectdivnew22",false);
		switchDiv("projectdivnew23",false);
		switchDiv("projectdivnew24",false);
		switchDiv("projectdivnew25",false);
		switchDiv("projectdivnew26",false);
		switchDiv("projectdivnew27",false);
		switchDiv("projectdivnew28",false);
		switchDiv("projectdivnew29",false);
		switchDiv("projectdivnew30",false);

	}
function hideNewFiveLoad(){
		switchDiv("text1",true);
}
function hideNewFive(){
		switchDiv("text1",false);
		switchDiv("text2",false);
		switchDiv("text3",false);
		switchDiv("text4",false);
		switchDiv("text5",false);
}
function retVal(sName)
{
  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
}

