var imageArray=new Array;var activeImage;if(animate==true){overlayDuration=0.2;if(resizeSpeed>10){resizeSpeed=10;}
if(resizeSpeed<1){resizeSpeed=1;}
resizeDuration=(11-resizeSpeed)*0.15;}else{overlayDuration=0;resizeDuration=0;}
Object.extend(Element,{getWidth:function(element){element=$(element);return element.offsetWidth;},setWidth:function(element,w){element=$(element);element.style.width=w+"px";},setHeight:function(element,h){element=$(element);element.style.height=h+"px";},setTop:function(element,t){element=$(element);element.style.top=t+"px";},setLeft:function(element,l){element=$(element);element.style.left=l+"px";},setSrc:function(element,src){element=$(element);element.src=src;},setHref:function(element,href){element=$(element);element.href=href;},setInnerHTML:function(element,content){element=$(element);element.innerHTML=content;}});Array.prototype.removeDuplicates=function(){for(i=0;i<this.length;i++){for(j=this.length-1;j>i;j--){if(this[i][0]==this[j][0]){this.splice(j,1);}}}}
Array.prototype.empty=function(){for(i=0;i<=this.length;i++){this.shift();}}
var Lightbox=Class.create();Lightbox.prototype={initialize:function(){this.updateImageList();var objBody=document.getElementsByTagName("body").item(0);var objOverlay=document.createElement("div");objOverlay.setAttribute('id','overlay');objOverlay.style.display='none';objOverlay.onclick=function(){myLightbox.end();}
objBody.appendChild(objOverlay);var objLightbox=document.createElement("div");objLightbox.setAttribute('id','lightbox');objLightbox.style.display='none';objLightbox.onclick=function(e){if(!e)var e=window.event;var clickObj=Event.element(e).id;if(clickObj=='lightbox'){myLightbox.end();}};objBody.appendChild(objLightbox);var objOuterImageContainer=document.createElement("div");objOuterImageContainer.setAttribute('id','outerImageContainer');objLightbox.appendChild(objOuterImageContainer);if(animate){Element.setWidth('outerImageContainer',250);Element.setHeight('outerImageContainer',250);}else{Element.setWidth('outerImageContainer',1);Element.setHeight('outerImageContainer',1);}
var objImageContainer=document.createElement("div");objImageContainer.setAttribute('id','imageContainer');objOuterImageContainer.appendChild(objImageContainer);var objLightboxImage=document.createElement("img");objLightboxImage.setAttribute('id','lightboxImage');objImageContainer.appendChild(objLightboxImage);var objHoverNav=document.createElement("div");objHoverNav.setAttribute('id','hoverNav');objImageContainer.appendChild(objHoverNav);var objPrevLink=document.createElement("a");objPrevLink.setAttribute('id','prevLink');objPrevLink.setAttribute('href','#');objHoverNav.appendChild(objPrevLink);var objNextLink=document.createElement("a");objNextLink.setAttribute('id','nextLink');objNextLink.setAttribute('href','#');objHoverNav.appendChild(objNextLink);var objLoading=document.createElement("div");objLoading.setAttribute('id','loading');objImageContainer.appendChild(objLoading);var objLoadingLink=document.createElement("a");objLoadingLink.setAttribute('id','loadingLink');objLoadingLink.setAttribute('href','#');objLoadingLink.onclick=function(){myLightbox.end();return false;}
objLoading.appendChild(objLoadingLink);var objLoadingImage=document.createElement("img");objLoadingImage.setAttribute('src',fileLoadingImage);objLoadingLink.appendChild(objLoadingImage);var objImageDataContainer=document.createElement("div");objImageDataContainer.setAttribute('id','imageDataContainer');objLightbox.appendChild(objImageDataContainer);var objImageData=document.createElement("div");objImageData.setAttribute('id','imageData');objImageDataContainer.appendChild(objImageData);var objImageDetails=document.createElement("div");objImageDetails.setAttribute('id','imageDetails');objImageData.appendChild(objImageDetails);var objCaption=document.createElement("span");objCaption.setAttribute('id','caption');objImageDetails.appendChild(objCaption);var objNumberDisplay=document.createElement("span");objNumberDisplay.setAttribute('id','numberDisplay');objImageDetails.appendChild(objNumberDisplay);var objBottomNav=document.createElement("div");objBottomNav.setAttribute('id','bottomNav');objImageData.appendChild(objBottomNav);var objBottomNavCloseLink=document.createElement("a");objBottomNavCloseLink.setAttribute('id','bottomNavClose');objBottomNavCloseLink.setAttribute('href','#');objBottomNavCloseLink.onclick=function(){myLightbox.end();return false;}
objBottomNav.appendChild(objBottomNavCloseLink);var objBottomNavCloseImage=document.createElement("img");objBottomNavCloseImage.setAttribute('src',fileBottomNavCloseImage);objBottomNavCloseLink.appendChild(objBottomNavCloseImage);},updateImageList:function(){if(!document.getElementsByTagName){return;}
var anchors=document.getElementsByTagName('a');var areas=document.getElementsByTagName('area');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];var relAttribute=String(anchor.getAttribute('rel'));if(anchor.getAttribute('href')&&(relAttribute.toLowerCase().match('lightbox'))){anchor.onclick=function(){myLightbox.start(this);return false;}}}
for(var i=0;i<areas.length;i++){var area=areas[i];var relAttribute=String(area.getAttribute('rel'));if(area.getAttribute('href')&&(relAttribute.toLowerCase().match('lightbox'))){area.onclick=function(){myLightbox.start(this);return false;}}}},start:function(imageLink){hideSelectBoxes();hideFlash();var arrayPageSize=getPageSize();Element.setWidth('overlay',arrayPageSize[0]);Element.setHeight('overlay',arrayPageSize[1]);new Effect.Appear('overlay',{duration:overlayDuration,from:0.0,to:overlayOpacity});imageArray=[];imageNum=0;if(!document.getElementsByTagName){return;}
var anchors=document.getElementsByTagName(imageLink.tagName);if((imageLink.getAttribute('rel')=='lightbox')){imageArray.push(new Array(imageLink.getAttribute('href'),imageLink.getAttribute('title')));}else{for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute('href')&&(anchor.getAttribute('rel')==imageLink.getAttribute('rel'))){imageArray.push(new Array(anchor.getAttribute('href'),anchor.getAttribute('title')));}}
imageArray.removeDuplicates();while(imageArray[imageNum][0]!=imageLink.getAttribute('href')){imageNum++;}}
var arrayPageScroll=getPageScroll();var lightboxTop=arrayPageScroll[1]+(arrayPageSize[3]/10);var lightboxLeft=arrayPageScroll[0];Element.setTop('lightbox',lightboxTop);Element.setLeft('lightbox',lightboxLeft);Element.show('lightbox');this.changeImage(imageNum);},changeImage:function(imageNum){activeImage=imageNum;if(animate){Element.show('loading');}
Element.hide('lightboxImage');Element.hide('hoverNav');Element.hide('prevLink');Element.hide('nextLink');Element.hide('imageDataContainer');Element.hide('numberDisplay');imgPreloader=new Image();imgPreloader.onload=function(){Element.setSrc('lightboxImage',imageArray[activeImage][0]);myLightbox.resizeImageContainer(imgPreloader.width,imgPreloader.height);imgPreloader.onload=function(){};}
imgPreloader.src=imageArray[activeImage][0];},resizeImageContainer:function(imgWidth,imgHeight){this.widthCurrent=Element.getWidth('outerImageContainer');this.heightCurrent=Element.getHeight('outerImageContainer');var widthNew=(imgWidth+(borderSize*2));var heightNew=(imgHeight+(borderSize*2));this.xScale=(widthNew/this.widthCurrent)*100;this.yScale=(heightNew/this.heightCurrent)*100;wDiff=this.widthCurrent-widthNew;hDiff=this.heightCurrent-heightNew;if(!(hDiff==0)){new Effect.Scale('outerImageContainer',this.yScale,{scaleX:false,duration:resizeDuration,queue:'front'});}
if(!(wDiff==0)){new Effect.Scale('outerImageContainer',this.xScale,{scaleY:false,delay:resizeDuration,duration:resizeDuration});}
if((hDiff==0)&&(wDiff==0)){if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250);}else{pause(100);}}
Element.setHeight('prevLink',imgHeight);Element.setHeight('nextLink',imgHeight);Element.setWidth('imageDataContainer',widthNew);this.showImage();},showImage:function(){Element.hide('loading');new Effect.Appear('lightboxImage',{duration:resizeDuration,queue:'end',afterFinish:function(){myLightbox.updateDetails();}});this.preloadNeighborImages();},updateDetails:function(){if(imageArray[activeImage][1]){Element.show('caption');Element.setInnerHTML('caption',imageArray[activeImage][1]);}
if(imageArray.length>1){Element.show('numberDisplay');var chaine="";var max=imageArray.length;for(var ii=0;ii<imageArray.length;ii++)
{if(eval(activeImage)==ii)
{var actif=ii+1;}}
chaine=labelImage+' '+actif+' '+labelOf+' '+max;Element.setInnerHTML('numberDisplay',chaine);}
new Effect.Parallel([new Effect.SlideDown('imageDataContainer',{sync:true,duration:resizeDuration,from:0.0,to:1.0}),new Effect.Appear('imageDataContainer',{sync:true,duration:resizeDuration})],{duration:resizeDuration,afterFinish:function(){var arrayPageSize=getPageSize();Element.setHeight('overlay',arrayPageSize[1]);myLightbox.updateNav();}});var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters))
{old_src=lightboxImage.src;if((old_src.substring(old_src.length-3,old_src.length)=="PNG")||(old_src.substring(old_src.length-3,old_src.length)=="png"))
{h=lightboxImage.height;w=lightboxImage.width;lightboxImage.src='image/transparent.gif';lightboxImage.runtimeStyle.filter="progid:DXImageTransform.Microsoft."+"AlphaImageLoader(src='"+old_src+"',sizingMethod='scale')";Element.setHeight('lightboxImage',h);Element.setWidth('lightboxImage',w);}}},updateNav:function(){Element.show('hoverNav');if(activeImage!=0){Element.show('prevLink');document.getElementById('prevLink').onclick=function(){myLightbox.changeImage(activeImage-1);return false;}}
if(activeImage!=(imageArray.length-1)){Element.show('nextLink');document.getElementById('nextLink').onclick=function(){myLightbox.changeImage(activeImage+1);return false;}}
this.enableKeyboardNav();},enableKeyboardNav:function(){document.onkeydown=this.keyboardAction;},disableKeyboardNav:function(){document.onkeydown='';},keyboardAction:function(e){if(e==null){keycode=event.keyCode;escapeKey=27;}else{keycode=e.keyCode;escapeKey=e.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key=='x')||(key=='o')||(key=='c')||(keycode==escapeKey)){myLightbox.end();}else if((key=='p')||(keycode==37)){if(activeImage!=0){myLightbox.disableKeyboardNav();myLightbox.changeImage(activeImage-1);}}else if((key=='n')||(keycode==39)){if(activeImage!=(imageArray.length-1)){myLightbox.disableKeyboardNav();myLightbox.changeImage(activeImage+1);}}},preloadNeighborImages:function(){if((imageArray.length-1)>activeImage){preloadNextImage=new Image();preloadNextImage.src=imageArray[activeImage+1][0];}
if(activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=imageArray[activeImage-1][0];}},end:function(){this.disableKeyboardNav();Element.hide('lightbox');new Effect.Fade('overlay',{duration:overlayDuration});showSelectBoxes();showFlash();}}
function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll)
return arrayPageScroll;}
function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}
function getKey(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
key=String.fromCharCode(keycode).toLowerCase();if(key=='x'){}}
function listenKey(){document.onkeypress=getKey;}
function showSelectBoxes(){var selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible";}}
function hideSelectBoxes(){var selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}}
function showFlash(){var flashObjects=document.getElementsByTagName("object");for(i=0;i<flashObjects.length;i++){flashObjects[i].style.visibility="visible";}
var flashEmbeds=document.getElementsByTagName("embed");for(i=0;i<flashEmbeds.length;i++){flashEmbeds[i].style.visibility="visible";}}
function hideFlash(){var flashObjects=document.getElementsByTagName("object");for(i=0;i<flashObjects.length;i++){flashObjects[i].style.visibility="hidden";}
var flashEmbeds=document.getElementsByTagName("embed");for(i=0;i<flashEmbeds.length;i++){flashEmbeds[i].style.visibility="hidden";}}
function pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);}
function initLightbox(){myLightbox=new Lightbox();}
Event.observe(window,'load',initLightbox,false);


function XHRConnection(pdebug){var conn=false;var debug=(pdebug==true||pdebug==false)?pdebug:false;var datas=new String();var areaId=new String();var xmlObj;var xmlLoad;this.texte_renvoye="";try{conn=new XMLHttpRequest();}
catch(error){if(debug){alert('Erreur lors de la tentative de cr‚ation de l\'objet \nnew XMLHttpRequest()\n\n'+error);}
try{conn=new ActiveXObject("Microsoft.XMLHTTP");}
catch(error){if(debug){alert('Erreur lors de la tentative de cr‚ation de l\'objet \nnew ActiveXObject("Microsoft.XMLHTTP")\n\n'+error);}
try{conn=new ActiveXObject("Msxml2.XMLHTTP");}
catch(error){if(debug){alert('Erreur lors de la tentative de cr‚ation de l\'objet \nnew ActiveXObject("Msxml2.XMLHTTP")\n\n'+error);}
conn=false;}}}
this.setDebugOff=function(){debug=false;};this.setDebugOn=function(){debug=true;};this.resetData=function(){datas=new String();datas='';};this.appendData=function(pfield,pvalue){datas+=(datas.length==0)?pfield+"="+escape(pvalue):"&"+pfield+"="+escape(pvalue);};this.setRefreshArea=function(id){areaId=id;};this.createXMLObject=function(){try{xmlDoc=document.implementation.createDocument("","",null);xmlLoad='onload';}
catch(error){try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlLoad='onreadystatechange ';}
catch(error){if(debug){alert('Erreur lors de la tentative de cr‚ation de l\'objet XML\n\n');}
return false;}}
return xmlDoc;}
this.setXMLObject=function(obj){if(obj==undefined){if(debug){alert('Paramètre manquant lors de l\'appel de la méthode setXMLObject');}
return false;}
try{xmlObj=obj;}
catch(error){if(debug){alert('Erreur lors de l\'affectation de l\'objet XML dans la méthode setXMLObject');}}}
this.loadXML=function(xml,callBack){if(!conn)return false;if(xmlObj&&xml){if(typeof callBack=="function"){if(xmlLoad=='onload'){xmlObj.onload=callBack;}
else{xmlObj.onreadystatechange=function(){if(xmlObj.readyState==4)callBack()}}}
xmlObj.load(xml);return;}}
this.sendAndLoad=function(Url,httpMode,callBack,callNext,asynch){if(asynch==1){asynchrone=false;}else{asynchrone=true;}
httpMode=httpMode.toUpperCase();conn.onreadystatechange=function(){if(conn.readyState==4&&conn.status==200){if(typeof callBack=="function"){callBack(conn);}
if(areaId.length>0){try{document.getElementById(areaId).innerHTML=conn.responseText;}
catch(error){if(debug){alert('Echec, '+areaId+' n\'est pas un objet valide');}}}
else{texte_renvoye=conn.responseText;}
if(typeof callNext=="function"){callNext(conn);}
return;}};switch(httpMode){case"GET":try{Url=(datas.length>0)?Url+"?"+datas:Url;conn.open("GET",Url,asynchrone);conn.send(null);}
catch(error){if(debug){alert('Echec lors de la transaction avec '+Url+' via la méthode GET');}
return false;}
break;case"POST":try{conn.open("POST",Url,asynchrone);conn.setRequestHeader("Content-Type","application/x-www-form-urlencoded");conn.send(datas);}
catch(error){if(debug){alert('Echec lors de la transaction avec '+Url+' via la méthode POST');}
return false;}
break;default:return false;break;}
return true;};return this;}
function getElementsByTagNames(list,obj){if(!obj)var obj=document;var tagNames=list.split(',');var resultArray=new Array();for(var i=0;i<tagNames.length;i++){var tags=obj.getElementsByTagName(tagNames[i]);for(var j=0;j<tags.length;j++){resultArray.push(tags[j]);}}
var testNode=resultArray[0];if(!testNode)return[];if(testNode.sourceIndex){resultArray.sort(function(a,b){return a.sourceIndex-b.sourceIndex;});}
else if(testNode.compareDocumentPosition){resultArray.sort(function(a,b){return 3-(a.compareDocumentPosition(b)&6);});}
return resultArray;}
function LoadAndSave(nom_div,url,id_form,est_div)
{i=0;var XHR=new XHRConnection();XHR.appendData('demande_ajax',1);if(id_form!=""){XHR.appendData('send_ajax',1);if(est_div==1)
{ladiv=document.getElementById(id_form);tab_elem=getElementsByTagNames('input,select,textarea',ladiv);for(i=0;i<tab_elem.length;i++){name=tab_elem[i].name;if(tab_elem[i].type=='radio'&&tab_elem[i].checked==true){XHR.appendData(name,tab_elem[i].value);}
if(tab_elem[i].type=='checkbox'&&tab_elem[i].checked==true){XHR.appendData(name,tab_elem[i].value);}
if(tab_elem[i].type!='radio'&&tab_elem[i].type!='checkbox'){XHR.appendData(name,tab_elem[i].value);}}}
else
{nb=document.getElementById(id_form).length;for(i=0;i<nb;i++){name=document.getElementById(id_form).elements[i].name;if(document.getElementById(id_form).elements[i].type=='radio'&&document.getElementById(id_form).elements[i].checked==true){XHR.appendData(name,document.getElementById(id_form).elements[i].value);}
if(document.getElementById(id_form).elements[i].type=='checkbox'&&document.getElementById(id_form).elements[i].checked==true){XHR.appendData(name,document.getElementById(id_form).elements[i].value);}
if(document.getElementById(id_form).elements[i].type!='radio'&&document.getElementById(id_form).elements[i].type!='checkbox'){XHR.appendData(name,document.getElementById(id_form).elements[i].value);}}}}
if(nom_div!="")XHR.setRefreshArea(nom_div);XHR.sendAndLoad(url,"POST");}


function controlesaisie(obj,entier,autorise_negatif,limit){val=obj.value;if(!isNaN(val)){if(limit!=null)
if(val>=limit)
val=Math.floor(limit);if(entier==1)
val=Math.round(val);if((val<0)&&(autorise_negatif==0))
val=Math.abs(val);}
else{val=null;}
obj.value=val;if(val==null){obj.value="0";return false;}
else
return true;}
function iFrameHeight(id){var h=0;if(!document.all){h=document.getElementById(id).contentDocument.height;document.getElementById(id).style.height=h+60+'px';}else if(document.all){h=document.frames(id).document.body.scrollHeight;eval("document.all."+id+".style.height = h + 60 + 'px';");}}
function hauteur_iframe(id){var h=0;if(!document.all){h=document.getElementById(id).contentDocument.height;}else if(document.all){h=document.frames(id).document.body.scrollHeight;}
return h+20;}
function iFrameWidth(id){var w=0;if(!document.all){w=document.getElementById(id).contentDocument.width;document.getElementById(id).style.width=w+20+'px';}else if(document.all){w=document.frames(id).document.body.scrollWidth;eval("document.all."+id+".style.width = w + 20 + 'px';");}}
var t_zoom_image=new Array();function zoom_image_over(id,w_min,h_min,w_max,h_max){i=t_zoom_image.length;if(i>0)z=t_zoom_image[i-1]["zindex"]+1;else z=2;document.getElementById("conteneur_"+id).style.zIndex=z;t_zoom_image[i]=new Array();t_zoom_image[i]["id"]=id;t_zoom_image[i]["w_min"]=w_min;t_zoom_image[i]["h_min"]=h_min;t_zoom_image[i]["w_max"]=w_max;t_zoom_image[i]["h_max"]=h_max;t_zoom_image[i]["boucle"]=0;t_zoom_image[i]["zindex"]=z;t_zoom_image[i]["interval"]=setInterval("zoom_image_anim_over("+i+")",20);}
function zoom_image_anim_over(i){t_zoom_image[i]["boucle"]++;w_augmentation=Math.round((t_zoom_image[i]["w_max"]-t_zoom_image[i]["w_min"])/10*t_zoom_image[i]["boucle"]);h_augmentation=Math.round((t_zoom_image[i]["h_max"]-t_zoom_image[i]["h_min"])/10*t_zoom_image[i]["boucle"]);document.getElementById(t_zoom_image[i]["id"]).style.left=(-Math.round(w_augmentation/2))+"px";document.getElementById(t_zoom_image[i]["id"]).style.top=(-Math.round(h_augmentation/2))+"px";document.getElementById(t_zoom_image[i]["id"]).style.width=(t_zoom_image[i]["w_min"]+w_augmentation)+"px";document.getElementById(t_zoom_image[i]["id"]).style.height=(t_zoom_image[i]["h_min"]+h_augmentation)+"px";if(t_zoom_image[i]["boucle"]==10){clearInterval(t_zoom_image[i]["interval"]);}}
function zoom_image_out(){i=t_zoom_image.length-1;clearInterval(t_zoom_image[i]["interval"]);t_zoom_image[i]["interval"]=setInterval("zoom_image_anim_out("+i+")",20);}
function zoom_image_anim_out(i){t_zoom_image[i]["boucle"]--;if(t_zoom_image[i]["boucle"]>0){w_augmentation=Math.round((t_zoom_image[i]["w_max"]-t_zoom_image[i]["w_min"])/10*t_zoom_image[i]["boucle"]);h_augmentation=Math.round((t_zoom_image[i]["h_max"]-t_zoom_image[i]["h_min"])/10*t_zoom_image[i]["boucle"]);document.getElementById(t_zoom_image[i]["id"]).style.left=(-Math.round(w_augmentation/2))+"px";document.getElementById(t_zoom_image[i]["id"]).style.top=(-Math.round(h_augmentation/2))+"px";document.getElementById(t_zoom_image[i]["id"]).style.width=(t_zoom_image[i]["w_min"]+w_augmentation)+"px";document.getElementById(t_zoom_image[i]["id"]).style.height=(t_zoom_image[i]["h_min"]+h_augmentation)+"px";}
else{clearInterval(t_zoom_image[i]["interval"]);document.getElementById("conteneur_"+t_zoom_image[i]["id"]).style.zIndex=1;document.getElementById(t_zoom_image[i]["id"]).style.left="0px";document.getElementById(t_zoom_image[i]["id"]).style.top="0px";document.getElementById(t_zoom_image[i]["id"]).style.width=t_zoom_image[i]["w_min"]+"px";document.getElementById(t_zoom_image[i]["id"]).style.height=t_zoom_image[i]["h_min"]+"px";}}
var obj_lien="";var obj_fenetre="";var obj_contenu="";function set_lien(lien,fenetre,contenu){obj_lien.value=lien;obj_fenetre.value=fenetre;obj_contenu.value=contenu;}
function editer_lien(lien,fenetre,contenu){obj_lien=lien;obj_fenetre=fenetre;obj_contenu=contenu;if(obj_fenetre.value==0)fenetre="false";else fenetre="true";affiche_popup('../admin/page_intranet_pop_lien.php?lien='+obj_lien.value+'&fenetre='+fenetre+'&contenu='+obj_contenu.value);}
function set_date(d,chemin,envoi,forme,id){if(id==1)
{elem=document.getElementById(chemin);elem.value=d;}
else
eval(chemin+".value='"+d+"';");if(envoi==1)eval("document."+forme+".submit();")}
function pop_date(d,chemin,envoi,forme,id){MM_openBrWindow('calendrier.php?date_origine='+d+'&chemin='+chemin+'&envoi='+envoi+'&forme='+forme+'&id='+id,'','width=200,height=167')}
function findPosX(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;}
function findPosY(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curleft+=obj.offsetTop;obj=obj.offsetParent;}}
else if(obj.y)
curleft+=obj.y;return curleft;}
function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&id.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_CheckFlashVersion(reqVerStr,msg){with(navigator){var isIE=(appVersion.indexOf("MSIE")!=-1&&userAgent.indexOf("Opera")==-1);var isWin=(appVersion.toLowerCase().indexOf("win")!=-1);if(!isIE||!isWin){var flashVer=-1;if(plugins&&plugins.length>0){var desc=plugins["Shockwave Flash"]?plugins["Shockwave Flash"].description:"";desc=plugins["Shockwave Flash 2.0"]?plugins["Shockwave Flash 2.0"].description:desc;if(desc=="")flashVer=-1;else{var descArr=desc.split(" ");var tempArrMajor=descArr[2].split(".");var verMajor=tempArrMajor[0];var tempArrMinor=(descArr[3]!="")?descArr[3].split("r"):descArr[4].split("r");var verMinor=(tempArrMinor[1]>0)?tempArrMinor[1]:0;flashVer=parseFloat(verMajor+"."+verMinor);}}
else if(userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=4.0;var verArr=reqVerStr.split(",");var reqVer=parseFloat(verArr[0]+"."+verArr[2]);if(flashVer<reqVer){if(confirm(msg))
window.location="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";}}}
if(document.getElementById(GenPageStat))
document.getElementById(GenPageStat).style.display='none';}
function BackToTheHtml(node)
{if(node==null)
this.node=document;else
this.node=node;};BackToTheHtml.prototype.node=null;BackToTheHtml.prototype.execute=function()
{this.activateObject();}
BackToTheHtml.prototype.activateObject=function(domObject)
{var aDomObject=this.node.getElementsByTagName('object');var activationObject;for(var i=0;i<aDomObject.length;i++)
if
((aDomObject[i].getAttributeNode('BackToTheHtml')==null)&&(activationObject=this.getActivationObject(aDomObject[i]))!=null)
activationObject.execute();};BackToTheHtml.prototype.getActivationObject=function(domObject)
{var classid=domObject.classid.toUpperCase().substr('clsid:'.length);var mimeType=domObject.type.toLowerCase();switch(true)
{case
classid=='D27CDB6E-AE6D-11CF-96B8-444553540000'||mimeType=='application/x-shockwave-flash':return new ActivateObjectFlash(domObject);default:return null;}};BackToTheHtml.uniqueID=function(prefix)
{var sPrefix;if(prefix==null)
sPrefix='uniqueId';else
sPrefix=prefix;var i=0;while(document.getElementById(sPrefix+(i++)));return sPrefix+(i-1);};BackToTheHtml.isParentOf=function(parent,child)
{var found=false;for(var i=0;i<parent.childNodes.length;i++)
if(parent.childNodes[i]==child)
return true;else
found=arguments.callee(parent.childNodes[i],child);return found;}
function ActivateObject(domObject)
{this.domObject=domObject;}
ActivateObject.prototype.domObject=null;ActivateObject.prototype.classid=null;ActivateObject.prototype.aHtmlAttribute=['accessKey','align','alt','archive','border','code','codeBase','codeType','declare','dir','height','hideFocus','hspace','lang','language','name','standby','tabIndex','title','useMap','vspace','width'];ActivateObject.prototype.aObjectProperty=null;ActivateObject.prototype.execute=function()
{this.xndObjectId=BackToTheHtml.uniqueID();this.setTextHtml();this.writeObject();this.xndObject=document.getElementById(this.xndObjectId);this.setSpecialProperties();this.removeOriginalObject();}
ActivateObject.prototype.setTextHtml=function()
{var str='';str+='<object BackToTheHtml '+'\n';str+=' classid="clsid:'+this.classid+'" '+'\n';for(var i=0;i<this.aHtmlAttribute.length;i++)
{var name=this.aHtmlAttribute[i];if(typeof this.domObject[name]!='undefined'&&this.domObject[name].toString()!='')
str+='\t'+name+'="'+this.domObject[name].toString()+'" '+'\n';}
str+='id="'+this.xndObjectId+'" '+'\n';str+='>';for(var i=0;i<this.aObjectProperty.length;i++)
{var name=this.aObjectProperty[i];if(typeof this.domObject[name]!='undefined'&&this.domObject[name].toString()!='')
str+='\t<param name="'+name+'" value="'+this.domObject[name].toString()+'"></param>'+'\n';}
str+='</object>';this.textHtml=str;};ActivateObject.prototype.writeObject=function()
{this.domObject.insertAdjacentHTML("afterEnd",this.textHtml);};ActivateObject.prototype.setSpecialProperties=function()
{if(typeof this.domObject.className!='undefined'&&this.domObject.className.toString()!='')
this.xndObject.className=this.domObject.className
if(typeof this.domObject.style.cssText!='undefined'&&this.domObject.style.cssText.toString()!='')
this.xndObject.style.cssText=this.domObject.style.cssText;if(typeof this.domObject.SWRemote!='undefined'&&this.domObject.SWRemote.toString()!='')
this.xndObject.FlashVars=this.domObject.SWRemote;if(typeof this.domObject.codebase=='undefined'||this.domObject.codebase.toString()=='')
this.xndObject.codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0';if(typeof this.domObject.id!='undefined'&&this.domObject.id.toString()!='')
this.xndObject.id=this.domObject.id;};ActivateObject.prototype.removeOriginalObject=function()
{this.domObject.parentNode.removeChild(this.domObject);};function ActivateObjectFlash(domObject)
{ActivateObject.call(this,domObject);}
ActivateObjectFlash.prototype=new ActivateObject;ActivateObjectFlash.prototype.aObjectProperty=['FrameNum','Playing','Quality','Quality2','Scalemode','Scale','AlignMode','SAlign','BackgroundColor','BGColor','Loop','Movie','WMode','Base','DeviceFont','EmbedMovie','SWRemote','FlashVars','AllowScriptAccess'];ActivateObjectFlash.prototype.classid='D27CDB6E-AE6D-11CF-96B8-444553540000';if(typeof ActiveXObject!='undefined'&&typeof Function.call!='undefined')
{var styleId=BackToTheHtml.uniqueID();document.write('<style id="'+styleId+'" ></style>');var domStyle=document.getElementById(styleId);var isHead=false;var aHead=document.getElementsByTagName('head');for(var i=0;i<aHead.length;i++)
if(BackToTheHtml.isParentOf(aHead[i],domStyle))
isHead=true;if(isHead)
{document.write('<style type="text/css">OBJECT{visibility:hidden;}</style>');document.onreadystatechange=function()
{if(document.readyState=='complete')
{new BackToTheHtml().execute();document.styleSheets[document.styleSheets.length-1].addRule("OBJECT","visibility:visible;");}}}
else
{new BackToTheHtml().execute();}
domStyle.parentNode.removeChild(domStyle);}


var obj_color="";var Timer;function set_couleur(couleur){obj_color.value=couleur;if(couleur!=0){document.all['image_'+obj_color.name].style.backgroundColor='#'+couleur;document.all['image_'+obj_color.name].style.backgroundImage='url(image/transparent.gif)';}}
function editer_couleur(obj){obj_color=obj;change_page('xml_pop_couleur.php?couleur='+obj.value,'','1');}
function del(){return confirm("Etes vous sur de vouloir supprimer ?");}
function vider(){return confirm("Etes vous sur de vouloir vider le contenu de la facture ?");}
function del_art(){return confirm("Etes vous sur de vouloir supprimer un article");}
function del_contrat(){return confirm("Etes vous sur de vouloir supprimer un contrat");}
function arch(){return confirm("Etes vous sur de vouloir archiver");}
function enreg(){return confirm("Etes vous sur de vouloir enregistrer les modifications");}
function del_dossier(){return confirm("Ce dossier contient peut-être des e-mails. Confirmez la suppression");}
function del_compte(){return confirm("Vous allez perdre les messages ainsi que les dossiers associés à ce compte. Confirmez la suppression");}
function del_user(){return confirm("Vous allez perdre les taches, rendez-vous et contacts associés à cet utilisateur. Confirmez la suppression");}
function del_facture(type){if(type!=undefined)
type="de "+type;else
type="";return confirm("Etes vous sur de vouloir valider la facture "+type);}
function del_fact_ligne(){return confirm("Etes vous sur de vouloir supprimer la ligne de facture");}
function del_facture_art_offert(){return confirm("Etes vous sur de vouloir supprimer l'article offert de la facture");}
function del_liste_noire(){return confirm("Confirmez la libération de cette adresse email");}
function setPointer(theRow,theAction,theDefaultColor,thePointerColor,theMarkColor)
{var theCells=null;if((thePointerColor==''&&theMarkColor=='')||typeof(theRow.style)=='undefined'){return false;}
if(typeof(document.getElementsByTagName)!='undefined'){theCells=theRow.getElementsByTagName('td');}
else if(typeof(theRow.cells)!='undefined'){theCells=theRow.cells;}
else{return false;}
var rowCellsCnt=theCells.length;var domDetect=null;var currentColor=new String('');var newColor=null;if(typeof(window.opera)=='undefined'&&typeof(theCells[0].getAttribute)!='undefined'){currentColor=theCells[0].getAttribute('bgcolor');domDetect=true;}
else{currentColor=theCells[0].style.backgroundColor;domDetect=false;}
if(currentColor==null)currentColor=new String('');if(currentColor==''||currentColor.toLowerCase()==theDefaultColor.toLowerCase()){if(theAction=='over'&&thePointerColor!=''){newColor=thePointerColor;}
else if(theAction=='click'&&theMarkColor!=''){newColor=theMarkColor;}}
else if(currentColor.toLowerCase()==thePointerColor.toLowerCase()){if(theAction=='out'){newColor=theDefaultColor;}
else if(theAction=='click'&&theMarkColor!=''){newColor=theMarkColor;}}
else if(currentColor.toLowerCase()==theMarkColor.toLowerCase()){if(theAction=='click'){newColor=(thePointerColor!='')?thePointerColor:theDefaultColor;}}
if(newColor){var c=null;if(domDetect){for(c=0;c<rowCellsCnt;c++){theCells[c].setAttribute('bgcolor',newColor,0);}}
else{for(c=0;c<rowCellsCnt;c++){theCells[c].style.backgroundColor=newColor;}}}
return true;}
function setOpacity(obj,opacity){opacity=(opacity==100)?99.999:opacity;obj.style.filter="alpha(opacity:"+opacity+")";obj.style.KHTMLOpacity=opacity/100;obj.style.MozOpacity=opacity/100;obj.style.opacity=opacity/100;}
function fadeIn(objId,start_opacity,end_opacity,full_screen,cache_select,no_fade){if(optimisation_performance=="1")no_fade=1;if(cache_select==1)cacher_select();if(document.getElementById){obj=document.getElementById(objId);if(full_screen==1){if(navigator.appName!="Microsoft Internet Explorer"){obj.style.height=document.body.clientHeight+"px";obj.style.width=document.body.clientWidth+"px";}else{obj.style.height=document.documentElement.scrollHeight+"px";obj.style.width=document.documentElement.scrollWidth+"px";}}
obj.style.display="block";if(no_fade!=1){if(start_opacity<=end_opacity){setOpacity(obj,start_opacity);start_opacity+=20;window.setTimeout("fadeIn('"+objId+"',"+start_opacity+","+end_opacity+")",5);}}
else{setOpacity(obj,end_opacity);}}}
function fadeOut(objId,start_opacity,end_opacity,aff_select,no_fade){if(objId==undefined||objId=='')objId="div_pop";if(optimisation_performance=="1")no_fade=1;if(document.getElementById){obj=document.getElementById(objId);if(no_fade!=1){if(start_opacity>=end_opacity){setOpacity(obj,start_opacity);start_opacity-=20;window.setTimeout("fadeOut('"+objId+"',"+start_opacity+","+end_opacity+","+aff_select+")",5);}}
else{start_opacity=0;end_opacity=0;}
if(start_opacity<=end_opacity){obj.style.display="none";if(aff_select==1)afficher_select();}}}
function cacher_select()
{ss=window.document.getElementsByTagName("select");for(var i=0;i<ss.length;i++){ss[i].style.visibility='hidden';}
p=window.iframe_contenu;if(p!=undefined){ss2=window.iframe_contenu.document.getElementsByTagName("select");for(var i=0;i<ss2.length;i++){ss2[i].style.visibility='hidden';}}}
function afficher_select()
{ss=window.document.getElementsByTagName("select");for(var i=0;i<ss.length;i++){ss[i].style.visibility='visible';}
p=window.iframe_contenu;if(p!=undefined){ss2=window.iframe_contenu.document.getElementsByTagName("select");for(var i=0;i<ss2.length;i++){ss2[i].style.visibility='visible';}}}
function loadNewDiv(url,id,no_style,no_fade,no_cacher_select){if(no_cacher_select=="undefined"){cacher_select();}
document.body.style.overflow='hidden';document.getElementById(id).innerHTML='<div align="center" style="padding:20px;"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="300" height="30"><param name="movie" value="images/loading.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="image/loading.swf" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="30"></embed></object></div>';var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest();else
if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP");xhr_object.open("POST",url,true);xhr_object.onreadystatechange=function(){if(xhr_object.readyState==4)
{if(no_style==1){document.getElementById(id).className="";}
else{document.getElementById(id).className="div_popup";}
document.getElementById(id).innerHTML=xhr_object.responseText;}}
xhr_object.send(null);fadeIn("masque",0,60,1,1,no_fade);fadeIn(id,0,100,0,0,no_fade);}
function reduce_div(id,no_fade){fadeOut("masque",60,0,0,no_fade);fadeOut(id,100,0,1,no_fade);document.body.style.overflow='';}
function fermer_session(){loadNewDiv("fermer_session.php","div_pop_old",1);}
function affiche_popup(url,url_retour,no_fade,nom_div_popup,nom_iframe_popup,nom_iframe_contenu){if(url_retour==undefined)url_retour="";if(nom_div_popup==undefined||nom_div_popup=='')nom_div_popup="div_pop";if(nom_iframe_popup==undefined||nom_iframe_popup=='')nom_iframe_popup="iframe_popup";if(nom_iframe_contenu==undefined||nom_iframe_contenu=='')nom_iframe_contenu="iframe_contenu";if(no_fade==undefined)no_fade="";eval("document.getElementById(\"bouton_fermer_popup\").onclick=function (){ fermer_popup('"+url_retour+"','"+no_fade+"','"+nom_div_popup+"','"+nom_iframe_popup+"','"+nom_iframe_contenu+"'); };");if(no_fade==1){fadeIn("masque",60,60,1,1);fadeIn("div_pop",100,100,0,0);}
else{fadeIn("masque",0,60,1,1);fadeIn("div_pop",0,100,0,0);}
if(document.all)window.eval(nom_iframe_popup).set_lien_ajax(url);else document.getElementById(nom_iframe_popup).contentWindow.set_lien_ajax(url);}
function fermer_popup(url_retour,no_fade,nom_div_pop){if(nom_div_pop=='undefined'||nom_div_pop=='')nom_div_pop="div_pop";if(no_fade==1){fadeOut("masque",0,0,0);fadeOut(nom_div_pop,0,0,1);}
else{fadeOut("masque",60,0,0);fadeOut(nom_div_pop,100,0,1);}
if(url_retour!=""){if(document.getElementById("iframe_contenu")){document.getElementById("iframe_contenu").src=url_retour;}
else{document.location.href=url_retour;}}
window.iframe_popup.vider_page();}
var categorie_initial=new Array();function charge_categorie(parent,niveau_categorie,type_categorie,nom_champ){var XHR_categorie=new XHRConnection();XHR_categorie.appendData('retour[niveau_categorie]',niveau_categorie);XHR_categorie.appendData('retour[type_categorie]',type_categorie);XHR_categorie.appendData('retour[nom_champ]',nom_champ);XHR_categorie.appendData('type',type_categorie);XHR_categorie.appendData('id',parent);XHR_categorie.sendAndLoad("../ajax/recherche.php","GET",affiche_categorie);}
function affiche_categorie(obj){s="";var tabResult=obj.responseXML.getElementsByTagName('resultat');var niveau_categorie=obj.responseXML.getElementsByTagName('niveau_categorie').item(0).getAttribute('value')*1;var type_categorie=obj.responseXML.getElementsByTagName('type_categorie').item(0).getAttribute('value');var nom_champ=obj.responseXML.getElementsByTagName('nom_champ').item(0).getAttribute('value');for(i=0;i<tabResult.length;i++){resultat=tabResult.item(i);if(categorie_initial[nom_champ][niveau_categorie]==resultat.getAttribute('id'))selected=" selected";else selected="";s+="<option value='"+resultat.getAttribute('id')+"'"+selected+">"+resultat.getAttribute('titre')+"</option>";}
if(niveau_categorie>0)slash="&nbsp;/ ";else slash="";if(s!="")s="<div style='float:left;'>"+slash+"<select name='"+nom_champ+"_"+niveau_categorie+"' id='"+nom_champ+"_"+niveau_categorie+"' class='liste-deroulante' onChange='change_categorie("+niveau_categorie+",\""+type_categorie+"\",\""+nom_champ+"\")'><option value=''></option>"+s+"</select> </div><div id='refresh_"+nom_champ+"_"+(niveau_categorie+1)+"'></div>";document.getElementById('refresh_'+nom_champ+'_'+niveau_categorie).innerHTML=s;if(categorie_initial[nom_champ][niveau_categorie]!=undefined){categorie_initial[nom_champ][niveau_categorie]=undefined;change_categorie(niveau_categorie,type_categorie,nom_champ);}}
function change_categorie(niveau,type_categorie,nom_champ){id=document.getElementById(nom_champ+'_'+niveau).value;if(id==""){if(niveau>0)id=document.getElementById(nom_champ+'_'+(niveau-1)).value;else id="";document.getElementById(nom_champ).value=id;document.getElementById('refresh_'+nom_champ+'_'+(niveau+1)).innerHTML="";}
else{document.getElementById(nom_champ).value=id;charge_categorie(id,niveau+1,type_categorie,nom_champ);}}
function affichageElement(string_idElement,bool_OuiNon){if(bool_OuiNon){document.getElementById(string_idElement).style.display='';}else{document.getElementById(string_idElement).style.display='none';}}
function affichagecacheElement(string_idElement){if(document.getElementById(string_idElement).style.display=='none'){document.getElementById(string_idElement).style.display='';}else{document.getElementById(string_idElement).style.display='none';}}
var t_memorise_formulaire=new Array();function memorise_formulaire(nom_form,cible)
{if(nom_form!=""){if(cible==undefined)w=window;else eval("w=window."+cible+";");t_memorise_formulaire[nom_form]=new Array();nb=w.document[nom_form].length;for(i=0;i<nb;i++){name=w.document[nom_form].elements[i].name;if(w.document[nom_form].elements[i].type=='radio'&&w.document[nom_form].elements[i].checked==true){t_memorise_formulaire[nom_form][name]=w.document[nom_form].elements[i].value;}
if(w.document[nom_form].elements[i].type=='checkbox'&&w.document[nom_form].elements[i].checked==true){t_memorise_formulaire[nom_form][name]=w.document[nom_form].elements[i].value;}
if(w.document[nom_form].elements[i].type!='radio'&&w.document[nom_form].elements[i].type!='checkbox'){t_memorise_formulaire[nom_form][name]=w.document[nom_form].elements[i].value;}}}}
function compare_formulaire(nom_form,cible)
{if(nom_form!=""){if(cible==undefined)w=window;else eval("w=window."+cible+";");t=new Array();k=0;nb=w.document[nom_form].length;for(i=0;i<nb;i++){name=w.document[nom_form].elements[i].name;if(w.document[nom_form].elements[i].type=='radio'&&w.document[nom_form].elements[i].checked==true){t[k]=new Array();t[k]['name']=name;t[k]['value']=w.document[nom_form].elements[i].value;k++;}
if(w.document[nom_form].elements[i].type=='checkbox'&&w.document[nom_form].elements[i].checked==true){t[k]=new Array();t[k]['name']=name;t[k]['value']=w.document[nom_form].elements[i].value;k++;}
if(w.document[nom_form].elements[i].type!='radio'&&w.document[nom_form].elements[i].type!='checkbox'){t[k]=new Array();t[k]['name']=name;t[k]['value']=w.document[nom_form].elements[i].value;k++;}}
for(i=0;i<t.length;i++){if(t[i]['value']!=t_memorise_formulaire[nom_form][t[i]['name']])return false;}
return true;}
return true;}
function check_form(cible,message_erreur){if(cible==undefined||cible=="")w=window;else eval("w=window."+cible+";");bool=true;if(typeof w.get_champ_obligatoire=="function"){t=w.get_champ_obligatoire();for(i=0;i<t.length;i++){if(w.document.getElementById(t[i]["champ"])!=undefined&&w.document.getElementById(t[i]["label"])!=undefined){if(w.document.getElementById(t[i]["champ"]).value==""){w.document.getElementById(t[i]["label"]).style.color="#FF0000";bool=false;}
else{w.document.getElementById(t[i]["label"]).style.color="";}
w.document.getElementById(t[i]["champ"]).onchange=function(){w.check_form()};}}}
if(message_erreur==1&&!bool)alert("Tous les champs obligatoires ne sont pas remplis.");return bool;}
function goMap24(){Map24.loadApi(["core_api","wrapper_api"],init_map);}
function goMap24_no_carte(){Map24.loadApi(["core_api","wrapper_api"],DoNothing);}
function init_map()
{Map24.MapApplication.init({NodeName:"maparea"});}
function DoNothing()
{Map24.MapApplication.Map=new Map24.Map();}
function get_lg_lt_map24(adresse,cp,ville,callback)
{if(Map24.trim(adresse+" "+cp+" "+ville)==""){return;}
var geocoder=new Map24.GeocoderServiceStub();if(callback==undefined)
callback=ResultGeocode;geocoder.geocode({SearchText:Map24.trim(adresse+" "+cp+" "+ville),MaxNoOfAlternatives:10,CallbackFunction:callback});}
function get_lg_lt_map24_world(adresse,cp,ville,dep,pays,callback)
{if(Map24.trim(adresse+" "+cp+" "+ville+" "+dep+" "+pays)==""){return;}
var geocoder=new Map24.GeocoderServiceStub();if(callback==undefined)
callback=ResultGeocode;geocoder.geocode({SearchText:Map24.trim(adresse+" "+cp+" "+ville),MaxNoOfAlternatives:10,CallbackFunction:callback});}
function ResultGeocodeAdresse(locs)
{alert(locs[0].getLongitude());alert(locs[0].getLatitude());}
function format_mel(champ)
{var _Mel=document.getElementById(champ);if(_Mel.value!="")
{var usr="([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";var domain="([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";var regex="^"+usr+"\@"+domain+"$";var rgx=new RegExp(regex);var etat=rgx.exec(_Mel.value);if(!etat)
{alert('Veuillez saisir une adresse E-Mail de la forme : X@X.XX');document.getElementById(champ).focus();}
else
{return'valide';}}}
function alert_liste_creer_panier()
{if(document.getElementById("titre_panier").options[document.getElementById("titre_panier").selectedIndex].value==""&&document.getElementById("maj_panier").checked==true)
{document.getElementById('erreur_vide').style.display='block';document.getElementById("pop_contenu").style.display="block";}
else if(document.getElementById("nom_panier").value==""&&document.getElementById("maj_panier").checked==false)
{document.getElementById('erreur_vide').style.display='block';document.getElementById("nom_panier").focus();}
else
{document.getElementById("pop_contenu").style.display="none";document.getElementById("mess").style.display="block";}}
function alert_creer_panier()
{if(document.getElementById("nom_panier").value=="")
{document.getElementById('erreur_vide').style.display='block';document.getElementById("nom_panier").focus();}
else
{document.getElementById("pop_contenu").style.display="none";document.getElementById("mess").style.display="block";}}
function alert_mail_envoyer_vide()
{var mail=document.getElementById("adresse_mel");if(mail.value!="")
{var usr="([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";var domain="([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";var regex="^"+usr+"\@"+domain+"$";var rgx=new RegExp(regex);var etat=rgx.exec(mail.value);if(!etat)
{statut=0;}
else
{statut=1;}}
if(mail.value=="")
{document.getElementById("mess_mail").style.display="none";document.getElementById("erreur_mail").style.display="block";mail.focus();}
else if(mail.value!=""&&statut==0)
{document.getElementById("mess_mail").style.display="none";document.getElementById("erreur_mail").style.display="block";mail.value='';mail.focus();}
else if(mail.value!=""&&statut==1)
{document.getElementById("pop_contenu").style.display="none";document.getElementById("mess").style.display="block";}}
function masquer_pop_message()
{if(document.getElementById("boite_message_boite"))
{document.getElementById("boite_message_boite").style.display="none";}
if(document.getElementById("boite_message_fond"))
{document.getElementById("boite_message_fond").style.display="none";}
if(document.getElementById("boite_message"))
{document.getElementById("boite_message").style.display="none";}
document.getElementById("boite_message_fond").style.display="none";if(jQuery('#jquery-overlay'))
jQuery('#jquery-overlay').fadeOut(function(){jQuery('#jquery-overlay').remove();});}
function format_tel(champ)
{var _Champ=document.getElementById(champ);var valeur=_Champ.value;return(valeur);}
function format_jour(jour,mois)
{var _Jour=document.getElementById(jour);var _Mois=document.getElementById(mois);if(_Jour.value>31)
{_Jour.value=31;}
if(_Jour.value.length==2)
{_Mois.focus();_Mois.select();_Mois.value='';}}
function format_mois(jour,mois,annee)
{var _Jour=document.getElementById(jour);var _Mois=document.getElementById(mois);var _Annee=document.getElementById(annee);if(_Mois.value>12){_Mois.value=12;}
if(_Jour.value=='')
{_Jour.value='01';}
if(_Mois.value.length==2){_Annee.focus();_Annee.select();_Annee.value='';}}
function calculer_prix()
{var XHR=new XHRConnection();XHR.appendData('demande_ajax',1);XHR.appendData('del',document.getElementById('del').value);XHR.appendData('info_del',document.getElementById('info_del').value);XHR.appendData('vider',document.getElementById('vider').value);if(document.getElementById('commentaire'))
XHR.appendData('commentaire',document.getElementById('commentaire').value);for(i=0;i<document.form_panier.length;i++)
{if(document.form_panier[i].id.indexOf('quantite')!=-1)
{var id=document.form_panier[i].id;if(document.getElementById(id))
XHR.appendData(document.form_panier[i].name,document.getElementById(id).value);}}
XHR.sendAndLoad("../ajax/ajax_panier.php","POST",refresh_panier);}
function refresh_panier(obj)
{document.getElementById('refresh_panier').innerHTML=obj.responseText;if(document.getElementById('refresh_panier_header'))lance_refresh_header_panier();}
function lance_refresh_header_panier()
{var XHR=new XHRConnection();XHR.appendData('demande_ajax',1);XHR.sendAndLoad("../ajax/ajax_panier_header.php","POST",refresh_panier_header);}
function refresh_panier_header(obj)
{var text=obj.responseText;text=text.replace('--##--','&euro;');if(document.getElementById('refresh_panier_header'))
document.getElementById('refresh_panier_header').innerHTML=text;}
function lance_refresh_boite_panier()
{var XHR=new XHRConnection();XHR.appendData('demande_ajax',1);XHR.appendData('id_menu',document.getElementById('id_menu_en_cours').value);XHR.sendAndLoad("../ajax/ajax_boite_panier.php","POST",refresh_boite_panier);}
function lance_refresh_boite_comparateur()
{var XHR=new XHRConnection();XHR.appendData('demande_ajax',1);XHR.appendData('id_menu',document.getElementById('id_menu_en_cours').value);XHR.sendAndLoad("../ajax/ajax_boite_comparateur.php","POST",refresh_boite_comparateur);}
function lance_refresh_comparateur()
{var XHR=new XHRConnection();XHR.appendData('demande_ajax',1);XHR.appendData('id_menu','comparateur');XHR.sendAndLoad("../ajax/ajax_comparateur.php","POST",refresh_comparateur);}
function refresh_boite_panier(obj)
{eval(obj.responseText);if(document.getElementById('refresh_panier_header'))lance_refresh_header_panier();}
function refresh_boite_comparateur(obj)
{eval(obj.responseText);}
function refresh_comparateur(obj)
{eval(obj.responseText);}
function remplir_boite(obj)
{if(obj.responseText=="34")
location.href="home.php";if(navigator.appName=="Microsoft Internet Explorer")
{ScrollY=document.documentElement.scrollTop+document.body.scrollTop;ScrollX=document.documentElement.scrollLeft+document.body.scrollLeft;}
else
{ScrollY=window.pageYOffset;ScrollX=window.pageXOffset;}
var View={width:(window.innerWidth?window.innerWidth:(document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.clientWidth),height:(window.innerHeight?window.innerHeight:(document.documentElement&&document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight)}
document.getElementById('boite_message_boite').innerHTML=obj.responseText;width_boite='300';height_boite='400';if(document.all)
{xleft=(window.document.body.clientWidth/2)-(width_boite/2)+'px';xlongueur=window.document.body.clientWidth+'px';xtop=((window.document.body.clientHeight+document.documentElement.scrollTop+document.body.scrollTop)/2)-(height_boite/2)+'px';}
else
{xleft=(window.innerWidth/2-width_boite/2)+'px';xlongueur=window.innerWidth+'px';xtop=(window.innerHeight/2-height_boite/2)+'px';}
ylongueur=document.body.scrollHeight+'px';with(document.getElementById('boite_message_boite').style){left=xleft;top=(View.height/2-(height_boite/2)+ScrollY)+'px';display='';position='absolute';}
document.getElementById('boite_message_fond').style.display='block';document.getElementById('boite_message_fond').style.width=xlongueur;document.getElementById('boite_message_fond').style.height=ylongueur;if(document.all)
{document.getElementById('boite_message_fond').style.backgroundColor='#F2F7EE';}
lance_refresh_boite_panier();}
function ajout_panier(article_var,gabarit,article)
{var qte=1;if(document.getElementById('quantite_'+article_var+'_'+gabarit))
{qte=document.getElementById('quantite_'+article_var+'_'+gabarit).value;}
var XHR=new XHRConnection();XHR.appendData("id_article",article);XHR.appendData("id_article_var",article_var);XHR.appendData("qte",qte);XHR.sendAndLoad("../ajax/ajout_panier.php","POST",remplir_boite);}
function creer_un_panier_boite(commande)
{var XHR=new XHRConnection();XHR.appendData("ajax","1");XHR.appendData("commande",commande);XHR.sendAndLoad("../ajax/creer_un_panier_boite.php","POST",remplir_boite);}
function creer_boite_mail_panier()
{var XHR=new XHRConnection();XHR.appendData("ajax","1");XHR.sendAndLoad("../ajax/creer_boite_mail_panier.php","POST",remplir_boite);}
function envoyer_mail_panier(mail)
{var XHR=new XHRConnection();XHR.appendData("mail",mail);XHR.sendAndLoad("../ajax/envoyer_mail_panier.php","POST");}
function show_div_panier()
{var status=document.getElementById('maj_panier').checked;var div_paniers=document.getElementById('list_paniers');if(status)
div_paniers.style.display='none';else
div_paniers.style.display='block';}
function creer_un_favori_boite(article)
{var XHR=new XHRConnection();XHR.appendData("ajax","1");XHR.appendData("article",article);XHR.sendAndLoad("../ajax/creer_un_favori_boite.php","POST",remplir_boite);}
function envoyer_a_un_ami_panier_boite(id)
{var XHR=new XHRConnection();XHR.appendData("ajax","1");XHR.appendData("id_panier",id);XHR.sendAndLoad("../ajax/envoyer_a_un_ami_panier_boite.php","POST",remplir_boite);}
function envoyer_a_un_ami_favori_boite(id_article)
{var XHR=new XHRConnection();XHR.appendData("ajax","1");XHR.appendData("id_article",id_article);XHR.sendAndLoad("../ajax/envoyer_a_un_ami_favori_boite.php","POST",remplir_boite);}
function envoyer_a_un_ami_panier(id_panier,mail)
{var XHR=new XHRConnection();XHR.appendData("id_panier",id_panier);XHR.appendData("mail",mail);XHR.sendAndLoad("../ajax/envoyer_a_un_ami_panier.php","POST");}
function envoyer_a_un_ami_favori(id_article,mail)
{var XHR=new XHRConnection();XHR.appendData("id_article",id_article);XHR.appendData("mail",mail);XHR.sendAndLoad("../ajax/envoyer_a_un_ami_favori.php","POST");}
function creer_un_panier(id_commande,nom,titre_panier)
{var XHR=new XHRConnection();XHR.appendData("id_commande",id_commande);XHR.appendData("nom",nom);XHR.appendData("titre_panier",titre_panier);XHR.sendAndLoad("../ajax/creer_un_panier.php","POST",retour_creer_un_panier);}
function retour_creer_un_panier(obj)
{document.getElementById('mess').style.display='';document.getElementById('mess').innerHTML=obj.responseText;}
function ajouter_un_favori(article)
{var XHR=new XHRConnection();XHR.appendData("article",article);XHR.sendAndLoad("../ajax/ajouter_un_favori.php","POST");}
function supprimer_une_commande_boite(id_commande,num_commande,hash)
{var XHR=new XHRConnection();XHR.appendData("id_commande",id_commande);XHR.appendData("num_commande",num_commande);XHR.appendData('hash',hash);XHR.sendAndLoad("../ajax/supprimer_une_commande_boite.php","POST",remplir_boite);}
function get_nb_cheque()
{var chaine;var chaine2;var element_nom;var qte_requise;var taille=document.forms['form_fidelite'].elements.length;var element=null;var i=0;while(i<taille)
{element=document.forms['form_fidelite'].elements[i];element_nom=element.name.replace("qte[","");if(element.name!=element_nom)
{var id_valeur=element.id;id_valeur=id_valeur.replace("qte[","");id_valeur=id_valeur.replace("]","");if(element.type=='text')
{qte_requise=document.getElementById('qte['+id_valeur+']').value;chaine2+=id_valeur+"-"+qte_requise+",";chaine2=chaine2.replace("undefined","");chaine2=chaine2.replace(" ","");}}
i++;}
var XHR=new XHRConnection();XHR.appendData("chaine",chaine2);XHR.sendAndLoad("../ajax/ajax_fidelite.php","POST",recevoir_data_fidelite);}
function recevoir_data_fidelite(obj)
{var tab_points_restants=obj.responseText.split('_');var points_restants=tab_points_restants[1];var tab_nb_cheque=tab_points_restants[0].split(',');var nb_cheques=tab_nb_cheque[1];var tab1=tab_nb_cheque[0].split('-');taille=(tab1.length);for(var i=0;i<taille;i++)
{tab2=tab1[i].split('|');taille2=(tab1.length)-1;prevision=tab2[1];nb_points=tab2[0];nb_points=nb_points.replace(' ','');nb_points=nb_points.replace(' ','');nb_points=nb_points.replace(' ','');document.getElementById('qte['+nb_points+']').value=prevision;}
document.getElementById('nb_cheque').innerHTML=nb_cheques;document.getElementById('points_restants').innerHTML=points_restants;}
function supprimer_une_commande(id_commande,hash)
{var XHR=new XHRConnection();XHR.appendData('id_commande',id_commande);XHR.appendData('hash',hash);XHR.sendAndLoad('../ajax/supprimer_une_commande.php','POST');}
function envoyer_a_un_ami_boite(id_cheque,adr)
{var XHR=new XHRConnection();XHR.appendData("id_cheque",id_cheque);XHR.appendData("hash",adr);XHR.sendAndLoad("../ajax/envoyer_a_un_ami_boite.php","POST",remplir_boite);}
function envoyer_cheque_ami(id_cheque,adr)
{var adr=document.getElementById('adresse_mel').value;var msg=document.getElementById('message_favoris').value;var protection=document.getElementById('protection').value;var XHR=new XHRConnection();XHR.appendData('id_cheque',id_cheque);XHR.appendData('adr',adr);XHR.appendData('msg',msg);XHR.appendData('protection',protection);XHR.sendAndLoad('../ajax/envoyer_a_un_ami.php','POST');}
function verif_formulaire_envoyer_ami(id_article)
{var mail_ami=document.getElementById('mail_ami').value;var mon_mail=document.getElementById('mon_mail').value;var nom_ami=document.getElementById('nom_ami').value;var mon_nom=document.getElementById('mon_nom').value;var commentaire=document.getElementById('commentaire_ami').value;var XHR=new XHRConnection();XHR.appendData('id_article',id_article);XHR.appendData('mail_ami',mail_ami);XHR.appendData('mon_mail',mon_mail);XHR.appendData('nom_ami',nom_ami);XHR.appendData('mon_nom',mon_nom);XHR.appendData('commentaire',commentaire);XHR.sendAndLoad('../ajax/verif_formulaire_envoyer_ami.php','POST',retour_formulaire_envoyer_ami);}
function retour_formulaire_envoyer_ami(obj)
{var retour=obj.responseText;var tab=retour.split("---");var etat=tab[0];var erreur=tab[1];if(etat==1)
{document.getElementById('formulaire').style.display='none';document.getElementById('message').style.display='block';document.getElementById('mail_ami').value="";document.getElementById('mon_mail').value="";document.getElementById('nom_ami').value="";document.getElementById('mon_nom').value="";document.getElementById('commentaire_ami').value="";document.getElementById('commentaire_ami').innerHTML="";document.getElementById('message').innerHTML=erreur;}
else
{document.getElementById('formulaire').style.display='block';document.getElementById('message').style.display='block';document.getElementById('message').innerHTML=erreur;}}
function verif_avis_internaute(id_article)
{if(document.getElementById('mail'))
{var mail=document.getElementById('mail').value;var id_client='';}
else
{var mail='';var id_client=document.getElementById('id_client').value;}
var titre=document.getElementById('titre').value;var commentaire=document.getElementById('commentaire').value;var note=document.getElementById('note').value;var XHR=new XHRConnection();XHR.appendData('id_article',id_article);XHR.appendData('mail',mail);XHR.appendData('id_client',id_client);XHR.appendData('titre',titre);XHR.appendData('commentaire',commentaire);XHR.appendData('note',note);XHR.sendAndLoad('../ajax/verif_formulaire_avis_internaute.php','POST',retour_formulaire_avis_internaute);}
function retour_formulaire_avis_internaute(obj)
{var retour=obj.responseText;var tab=retour.split("---");var etat=tab[0];var erreur=tab[1];if(etat==1)
{document.getElementById('commentaire_ajout').style.display='none';document.getElementById('tab_message').style.display='';document.getElementById('message_avis').style.display='block';if(document.getElementById('mail'))
document.getElementById('mail').value="";document.getElementById('titre').value="";document.getElementById('note').value="";document.getElementById('commentaire').value="";document.getElementById('commentaire').innerHTML="";document.getElementById('message_avis').innerHTML=erreur;}
else
{document.getElementById('commentaire_ajout').style.display='';document.getElementById('tab_message').style.display='';document.getElementById('message_avis').style.display='block';document.getElementById('message_avis').innerHTML=erreur;}}
function affichage_alternance(id)
{if(document.getElementById(id).style.display=='none')
{document.getElementById(id).style.display='block';}
else
{document.getElementById(id).style.display='none';}}
function nb_carac_champ(champ)
{var chaine=document.getElementById(champ).value;var longueur=chaine.length;return(longueur);}
function tronquer(max,nb_carac,champ_tronc,champ_nb_carac)
{var diff=max-nb_carac;if(diff<0)
{diff=0;}
document.getElementById(champ_nb_carac).innerHTML=diff;if(max<nb_carac)
{var texte=document.getElementById(champ_tronc).value;texte=texte.substring(0,max);document.getElementById(champ_tronc).value=texte;}}
function affiche(Colonne,tablo,idchkbx,nbcheckbox)
{var n=0;var j=0;for(i=1;i<=nbcheckbox;i++)
{if(document.getElementById('checkbox_'+i).checked==true)
{j++;}}
while(document.getElementById(tablo).rows[n]!=null)
{if(document.getElementById(tablo).rows[n].cells[Colonne].style.display=='')
{if(j>0)
{document.getElementById(tablo).rows[n].cells[Colonne].style.display='none';i=1;while(document.getElementById(tablo).rows[n].cells[i]!=null)
{document.getElementById(tablo).rows[n].cells[i].width=85/j+"%";i++;}
document.getElementById(tablo).rows[n].cells[Colonne].width='';}
else
{document.getElementById('checkbox_'+idchkbx).checked=true;document.getElementById('alerte').className="erreur";document.getElementById('alerte').innerHTML="au moins un produit doit être sélectionné";}}
else
{if(j<4)
{document.getElementById(tablo).rows[n].cells[Colonne].style.display='';i=1;while(document.getElementById(tablo).rows[n].cells[i]!=null)
{document.getElementById(tablo).rows[n].cells[i].width=85/j+"%";i++;}
document.getElementById('alerte').innerHTML="";if(j==3)
{document.getElementById('alerte').className="message";document.getElementById('alerte').innerHTML="vous avez atteint la limite d'affichage des produits<br>";}
else
{document.getElementById('alerte').innerHTML="";}}
else
{document.getElementById('alerte').className="erreur";document.getElementById('alerte').innerHTML="vous ne pouvez pas afficher plus de trois articles en même temps<br>";document.getElementById('checkbox_'+idchkbx).checked=false;break;}}
n++;}
return(nbcheckbox);}
function add_comparateur(id,num_bouton)
{if(document.getElementById('ajout_comparateur_'+num_bouton).value=='ajouter')
{var XHR=new XHRConnection();XHR.appendData('id_variante',id);XHR.sendAndLoad("../ajax/ajout_comparateur.php","POST");document.getElementById('ajout_comparateur_'+num_bouton).value='enlever';}
else
{var XHR=new XHRConnection();XHR.appendData('id_variante',id);XHR.sendAndLoad("../ajax/enlever_comparateur.php","POST");document.getElementById('ajout_comparateur_'+num_bouton).value='ajouter';}
lance_refresh_boite_comparateur();}
function ajout_comparateur(id,num_del)
{if(typeof(id)=="undefined")
{id=document.getElementById("select_article").value;}
if(typeof(num_del)=="undefined")
{var XHR=new XHRConnection();XHR.appendData('id_variante',id);XHR.sendAndLoad("../ajax/ajout_comparateur.php","POST");}
else
{var XHR=new XHRConnection();XHR.appendData('id_variante',id);XHR.sendAndLoad("../ajax/enlever_comparateur.php","POST");}
lance_refresh_comparateur();lance_refresh_boite_comparateur();}
function format_annee(jour,mois,annee)
{var _Jour=document.getElementById(jour);var _Mois=document.getElementById(mois);var _Annee=document.getElementById(annee);encours=new Date();var annee_en_cours=encours.getYear();if(document.all)
{annee_en_cours_2=parseInt(annee_en_cours)-2000;}
else
{annee_en_cours_2=parseInt(annee_en_cours)-100;annee_en_cours=parseInt(annee_en_cours)+1900;}
if(_Annee.value.length<2)
{_Annee.value=0+_Annee.value;}
if(_Annee.value<=parseInt(annee_en_cours_2)&&_Annee.value>=0&&_Annee.value!='')
{_Annee.value='20'+_Annee.value;}
if(_Annee.value>parseInt(annee_en_cours_2)&&_Annee.value<100&&_Annee.value!='')
{_Annee.value='19'+_Annee.value;}
if(_Annee.value>parseInt(annee_en_cours)&&_Annee.value!='')
{_Annee.value=parseInt(annee_en_cours);}
if(_Annee.value<1900&&_Annee.value!='')
{_Annee.value=1900;}
if(_Jour.value=='')
{_Jour.value='01';}
if(_Mois.value=='')
{_Mois.value='01';}}
var valeur=0;function deplacer_galerie_photo_h(sens,max)
{valeur=document.getElementById('galerie_interne').style.left;if(document.getElementById('galerie_interne').offsetWidth){taille_div=document.getElementById('galerie_externe').offsetWidth;}else{taille_div=document.getElementById('galerie_externe').style.pixelWidth;}
valeur=valeur.replace('px','');if(valeur==''){valeur=0;}
valeur=parseInt(valeur);if(sens=='p'){valeur=valeur-5;}else{valeur=valeur+5;}
if(valeur>0){valeur=0;}
if(max>taille_div){diff=parseInt(max)-parseInt(taille_div);}else{diff=0;}
if(valeur<-diff){valeur=-diff;}
document.getElementById('galerie_interne').style.left=valeur+'px';Timer=setTimeout('deplacer_galerie_photo_h(\''+sens+'\',\''+max+'\');',50);}
function deplacer_block_galerie_photo_h(sens,max,max_page)
{valeur=document.getElementById('galerie_interne').style.left;if(document.getElementById('galerie_interne').offsetWidth){taille_div=document.getElementById('galerie_externe').offsetWidth;}else{taille_div=document.getElementById('galerie_externe').style.pixelWidth;}
valeur=valeur.replace('px','');if(valeur==''){valeur=0;}
valeur=parseInt(valeur);if(sens=='p'){valeur=valeur-max_page;if(valeur<=-max)
valeur=valeur+max_page;}else{valeur=valeur+max_page;if(valeur>0)
valeur=0;}
document.getElementById('galerie_interne').style.left=valeur+'px';}
function deplacer_galerie_photo_v(sens,max)
{valeur=document.getElementById('galerie_interne').style.top;if(document.getElementById('galerie_interne').offsetWidth){taille_div=document.getElementById('galerie_externe').offsetHeight;}else{taille_div=document.getElementById('galerie_externe').style.pixelHeight;}
valeur=valeur.replace('px','');if(valeur==''){valeur=0;}
valeur=parseInt(valeur);if(sens=='p'){valeur=valeur-5;}else{valeur=valeur+5;}
if(valeur>0){valeur=0;}
if(max>taille_div){diff=parseInt(max)-parseInt(taille_div);}else{diff=0;}
if(valeur<-diff){valeur=-diff;}
document.getElementById('galerie_interne').style.top=valeur+'px';Timer=setTimeout('deplacer_galerie_photo_v(\''+sens+'\',\''+max+'\');',50);}
function deplacer_block_galerie_photo_v(sens,max,max_page)
{valeur=document.getElementById('galerie_interne').style.top;if(document.getElementById('galerie_interne').offsetWidth){taille_div=document.getElementById('galerie_externe').offsetHeight;}else{taille_div=document.getElementById('galerie_externe').style.pixelHeight;}
valeur=valeur.replace('px','');if(valeur==''){valeur=0;}
valeur=parseInt(valeur);if(sens=='p'){valeur=valeur-max_page;if(valeur<=-max)
valeur=valeur+max_page;}else{valeur=valeur+max_page;if(valeur>0)
valeur=0;}
document.getElementById('galerie_interne').style.top=valeur+'px';}
function get_nb_cheque(chaine)
{var chaine;var chaine2;var element_nom;var qte_requise;var taille=document.forms['form_fidelite'].elements.length;var element=null;var i=0;while(i<taille)
{element=document.forms['form_fidelite'].elements[i];element_nom=element.name.replace("qte[","");if(element.name!=element_nom)
{var id_valeur=element.id;id_valeur=id_valeur.replace("qte[","");id_valeur=id_valeur.replace("]","");if(element.type=='text')
{qte_requise=document.getElementById('qte['+id_valeur+']').value;qte_requise=qte_requise.replace(' ','');chaine2+=id_valeur+"-"+qte_requise+",";chaine2=chaine2.replace("undefined","");}}
i++;}
var XHR=new XHRConnection();XHR.appendData("chaine",chaine2);XHR.sendAndLoad("../ajax/ajax_fidelite.php","POST",recevoir_data_fidelite);}
function show_div(id)
{document.getElementById(id).style.display='';}
function hide_div(id)
{document.getElementById(id).style.display='none';}
no_cache_div=true;function no_cache(type){no_cache_div=type;cache_div();}
function affichage_photo(url_photo,largeur_photo,hauteur_photo,largeur_div,hauteur_div)
{no_cache_cdiv=false;couleur_bordure="#000000";couleur_fond="#ffffff";taille_bordure=1;type_bordure="solid";document.getElementById("affiche_article").style.display="block";document.getElementById("affiche_article").style.width=hauteur_div+"px";document.getElementById("affiche_article").style.height=largeur_div+"px";document.getElementById("affiche_article").style.borderSize=taille_bordure+"px";document.getElementById("affiche_article").style.borderStyle=type_bordure;document.getElementById("affiche_article").style.borderColor=couleur_bordure;document.getElementById("affiche_article").style.backgroundColor=couleur_fond;document.getElementById("affiche_article").style.position="fixed";document.getElementById("affiche_article").style.top=0;document.getElementById("affiche_article").style.right=0;contenu_div="<table style=\"text-align:center; vertical-align:middle; height:"+hauteur_div+"px;\">";contenu_div+="<tr><td style=\"text-align:center; width:"+hauteur_div+"px;\">";contenu_div+="<img src=\""+url_photo+"\" width='"+largeur_photo+"' height='"+hauteur_photo+"'>";contenu_div+="</td></tr></table>";document.getElementById("affiche_article").innerHTML=contenu_div;}
function cacher_photo()
{no_cache_cdiv=true;attente=window.setTimeout("cache_div()",500);}
function cache_div()
{if(no_cache_div&&no_cache_cdiv){document.getElementById("affiche_article").style.display="none";}
window.clearTimeout(attente);}
function check_code_postal(cp){if(cp.length<5||isNaN(cp)==true)
{return false;}
return true;}


var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='';if(isIE&&isWin&&!isOpera)
{str+='<object ';for(var i in objAttrs)
{str+=i+'="'+objAttrs[i]+'" ';}
str+='>';for(var i in params)
{str+='<param name="'+i+'" value="'+params[i]+'" /> ';}
str+='</object>';}
else
{str+='<embed ';for(var i in embedAttrs)
{str+=i+'="'+embedAttrs[i]+'" ';}
str+='> </embed>';}
document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_SW_RunContent(){var ret=AC_GetArgs
(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":ret.objAttrs[args[i]]=args[i+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;}


