/* ================================================ PVII Menu Bar Magic scripts Copyright (c) 2008 Project Seven Development www.projectseven.com Version: 1.0.5 - script build: 1-07 ================================================ */ var p7MBi=false,p7MBa=false,p7MBctl=[],p7MBadv=[]; function P7_MBaddLoad(){ if(window.addEventListener){ window.addEventListener("load",P7_MBinit,false); } else if(window.attachEvent){ window.attachEvent("onload",P7_MBinit); } else{ window.onload=P7_MBinit; } } P7_MBaddLoad(); function P7_MBop(){ if(!document.getElementById){ return; } p7MBctl[p7MBctl.length]=arguments; } function P7_MBinit(){ var i,j,tD,tA; if(p7MBi){ return; } p7MBi=true; for(j=0;j-1){ return; } if(op[1]){ if(a.p7bga){ clearTimeout(a.p7bga); } P7_MBslideBG(a,1); } else{ a.style.backgroundPosition=op[6]+"px "+op[4]+"px"; } } function P7_MBout(a){ var i,tD,op,cl; if(!p7MBa){ return; } tD=document.getElementById(a.p7mb); op=tD.p7opt; cl=a.className; if(op[10]!=1&&cl&&cl.indexOf('p7MBmark')>-1){ return; } if(op[1]){ if(a.p7bga){ clearTimeout(a.p7bga); } P7_MBslideBG(a,0); } else{ a.style.backgroundPosition=op[5]+"px "+op[3]+"px"; } } function P7_MBdown(d){ var i,a,tD,tA; a=document.getElementById(d); if(a){ tD=document.getElementById(a.p7mb); tA=tD.getElementsByTagName('a'); for(i=0;i0){ if(tA[j].href==wH||aU==wH){ k=j; kk=-1; break; } } if(op==2){ if(tA[j].firstChild){ if(tA[j].firstChild.nodeValue==mt[2]){ kk=j; } } } if(op==3&&tA[j].href.indexOf(mt[2])>-1){ kk=j; } if(op==4){ for(x=2;x-1){ if(tA[j].firstChild&&tA[j].firstChild.nodeValue){ if(tA[j].firstChild.nodeValue==mt[x+1]){ kk=j; } } } } } } k=(kk>k)?kk:k; if(k>-1){ P7_MBdown(tA[k].id); } } function P7_MBslideBG(el,md){ var i,tD,op,cp,tl,tt,du,dl,dt,ds,st,fr,dy=10; tD=document.getElementById(el.p7mb); op=tD.p7opt; cp=P7_MBgetBG(el); if(md==1){ tl=op[6]; tt=op[4]; du=op[7]; } else{ tl=op[5]; tt=op[3]; du=op[8]; } dl=Math.abs(Math.abs(tl)-Math.abs(cp[0])); dt=Math.abs(Math.abs(tt)-Math.abs(cp[1])); ds=(dl>=dt)?dl:dt; st=du/dy; fr=parseInt(ds/st); fr=(fr<1)?1:fr; P7_MBglideBG(el.id,cp[0],tl,cp[1],tt,fr,dy); } function P7_MBglideBG(id,x,tl,y,tt,fr,dy){ var el,nt,nl,m=false; el=document.getElementById(id); if(y!=tt){ if(tt=tt)?tt:nt; } m=true; } else{ nt=y; } if(x!=tl){ if(tl=tl)?tl:nl; } m=true; } else{ nl=x; } if(m){ if(el.p7bga){ clearTimeout(el.p7bga); } el.style.backgroundPosition=nl+"px "+nt+"px"; el.p7bga=setTimeout("P7_MBglideBG('"+el.id+"',"+nl+","+tl+","+nt+","+tt+","+fr+","+dy+")",dy); } } function P7_MBgetBG(el){ var bg,ba,x,y,nx=0,ny=0; bg=el.style.backgroundPosition; if(!bg){ if(el.currentStyle){ bg=el.currentStyle.backgroundPosition; if(!bg){ x=el.currentStyle.backgroundPositionX; y=el.currentStyle.backgroundPositionY; bg=x+' '+y; } } else if(document.defaultView.getComputedStyle(el,"")){ bg=document.defaultView.getComputedStyle(el,"").getPropertyValue('background-position'); } } ba=bg.split(' '); if(ba&&ba[0]){ nx=parseInt(ba[0]); if(ba[1]){ ny=parseInt(ba[1]); } } nx=(nx)?nx:0; ny=(ny)?ny:0; return [nx,ny]; } function P7_MBsetFL(el){ var i,pt,ob,a; pt=P7_MBgetFL(el,'LI'); if(pt[0]>-1){ ob=el.childNodes[pt[0]]; P7_MBsetClass(ob,'p7MBfirst'); a=ob.getElementsByTagName('a'); if(a&&a[0]){ P7_MBsetClass(a[0],'p7MBfirst'); } } if(pt[1]>-1){ ob=el.childNodes[pt[1]]; P7_MBsetClass(ob,'p7MBlast'); a=ob.getElementsByTagName('a'); if(a&&a[0]){ P7_MBsetClass(a[0],'p7MBlast'); } } } function P7_MBgetFL(nD,tp){ var i,tC,a=-1,b=-1,rr=[]; tC=nD.childNodes; for(i=0;i0){ nc=cc+' '+cl; } nc=nc.replace(r,' '); ob.className=nc; } function P7_MBremClass(ob,cl){ var cc,nc,r=/\s+/g;; cc=ob.className; if(cc&&cc.indexOf(cl>-1)){ nc=cc.replace(cl,''); nc=nc.replace(r,' '); ob.className=nc; } }