var j=null;var k;var l;function showLoading(){document.getElementById("loading").innerHTML='<img src="images/loading.gif" style="position: relative; left: 198px; top: 34px;">';}function set_iframe(a){j=a;}function hideshow_zooms(){if(j){if(document.getElementById("show-zooms-bt").value=="Cacher les zooms"){document.getElementById("show-zooms-bt").value="Montrer les zooms";}else{document.getElementById("show-zooms-bt").value="Cacher les zooms";}j.hideshow_zooms();}}function hideshow_othersdates(){if(document.getElementById("others-dates-bt").value=="Voir d'autres dates"){document.getElementById("others-dates-bt").value="Cacher les dates";document.getElementById("pano_other_date").style.display="";}else{document.getElementById("others-dates-bt").value="Voir d'autres dates";document.getElementById("pano_other_date").style.display="none";}}var m=null;var n=30;function init(b,c){l=b;document.getElementById("idpano").value=c;doScroll();}function autoScroll(){var iframe_name=window.frames['iframe_name'];var p=iframe_name.document.body.scrollWidth-iframe_name.document.body.offsetWidth-16;m=setTimeout("autoScroll()",n);if(t==1){if(iframe_name.document.body.scrollLeft<p)iframe_name.document.body.scrollLeft=iframe_name.document.body.scrollLeft+u;else{iframe_name.document.body.scrollLeft=p;t=-1;}}else{if(iframe_name.document.body.scrollLeft>0)iframe_name.document.body.scrollLeft=iframe_name.document.body.scrollLeft-u;else{iframe_name.document.body.scrollLeft=0;t=1;}}}function doScroll(){var q=window.frames['iframe_name'].document.body.offsetWidth;var s=253-(q/2);window.frames['iframe_name'].scrollBy(s,0);}function scrollHandler(d){iframe_name.document.body.scrollLeft=iframe_name.document.body.scrollLeft-d;}var r;var t=1;var u=3;u=1;function ScrollWay(D){stopScroll();if(D=="+"){t=1;}else{t=-1;}autoScroll();}function stopScroll(){clearTimeout(m);}function sendRequest(f,g){showLoading();var v=false;var w=this;if(window.XMLHttpRequest){w.v=new XMLHttpRequest();}else if(window.ActiveXObject){w.v=new ActiveXObject("Microsoft.XMLHTTP");}w.v.open('POST',f,false);w.v.setRequestHeader('Content-Type','application/x-www-form-urlencoded');w.v.send(getquerystring(g));if(w.v.readyState==4){updatepage(w.v.responseText);}}function getquerystring(g){qstr='current='+escape(document.getElementById("idpano").value);qstr+="&action="+g;return qstr;}function xmlError(e){alert(e);}function formatDate(h){var s=h.substr(6,2)+"/"+h.substr(4,2)+"/"+h.substr(0,4)+" "+h.substr(8,2)+":"+h.substr(10,2);return s;}function updatepage(i){var x=eval('('+i+')');k=x.ResultSet.nextPano;document.getElementById("loading").innerHTML='<a href="javascript:void(0);" onClick="showPano();"><img src="'+l+'/small/'+k+'.jpg"></a>'
document.getElementById("otheridpano").innerHTML=formatDate(k);}function showPano(){stopScroll();var y="iframe_pano.php?idpano="+document.getElementById("idpano").value;document.getElementById("iframe_name").src=y;document.getElementById("idpano_label").innerHTML=document.getElementById("otheridpano").innerHTML;}function showNextPano(){sendRequest('getPano.php','next');if(k==document.getElementById("idpano").value){alert('Pas de date suivante.\nUtilisez le bouton "<" pour voir les dates précédentes.');}else{document.getElementById("idpano").value=k;}}function showPrevPano(){sendRequest('getPano.php','prev');if(k==document.getElementById("idpano").value){alert('Pas de date précédente.\nDernière date.');}else{document.getElementById("idpano").value=k;}}