//Fix Safari Back Button Bug
function _fixSafariBB(){ //v1.1 by PVII
if(navigator.userAgent.indexOf("Safari")>-1){
var jj=onload;if(jj){if(onunload==null){
document.body.setAttribute('onunload',jj);}}}
}
//Netscape 4 Resize Fix
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//write NN4 stylesheet if not version5 browser
if(!document.getElementById){
document.write('<link rel="stylesheet" type="text/css" href="/04includes/04n4styles.css">');
document.close();}

//handle table row highligthing
function _rowLite(tb,cl){ //v1.0 by PVII -table row highlighter
 var g,i,x,gr;if(document.getElementById){g=document.getElementsByTagName("TABLE");
 for(x=0;x<g.length;x++){if(g[x].className&&g[x].className==tb){
 gr=g[x].getElementsByTagName("TR");if(gr){for(i=0;i<gr.length;i++){
 if(i>0){gr[i].onmouseover=function(){this.className=cl;};
 gr[i].onmouseout=function(){this.className='';};}}}}}}
}

//handle pop up windows
function _infopop(a) { //v1.0 by PVII
 document.tutpop = window.open(a,'theInfo','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,height=500,width=800');
 document.tutpop.focus();
}

//  Multi-Menu - Copyright 2004 Project Seven Development (PVII)
// Developed by: Gerry Jacobsen-PVII
// beta version 0.85_6a
function _setNM2(){var i,d='',h="<sty"+"le type=\"text/css\">";var tA=navigator.userAgent.toLowerCase();if(window.opera){if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1){return;}}if(document.getElementById){for(i=1;i<10;i++){d+='ul ';h+="\n.sub ul "+d+"{display:none;}";}document.write(h+"\n<"+"/sty"+"le>");}}_setNM2();function _buildNM(){var i,x,g,theDiv,bb,theS,tA,theU,pp,lvl,tS,opn;tA=navigator.userAgent.toLowerCase();if(window.opera){if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1){return;}}document.tControl=new Array;opn='';if(document.NMopener&&document.NMopener.length>5){opn=document.NMopener.split(",");}if(document.getElementById){for(x=1;x<10;x++){theDiv=document.getElementById('NMnav'+x);if(theDiv){if(theDiv.className&&theDiv.className.indexOf("snm")>-1){theS=theDiv.className.split('_');if(theS.length&&theS.length>2){theDiv.NMprop=theS.slice(1);}else{alert('Missing NM2 Menu Props:'+theDiv.id);continue;}}else{alert('Missing NM2 Menu Props:'+theDiv.id);continue;}theU=theDiv.getElementsByTagName("UL");for(i=0;i<theU.length;i++){theU[i].nmdiv=theDiv.id;theU[i].tctrl=document.tControl.length;document.tControl[document.tControl.length]=theU[i];if(i==0){}pp=theU[i].parentNode;lvl=0;while(pp){if(pp.tagName&&pp.tagName=="UL"){lvl++;}if(pp.tagName&&pp.tagName=="DIV"){break;}pp=pp.parentNode;}theU[i].nmlvl=lvl;}theA=theDiv.getElementsByTagName("A");for(i=0;i<theA.length;i++){theA[i].nmdiv=theDiv.id;bb=_getSub(theA[i]);theA[i].ulref=(bb!=null)?bb.tctrl:-1;theA[i].aref=document.tControl.length;document.tControl[document.tControl.length]=theA[i];if(theDiv.NMprop[2]==2){theA[i].onmouseover=function(){_timeNM2(this);};theA[i].onfocus=function(){_timeNM2(this);};}else{if(theA[i].ulref<0){theA[i].onclick=function(){_toggleNM2(this);};}else{theA[i].onclick=function(){_clickNM2(this);};}}}if(theDiv.NMprop[1]==1){tS="'"+theDiv.id+"'";for(i=0;i<opn.length;i+=3){if(opn[i]==theDiv.id){tS=tS+","+opn[i+1]+",'"+opn[i+2]+"'";}break;}eval("_openNM2("+tS+")");}}}document.body.onmouseover=_mainClose;}}function _getSub(a){var i,theU=null;var g=a.parentNode.getElementsByTagName("UL");if(g&&g.length){theU=g[0];}return theU;}function _showNM2(ob,bp){var i,s,hh,thePc,mk;var g=document.getElementById(ob.nmdiv);if(!bp&&g.NMprop[3]==1){_toggleNM2(ob);}if(ob&&ob.parentNode){thePc=ob.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){if(thePc[i].style.display!="block"){thePc[i].style.display="block";ob.parentNode.style.position="relative";if(g.NMprop[0]==0||thePc[i].nmlvl<(g.NMprop[7])){thePc[i].style.position="absolute";thePc[i].style.left=g.NMprop[4];thePc[i].style.top=g.NMprop[5];}thePc[i].style.visibility="visible";mk=(ob.className.indexOf("curr")>-1)?"minusmarkcurr":"minusmark";ob.className=mk;if(g.NMprop[6]==1){_animSub(thePc[i].tctrl,40);}}}}}}function _toggleNM2(a,b){var i,g,pp,theU,theA;if(a&&a.parentNode){pp=a.parentNode;while(pp){if(pp.tagName&&pp.tagName=="UL"){break;}pp=pp.parentNode;}if(pp){theU=pp.getElementsByTagName("UL");g=document.getElementById(pp.nmdiv);if(g.NMprop[0]==1&&b==1){return;}for(i=0;i<theU.length;i++){theA=theU[i].parentNode.firstChild;if(b!=1&&theA==a){continue;}else{if(theU[i].style.display=="block"){_hideNM2(theA);}}}}}}function _hideNM2(ob){var i,s,hh,thePc,theIm,tt;var g=document.getElementById(ob.nmdiv);if(ob&&ob.parentNode){thePc=ob.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){thePc[i].style.display="none";if(g.NMprop[0]==0||thePc[i].nmlvl<(g.NMprop[7])){thePc[i].style.position="static";thePc[i].style.left=0;thePc[i].style.top=0;}thePc[i].style.visibility="hidden";mk=(ob.className.indexOf("curr")>-1)?"plusmarkcurr":"plusmark";ob.className=mk;tt='setTimeout("_dodo('+thePc[i].tctrl+')",1)';eval(tt);}}}}function _dodo(ct){var g=document.tControl[ct];g.parentNode.style.position="static";}function _animSub(ct,st){var g=document.tControl[ct];var sp=30;var inc=20;st=(st>=100)?100:st;g.style.fontSize=st+"%";if(st<100){st+=inc;setTimeout("_animSub("+ct+","+st+")",sp);}}function _clickNM2(a){document.nmactive=1;document.nmadiv=a.nmdiv;var i,s,thePc;if(a&&a.parentNode){thePc=a.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){s=thePc[i].style.display;if(s=="block"){_hideNM2(a);}else{_showNM2(a);}}}}}function _timeNM2(a){if(document.nmcc){clearTimeout(document.nmcc);}document.nmactive=1;document.nmadiv=a.nmdiv;var tg='document.nmcc=setTimeout("_mouseNM2('+a.aref+')",220)';eval(tg);}function _mouseNM2(ct){var g=document.tControl[ct];if(ct>=0){_showNM2(g);}else{_toggleNM2(g);}}function _mainClose(evt){evt=(evt)?evt:((event)?event:null);var nn,pp,m=true;var st=document.nmactive;if(st!=-999){if(evt){var theSrc=(evt.target)?evt.target:evt.srcElement;pp=theSrc.parentNode;while(pp){nn=pp.nodeName;if(nn=="DIV"&&pp.NMprop){m=false;document.nmactive=1;document.nmadiv=pp.id;pp.nmstate=1;break;}pp=pp.parentNode;}if(m){document.nmactive=0;document.nmadiv='none';}if(document.nmc){clearTimeout(document.nmc);}document.nmc=setTimeout("_closeNM2()",300);}}}function _closeNM2(){var theA,i,divName,theDiv;if(document.nmadiv=='none'){document.nmactive=-1;}for(i=1;i<11;i++){divName='NMnav'+i;theDiv=document.getElementById(divName);if(theDiv){if(document.nmadiv!=theDiv.id){theDiv.nmstate==0;theA=theDiv.getElementsByTagName("A");if(theA){_toggleNM2(theA[0],1);}}}}}

//menu auto opener
function _openNM2(navDiv,tp,vu){var i,d,ha,pp,m=false;if(document.getElementById){d=document.getElementById(navDiv);if(d){ha=d.getElementsByTagName("A");if(tp==null||tp==0){vu=window.location.href;tp=0;}for(i=0;i<ha.length;i++){if(ha[i].href){if(tp<=0){if(ha[i].href.indexOf(vu)>-1){m=true;break;}}if(tp==1){if(ha[i].href.indexOf(vu)>-1){m=true;break;}}if(tp==2){if(ha[i].firstChild){if(ha[i].firstChild.nodeValue==vu){m=true;break;}}}}}if(m){pp=ha[i].parentNode;if(ha[i].ulref<0){ha[i].className="currentmark";pp=pp.parentNode;}while(pp){if(pp.nodeName=="LI"){if(pp.firstChild.nodeName=="A"){pp.firstChild.className="plusmarkcurr";if(d.NMprop[0]==1){_showNM2(pp.firstChild,9);}}}pp=pp.parentNode;}}}}}

//  Random Background Scroller - Copyright 2004 Project Seven Development (PVII)
// Developed by: Gerry Jacobsen-PVII
// beta version 0.7 -beta
function _setRBS(){var theBox="thumbnails";var theShim="thumbs";var theDiv="bgsc1inks";var i,tB,tS,tD,tL,tA,j,np;if(document.getElementById){tB=document.getElementById(theBox);if(tB){tD=document.getElementById(theDiv);if(tD){tB.RBS=arguments;if(document.RBSdn){tB.RBS[0]=document.RBSdn;}tL=tD.getElementsByTagName("LI");if(tL){j=tL.length;if(tB.RBS[0]==0){i=Math.floor(Math.random()*j);}else{i=(tB.RBS[0]>j)?0:tB.RBS[0]-1;i=(i<0)?0:i;}tA=tL[i].getElementsByTagName("A");if(tA&&tA.length>1){tB.style.backgroundImage="url("+tA[1].href+")";tS=document.getElementById(theShim);if(tS){tS.setAttribute("alt",tA[0].firstChild.nodeValue);tS.parentNode.setAttribute("href",tA[0].href);}_runRBS(tB.id,'Reset');}}}}}}function _scrollRBS(ob,tT,np){if(document.getElementById){var theBox=document.getElementById(ob);var tt,nu,tF,lp=0,hp=0,inc=0,dl=theBox.RBS[5],m=true;;var tm="theBox.BGtm=setTimeout(\"_scrollRBS('";if(theBox){if(tT=='H'||tT=='D'){lp=np;}if(tT=='V'||tT=='D'){hp=np;}theBox.style.backgroundPosition=lp+'px '+hp+'px';tF=theBox.RBS[4];theBox.RBSac+=tF;nu=theBox.RBSac+tF;if(theBox.RBS[1]=='C'){if(nu>theBox.RBS[6]&&theBox.RBSac!=theBox.RBS[6]){tF=theBox.RBS[6]-theBox.RBSac;theBox.RBSac=theBox.RBS[6]-theBox.RBS[4];}if(theBox.RBSac>=theBox.RBS[6]){dl=theBox.RBS[7];theBox.RBSac=0;theBox.RBSc+=1;if(theBox.RBSc>theBox.RBScc){theBox.RBSc=1;}}}theBox.RBSae+=tF;inc=(np>=0)?tF:tF*-1;np=np+inc;if(theBox.RBSae+tF>theBox.RBS[9]){np=(np>=0)?theBox.RBS[9]:theBox.RBS[9]*-1;}tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.RBSres=tm;if(theBox.RBS[3]=="N"&&theBox.RBSae>theBox.RBS[9]){m=false;theBox.RBScm=0;if(theBox.BGtm){clearTimeout(theBox.BGtm);}}if(m){if(theBox.RBScm==1){eval(tm);}}}}}function _runRBS(ob,cm,op){var lp=0,hp=0,tT,tm,dl;var tm="theBox.BGtm=setTimeout(\"_scrollRBS('";if(document.getElementById){var theBox=document.getElementById(ob);if(theBox){if(cm=='Stop'){theBox.RBScm=0;if(theBox.BGtm){clearTimeout(theBox.BGtm);}}if(cm=='Resume'){theBox.RBScm=1;if(theBox.RBSres){eval(theBox.RBSres);}}if(cm=='Reset'){theBox.RBScm=0;if(theBox.BGtm){clearTimeout(theBox.BGtm);}theBox.RBSres='';np=theBox.RBS[8];theBox.RBSac=0;theBox.RBSae=0;var tT="H";if(theBox.RBS[2]=='U'||theBox.RBS[2]=='D'){tT="V";}if(tT=='H'||tT=='D'){lp=np;}if(tT=='V'||tT=='D'){hp=np;}theBox.style.backgroundPosition=lp+'px '+hp+'px';np+=theBox.RBS[4];if(theBox.RBS[2]=="L"||theBox.BGs[2]=="U"){np=np*-1;}theBox.RBSc=1;theBox.RBScc=parseInt(theBox.RBS[9]/theBox.RBS[6]);theBox.RBScm=1;dl=(op)?op:theBox.RBS[7];tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.RBSres=tm;if(theBox.RBS[10]=="Y"){eval(tm);}}}}}

