//Fades Layer in
ie5in = (document.all && document.getElementById);
ns6in = (!document.all && document.getElementById);
opacin = 0;

var div=null;
function fadein(divname,w,h) {
var divl = (screen.width-w)/2;
var divt = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+divt+',';
settings +='left='+divl+',';
div = document.getElementById('theLayer'); 
if(opacin!= 100){
opacin+=20;
if(ie5in) document.getElementById('theLayer').filters.alpha.opacity = opacin;
if(ns6in) document.getElementById('theLayer').style.MozOpacity = opacin/100;
setTimeout('fadein()', 1);
}
}

//fades layer out
ie5out = (document.all && document.getElementById);
ns6out = (!document.all && document.getElementById);
opacout = 100;

function fadeOut() {
if(opacout!= 0) {
opacout-=100;
if(ie5out) document.getElementById('theLayer').filters.alpha.opacity = opacout;
if(ns6out) document.getElementById('theLayer').style.MozOpacity = opacout/100;
setTimeout('fadeOut()', 1);
window.location = 'default.asp';
}
}

//Toggle open close main and sections/subsections
function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
     key.innerHTML="<img src='imgSource/folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   } else {
      obj.style.display="block";
      key.innerHTML="<img src='imgSource/folderDown.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}

//Toggle Expand Collapse All section/subsections
function Expand() {
   divs=window.frames['menuHelpFrame'].document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
     key=window.frames['menuHelpFrame'].document.getElementById("x" + divs[i].id);
	 key.innerHTML="<img src='../imgSource/textFolder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}

function Collapse() {
   divs=window.frames['menuHelpFrame'].document.getElementsByTagName("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
     key=window.frames['menuHelpFrame'].document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='../imgSource/Folder.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
   }
}

//TR rollover
function ChangeCell(Cell) {
	Cell.style.color="#CC0000"
	Cell.style.cursor="pointer"
	Cell.style.background="#F7FBEA"
}
function ChangeBack(Cell) {
	Cell.style.color="#333333"
	Cell.style.background=""
}

//Pop Menu Center
var win= null;
function Position(){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var divl = 700;
var divt = 360;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
div.style.left = divl
}

//Help Menu Dragger
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");