//Fix Safari Back Button Bug
function P7_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 P7_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 P7_infopop(a) { //v1.0 by PVII
 document.p7tutpop = window.open(a,'theInfo','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,height=500,width=800');
 document.p7tutpop.focus();
}

// P7 Multi-Menu - Copyright 2004 Project Seven Development (PVII)
// Developed by: Gerry Jacobsen-PVII
// beta version 0.85_6a
function P7_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.p7sub ul "+d+"{display:none;}";
			}
	document.write(h+"\n<"+"/sty"+"le>");}}P7_setNM2();
	function P7_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.p7tControl=new Array;opn='';if(document.p7NMopener&&document.p7NMopener.length>5){opn=document.p7NMopener.split(",");}if(document.getElementById){for(x=1;x<10;x++){theDiv=document.getElementById('p7NMnav'+x);if(theDiv){if(theDiv.className&&theDiv.className.indexOf("p7snm")>-1){theS=theDiv.className.split('_');if(theS.length&&theS.length>2){theDiv.p7NMprop=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].p7nmdiv=theDiv.id;theU[i].p7tctrl=document.p7tControl.length;document.p7tControl[document.p7tControl.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].p7nmlvl=lvl;}theA=theDiv.getElementsByTagName("A");for(i=0;i<theA.length;i++){theA[i].p7nmdiv=theDiv.id;bb=P7_getSub(theA[i]);theA[i].p7ulref=(bb!=null)?bb.p7tctrl:-1;theA[i].p7aref=document.p7tControl.length;document.p7tControl[document.p7tControl.length]=theA[i];if(theDiv.p7NMprop[2]==2){theA[i].onmouseover=function(){P7_timeNM2(this);};theA[i].onfocus=function(){P7_timeNM2(this);};}else{if(theA[i].p7ulref<0){theA[i].onclick=function(){P7_toggleNM2(this);};}else{theA[i].onclick=function(){P7_clickNM2(this);};}}}if(theDiv.p7NMprop[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("P7_openNM2("+tS+")");}}}document.body.onmouseover=P7_mainClose;}}function P7_getSub(a){var i,theU=null;var g=a.parentNode.getElementsByTagName("UL");if(g&&g.length){theU=g[0];}return theU;}function P7_showNM2(ob,bp){var i,s,hh,thePc,mk;var g=document.getElementById(ob.p7nmdiv);if(!bp&&g.p7NMprop[3]==1){P7_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.p7NMprop[0]==0||thePc[i].p7nmlvl<(g.p7NMprop[7])){thePc[i].style.position="absolute";thePc[i].style.left=g.p7NMprop[4];thePc[i].style.top=g.p7NMprop[5];}thePc[i].style.visibility="visible";mk=(ob.className.indexOf("curr")>-1)?"p7minusmarkcurr":"p7minusmark";ob.className=mk;if(g.p7NMprop[6]==1){P7_animSub(thePc[i].p7tctrl,40);}}}}}}function P7_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.p7nmdiv);if(g.p7NMprop[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"){P7_hideNM2(theA);}}}}}}function P7_hideNM2(ob){var i,s,hh,thePc,theIm,tt;var g=document.getElementById(ob.p7nmdiv);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.p7NMprop[0]==0||thePc[i].p7nmlvl<(g.p7NMprop[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)?"p7plusmarkcurr":"p7plusmark";ob.className=mk;tt='setTimeout("P7_dodo('+thePc[i].p7tctrl+')",1)';eval(tt);}}}}function P7_dodo(ct){var g=document.p7tControl[ct];g.parentNode.style.position="static";}function P7_animSub(ct,st){var g=document.p7tControl[ct];var sp=30;var inc=20;st=(st>=100)?100:st;g.style.fontSize=st+"%";if(st<100){st+=inc;setTimeout("P7_animSub("+ct+","+st+")",sp);}}function P7_clickNM2(a){document.p7nmactive=1;document.p7nmadiv=a.p7nmdiv;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"){P7_hideNM2(a);}else{P7_showNM2(a);}}}}}function P7_timeNM2(a){if(document.p7nmcc){clearTimeout(document.p7nmcc);}document.p7nmactive=1;document.p7nmadiv=a.p7nmdiv;var tg='document.p7nmcc=setTimeout("P7_mouseNM2('+a.p7aref+')",220)';eval(tg);}function P7_mouseNM2(ct){var g=document.p7tControl[ct];if(ct>=0){P7_showNM2(g);}else{P7_toggleNM2(g);}}function P7_mainClose(evt){evt=(evt)?evt:((event)?event:null);var nn,pp,m=true;var st=document.p7nmactive;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.p7NMprop){m=false;document.p7nmactive=1;document.p7nmadiv=pp.id;pp.nmstate=1;break;}pp=pp.parentNode;}if(m){document.p7nmactive=0;document.p7nmadiv='none';}if(document.p7nmc){clearTimeout(document.p7nmc);}document.p7nmc=setTimeout("P7_closeNM2()",300);}}}function P7_closeNM2(){var theA,i,divName,theDiv;if(document.p7nmadiv=='none'){document.p7nmactive=-1;}for(i=1;i<11;i++){divName='p7NMnav'+i;theDiv=document.getElementById(divName);
	if(theDiv){if(document.p7nmadiv!=theDiv.id){theDiv.nmstate==0;theA=theDiv.getElementsByTagName("A");
	if(theA){P7_toggleNM2(theA[0],1);}}}}}

//menu auto opener
function P7_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].p7ulref<0){ha[i].className="p7currentmark";pp=pp.parentNode;}while(pp){if(pp.nodeName=="LI"){if(pp.firstChild.nodeName=="A"){pp.firstChild.className="p7plusmarkcurr";if(d.p7NMprop[0]==1){P7_showNM2(pp.firstChild,9);}}}pp=pp.parentNode;}}}}}

// P7 Random Background Scroller - Copyright 2004 Project Seven Development (PVII)
// Developed by: Gerry Jacobsen-PVII
// beta version 0.7 -beta
function P7_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.p7RBS=arguments;if(document.p7RBSdn){tB.p7RBS[0]=document.p7RBSdn;}tL=tD.getElementsByTagName("LI");if(tL){j=tL.length;if(tB.p7RBS[0]==0){i=Math.floor(Math.random()*j);}else{i=(tB.p7RBS[0]>j)?0:tB.p7RBS[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);}P7_runRBS(tB.id,'Reset');}}}}}}function P7_scrollRBS(ob,tT,np){if(document.getElementById){var theBox=document.getElementById(ob);var tt,nu,tF,lp=0,hp=0,inc=0,dl=theBox.p7RBS[5],m=true;;var tm="theBox.p7BGtm=setTimeout(\"P7_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.p7RBS[4];theBox.p7RBSac+=tF;nu=theBox.p7RBSac+tF;if(theBox.p7RBS[1]=='C'){if(nu>theBox.p7RBS[6]&&theBox.p7RBSac!=theBox.p7RBS[6]){tF=theBox.p7RBS[6]-theBox.p7RBSac;theBox.p7RBSac=theBox.p7RBS[6]-theBox.p7RBS[4];}if(theBox.p7RBSac>=theBox.p7RBS[6]){dl=theBox.p7RBS[7];theBox.p7RBSac=0;theBox.p7RBSc+=1;if(theBox.p7RBSc>theBox.p7RBScc){theBox.p7RBSc=1;}}}theBox.p7RBSae+=tF;inc=(np>=0)?tF:tF*-1;np=np+inc;if(theBox.p7RBSae+tF>theBox.p7RBS[9]){np=(np>=0)?theBox.p7RBS[9]:theBox.p7RBS[9]*-1;}tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.p7RBSres=tm;if(theBox.p7RBS[3]=="N"&&theBox.p7RBSae>theBox.p7RBS[9]){m=false;theBox.p7RBScm=0;if(theBox.p7BGtm){clearTimeout(theBox.p7BGtm);}}if(m){if(theBox.p7RBScm==1){eval(tm);}}}}}function P7_runRBS(ob,cm,op){var lp=0,hp=0,tT,tm,dl;var tm="theBox.p7BGtm=setTimeout(\"P7_scrollRBS('";if(document.getElementById){var theBox=document.getElementById(ob);if(theBox){if(cm=='Stop'){theBox.p7RBScm=0;if(theBox.p7BGtm){clearTimeout(theBox.p7BGtm);}}if(cm=='Resume'){theBox.p7RBScm=1;if(theBox.p7RBSres){eval(theBox.p7RBSres);}}if(cm=='Reset'){theBox.p7RBScm=0;if(theBox.p7BGtm){clearTimeout(theBox.p7BGtm);}theBox.p7RBSres='';np=theBox.p7RBS[8];theBox.p7RBSac=0;theBox.p7RBSae=0;var tT="H";if(theBox.p7RBS[2]=='U'||theBox.p7RBS[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.p7RBS[4];if(theBox.p7RBS[2]=="L"||theBox.p7BGs[2]=="U"){np=np*-1;}theBox.p7RBSc=1;theBox.p7RBScc=parseInt(theBox.p7RBS[9]/theBox.p7RBS[6]);theBox.p7RBScm=1;dl=(op)?op:theBox.p7RBS[7];tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.p7RBSres=tm;if(theBox.p7RBS[10]=="Y"){eval(tm);}}}}}
