function zoom(v){
var w;
if(!isNaN(v)&&v) w=w0*v/100;
else if(v=='+'||v=='-') w=(Math.round((i.offsetWidth-14)/w0*10-parseInt(v+1)/2.1)+parseInt(v+1))*w0/10;
else w=Math.min(w0,d.getElementById('barre').offsetWidth-14);
i.style.width=i0.style.width=Math.round(w=Math.min(w0*2,Math.max(w0*0.2,w)))+'px';
i.style.height=i0.style.height=Math.round(w*h0/w0)+'px';
i.style.top=i0.offsetTop+'px';
i.style.left=i0.offsetLeft+'px';
s.style.backgroundPosition=(Math.floor(w/w0*50)-227)+'px '+gB(s)[1]+'px';
r=Math.round(w/w0*100);
af.firstChild.data='affichage : '+(v?(r+'%'):'auto');
z=v?r:'';
}
function play(i){
if(t) clearTimeout(t);
t=t?0:setTimeout("d.location.href=d.getElementById('suiv').href+'#play'+z",i?i:500);
dp.className=t?'actif':'';
dp.focus();
}
function rz(e){
var x,y;
e=pE(e);
y=e.clientY;
i.title='';
i0.className='zoom';
i.onmousemove=function(e){if(x=(-y+(y=(e?e:window.event).clientY))*r/250) zoom(r+(Math.abs(x)>1?x:(x>0?1:-1)))}
i.onmouseup=i.onmouseout=function(){
i.title=h;
i0.className='';
i.onmousemove=null;
}
}
function sl(e){
e=pE(e);
var v=(isNaN(e.offsetX)?(e.clientX+window.pageXOffset-gX(s)):e.offsetX)*2+14;
if(v<20) v=20;
if(v>200) v=200;
if(sl.t) clearTimeout(sl.t);
if(s.onmousemove) zoom(v);
else sS(v);
s.onmousemove=sl;
}
function sS(v){
zoom(Math.round((2*v+r)/6)*2);
if(r!=v) sl.t=setTimeout('sS('+v+')',40);
}
function gX(o){
var p=o.offsetLeft;
while(o=o.offsetParent) p+=o.offsetLeft;
return p;
}
function gB(o){
var p=o.style.backgroundPosition.match('^([0-9-]+)px ([0-9-]+)px$');
return p?[p[1],p[2]]:[-175,-15];
}
function pE(e){
if(!e) e=window.event;
if(e.preventDefault) e.preventDefault();
else e.returnValue=false;
return e;
}
function sH(){
s.style.backgroundPosition=gB(s)[0]+'px '+(parseInt(gB(s)[1])?0:15)+'px';
s.onmousemove=null;
}
var t,h,r=100,
d=document,
i0=d.images[0],
w0=i0.offsetWidth-14,
h0=i0.offsetHeight-14,
dp=d.getElementById('diap'),
af=d.getElementById('pourcent'),
a=location.hash.match('^#(play)?([0-9]+)?$'),
z=a?a[2]:'',
c=d.getElementById('barre').getElementsByTagName('ul')[0],
i=d.createElement('div'),
s=d.createElement('li');
i.title=h='Faite glisser pour redimensionner, ou double-cliquez pour retrouver la taille adaptée';
i.onmousedown=rz;
i.ondblclick=function(){zoom()}
s.id='slider';
s.innerHTML='Glissière';
s.onmousedown=sl;
s.onmouseup=function(){s.onmousemove=null}
s.onmouseout=s.onmouseover=sH;
s.ondragstart=i.ondragstart=i.onselectstart=function(){return false}
c.insertBefore(s,c.lastChild);
dp.href='javascript:play()';
d.getElementById('zout').style.margin='0';
d.getElementById('adap').href='javascript:zoom()';
d.getElementById('zoom').href="javascript:zoom('+')";
d.getElementById('zout').href="javascript:zoom('-')";
d.getElementById('prec').onclick=d.getElementById('suiv').onclick=function(){if(z) this.href+='#'+z}
d.getElementById('photo').insertBefore(i,d.getElementById('photo').lastChild);
onresize=function(){if(!z) zoom()}
zoom(z);
if(a&&a[1]) play(4000);
//if(top!=self) {
//top.location.replace(location.href+'#top');
//}
//if(location.hash=='#top') {
//window.name='top';
//top.location.replace('.');
//}
//if((window.name=='top' && location.hash!='#top') || d.cookie.indexOf('hotlink')!=-1) {
//window.name='';
//d.cookie = 'hotlink=0;domain=www.tripalbum.net;expires=Thu, 01-Jan-70 00:00:01 GMT;path=/';
//d.write('<div id="ad" style="display:none"><script type="text/javascript" src="/pub.js"><\/script></div>');}
if(top!=self) top.location.replace('.');

