/** * pop-corn-1.0.js * Copyrights 2011 www.pop-corn.ch */ window.onload=function() {(function Egalize(){var ToCheck=Array('lpanel','rpanel','cpanel');var ToGrow=Array('mmbck','lphotos','content');var MaxHeight=0;for(var I=0;ICurHeight?MaxHeight:CurHeight;} for(var I=0;I-1) {LinkTags[i].parentNode.removeChild(LinkTags[i]);}} document.getElementById('viewerframe').onclick=function(){};document.getElementById('viewer').onclick=function(){};ScrollOffset=document.body.offsetWidth/2;;FullScreen=false;} window.setTimeout(function(){Banner.scrollLeft=ScrollLeftBuffer+ScrollOffset;},1000);} function ScrollBanner(ScrollAmp,Callback) {if(Scrolling||(Banner.scrollLeft>(getLeftPosition(LastPic)-getLeftPosition(Banner)-Banner.offsetWidth/2)&&ScrollAmp>0)){return;} ScrollTo=Banner.scrollLeft+ScrollAmp;Scrolling=true;ScrollHandle=window.setInterval(function(){ScrollStep=ScrollAmp/10;if(Math.abs(ScrollStep)<1){ScrollStep=ScrollStep>0?1:-1;} Banner.scrollLeft+=ScrollStep;if(Math.abs(ScrollTo-Banner.scrollLeft)<=Math.abs(ScrollStep)||Banner.scrollLeft<=0){window.clearInterval(ScrollHandle);Scrolling=false;Callback();}},20);} function Check(){CurPhoto=window.location.href.split('#',2);CurPhoto=CurPhoto.length>1?parseInt(CurPhoto[1]):0;if(isNaN(CurPhoto)){CurPhoto=0;} if(LastPhoto==CurPhoto||Scrolling||CurPhoto>=GalSize){return;} else {try{CurThumb.parentNode.style.border='none';document.getElementById('curphoto').innerHTML=CurPhoto+1;}catch(e){} CurThumb=document.getElementById('banner_'+CurPhoto);Middle=Banner.scrollLeft+getLeftPosition(Banner)+Banner.offsetWidth/2;ScrollAmp=getLeftPosition(CurThumb)-Middle+CurThumb.offsetWidth/2;ScrollTo=Banner.scrollLeft+ScrollAmp;while(Viewer.hasChildNodes()){Viewer.removeChild(Viewer.firstChild);} var Img=document.createElement('img');Img.src=RepViewer+GalName+'.Photo'+CurPhoto+'.jpg';Viewer.appendChild(Img);Img.onclick=function(){Fullscreen();};Img.style.cursor='pointer';document.getElementById('arrowleft').parentNode.href='galeries-'+url+'/'+GalName+'/#'+((CurPhoto-1)>0?(CurPhoto-1):0);document.getElementById('arrowright').parentNode.href='galeries-'+url+'/'+GalName+'/#'+((CurPhoto+1)0?(CurPhoto-1):0);break;case 39:document.location.href='http://www.pop-corn.ch/galeries'+url+'/'+GalName+'/#'+((CurPhoto+1)sur'+GalSize+'';onclick=function(){};style.fontSize="1em";style.fontWeight="normal";}} else if(ajaxhandle.readyState==4&&ajaxhandle.status==404) {alert("Erreur! Veuillez réessayer plus tard...");}} ajaxhandle.open("GET","vote.php?galid="+GalName+"&photoid="+CurPhoto,true);ajaxhandle.send();};}catch(e){} Banner.style.overflow='hidden';document.getElementById('doublearrowleft').parentNode.onclick=function(){ScrollBanner(-500,function(){})} document.getElementById('doublearrowright').parentNode.onclick=function(){ScrollBanner(500,function(){})} document.getElementById('view').onclick=function(){Fullscreen()};document.getElementById('view').style.cursor='pointer';document.getElementById('fullscreen').onclick=function(){Fullscreen()};document.getElementById('fullscreen').style.cursor='pointer';document.onkeyup=function(e){KeyPressed(e)} window.setInterval(function(){Check()},200);document.getElementById('arrowleft').parentNode.href='galeries-'+url+'/'+GalName+'/#0';document.getElementById('arrowright').parentNode.href='galeries-'+url+'/'+GalName+'/#1';document.getElementById('doublearrowright').parentNode.href='galeries-'+url+'/'+GalName+'/#0';document.getElementById('doublearrowleft').parentNode.href='galeries-'+url+'/'+GalName+'/#0';Preload(0,3);})();(function Mariage(){try {var mField=document.getElementById('code');var mVerif=document.getElementById('verif');var ajaxhandle;if(window.XMLHttpRequest) ajaxhandle=new XMLHttpRequest();else ajaxhandle=new ActiveXObject("Microsoft.XMLHTTP");ajaxhandle.onreadystatechange=function() {if(ajaxhandle.readyState==4&&ajaxhandle.status!=404) {window.location.replace("http://www.pop-corn.ch/galeries-mariage/"+document.getElementById('code').value.replace(/^[A-Z]{3}([0-9]{2})([0-9]{2})([0-9]{2})$/,"20$3.$2.$1")+"."+mField.value+"/");} else if(ajaxhandle.readyState==4&&ajaxhandle.status==404) {alert("Mot de passe invalide. Veuillez SVP vérifier le mot de passe.");}} mVerif.onclick=function() {if(!/^[A-Z]{3}([0-9]{2})([0-9]{2})([0-9]{2})$/.test(mField.value)) return(alert("Mot de passe invalide. Veuillez SVP vérifier le mot de passe."));ajaxhandle.open("GET","/galeries_POP_CORN_traitees/"+mField.value.replace(/^[A-Z]{3}([0-9]{2})([0-9]{2})([0-9]{2})$/,"20$3.$2.$1")+"."+mField.value+"/",true);ajaxhandle.send();}} catch(e) {return;}})();};window.___gcfg={lang:'fr'};(function(){var po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/plusone.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();