function effect_img(file,x,y)
{IE4=(document.all)?1:0;NS4=(document.layers)?1:0;ver4=(IE4||NS4)?1:0;if(IE4){whichEl=document.all.effectimg}
else{whichEl=document.getElementById("effectimg")};whichEl.style.filter="alpha(opacity=0)";whichEl.style.opacity=0;whichEl.src=file;whichEl.height=y;whichEl.width=x;var i;for(i=0;i<=100;i=i+2)
{setTimeout('effect_img_alpha(whichEl,'+i+')',10*i);}}
function effect_img_alpha(element,i)
{element.style.filter="alpha(opacity="+i+")";element.style.opacity=i/100;}
function effect_img_reset(file,x,y)
{IE4=(document.all)?1:0;NS4=(document.layers)?1:0;ver4=(IE4||NS4)?1:0;if(IE4){whichEl=document.all.effectimg}
else{whichEl=document.getElementById("effectimg")};whichEl.style.filter="alpha(opacity=100)";whichEl.style.opacity=1;whichEl.src=file;whichEl.height=y;whichEl.width=x;var i;};target_x=20;target_y=290;has_inner=typeof(window.innerWidth)=='number';has_element=document.documentElement&&document.documentElement.clientWidth;var fm_id='floatdiv';var floating_menu;function define_var_float(){floating_menu=document.getElementById?document.getElementById(fm_id):document.all?document.all[fm_id]:document.layers[fm_id];}
var fm_shift_x,fm_shift_y,fm_next_x,fm_next_y;function move_menu()
{if(floating_menu){if(document.layers)
{floating_menu.left=fm_next_x;floating_menu.top=fm_next_y;}
else
{floating_menu.style.left=fm_next_x+'px';floating_menu.style.top=fm_next_y+'px';}}}
function compute_shifts()
{fm_shift_x=has_inner?pageXOffset:has_element?document.documentElement.scrollLeft:document.body.scrollLeft;if(target_x<0)
fm_shift_x+=has_inner?window.innerWidth:has_element?document.documentElement.clientWidth:document.body.clientWidth;fm_shift_y=has_inner?pageYOffset:has_element?document.documentElement.scrollTop:document.body.scrollTop;if(target_y<0)
fm_shift_y+=has_inner?window.innerHeight:has_element?document.documentElement.clientHeight:document.body.clientHeight;}
function float_menu()
{define_var_float();if(floating_menu){var step_x,step_y;compute_shifts();step_x=(fm_shift_x+target_x-fm_next_x)*.07;if(Math.abs(step_x)<.5)
step_x=fm_shift_x+target_x-fm_next_x;step_y=(fm_shift_y+target_y-fm_next_y)*.07;if(Math.abs(step_y)<.5)
step_y=fm_shift_y+target_y-fm_next_y;if(Math.abs(step_x)>0||Math.abs(step_y)>0)
{fm_next_x+=step_x;fm_next_y+=step_y;move_menu();}}
setTimeout('float_menu()',20);};compute_shifts();if(document.layers)
{fm_next_x=0;fm_next_y=0;}
else
{fm_next_x=fm_shift_x+target_x;fm_next_y=fm_shift_y+target_y;move_menu();}
function hide_menu()
{IE4=(document.all)?1:0;NS4=(document.layers)?1:0;ver4=(IE4||NS4)?1:0;if(IE4){whichEl=document.all.floatdiv.style}
else{whichEl=document.getElementById("floatdiv").style};whichEl.visibility="hidden";}
float_menu();;var isf={'clock':null,'fade':true,'count':1}
var imageLoaded=false;function swapfade(obj,src,height,width,title,duration,resolution)
{if(isf.clock==null)
{var image=new Image();image.src=src;isf.obj=obj;isf.src=src;isf.height=height;isf.width=width;if(typeof isf.obj.style.opacity!='undefined')
{isf.type='w3c';}
else if(typeof isf.obj.style.MozOpacity!='undefined')
{isf.type='moz';}
else if(typeof isf.obj.style.KhtmlOpacity!='undefined')
{isf.type='khtml';}
else if(typeof isf.obj.filters=='object')
{isf.type=(isf.obj.filters.length>0&&typeof isf.obj.filters.alpha=='object'&&typeof isf.obj.filters.alpha.opacity=='number')?'ie':'none';}
else
{isf.type='none';}
isf.obj.title=title;isf.obj.alt=title;if(isf.type!='none')
{isf.length=parseInt(duration,10);isf.resolution=parseInt(resolution,10);isf.clock=setInterval('isf.swapfade()',isf.length/isf.resolution);}
else
{isf.obj.src=isf.src;}}};isf.swapfade=function()
{if(isf.obj.complete){if(isf.fade){isf.count=isf.count*0.7;}else{isf.count=isf.count*(1/0.7);}
if(isf.count<(1/isf.resolution))
{clearInterval(isf.clock);isf.clock=null;isf.obj.src=isf.src;isf.obj.width=isf.width;isf.obj.height=isf.height;isf.fade=false;isf.clock=setInterval('isf.swapfade()',isf.length/isf.resolution);}
if(isf.count>(1-(1/isf.resolution)))
{clearInterval(isf.clock);isf.clock=null;isf.fade=true;isf.count=1;}
switch(isf.type)
{case'ie':isf.obj.filters.alpha.opacity=isf.count*100;break;case'khtml':isf.obj.style.KhtmlOpacity=isf.count;break;case'moz':isf.obj.style.MozOpacity=(isf.count==1?0.9999999:isf.count);break;default:isf.obj.style.opacity=(isf.count==1?0.9999999:isf.count);}}};function hideId(id){if(document.getElementById){var element=document.getElementById(id);if(element){element.style.display='none';}}}
function showId(id){if(document.getElementById){var element=document.getElementById(id);if(element){element.style.display='block';}}}
function precedent(){if(currentId>0){currentId=currentId-1;afficherImage(currentId);}}
function suivant(){if(currentId+1<tabPhotos.length){currentId=currentId+1;afficherImage(currentId);}}
function afficherImage(i){if(i>=0&&i<tabPhotos.length){currentId=i;if(i==0){hideId('precedent');}else{showId('precedent');changerLien('lien_precedent',tabPhotos[i-1][4]);}
if(i==tabPhotos.length-1){hideId('suivant');}else{showId('suivant');changerLien('lien_suivant',tabPhotos[i+1][4]);}
var image=tabPhotos[i];changerImage(image[0],image[1],image[2],image[3]);}}
function changerImage(fichier,hauteur,largeur,description){if(document.getElementById){var image=document.getElementById('photo');if(image){imageLoaded=false;swapfade(image,fichier,hauteur,largeur,description,1000,20);}
var lienImage=document.getElementById('lien_image');if(lienImage){lienImage.href=fichier;}
var texteImage=document.getElementById('descriptionText');if(texteImage){texteImage.innerHTML='<p>'+description+'</p>';}}}
function onLoadImgGalerie(){imageLoaded=true;}
function changerLien(id,url){if(document.getElementById){var lien=document.getElementById(id);if(lien){lien.href=url;}}}
compteur=0;currentTimer=1;elements=new Array();stopElipse=false;function initElipse(){var container=document.getElementById('photosTournantes');var blocListe=document.getElementById('listephotos');var newnode=document.createElement("span");container.style.height='350px';container.style.position='relative';elements=ajouterElementsPhotos(blocListe,container);newnode.setAttribute('id','text');container.appendChild(newnode);newnode.style.width=container.offsetWidth+'px';newnode.style.textAlign='center';newnode.style.position='absolute';newnode.style.top=Math.round(container.offsetHeight/2-40)+'px';newnode.style.left='0px';tourner(1);}
function tourner(val){if(!stopElipse&&val==currentTimer){var container=document.getElementById('photosTournantes');var x=container.offsetWidth-90;var y=container.offsetHeight-120;var espace=150/elements.length;for(i=0;i<elements.length;i++){position(elements[i],compteur+espace*i,x,y);}
compteur++;setTimeout('tourner('+val+')',80);}}
function position(element,val,x,y){var o=val/150*(Math.PI*2);var coefX=(Math.cos(o)+1)/2;var coefY=(Math.sin(o)+1)/2;var coef=(coefY+1)/2;var newX=coefX*x+20;var newY=coefY*y+20;var width=Math.round(coef*element[2]);var height=Math.round(coef*element[3]);var zindex=Math.round(coefY*100);element[0].style.left=newX+'px';element[0].style.top=newY+'px';element[0].style.zIndex=zindex;element[1].style.width=width+'px';element[1].style.height=height+'px';}
function ajouterElementsPhotos(blocPhotos,container){var node=blocPhotos.firstChild;elements=new Array();while(node){if(node.tagName&&node.tagName=="A"){var newNode=document.createElement('a');newNode.setAttribute('href',node.href);container.appendChild(newNode);newNode.style.position='absolute';var tab=new Array();tab[0]=newNode;var texte=node.textContent;newNode.setAttribute('onmouseover','survol(\''+node.textContent+'\')');newNode.setAttribute('onmouseout','finsurvol()');var child=node.firstChild;while(child){if(child.tagName){if(child.tagName=="IMG"){var newChild=document.createElement('img');newChild.setAttribute('src',child.src);newNode.appendChild(newChild);tab[1]=newChild;tab[2]=child.offsetWidth;tab[3]=child.offsetHeight;}}
child=child.nextSibling;}
elements.push(tab);}
node=node.nextSibling;}
return elements;}
function survol(texte){var text=document.getElementById('text');if(text){stopElipse=true;var node=document.createTextNode(texte);text.appendChild(node);}}
function finsurvol(){var text=document.getElementById('text');if(text){stopElipse=false;currentTimer++;tourner(currentTimer);var node=text.firstChild;while(node){var oldNode=node;node=node.nextSibling;text.removeChild(oldNode);}}};function afficherDessous(idObj,idRef){var obj=document.getElementById(idObj);var ref=document.getElementById(idRef);if(obj==null||ref==null){return;}
obj.style.left=ref.offsetLeft+'px';obj.style.top=(ref.offsetTop+ref.offsetHeight)+'px';obj.style.width=ref.offsetWidth+'px';obj.style.display="block";}
function set_active(nom)
{element=document.getElementById(nom);if(element!=null){element.style.backgroundColor="#BBBBBB";}}
