/* 
  ------------------------------------------------
  Utility scripts
  Copyright (c) 2005-2008 Project Seven Development
  ------------------------------------------------
*/
function Treeenu(b,og) { 
 var i,s,c,k,j,tN,hh;if(document.getElementById){
 if(b.parentNode && b.parentNode.childNodes){tN=b.parentNode.childNodes;}else{return;}
 for(i=0;i<tN.length;i++){if(tN[i].tagName=="DIV"){s=tN[i].style.display;
 hh=(s=="block")?"none":"block";if(og==1){hh="block";}tN[i].style.display=hh;}}
 c=b.firstChild;if(c.data&&(b.className!="Treeminusmark"&&b.className!="Treeplusmark")){
 k=c.data;j=k.charAt(0);if(j=='+'){c.data='-'+k.substring(1,k.length);
 }else if(j=='-'){c.data='+'+k.substring(1,k.length);}}if(b.className=='Treeplusmark'){
 b.className='Treeminusmark';}else if(b.className=='Treeminusmark'){b.className='Treeplusmark';}}
}
function P7_setTMenu(){  
 var i,d='',h='<style type=\"text/css\">';if(document.getElementById){
 var tA=navigator.userAgent.toLowerCase();if(window.opera){
 if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){return;}}
 for(i=1;i<20;i++){d+='div ';h+="\n#Treenav div "+d+"{display:none;}";}
 document.write(h+"\n</style>");}
}
P7_setTMenu();

function Treeopen(){ 
 var i,x,d,hr,ha,ef,a,ag;if(document.getElementById){d=document.getElementById('Treenav');
 if(d){hr=window.location.href;ha=d.getElementsByTagName("A");if(ha&&ha.length){
 for(i=0;i<ha.length;i++){if(ha[i].href){if(hr.indexOf(ha[i].href)>-1){
 if(ha[i].className=='Treeplusmark')
 {ha[i].className="Treecurrentplus";
  Treeenu(ha[i],1); } 
 else
 {ha[i].className="Treecurrentmark"} 
 a=ha[i].parentNode.parentNode; while(a){
 if(a.firstChild && a.firstChild.tagName=="A"){if(a.firstChild.onclick){
 ag=a.firstChild.onclick.toString();if(ag&&ag.indexOf("Treeenu")>-1){
 Treeenu(a.firstChild,1);}}}a=a.parentNode;}}}}}}}
}

function Treeall(a){  
 var i,x,ha,s,tN;if(document.getElementById){ha=document.getElementsByTagName("A");
 for(i=0;i<ha.length;i++){if(ha[i].onclick){ag=ha[i].onclick.toString();
 if(ag&&ag.indexOf("Treeenu")>-1){if(ha[i].parentNode && ha[i].parentNode.childNodes){
 tN=ha[i].parentNode.childNodes;}else{break;}for(x=0;x<tN.length;x++){
 if(tN[x].tagName=="DIV"){s=tN[x].style.display;if(a==0&&s!='block'){Treeenu(ha[i]);
 }else if(a==1&&s=='block'){Treeenu(ha[i]);}break;}}}}}}
}

function Treeclass(){  
 var i,x,d,tN,ag;if(document.getElementById){d=document.getElementById('Treenav');
 if(d){tN=d.getElementsByTagName("A");if(tN&&tN.length){for(i=0;i<tN.length;i++){
 ag=(tN[i].onclick)?tN[i].onclick.toString():false;if(ag&&ag.indexOf("Treeenu")>-1){
 tN[i].className='Treeplusmark';}else{tN[i].className='Treedefmark';}}}}}
}


var p7tpa=new Array();
var isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
function P7_setTP(){ 
 var i,h="<sty"+"le type=\"text/css\">\n";h+=".p7TP_tabs{display: block;}.p7TPcontent div{display:none;}\n";
 h+=".p7TPcontent div div{display:block;}\n";if(document.getElementById){for(i=1;i<11;i++){
 h+="#p7tpc"+i+"_1 {display:block;}\n";}h+="\n<"+"/sty"+"le>";document.write(h);}
}
P7_setTP();
function P7_initTP(){ 
 var i,j,tb,tD,tP,tA,pb="p7TP";if(!document.getElementById){return;};p7tpa=arguments;
 for(i=1;i<11;i++){tb=pb+i;tP=document.getElementById(tb);if(tP){tD=tP.getElementsByTagName("DIV");
 if(tD){for(j=0;j<tD.length;j++){if(tD[j].id&&tD[j].id.indexOf("p7tpb")==0){
 tA=tD[j].getElementsByTagName("A");if(tA[0]){tA[0].p7tpn=new Array(i,tD[j].id);
 tA[0].onclick=function(){return P7_TPtrig(this);};}}}}}}
}
function P7_TPtrig(a){ 
 var i,tD,tA,tC,c,d,sb,an=p7tpa[1],wP,h,cP,ch,hD,hh;if(typeof(a)!='object'){c=a.replace("p7tpc","p7tpb");
 d=document.getElementById(c);if(d){a=d.getElementsByTagName("A")[0];}}if(a.p7tpn){
 tD=document.getElementById(a.p7tpn[1]);if(tD){tA=tD.parentNode.getElementsByTagName("A");
 if(an==29&&!isIE5){wP=P7_getCD(a);h=P7_getPH(wP);cP=getTPc(a);ch=P7_getPH(cP);hD=h-ch;
 if(window.opera){P7_setPW(wP);}wP.style.height=h+"px";wP.style.overflow="hidden";}
 for(i=0;i<tA.length;i++){if(tA[i].p7tpn){sb=tA[i].p7tpn[1].replace("p7tpb","p7tpc");
 tC=document.getElementById(sb);if(tA[i]==a){tA[i].className="down";
 document.getElementById(tA[i].p7tpn[1]).className="down";if(tC){if(an>0&&an!=29){
 tC.style.visibility="hidden";tC.style.display="block";setTimeout("P7_TPanim('"+tC.id+"')",100);}
 else{tC.style.display="block";}if(an==29&&!isIE5){hh=P7_getPH(tC);P7_TPglide(tC.id,h,hh+hD);}}}
 else{tA[i].className='';document.getElementById(tA[i].p7tpn[1]).className='';if(tC){
 tC.style.display="none";}}}}}}if(typeof(P7_colH2)=='function'){P7_colH2();}
 if(typeof(P7_colH)=='function'){P7_colH();}return false;
}
function P7_TPanim(iD){ 
 var i,f,tC,g=new Array(),an=p7tpa[1],ob=document.getElementById(iD);tC=ob.parentNode;
 if(!tC.filters){ob.style.opacity="0.10";ob.style.visibility='visible';
 P7_TPfadeIn(ob.id,0.00);return;}f='progid:DXImageTransform.Microsoft.';d=' Duration=1';
g[0]='Fade';
g[1]='Fade';
g[2]='Wipe(GradientSize=0.5, wipeStyle=0, motion="forward"'+d+')';
g[3]='Pixelate(MaxSquare=50,Duration=1,Enabled=false'+d+')';
g[4]='RandomDissolve('+d+')';
g[5]='Iris(irisstyle="SQUARE", motion="in"'+d+')';
g[6]='Iris(irisstyle="SQUARE", motion="out"'+d+')';
g[7]='Iris(irisstyle="CIRCLE", motion="in"'+d+')';
g[8]='Iris(irisstyle="CIRCLE", motion="out"'+d+')';
g[9]='Blinds(direction="up", bands=1'+d+')';
g[10]='Blinds(direction="down", bands=1'+d+')';
g[11]='Blinds(direction="right", bands=1'+d+')';
g[12]='Blinds(direction="left", bands=1'+d+')';
g[13]='Barn(orientation="vertical", motion="in"'+d+')';
g[14]='Barn(orientation="vertical", motion="out"'+d+')';
g[15]='Barn(orientation="horizontal", motion="in"'+d+')'
g[16]='Barn(orientation="horizontal", motion="out"'+d+')'
g[17]='Strips(motion="leftdown"'+d+')';
g[18]='Strips(motion="leftup"'+d+')';
g[19]='Strips(motion="rightdown"'+d+')';
g[20]='Strips(motion="rightup"'+d+')';
g[21]='RadialWipe(wipeStyle="clock"'+d+')';
g[22]='RadialWipe(wipeStyle="wedge"'+d+')';
g[23]='RadialWipe(wipeStyle="radial"'+d+')';
g[24]='Slide(slideStyle="PUSH", bands=1'+d+')';
g[25]='Slide(slideStyle="SWAP", bands=5'+d+')';
g[26]='Slide(slideStyle="HIDE", bands=1'+d+')';
g[27]='Wheel(spokes=4'+d+')';
g[28]='Wheel(spokes=16'+d+')';
 an=(an>g.length)?3:an;f+=g[an];tC.style.filter=f;if(tC.filters.length<1){
 p7tpa[1]=0;ob.style.visibility='visible';return;}tC.filters[0].Apply();
 ob.style.visibility='visible';tC.filters[0].Play();
}
function P7_TPfadeIn(id,op){ 
 var d=document.getElementById(id);op+=.05;op=(op>=1)?1:op;d.style.opacity=op;
 if(op<1){setTimeout("P7_TPfadeIn('"+id+"',"+op+")",60);}
}
function P7_getPH(d){ 
 var h,nh,dh,oh;d.style.height="auto";oh=d.offsetHeight;d.style.height=oh+"px";
 nh=d.offsetHeight;if(oh!=nh){nh=(oh-(nh-oh));}d.style.height="auto";return nh;
}
function P7_setPW(d){ 
 var w,nw,dw,ow;d.style.width="auto";ow=d.offsetWidth;d.style.width=ow+"px";
 nw=d.offsetWidth;if(ow!=nw){nw=(ow-(nw-ow));}d.style.width=nw+"px";
}
function P7_getCD(a){ 
 var g,tP=a.p7tpn[1].replace("p7tpb","p7tpc");g=document.getElementById(tP);return g.parentNode;
}
function getTPc(a){ 
 var i,tA,cD,tC=null;tA=a.parentNode.parentNode.getElementsByTagName("A");
 for(i=0;i<tA.length;i++){if(tA[i].className && tA[i].className=="down"){
 cD=tA[i].p7tpn[1].replace("p7tpb","p7tpc");tC=document.getElementById(cD);break;}}
 return tC;
}
function P7_TPglide(pn,ch,th){ 
 var tt,inc,dy=10,w,m;w=document.getElementById(pn).parentNode;m=(ch<=th)?0:1;
 tt=Math.abs(parseInt(Math.abs(th)-Math.abs(ch)));inc=(tt*.15<1)?1:tt*.15;
 inc=(m==1)?inc*-1:inc;w.style.height=ch+"px";
 if(ch==th){w.style.height="auto";w.style.overflow="visible";}else{ch+=inc;
 if(m==0){ch=(ch>=th)?th:ch;}else{ch=(ch<=th)?th:ch;}if(w.p7tpG){clearTimeout(w.p7tpG);}
 w.p7tpG=setTimeout("P7_TPglide('"+pn+"',"+ch+","+th+")",dy);}
}


var TopNavma=new Array();
var TopNavmt=new Array();

function P7_initTBM(){ // PVII-www.projectseven.com
 //define over and down image suffix
 var Iv = "_f2";
 var Id = "_f3";
 var i,j,x,k,d,nV,tB,tbs,iM,im,ts,tA,sA,nA=new Array();
 document.TopNavmsw=new Array();TopNavma=arguments;
 if(!document.getElementById||document.TopNavmf){return;}
 tB=document.getElementById('TopNavM');nV=document.getElementById('TopNavMroot');
 if(!nV||!tB){return;}tB.onmouseout=P7_TBMclose;
 tA=nV.getElementsByTagName('A');j=0;for(i=0;i<tA.length;i++){
 TopNavmt[j]=tA[i].id;j++;d='TopNavMsub'+tA[i].id.replace('TopNavMt','');
 tbs=document.getElementById(d);if(tbs){tbs.onmouseover=function(){P7_TBMsub(this);};}
 TopNavmt[j]=(tbs)?tbs.id:false;tA[i].hasSub=TopNavmt[j];j++;tA[i].isRoot=true;
 tA[i].onclick=function(){return P7_TBMtrig(this);};
 tA[i].onmouseover=function(){P7_TBMovr(this);};tA[i].p7state=0;tA[i].hasIm=false;
 iM=tA[i].getElementsByTagName('IMG');if(iM&&iM[0]){im=iM[0];ts=im.getAttribute("src");
 x=ts.lastIndexOf(".");nA[0]=ts.substring(0,x);nA[1]='.'+ts.substring(x+1);
 im.p7mimg=new Array();im.p7mimg[0]=ts;if(TopNavma[1]>1){ts=nA[0]+Iv+nA[1];
 P7_TBMpl(ts);}im.p7mimg[1]=ts;if(TopNavma[1]==3){im.p7mimg[2]=ts;}
 if(TopNavma[1]==1||TopNavma[1]==2){ts=nA[0]+Id+nA[1];P7_TBMpl(ts);if(TopNavma[1]==1){
 im.p7mimg[1]=ts;}}im.p7mimg[2]=ts;im.p7state=0;tA[i].hasIm=true;}}
 document.TopNavmf=true;P7_TBMopen();
}

function P7_TBMpl(ims){ 
 var x=document.TopNavmsw.length;document.TopNavmsw[x]=new Image();document.TopNavmsw[x].src=ims;
}

function P7_TBMovr(a){ 
 if(!document.TopNavmf){return;}if(document.TopNavMtm){clearTimeout(document.TopNavMtm);}P7_TBMswp(a);
 if(TopNavma[0]==1){document.TopNavMtm=setTimeout("P7_TBMshow('"+a.id+"')",TopNavma[4]);
 }else{P7_TBMshow(a.id);}
}

function P7_TBMswp(d){ 
 var i,cl,a;for(i=0;i<TopNavmt.length;i+=2){a=document.getElementById(TopNavmt[i]);
 cl=a.className;if(TopNavmt[i]!=d.id){if(a.p7state<2){if(cl.indexOf("TopNavMon")>-1){
 a.className=cl.replace("TopNavMon",'');}if(a.hasIm){im=a.getElementsByTagName('IMG')[0];
 if(im.p7state<2){im.src=im.p7mimg[0];}}}}else{if(a.p7state!=2){if(cl.indexOf("TopNavMon")==-1){
 a.className=(cl&&cl.length>0)?cl+" TopNavMon":"TopNavMon";}if(a.hasIm){
 im=a.getElementsByTagName('IMG')[0];if(im.p7state<2){im.src=im.p7mimg[1];}}}}}
}

function P7_TBMshow(d){ 
 var a,i,im,cl;a=document.getElementById(d);if(a.hasIm){im=a.getElementsByTagName('IMG')[0];
 if(im.p7state==0){im.src=im.p7mimg[1];im.p7state=1;}}if(a.hasSub){if(a.p7state!=2){
 a.p7state=1;cl=a.className;if(cl.indexOf("TopNavMon")==-1){
 a.className=(cl&&cl.length>0)?cl+" TopNavMon":"TopNavMon";}}
 document.getElementById(a.hasSub).style.visibility="visible";}P7_TBMtg(a);
}

function P7_TBMtg(d){ 
 var a,i,im,s,cl;for(i=0;i<TopNavmt.length;i+=2){if(!d||TopNavmt[i]!=d.id){
 a=document.getElementById(TopNavmt[i]);if(a.hasIm){im=a.getElementsByTagName('IMG')[0];
 if(im.p7state<2){im.src=im.p7mimg[0];im.p7state=0;}}if(a.p7state!=2){a.p7state=0;
 cl=a.className;if(cl.indexOf("TopNavMon")>-1){a.className=cl.replace("TopNavMon",'');}}
 s=document.getElementById(TopNavmt[i+1]);if(s){s.style.visibility="hidden";}}}
}

function P7_TBMtrig(a){ 
 var h,hh,ret=false;P7_TBMdown(a);h=a.href;hh='javascript:; javascript:void(0)';
 if(TopNavma[3]==1){if(h.charAt(h.length-1)=='#'||document.location.href==h){
 ret=false;}else{ret=(hh.indexOf(h)>-1)?false:true;}}else{ret=false;}return ret;
}

function P7_TBMdown(a){ 
 var i,aa,im,cl;for(i=0;i<TopNavmt.length;i+=2){aa=document.getElementById(TopNavmt[i]);
 aa.p7state=0;aa.className=P7_trim(aa.className.replace("TopNavMdown",''));if(aa.hasIm){
 im=aa.getElementsByTagName('IMG')[0];im.p7state=0;}}a.p7state=2;if(a.hasIm){
 im=a.getElementsByTagName('IMG')[0];im.p7state=2;im.src=im.p7mimg[2];}else{cl=a.className;
 a.className=(cl&&cl.length>0)?cl+" TopNavMdown":"TopNavMdown";}P7_TBMshow(a.id);
}
function P7_trim(t){ 
 t=t.replace(/^\s/,'');t=t.replace(/\s$/,'');return t;
}

function P7_TBMclose(evt){ 
 var i,pp,tS,d,p,f,m=true;evt=(evt)?evt:((event)?event:null);if(evt){
 tS=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;if(tS){pp=tS;
 while(pp){if(pp.id){d=pp.id;if(pp.id.indexOf("TopNavM")>-1){m=false;break;}}
 pp=pp.parentNode;}if(m){f='P7_TBMtg()';if(TopNavma[2]==1){for(i=0;i<TopNavmt.length;i+=2){
 p=document.getElementById(TopNavmt[i]);if(p.p7state==2){f="P7_TBMshow('"+p.id+"')";}}}
 if(TopNavma[0]==1){eval('document.TopNavMtm=setTimeout("'+f+'",'+parseInt(TopNavma[4]+50)+')');
 }else{eval(f);}}}}
}

function P7_TBMsub(s){ 
 if(document.TopNavMtm){clearTimeout(document.TopNavMtm);}
 var d=s.id.replace("TopNavMsub","TopNavMt"),a=document.getElementById(d);
 P7_TBMswp(a);
}

function P7_TBMmark(){document.TopNavMop=arguments;}

function P7_TBMopen(){ //v1.0.2 by PVII-www.projectseven.com
var x,i,j,k,tempk,wH,tM,tA,pp,cl,a,nd,op,r1,aU;wH=window.location.href;
var mt = new Array(1,'','');if(document.TopNavMop){mt=document.TopNavMop;}op=mt[0];
if(op<1){return;}r1=/index\.[\S]*/i;k=-1,tempk=-1;tM=document.getElementById('TopNavM');
tA=tM.getElementsByTagName("A");for(j=0;j<tA.length;j++){aU=tA[j].href.replace(r1,'');
if(op>0){if(tA[j].href==wH||aU==wH){k=j;tempk=-1;
// tweak to allow last link found
//break;
//end tweak
}}if(op==2){if(tA[j].firstChild){
if(tA[j].firstChild.nodeValue==mt[1]){tempk=j;}}}if(op==3 && tA[j].href.indexOf(mt[1])>-1){
tempk=j;}if(op==4){for(x=1;x<mt.length;x+=2){if(wH.indexOf(mt[x])>-1){
if(tA[j].firstChild&&tA[j].firstChild.nodeValue){if(tA[j].firstChild.nodeValue==mt[x+1]){
tempk=j;}}}}}}k=(tempk>k)?tempk:k;if(k>-1){a=false;if(!tA[k].hasIm&&!tA[k].isRoot){cl=tA[k].className;
tA[k].className=(cl&&cl.length>0)?cl+" TopNavMmark":"TopNavMmark";}pp=tA[k].parentNode;
while(pp){if(pp.id&&pp.id=='TopNavMroot'){a=tA[k];break;}if(pp.id&&pp.id.indexOf('TopNavMsub')>-1){ nd='TopNavMt'+pp.id.replace('TopNavMsub','');a=document.getElementById(nd);break;}
pp=pp.parentNode;}if(a){P7_TBMdown(a);}}
}




/*javascript for Bubble Tooltips by Alessandro Fulciniti
- http://pro.html.it - http://web-graphics.com */

function enableTooltips(id){
var links,i,h;
if(!document.getElementById || !document.getElementsByTagName) return;
AddCss();
h=document.createElement("span");
h.id="btc";
h.setAttribute("id","btc");
h.style.position="absolute";
document.getElementsByTagName("body")[0].appendChild(h);
if(id==null) links=document.getElementsByTagName("a");
else links=document.getElementById(id).getElementsByTagName("a");
for(i=0;i<links.length;i++){
    Prepare(links[i]);
    }
}

function Prepare(el){
var tooltip,t,b,s,l;
t=el.getAttribute("title");
el.removeAttribute("title");
if(t.length>0) 
	{
	tooltip=CreateEl("span","tooltip");
	s=CreateEl("span","top");
	s.appendChild(document.createTextNode(t));
	tooltip.appendChild(s);
	b=CreateEl("b","bottom");
	tooltip.appendChild(b);
	setOpacity(tooltip);
	el.tooltip=tooltip;
	el.onmouseover=showTooltip;
	el.onmouseout=hideTooltip;
	el.onmousemove=Locate;
	}
}

function showTooltip(e){
document.getElementById("btc").appendChild(this.tooltip);
Locate(e);
}

function hideTooltip(e){
var d=document.getElementById("btc");
if(d.childNodes.length>0) d.removeChild(d.firstChild);
}

function setOpacity(el){
el.style.filter="alpha(opacity:95)";
el.style.KHTMLOpacity="0.95";
el.style.MozOpacity="0.95";
el.style.opacity="0.95";
}

function CreateEl(t,c){
var x=document.createElement(t);
x.className=c;
x.style.display="block";
return(x);
}

function AddCss(){
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","bt.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}

function Locate(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
    posx=e.pageX; posy=e.pageY;
    }
else if(e.clientX || e.clientY){
    if(document.documentElement.scrollTop){
        posx=e.clientX+document.documentElement.scrollLeft;
        posy=e.clientY+document.documentElement.scrollTop;
        }
    else{
        posx=e.clientX+document.body.scrollLeft;
        posy=e.clientY+document.body.scrollTop;
        }
    }
document.getElementById("btc").style.top=(posy+10)+"px";
document.getElementById("btc").style.left=(posx-20)+"px";
}

