
/* 
 ================================================
 PVII ToolTip Magic scripts
 Copyright (c) 2010 Project Seven Development
 www.projectseven.com
 Version: 1.x.x -build 13
 ================================================
 
*/

var p7TTMctl=[],p7TTMi=false,p7TTMa=false;
function P7_TTMset(){
	var h,sh,hd,v;
	if (!document.getElementById){
		return;
	}
	sh='#p7TTMbox {position:absolute; visibility:hidden; left:-3000px; top:0;z-index:999999;}\n';
	sh+='#p7TTMcall, #p7TTMclose {display:none;}\n';
	sh+='#p7TTMholder {position:absolute; visibility:hidden; left:-9000px; top:0;}\n';
	sh+='#p7TTMclose {position:absolute;z-index:9999999;}\n';
	if (document.styleSheets){
		h='\n<st'+'yle type="text/css">\n'+sh+'\n</s' + 'tyle>';
		document.write(h);
	}
	else{
		h=document.createElement('style');
		h.type='text/css';
		h.appendChild(document.createTextNode(sh));
		hd=document.getElementsByTagName('head');
		hd[0].appendChild(h);
	}
}
P7_TTMset();
function P7_opTTM(){
	if(!document.getElementById){
		return;
	}
	p7TTMctl[p7TTMctl.length]=arguments;
}
function P7_TTMaddLoad(){
	if(!document.getElementById||typeof document.createElement=='undefined'){
		return;
	}
	if(window.addEventListener){
		document.addEventListener("DOMContentLoaded",P7_initTTM,false);
		window.addEventListener("resize",P7_TTMrsz,false);
		window.addEventListener("load",P7_initTTM,false);
		window.addEventListener("unload",P7_TTMrf,false);
	}
	else if(document.addEventListener){
		document.addEventListener("load",P7_initTTM,false);
	}
	else if(window.attachEvent){
		document.write("<script id=p7ie_ttm defer src=\"//:\"><\/script>");
		document.getElementById("p7ie_ttm").onreadystatechange=function(){
			if (this.readyState=="complete"){
				if(p7TTMctl.length>0){
					P7_initTTM();
				}
			}
		};
		window.attachEvent("onload",P7_initTTM);
		window.attachEvent("onresize",P7_TTMrsz);
	}
	else if(typeof window.onload=='function'){
		var p7vloadit=onload;
		window.onload=function(){
			p7vloadit();
			P7_initTTM();
		};
	}
	else{
		window.onload=P7_initTTM;
	}
}
P7_TTMaddLoad();
function P7_TTMrf(){
	return;
}
function P7_initTTM(){
	var i,j,tD,eL,cS,tA,pH,eN,iD,tB,att,tm,cL;
	if(p7TTMi){
		return;
	}
	p7TTMi=true;
	P7_TTMbuild();
	tB=document.getElementById('p7TTMbox');
	tB.onmouseout=P7_TTMout;
	tB.onmouseover=function(){
		if(document.p7TTMcloseTmr){
			clearTimeout(document.p7TTMcloseTmr);
		}
	};
	tB.ttmState='closed';
	document.p7TTMcloseTmr=null;
	cL=document.getElementById('p7TTMclose');
	cL.onclick=function(){
		P7_TTMclose();
		return false;
	};
	pH=document.getElementById('p7TTMholder');
	pH.style.display='block';
	for(j=0;j<p7TTMctl.length;j++){
		eL=p7TTMctl[j][0];
		cS=p7TTMctl[j][1];
		tA=[];
		tA.length=0;
		if(eL.indexOf('#')==0){
			tA[0]=document.getElementById(eL.replace('#',''));
		}
		else{
			tA=document.getElementsByTagName(eL.toUpperCase());
		}
		if(tA&&tA[0]){
			for(i=0;i<tA.length;i++){
				if(cS.indexOf('#')==-1){
					att=tA[i].getAttribute(cS);
					if(att&&typeof(att)=='string'&&att!=''){
						tA[i].ttmAtt=att;
						if(cS.toLowerCase()=='title'||cS.toLowerCase()=='alt'){
							tA[i].removeAttribute(cS);
						}
					}
					else{
						continue;
					}
				}
				else{
					eN=document.getElementById(cS.replace('#',''));
					if(eN){
						tA[i].ttmSourceId=eN.id;
						pH.appendChild(eN);
					}
					else{
						continue;
					}
				}
				tA[i].p7TTMopt=p7TTMctl[j];
				tB.isIE5=false;
				if(P7_TTMgetIEver()==5){
					tA[i].p7TTMopt[3]=0;
					tA[i].p7TTMopt[6]=0;
					tB.isIE5=true;
				}
				tA[i].onmouseover=function(){
					return P7_TTMopen(this);
				};
				tA[i].onmouseout=function(){
					if(this.p7TTMopt[7]!=1){
						return;
					}
					if(document.p7TTMcloseTmr){
						clearTimeout(document.p7TTMcloseTmr);
					}
					document.p7TTMcloseTmr=setTimeout("P7_TTMclose()",500);
				};
			}
		}
	}
}
function P7_TTMopen(tr){
	var i,tB,wR,tC,pH,cD,cS,cL,t,l,ti,m=false,an,dur,stp,dy=30,fr,dh=100;
	if(document.p7TTMcloseTmr){
		clearTimeout(document.p7TTMcloseTmr);
	}
	if(tr.ttmState=='open'){
		return false;
	}
	an=tr.p7TTMopt[3];
	tB=document.getElementById('p7TTMbox');
	wR=document.getElementById('p7TTM_inner');
	tC=document.getElementById('p7TTMcontent');
	tB.className=tr.p7TTMopt[2];
	P7_TTMclose(1);
	P7_TTMrestore();
	tB.ttmTrigger=tr;
	wR.style.width=tr.p7TTMopt[4]+'px';
	if(tB.isIE5){
		tB.style.width=tr.p7TTMopt[4]+'px';
	}
	else{
		tB.style.width='auto';
	}
	tB.style.overflow='visible';
	cL=document.getElementById('p7TTMclose');
	if(tr.p7TTMopt[10]==1||tr.p7TTMopt[7]!=1){
		cL.style.display='block';
	}
	else{
		cL.style.display='none';
	}
	if(tr.ttmAtt){
		tC.innerHTML=tr.ttmAtt;
		tC.ttmRestoreId=null;
		m=true;
	}
	else if(tr.ttmSourceId){
		cS=tr.ttmSourceId;
		if(cS){
			pH=document.getElementById('p7TTMholder');
			cD=document.getElementById(cS);
			tC.appendChild(cD);
			tC.ttmRestoreId=cS;
			m=true;
		}
	}
	P7_TTMsetCallout(tB,tr);
	if(m){
		tB.style.height='auto';
		tB.style.width='auto';
		tB.ttmTargetHeight=tB.offsetHeight;
		tB.ttmTargetWidth=tB.offsetWidth;
		P7_TTMposBox();
		tr.ttmState='open';
		tB.ttmState='open';
		if(an!=1){
			if(tB.ttmFaderRunning){
				tB.ttmFaderRunning=false;
				clearInterval(tB.ttmFader);
				if(tB.filters){
					tB.style.filter='';
				}
				else{
					tB.style.opacity=1;
				}
			}
		}
		if(an==1){
			if(!tB.filters){
				tB.style.opacity=0.01;
			}
			else{
				tB.style.filter='alpha(opacity=1)';
			}
			tB.ttmOpacity=1;
			dur=tr.p7TTMopt[11];
			dur=(dur)?dur:500;
			stp=dur/dy;
			fr=parseInt(dh/stp,10);
			fr=(fr<=1)?1:fr;
			tB.ttmFaderFrameRate=fr;
			tB.style.visibility='visible';
			if(!tB.ttmFaderRunning){
				tB.ttmFaderRunning=true;
				tB.ttmFader=setInterval("P7_TTMfader('"+tB.id+"')",dy);
			}
		}
		else if(an>1){
			P7_TTMsetGrowOpen();
			tB.style.visibility='visible';
			if(!tB.ttmGrowRunning){
				tB.ttmGrowRunning=true;
				tB.ttmGrow=setInterval("P7_TTMGrow('"+tB.id+"')",dy);
			}
		}
		else{
			tB.style.visibility='visible';
		}
	}
	return false;
}
function P7_TTMrestore(){
	var tC,pH;
	tC=document.getElementById('p7TTMcontent');
	pH=document.getElementById('p7TTMholder');
	if(tC.ttmRestoreId){
		pH.appendChild(document.getElementById(tC.ttmRestoreId));
		tC.ttmRestoreId=null;
	}
	while(tC.childNodes.length>0){
		tC.removeChild(tC.childNodes[0]);
	}
}
function P7_TTMclose(bp){
	var i,tB,tR,dy=30,an;
	tB=document.getElementById('p7TTMbox');
	if(document.p7TTMcloseTmr){
		clearTimeout(document.p7TTMcloseTmr);
	}
	tR=tB.ttmTrigger;
	if(tR){
		an=tR.p7TTMopt[3];
		if(bp==1){
			an=0;
			if(tB.ttmGrowRunning){
				clearInterval(tB.ttmGrow);
				tB.ttmGrowRunning=false;
			}
			if(tB.ttmFaderRunning){
				tB.ttmFaderRunning=false;
				clearInterval(tB.ttmFader);
			}
		}
		tR.ttmState='closed';
		tB.ttmState='closed';
		if(an==1){
			if(!tB.ttmFaderRunning){
				tB.ttmFaderRunning=true;
				tB.ttmFader=setInterval("P7_TTMfader('"+tB.id+"')",dy);
			}
		}
		else if(an>1){
			tB.ttmTargetLeft=tB.ttmStartLeft;
			tB.ttmTargetTop=tB.ttmStartTop;
			tB.ttmTargetHeight=tB.ttmStartHeight;
			tB.ttmTargetWidth=tB.ttmStartWidth;
			tB.style.overflow='hidden';
			if(!tB.ttmGrowRunning){
				tB.ttmGrowRunning=true;
				tB.ttmGrow=setInterval("P7_TTMGrow('"+tB.id+"')",dy);
			}
		}
		else{
			tB.visibility='hidden';
			tB.style.left='-3000px';
		}
	}
}
function P7_TTMsetCallout(tB,tr){
	var cT,co,po;
	co=tr.p7TTMopt[6];
	po=tr.p7TTMopt[5];
	cT=document.getElementById('p7TTMcall');
	if(co==1){
		cT.className='p7TTM_Arrow_'+po;
		tB.className=tr.p7TTMopt[2]+' Arrow_'+po;
		cT.style.display='block';
	}
	else{
		cT.className='';
		tB.className=tr.p7TTMopt[2];
		cT.style.display='none';
	}
}
function P7_TTMposBox(){
	var tB,tR,pp,th,tw,tl=0,tt=0,bt,bl,bw,bh,p,wn;
	tB=document.getElementById('p7TTMbox');
	if(typeof(tB.ttmTrigger)!='object'){
		return;
	}
	p=tB.ttmTrigger.p7TTMopt[5];
	th=tB.ttmTrigger.offsetHeight;
	tw=tB.ttmTrigger.offsetWidth;
	pp=tB.ttmTrigger;
	while(pp){
		tl+=(pp.offsetLeft)?pp.offsetLeft:0;
		tt+=(pp.offsetTop)?pp.offsetTop:0;
		pp=pp.offsetParent;
	}
	bh=tB.offsetHeight;
	bw=tB.offsetWidth;
	if(p==1||p==2||p==3){
		bt=tt-bh;
	}
	else if(p==7||p==9){
		bt=tt;
	}
	else if(p==8||p==10){
		bt=tt+((th-bh)/2);
	}
	else{
		bt=tt+th;
	}
	if(p==3||p==6||p==9||p==10){
		bl=tl-bw;
	}
	else if(p==2||p==5){
		bl=tl+((tw-bw)/2);
	}
	else{
		bl=tl+tw;
	}
	bt+=tB.ttmTrigger.p7TTMopt[9];
	bl+=tB.ttmTrigger.p7TTMopt[8];
	wn=P7_TTMgetWinDims();
	bl=((bl+bw)>(wn[1]+wn[3]))?wn[1]-bw+wn[3]:bl;
	bt=((bt+bh)>wn[0]+wn[2])?wn[0]-bh+wn[2]:bt;
	bl=(bl<wn[3])?wn[3]:bl;
	bt=(bt<wn[2])?wn[2]:bt;
	tB.style.top=bt+'px';
	tB.style.left=bl+'px';
}
function P7_TTMout(evt){
	var tB,tg,pp,m=true;
	evt=(evt)?evt:event;
	tg=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;
	tB=document.getElementById('p7TTMbox');
	if(tB.ttmTrigger.p7TTMopt[7]!=1){
		return;
	}
	if(tg){
		pp=tg;
		while(pp){
			if(pp==tB||pp==tB.ttmTrigger){
				m=false;
				break;
			}
			pp=pp.parentNode;
		}
	}
	m=(tg)?m:false;
	if(m){
		if(document.p7TTMcloseTmr){
			clearTimeout(document.p7TTMcloseTmr);
		}
		document.p7TTMcloseTmr=setTimeout("P7_TTMclose()",500);
	}
}
function P7_TTMrsz(){
	var tB;
	tB=document.getElementById('p7TTMbox');
	if(tB.ttmState=='open'){
		P7_TTMposBox();
	}
}
function P7_TTMfader(dv){
	var tB,cP,co,ulm=99,llm=1,fr;
	tB=document.getElementById(dv);
	fr=tB.ttmFaderFrameRate;
	co=tB.ttmOpacity;
	if(tB.ttmState=='open'){
		co+=fr;
		co=(co>=ulm)?ulm:co;
	}
	else{
		co-=fr;
		co=(co<=llm)?llm:co;
	}
	tB.ttmOpacity=co;
	if(!tB.filters){
		tB.style.opacity=(co/100);
	}
	else{
		tB.style.filter='alpha(opacity='+(co)+')';
	}
	if((tB.ttmState=='open'&&co==ulm)||(tB.ttmState=='closed'&&co==llm)){
		tB.ttmFaderRunning=false;
		clearInterval(tB.ttmFader);
		if(tB.ttmState=='closed'){
			tB.visibility='hidden';
			tB.style.left='-3000px';
		}
		if(tB.filters){
			tB.style.filter='';
		}
		else{
			tB.style.opacity=1;
		}
	}
}
function P7_TTMGrow(dv){
	var an,tB,nl,nh,nw,nt,ml=false,mt=false,mh=false,mw=false;
	tB=document.getElementById(dv);
	nl=tB.ttmCurrentLeft;
	if(tB.ttmTargetLeft<tB.ttmCurrentLeft){
		nl-=tB.ttmFrameRateLeft;
		nl=(nl<=tB.ttmTargetLeft)?tB.ttmTargetLeft:nl;
		ml=true;
	}
	else if(tB.ttmTargetLeft>tB.ttmCurrentLeft){
		nl+=tB.ttmFrameRateLeft;
		nl=(nl>=tB.ttmTargetLeft)?tB.ttmTargetLeft:nl;
		ml=true;
	}
	nt=tB.ttmCurrentTop;
	if(tB.ttmTargetTop<tB.ttmCurrentTop){
		nt-=tB.ttmFrameRateTop;
		nt=(nt<=tB.ttmTargetTop)?tB.ttmTargetTop:nt;
		mt=true;
	}
	else if(tB.ttmTargetTop>tB.ttmCurrentTop){
		nt+=tB.ttmFrameRateTop;
		nt=(nt>=tB.ttmTargetTop)?tB.ttmTargetTop:nt;
		mt=true;
	}
	nh=tB.ttmCurrentHeight;
	if(tB.ttmCurrentHeight<tB.ttmTargetHeight){
		nh+=tB.ttmFrameRateHeight;
		nh=(nh>=tB.ttmTargetHeight)?tB.ttmTargetHeight:nh;
		mh=true;
	}
	else if(tB.ttmCurrentHeight>tB.ttmTargetHeight){
		nh-=tB.ttmFrameRateHeight;
		nh=(nh<=tB.ttmTargetHeight)?tB.ttmTargetHeight:nh;
		mh=true;
	}
	nw=tB.ttmCurrentWidth;
	if(tB.ttmCurrentWidth<tB.ttmTargetWidth){
		nw+=tB.ttmFrameRateWidth;
		nw=(nw>=tB.ttmTargetWidth)?tB.ttmTargetWidth:nw;
		mw=true;
	}
	else if(tB.ttmCurrentWidth>tB.ttmTargetWidth){
		nw-=tB.ttmFrameRateWidth;
		nw=(nw<=tB.ttmTargetWidth)?tB.ttmTargetWidth:nw;
		mw=true;
	}
	if(ml||mt||mh||mw){
		tB.ttmCurrentLeft=nl;
		tB.ttmCurrentTop=nt;
		tB.ttmCurrentWidth=nw;
		tB.ttmCurrentHeight=nh;
		tB.style.left=nl+'px';
		tB.style.top=nt+'px';
		tB.style.width=nw+'px';
		tB.style.height=nh+'px';
	}
	else{
		clearInterval(tB.ttmGrow);
		tB.ttmGrowRunning=false;
		if(tB.ttmState=='closed'){
			tB.visibility='hidden';
			tB.style.left='-3000px';
		}
		tB.style.overflow='visible';
	}
}
function P7_TTMsetGrowOpen(){
	var tB,tR,w,h,fr,dy=30,stp,dsw,dsh,frh,frw,an,dur;
	tB=document.getElementById('p7TTMbox');
	tR=tB.ttmTrigger;
	tB.style.height='auto';
	tB.style.width='auto';
	an=tR.p7TTMopt[3];
	tB.ttmAnimOpt=an;
	dur=tR.p7TTMopt[11];
	stp=dur/dy;
	tB.ttmTargetLeft=parseInt(tB.style.left);
	tB.ttmTargetTop=parseInt(tB.style.top);
	h=tB.ttmTargetHeight;
	w=tB.ttmTargetWidth;
	dsw=w;
	dsh=h;
	frh=parseInt(dsh/stp,10);
	frh=(frh<=1)?1:frh;
	tB.ttmFrameRateHeight=frh;
	frw=parseInt(dsw/stp,10);
	frw=(frw<=1)?1:frw;
	tB.ttmFrameRateWidth=frw;
	tB.ttmFrameRateLeft=frw;
	tB.ttmFrameRateTop=frh;
	tB.ttmStartLeft=tB.ttmTargetLeft;
	tB.ttmStartTop=tB.ttmTargetTop;
	tB.ttmStartHeight=tB.ttmTargetHeight;
	tB.ttmStartWidth=tB.ttmTargetWidth;
	if(an==2){
		tB.ttmStartWidth=1;
	}
	else if(an==3){
		tB.ttmStartLeft=tB.ttmTargetLeft+w;
		tB.ttmStartWidth=1;
	}
	else if(an==4){
		tB.ttmStartHeight=1;
	}
	else if(an==5){
		tB.ttmStartHeight=1;
		tB.ttmStartTop=tB.ttmTargetTop+h;
	}
	else if(an==6){
		tB.ttmStartHeight=1;
		tB.ttmStartWidth=1;
	}
	else if(an==7){
		tB.ttmStartHeight=1;
		tB.ttmStartWidth=1;
		tB.ttmStartLeft=tB.ttmTargetLeft+w;
	}
	else if(an==8){
		tB.ttmStartHeight=1;
		tB.ttmStartWidth=1;
		tB.ttmStartLeft=tB.ttmTargetLeft+w/2;
		tB.ttmStartTop=tB.ttmTargetTop+h/2;
		tB.ttmFrameRateLeft=frw/2;
		tB.ttmFrameRateTop=frh/2;
	}
	tB.ttmCurrentLeft=tB.ttmStartLeft;
	tB.ttmCurrentTop=tB.ttmStartTop;
	tB.ttmCurrentWidth=tB.ttmStartWidth;
	tB.ttmCurrentHeight=tB.ttmStartHeight;
	tB.style.left=tB.ttmStartLeft+'px';
	tB.style.top=tB.ttmStartTop+'px';
	tB.style.width=tB.ttmStartWidth+'px';
	tB.style.height=tB.ttmStartHeight+'px';
	tB.style.overflow='hidden';
}
function P7_TTMbuild(){
	var box,dv,el,ob,a,inr,il,wr,cls,mdl;
	box=document.createElement('div');
	box.setAttribute('id','p7TTMbox');
	inr=document.createElement('div');
	inr.setAttribute('id','p7TTM_inner');
	el=document.createElement('div');
	el.setAttribute('id','p7TTMtop');
	inr.appendChild(el);
	mdl=document.createElement('div');
	mdl.setAttribute('id','p7TTMmiddle');
	cnt=document.createElement('div');
	cnt.setAttribute('id','p7TTMcnt');
	cls=document.createElement('div');
	cls.setAttribute('id','p7TTMclose');
	a=document.createElement('a');
	a.setAttribute('href','#');
	il=document.createElement('i');
	il.appendChild(document.createTextNode('Close'));
	a.appendChild(il);
	cls.appendChild(a);
	cnt.appendChild(cls);
	dv=document.createElement('div');
	dv.setAttribute('id','p7TTMcontent');
	cnt.appendChild(dv);
	mdl.appendChild(cnt);
	inr.appendChild(mdl);
	dv=document.createElement('div');
	dv.setAttribute('id','p7TTMbottom');
	inr.appendChild(dv);
	dv=document.createElement('div');
	dv.setAttribute('id','p7TTMcall');
	box.appendChild(dv);
	box.appendChild(inr);
	document.getElementsByTagName('body')[0].appendChild(box);
	dv=document.createElement('div');
	dv.setAttribute('id','p7TTMholder');
	document.getElementsByTagName('body')[0].appendChild(dv);
}
function P7_TTMgetIEver(){
	var j,v=-1,nv,m=false;
	nv=navigator.userAgent.toLowerCase();
	j=nv.indexOf("msie");
	if(j>-1){
		v=parseInt(nv.substring(j+4,j+6),10);
		if(document.documentMode){
			v=document.documentMode;
		}
	}
	return v;
}
function P7_TTMgetWinDims(){
	var h,w,st,sl,IEver=P7_TTMgetIEver();
	if(document.documentElement&&document.documentElement.clientHeight){
		w=document.documentElement.clientWidth;
		h=document.documentElement.clientHeight;
	}
	else if(window.innerHeight){
		if(document.documentElement.clientWidth){
			w=document.documentElement.clientWidth;
		}
		else{
			w=window.innerWidth;
		}
		h=window.innerHeight;
	}
	else if(document.body){
		w=document.body.clientWidth;
		h=document.body.clientHeight;
	}
	st=document.body.parentNode.scrollTop;
	if(!st||IEver==5){
		st=document.body.scrollTop;
		if(!st){
			st=window.scrollY?window.scrollY:0;
		}
	}
	sl=document.body.parentNode.scrollLeft;
	if(!sl||IEver==5){
		sl=document.body.scrollLeft;
		if(sl){
			sl=window.scrollX?window.scrollX:0;
		}
	}
	return [h,w,st,sl];
}

