
/* 

  ================================================
  PVII Slide Show scripts
  Copyright (c) 2007 Project Seven Development
  www.projectseven.com
  Version: 1.2.0 - build 4-28b
  ================================================
  
*/

var figa,figfrst,p7sscur=-1,figmode='manual',figtimer,figbusy=false,figsobj,p7ofX,p7ofY,figspd,figMinSpeed=2,figMaxSpeed=25;
var p7sstmb=new Array(),figpnls=new Array(),fign=false,figih,p7ssgld,figAlt;
function P7_setSSM(){
	if(!document.getElementById){
		return;
	}
	var h,uA=navigator.userAgent.toLowerCase();
	if(window.opera){
		if(uA.indexOf("opera 5")>-1 || uA.indexOf("opera 6")>-1){
			return;
		}
	}
	h='\n<st'+'yle type="text/css">\n';
	h+='.fig_thumb_section{display:none;}\n';
	h+='</s'+'tyle>';
	document.write(h);
}
P7_setSSM();
function P7_SSMinit(){
	var i,x,tM,uA,tB,tA,tP,tD,id,d,tC,ds,bT,pV,iV;
	tM=document.getElementById("fig");
	if(!tM){
		return;
	}
	figa=arguments;
	uA=navigator.userAgent.toLowerCase();
	if(window.opera){
		if(uA.indexOf("opera 5")>-1 || uA.indexOf("opera 6")>-1){
			return;
		}
	}
	else if(uA.indexOf("netscape")>-1 || uA.indexOf("konqueror")>-1){
		figa[3]=0;
	}
	if(navigator.appVersion.indexOf("MSIE 5")>-1){
		figa[1]=0;
		figa[3]=0;
	}
	figfrst=true;
	document.p7sspre=new Array();
	tB=document.getElementById("fig_thumbs");
	tA=tB.getElementsByTagName("A");
	x=0;
	for(i=0;i<tA.length;i++){
		if(tA[i].parentNode.nodeName=="LI"){
			document.p7sspre[x]=new Image();
			document.p7sspre[x].cmp=false;
			document.p7sspre[x].onload=function (){
				this.cmp=true;
			};
			tA[i].p7ssindex=x;
			p7sstmb[x]=tA[i];
			x++;
			tA[i].onmouseover=function (){
				P7_SSMtmb_ovr(this);
			};
			tA[i].onmouseout=function (){
				P7_SSMtmb_out(this);
			};
tA[i].onclick= function(){
	return P7_SSMtmb(this);
};
}
}
tA=document.getElementsByTagName("A");
x=0;
for(i=0;i<tA.length;i++){
id=tA[i].id;
if(id && id.indexOf('figt')==1){
if(id=='figthmb' || id=='figtnav'){
	tA[i].onclick=function (){
		return P7_SSMtrgPanel(this.id,0);
	};
}
else{
	tA[i].onclick=function (){
		return P7_SSMtrgPanel(this.id,1);
	};
}
d=id.replace("t","w");
tD=document.getElementById(d);
if(tD){
	tC=tD.getElementsByTagName("DIV")[0];
	if(tA[i].className&&tA[i].className=="down"){
		tA[i].p7state="open";
	}
	else{
		tA[i].p7state="closed";
		tC.style.display="none";
	}
	figpnls[x]=id;
	x++;
	tA[i].p7type='normal';
	tA[i].p7panel=d;
	if(id.indexOf('_')>-1){
		tA[i].p7type='toggle';
	}
}
}
}
if(figa[6]==1){
figmode='auto';
}
else{
figmode='manual';
}
bT=document.getElementById('fig_pp');
bT.onclick=function(){
return P7_SSMppTrig(this);
};
if(figa[6]==1){
P7_SSMplay(1);
}
else{
P7_SSMpause(1);
}
tB=document.getElementById('fig_first');
tB.onclick=function(){
return P7_SSMctrl('first');
};
tB=document.getElementById('fig_last');
tB.onclick=function(){
return P7_SSMctrl('last');
};
tB=document.getElementById('fig_prev');
tB.onclick=function(){
return P7_SSMctrl('previous');
};
tB=document.getElementById('fig_next');
tB.onclick=function(){
return P7_SSMctrl('next');
};
P7_SSMsetDelay();
document.onmousedown=P7_SSMeng;
document.onmousemove = P7_SSMdrg;
document.onmouseup = P7_SSMrel;
pV=document.getElementById("fig_preview");
iV=P7_getChildIm(pV);
iV.busy=false;
if(iV){
iV.removeAttribute("width");
iV.removeAttribute("height");
}
tA=document.getElementById("fig_fslink");
if(tA){
tA.onclick=function(){
return P7_imgClick(this);
};
}
fign=true;
x=figa[5];
P7_SSMtrig(x);
P7_SSMurl();
}
function P7_SSMurl(){
	var i,h,s,x,d='ssm';
	if(document.getElementById){
		h=document.location.search;
		if(h){
			h=h.replace('?','');
			s=h.split(/[=&]/g);
			if(s&&s.length){
				for(i=0;i<s.length;i+=2){
					if(s[i]==d){
						x=s[i+1];
						if(x){
							P7_SSMtrig(x);
						}
					}
				}
			}
		}
		h=document.location.hash;
		if(h){
			x=h.substring(1,h.length);
			if(x && x.indexOf("ssm")==0){
				P7_SSMtrig(x.substring(3));
			}
		}
	}
}
function P7_SSMtrig(n){
	var i,td,pp,tA,td,tP;
	if(!n){
		n=p7sscur;
		n++;
	}
	else{
		n--;
	}
	if(n>=p7sstmb.length || n<0){
		n=0;
	}
	tA=p7sstmb[n];
	pp=tA.parentNode;
	while(pp){
		if(pp.nodeName=='DIV' && pp.id && pp.id.indexOf('figwp'==0)){
			td=pp.id.replace('w','t');
			tP=document.getElementById(td);
			break;
		}
		pp=pp.parentNode;
	}
	if(tP){
		if(tP.p7state!='open'){
			P7_SSMopenPanel(tP.id);
		}
	}
	P7_SSMtmb(tA,1);
}
function P7_SSMclear(){
	if(figtimer){
		clearTimeout(figtimer);
	}
}
function P7_SSMppTrig(){
	if(!fign){
		return false;
	}
	var a=document.getElementById('fig_pp');
	if(a.p7state=='play'){
		P7_SSMpause();
	}
	else{
		P7_SSMplay();
	}
	return false;
}
function P7_SSMplay(bp){
	var b=document.getElementById('fig_pp');
	if(figmode=='auto'&&bp!=1){
		return;
	}
	b.p7state='play';
	figmode='auto';
	b.title='Pause Slideshow';
	b.className='fig_pause';
	if(bp!=1){
		P7_SSMtrig();
	}
}
function P7_SSMpause(bp){
	var b=document.getElementById('fig_pp');
	P7_SSMclear();
	b.p7state='pause';
	if(bp!=1){
		figmode='pause';
	}
	b.title='Play Slideshow';
	b.className='fig_play';
}
function P7_SSMctrl(ag,bp){
	if(!fign){
		return false;
	}
	var n;
	if(ag=='pause'){
		P7_SSMpause();
		return false;
	}
	if(figbusy){
		return false;
	}
	if(ag=='play'){
		P7_SSMplay();
		return false;
	}
	if(bp!=1){
		P7_SSMpause();
	}
	if(ag=='first'){
		n=1;
	}
	else if(ag=='last'){
		n=p7sstmb.length;
	}
	else if(ag=='next'){
		n=p7sscur+1;
		n++;
		if(n>p7sstmb.length){
			n=1;
		}
	}
	else if(ag=='previous'){
		n=p7sscur+1;
		n--;
		if(n<1){
			n=p7sstmb.length;
		}
	}
	else{
		n=parseInt(ag);
	}
	if(n<1){
		n=1;
	}
	if(n>p7sstmb.length){
		n=p7sstmb.length;
	}
	P7_SSMclear();
	P7_SSMtrig(n);
	return false;
}
function P7_SSMshowImage(n){
	var x,i,tA,tI,pV,iV,pI,fsw,cI,lD;
	x=n-1;
	if(n>p7sstmb.length || n<1 || x==p7sscur){
		return;
	}
	figbusy=true;
	var cf=document.getElementById("fig_cf");
	cf.innerHTML='';
	cf.style.left="0px";
	cf.style.top="0px";
	if(p7sstmb[p7sscur]){
		p7sstmb[p7sscur].className='';
	}
	tA=p7sstmb[x];
	tA.className="down";
	p7sscur=x;
	tI=P7_getChildIm(tA);
	pV=document.getElementById("fig_preview");
	iV=P7_getChildIm(pV);
	if(!iV.busy){
		iV.src=tI.src;
		iV.alt=tI.alt;
	}
	pI=document.p7sspre[x];
	if(document.figwait){
		clearTimeout(document.figwait);
	}
	if(!pI.cmp){
		lD=document.getElementById("fig_loading");
		P7_SSMshowPRG();
		pI.src=tA.href;
		P7_SSMwait(x);
	}
	else{
		P7_SSMdisplay();
	}
}
function P7_SSMdisplay(){
	var i,x,n,op,fsw,fsc,fsimg,fslnk,ch,cw,gld=false,tC,tA,tI,tD,hr,alT,fd,a,cIM,nIM,oiw,oih,niw,nih,nw,nh,fDS,cf,nrw,cDim;
	op=(figfrst)?0:figa[3];
	p7ssgld=false;
	x=p7sscur;
	fsw=document.getElementById("fig_fsw");
	fsc=document.getElementById("fig_fsc");
	cf=document.getElementById("fig_cf");
	cf.style.visibility="hidden";
	cf.innerHTML='<im'+'g sr'+'c="'+document.p7sspre[x].src+'">';
	if(fsc.p7hssz){
		clearTimeout(fsc.p7hssz);
	}
	fsw.style.overflow="visible";
	fsc.style.height="auto";
	ch=fsw.offsetHeight;
	cw=fsw.offsetWidth;
	//fsc.style.width=cw+"px";
	tC=document.getElementById("fig_counter");
	n=p7sstmb.length;
	if(tC){
		tC.innerHTML='Image '+(x+1)+' of '+n;
	}
	tA=p7sstmb[x];
	tI=P7_getChildIm(tA);
	tD=tA.parentNode.getElementsByTagName("DIV");
	hr=null;
	figAlt=tI.alt;
	fd=null;
	if(tD){
		for(i=0;i<tD.length;i++){
			if(tD[i].className=="fig_lk"){
				a=tD[i].getElementsByTagName("A")[0];
				if(a){
					hr=a.href;
					figAlt=a.innerHTML;
				}
			}
			if(tD[i].className=="fig_fd"){
				fd=tD[i].innerHTML;
			}
		}
	}
	fDS=document.getElementById("fig_description");
	fDS.p7desc=fd;
	fslnk=document.getElementById("fig_fslink");
	if(hr){
		fslnk.setAttribute("href",hr);
	}
	else{
		fslnk.removeAttribute("href");
	}
	nih=cf.offsetHeight;
	niw=cf.offsetWidth;
	fsimg=document.getElementById("fig_fsimg");
	cIM=document.getElementById("fig_im");
	oiw=cIM.offsetWidth;
	oih=cIM.offsetHeight;
	nih=(nih>20)?nih:oih;
	niw=(niw>20)?niw:oiw;
	nw=oiw-niw;
	nh=oih-nih;
	fsc.p7cw=cw;
	fsc.p7ch=ch;
	nrw=cw-oiw+niw;
	fsc.p7nw=nrw;
	if(op==1){
		if(Math.abs(nw)>0 || Math.abs(nh)>0){
			p7ssgld=true;
			fsc.style.overflow="hidden";
			fsc.style.height=ch+"px";
			//fsc.style.width=cw+"px";
		}
	}
	if(p7ssgld){
		P7_SSMfadeOut("fig_im",.95);
	}
	else{
		//fsc.style.width=nrw+"px";
		if(fDS.p7desc){
			fDS.innerHTML=fDS.p7desc;
			fDS.style.display="block";
		}
		else{
			fDS.innerHTML='';
			fDS.style.display="none";
		}
		if(op==1){
			cDim=P7_SSMgetPos(cIM);
			P7_SSMsetPos('fig_cf',cDim[1],cDim[0]);
			P7_SSMcrossFade('fig_cf',.05,'fig_im',.95);
		}
		else{
			cIM.src=document.p7sspre[x].src;
			cf.innerHTML='';
			if(nih<1 || niw<1){
				cIM.height=null;
				cIM.width=null;
			}
			else{
				cIM.setAttribute("width",niw);
				cIM.setAttribute("height",nih);
			}
			cIM.setAttribute("alt",figAlt);
			P7_SSMdispFin();
		}
	}
}
function P7_SSMdispFin(){
	var x,pI;
	figfrst=false;
	figbusy=false;
	if(figmode=='auto'){
		x=p7sscur;
		x++;
		if(x<0||x>=p7sstmb.length){
			x=0;
		}
		if(figa[7]==1){
			pI=document.p7sspre[x];
			if(!pI.cmp){
				pI.src=p7sstmb[x].href;
			}
		}
		figtimer=setTimeout("P7_SSMtrig()",figa[8]*1000);
	}
}
function P7_SSMdisplayCf(){
	var x=p7sscur;
	var cIM=document.getElementById("fig_im");
	var cf=document.getElementById("fig_cf");
	cIM.src=document.p7sspre[x].src;
	cIM.setAttribute("width",cf.offsetWidth);
	cIM.setAttribute("height",cf.offsetHeight);
	cIM.setAttribute("alt",figAlt);
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		cIM.style.filter='alpha(opacity=100)';
	}
	else{
		cIM.style.opacity=0.99;
	}
	var cf=document.getElementById("fig_cf");
	cf.style.visibility="hidden";
	cf.innerHTML='';
	P7_SSMdispFin();
}
function P7_SSMdisplayGa(){
	var fsw,fsc,fDS,cIM,nh,cf;
	fsc=document.getElementById("fig_fsc");
	fsw=document.getElementById("fig_fsw");
	cf=document.getElementById("fig_cf");
	fDS=document.getElementById("fig_description");
	fsw.style.visibility="hidden";
	//fsw.style.width=fsc.p7nw+"px";
	if(fDS.p7desc){
		fDS.innerHTML=fDS.p7desc;
		fDS.style.display="block";
	}
	else{
		fDS.innerHTML='';
		fDS.style.display="none";
	}
	cIM=document.getElementById("fig_im");
	cIM.src=document.p7sspre[p7sscur].src;
	cIM.setAttribute("width",cf.offsetWidth);
	cIM.setAttribute("height",cf.offsetHeight);
	cf.innerHTML='';
	cIM.setAttribute("alt",figAlt);
	nh=fsw.offsetHeight;
	fsw.style.display="none";
	P7_SSMszg("fig_fsc","fig_fsw",fsc.p7ch,fsc.p7cw,nh,fsc.p7nw);
}
function P7_SSMdisplayGb(){
	P7_SSMdispFin();
}
function P7_SSMwait(x){
	var im=document.p7sspre[x];
	if(im.cmp || (!document.all&&im.height>1)){
		im.cmp=true;
		document.getElementById("fig_loading").style.visibility="hidden";
		P7_SSMdisplay();
	}
	else{
		if(document.figwait){
			clearTimeout(document.figwait);
		}
		document.figwait=setTimeout("P7_SSMwait("+x+")",60);
	}
}
function P7_SSMshowPRG(g){
	var i,im,tD,tB,ph,pw,ih,iw,nh,nw,lf,tp,cp;
	tD=document.getElementById("fig_loading");
	tB=document.getElementById("fig_fsimg");
	im=P7_getChildIm(tB);
	if(figfrst){
		im=document.getElementById("fig");
	}
	if(im){
		ph=tD.offsetHeight;
		pw=tD.offsetWidth;
		ih=im.offsetHeight;
		iw=im.offsetWidth;
		lf=parseInt((iw-pw)/2);
		tp=parseInt((ih-ph)/2);
		cp=P7_SSMgetPos(im);
		lf+=cp[0];
		tp+=cp[1];
		P7_SSMsetPos(tD.id,tp,lf);
		tD.style.visibility="visible";
	}
}
function P7_SSMszg(id,id2,ch,cw,th,tw){
	var i,d,dd,mh,mw,ih=5,iw=5,dy=20;
	d=document.getElementById(id);
	dd=document.getElementById(id2);
	d.style.height=ch+'px';
	//d.style.width=cw+'px';
	mh=(ch<=th)?0:1;
	mw=(cw<=tw)?0:1;
	ih=(mh==1)?ih*-1:ih;
	iw=(mw==1)?iw*-1:iw;
	if(ch==th && cw==tw){
		dd.style.display="block";
		d.style.overflow="visible";
		d.style.height=dd.offsetHeight+"px";
		dd.style.visibility="visible";
		setTimeout("P7_SSMfadeIn('fig_im',.05)",250);
	}
	else{
		ch+=ih;
		cw+=iw;
		if(mh==0){
			ch=(ch>=th)?th:ch;
		}
		else{
			ch=(ch<=th)?th:ch;
		}
		if(mw==0){
			cw=(cw>=tw)?tw:cw;
		}
		else{
			cw=(cw<=tw)?tw:cw;
		}
		if(d.p7hssz){
			clearTimeout(d.p7hssz);
		}
		d.p7hssz=setTimeout("P7_SSMszg('"+id+"','"+id2+"',"+ch+","+cw+","+th+','+tw+")",dy);
	}
}
function P7_SSMfadeIn(id,op){
	var im,dy,lm=.99,inc,d=document.getElementById(id);
	inc=(window.opera)?.15:.10;
	dy=(window.opera)?20:20;
	if(d.style.visibility!="visible"){
		d.style.visibility="visible";
	}
	op=(op>=lm)?lm:op;
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		d.style.filter='alpha(opacity='+op*100+')';
	}
	else{
		d.style.opacity=op;
	}
	if(op<lm){
		if(d.figfade){
			clearTimeout(d.figfade);
		}
		op+=inc;
		d.figfade=setTimeout("P7_SSMfadeIn('"+id+"',"+op+")",dy);
	}
	else{
		P7_SSMdisplayGb();
	}
}
function P7_SSMfadeOut(id,op){
	var im,dy,inc,cf,lm=.01,d=document.getElementById(id);
	inc=(window.opera)?.12:.10;
	dy=(window.opera)?20:20;
	if(d.style.visibility!="visible"){
		d.style.visibility="visible";
	}
	op=(op<=lm)?lm:op;
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		d.style.filter='alpha(opacity='+op*100+')';
	}
	else{
		d.style.opacity=op;
	}
	if(op>lm){
		if(d.figfade){
			clearTimeout(d.figfade);
		}
		op-=inc;
		d.figfade=setTimeout("P7_SSMfadeOut('"+id+"',"+op+")",dy);
	}
	else{
		d.style.visibility="hidden";
		setTimeout("P7_SSMdisplayGa()",150);
	}
}
function P7_SSMcrossFade(di,opi,dou,opo){
	var dIn,dOut,inc,dy,lm=01,hl=.99;
	inc=.05;
	dy=20;
	dIn=document.getElementById(di);
	dOut=document.getElementById(dou);
	if(dIn.style.visibility!="visible"){
		dIn.style.visibility="visible";
	}
	if(dOut.style.visibility!="visible"){
		dOut.style.visibility="visible";
	}
	opi=(opi>=hl)?hl:opi;
	opo=(opo<=lm)?lm:opo;
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		dIn.style.filter='alpha(opacity='+opi*100+')';
		dOut.style.filter='alpha(opacity='+opo*100+')';
	}
	else{
		dIn.style.opacity=opi;
		dOut.style.opacity=opo;
	}
	if(opo>lm || opi<hl){
		if(dIn.figfade){
			clearTimeout(dIn.figfade);
		}
		opi+=inc;
		opo-=inc;
		dIn.figfade=setTimeout("P7_SSMcrossFade('"+di+"',"+opi+",'"+dou+"',"+opo+")",dy);
	}
	else{
		P7_SSMdisplayCf();
	}
}
function P7_SSMtmb(a,bp){
	var m=(bp==1)?true:false;
	if(!fign){
		return m;
	}
	if(bp!=1 && figbusy){
		return m;
	}
	if(bp!=1){
		P7_SSMpause();
	}
	P7_SSMshowImage(a.p7ssindex+1);
	return m;
}
function P7_SSMtmb_ovr(a){
	if(!fign){
		return;
	}
	var iM,pV,iV,cl,ph,pw,of,newTop,newLeft,wW,scl,tw;
	iM=P7_getChildIm(a);
	pV=document.getElementById("fig_preview");
	iV=P7_getChildIm(pV);
	iV.busy=true;
	iV.src=iM.src;
	iV.alt=iM.alt;
}
function P7_SSMtmb_out(a){
	if(!fign){
		return;
	}
	var pI,tI,pV=document.getElementById("fig_preview");
	pI=P7_getChildIm(pV);
	tI=P7_getChildIm(p7sstmb[p7sscur]);
	pI.busy=false;
	pI.src=tI.src;
	pI.alt=tI.alt;
}
function P7_SSMtrgPanel(d,c){
	if(!fign){
		return false;
	}
	var i,a,x,td;
	if(c==1){
		P7_SSMpause();
	}
	a=document.getElementById(d);
	if(a){
		if(a.p7state=="open"){
			P7_SSMclosePanel(d,c);
		}
		else{
			P7_SSMopenPanel(d,c);
		}
	}
	return false;
}
function P7_SSMtoggle(id,c){
	var i,x,pd,nd;
	for(i=0;i<figpnls.length;i++){
		pd=figpnls[i];
		x=pd.indexOf("_");
		nd=pd.substring(0,x+1);
		if(x>0&&pd.indexOf(nd)==0&&pd!=id){
			P7_SSMclosePanel(pd,c);
		}
	}
}
function P7_SSMclosePanel(iD,c){
	var i,a,wD,tW,tC,h;
	a=document.getElementById(iD);
	if(a){
		if(a.p7state=="closed"){
			return;
		}
		if(c==1){
			P7_SSMpause();
		}
		wD=iD.replace('t','w');
		tW=document.getElementById(wD);
		if(tW){
			tC=tW.getElementsByTagName("DIV")[0];
			if(tC){
				a.p7state="closed";
				a.className='';
				if(figa[1]==1){
					if(P7_hasOverflow(tW)||P7_hasOverflow(tC)){
						tC.style.display="block";
						return;
					}
					h=tW.offsetHeight;
					tW.style.overflow="hidden";
					P7_SSMglide(tW.id,h,0);
				}
				else{
					tC.style.display="none";
				}
			}
		}
	}
}
function P7_SSMopenPanel(iD,c){
	var i,a,wD,tW,tC,h;
	a=document.getElementById(iD);
	if(a){
		if(a.p7state=="open"){
			return;
		}
		if(c==1){
			P7_SSMpause();
		}
		wD=iD.replace('t','w');
		tW=document.getElementById(wD);
		if(tW){
			tC=tW.getElementsByTagName("DIV")[0];
			if(tC){
				a.p7state="open";
				a.className="down";
				if(figa[1]==1){
					if(P7_hasOverflow(tW)||P7_hasOverflow(tC)){
						tC.style.display="block";
						return;
					}
					tW.style.overflow="hidden";
					tW.style.height="1px";
					tC.style.display="block";
					h=tC.offsetHeight;
					if(h>0){
						P7_SSMglide(tW.id,1,h);
					}
					else{
						tW.style.height="auto";
						tC.style.display="block";
					}
				}
				else{
					tC.style.display="block";
				}
				if(a.p7type=='toggle'){
					if(figa[2]==1){
						P7_SSMtoggle(iD,c);
					}
				}
			}
		}
	}
}
function P7_SSMglide(dd,ch,th){
	var w,m,d,tC,tt,dy=10,inc=10,pc=.15;
	d=document.getElementById(dd);
	m=(ch<=th)?0:1;
	tt=Math.abs( parseInt( Math.abs(th)-Math.abs(ch) ) );
	inc=(tt*pc<1)?1:tt*pc;
	inc=(m==1)?inc*-1:inc;
	d.style.height=ch+"px";
	if(ch==th){
		if(th==0){
			tC=d.getElementsByTagName('DIV')[0];
			tC.style.display="none";
			d.style.height="auto";
		}
		else{
			d.style.height="auto";
		}
	}
	else{
		ch+=inc;
		if(m==0){
			ch=(ch>=th)?th:ch;
		}
		else{
			ch=(ch<=th)?th:ch;
		}
		if(d.p7ssG){
			clearTimeout(d.p7ssG);
		}
		d.p7ssG=setTimeout("P7_SSMglide('"+dd+"',"+ch+","+th+")",dy);
	}
}
function P7_SSMeng(evt){
	if(!fign){
		return false;
	}
	var x,mx,tx,y,my,ty;
	evt=(evt)?evt:event;
	var m=true,tS,tg=(evt.target)?evt.target:evt.srcElement;
	figsobj=null;
	if(tg.id&&tg.id=='fig_slidebar'){
		figsobj=document.getElementById('fig_slider');
	}
	else if(tg.id&&tg.id=='fig_dragbar'){
		figsobj=document.getElementById('figwhmb');
	}
	if(figsobj){
		if(evt.clientX){
			x=(figsobj.offsetLeft)?figsobj.offsetLeft:0;
			y=(figsobj.offsetTop)?figsobj.offsetTop:0;
			mx=parseInt(P7_getPropValue(figsobj,'marginLeft','margin-left'));
			mx=(mx)?mx:0;
			my=parseInt(P7_getPropValue(figsobj,'marginTop','margin-top'));
			my=(my)?my:0;
			p7ofX=evt.clientX-(x-mx);
			p7ofY=evt.clientY-(y-my);
		}
		m=false;
		if(tg.id=='fig_slidebar'){
			document.getElementById('fig_slidebar').title='';
			tS=document.getElementById('fig_speed');
			if(tS){
				tS.style.display='block';
			}
			figspd=figa[8];
			if(figmode=='auto'){
				P7_SSMpause();
			}
		}
	}
	return m;
}
function P7_SSMdrg(evt){
	evt=(evt)?evt:event;
	var m=true;
	if(figsobj){
		if(evt.clientX){
			if(figsobj.id=='fig_slider'){
				P7_SSMshift(figsobj,(evt.clientX-p7ofX));
			}
			else{
				P7_SSMshiftThumb(figsobj,(evt.clientX-p7ofX),(evt.clientY-p7ofY));
			}
		}
		evt.cancelBubble=true;
		m=false;
	}
	return m;
}
function P7_SSMshiftThumb(obj,x,y){
	obj.style.left=x+"px";
	obj.style.top=y+"px";
}
function P7_SSMshift(obj,x){
	var r,sr,sp,tS,tC,tT;
	tS=document.getElementById('p7ssh_speed');
	if(tS){
		tS.style.display='block';
	}
	tC=document.getElementById('fig_slidechannel');
	r=tC.offsetWidth;
	x=(x<=0)?0:x;
	x=(x>=r)?r:x;
	obj.style.left=x+"px";
	sp = Math.round( (x/r) * figMaxSpeed );
	if(sp<=figMinSpeed){
		sp=figMinSpeed;
	}
	tT=document.getElementById('fig_speed');
	if(tT){
		tT.innerHTML='Delay:&nbsp;'+sp+'&nbsp;seconds';
	}
	figspd=sp;
}
function P7_SSMrel(evt){
	var tS;
	if(figsobj){
		if(figsobj.id=='fig_slider'){
			tS=document.getElementById('fig_speed');
			if(tS){
				tS.style.display='none';
			}
			figa[8]=figspd;
			document.getElementById('fig_slidebar').title='Delay: '+figa[8]+' seconds';
			if(figmode=='pause'){
				P7_SSMplay();
			}
		}
		figsobj=null;
	}
}
function P7_SSMsetDelay(s){
	var rr,sp,x,r,tC,sD,tT;
	tC=document.getElementById('fig_slidechannel');
	sD=document.getElementById('fig_slider');
	r=tC.offsetWidth;
	if(!s){
		s=figa[8];
	}
	s=(s<=figMinSpeed)?figMinSpeed:s;
	s=(s>=figMaxSpeed)?figMaxSpeed:s;
	x=Math.round( (s / figMaxSpeed) *r );
	sD.style.left=x+'px';
	figa[8]=s;
	tT=document.getElementById('fig_speed');
	if(tT){
		tT.innerHTML='Delay:&nbsp;'+sp+'&nbsp;seconds';
	}
	document.getElementById('fig_slidebar').title='Delay: '+figa[8]+' seconds';
}
function P7_getChildIm(d){
	return d.getElementsByTagName('IMG')[0];
}
function P7_hasOverflow(ob){
	var s,m;
	s=ob.style.overflow;
	if(!s){
		s=P7_getPropValue(ob,'overflow','overflow');
	}
	m=(s&&s=='auto')?true:false;
	return m;
}
function P7_getPropValue(ob,prop,prop2){
	var h,v=null;
	if(ob){
		if(ob.currentStyle){
			v=eval('ob.currentStyle.'+prop);
		}
		else if(document.defaultView.getComputedStyle(ob,"")){
			v=document.defaultView.getComputedStyle(ob,"").getPropertyValue(prop2);
		}
		else{
			v=eval("ob.style."+prop);
		}
	}
	return v;
}
function P7_SSMgetPos(obj){
	var t=0,l=0,pp,pos=new Array(),ct,cl,bt=0,bl=0;
	var isFF=navigator.userAgent.indexOf("Firefox")>-1;
	pp=obj;
	var ct,di;
	while(pp){
		l+=(pp.offsetLeft)?pp.offsetLeft:0;
		t+=(pp.offsetTop)?pp.offsetTop:0;
		if(isFF){
			pp.p7pn=true;
		}
		pp=pp.offsetParent;
	}
	if(isFF){
		pp=obj.parentNode;
		while(pp){
			if(!pp.p7pn&&pp.clientHeight){
				ct=(pp.offsetHeight-pp.clientHeight)/2;
				bt=(ct)?bt+ct:bt;
				cl=(pp.offsetWidth-pp.clientWidth)/2;
				bl=(cl)?bl+cl:bl;
			}
			if(pp.nodeName=="BODY"){
				break;
			}
			pp=pp.parentNode;
		}
		if(cl>0 || bl>0){
		}
	}
	pos[0]=l;
	pos[1]=t;
	return pos;
}
function P7_SSMsetPos(d,t,l){
	var i,pp,p,pf,tD=document.getElementById(d);
	pp=tD.parentNode;
	while(pp){
		if(pp.style){
			p=P7_getPropValue(pp,'position','position');
			if(p=="absolute" || p=="relative"){
				pf=P7_SSMgetPos(pp);
				l-=pf[0];
				t-=pf[1];
				break;
			}
		}
		pp=pp.parentNode;
	}
	tD.style.top=t+"px";
	tD.style.left=l+"px";
}
function P7_imgClick(a){
	if(a.href && a.href.indexOf(".")>-1){
		P7_SSMpause();
		document.p7NW=window.open(a.href,'ImageLink');
		document.p7NW.focus();
	}
	return false;
}
if(window.addEventListener){
	window.addEventListener("unload",P7_FFfix,false);
}
function P7_FFfix(){
	return;
}

