var iframe_image=null;var idpano_returned;var basedir;function showLoading(){document.getElementById("loading").innerHTML='<img src="images/loading.gif" style="position: relative; left: 198px; top: 34px;">'}function set_iframe(A){iframe_image=A}function hideshow_zooms(B,A){if(iframe_image){if(document.getElementById("show-zooms-bt").value==A){document.getElementById("show-zooms-bt").value=B}else{document.getElementById("show-zooms-bt").value=A}iframe_image.hideshow_zooms()}}function hideshow_othersdates(A,B){if(document.getElementById("others-dates-bt").value==A){document.getElementById("others-dates-bt").value=B;document.getElementById("pano_other_date").style.display=""}else{document.getElementById("others-dates-bt").value=A;document.getElementById("pano_other_date").style.display="none"}}var autoscrollTimerID=null;var autoscrollTime=30;function init(A,B){basedir=A;document.getElementById("idpano").value=B;doScroll()}function autoScroll(){var B=window.frames.iframe_name;var A=B.document.body.scrollWidth-B.document.body.offsetWidth-16;autoscrollTimerID=setTimeout("autoScroll()",autoscrollTime);if(sens==1){if(B.document.body.scrollLeft<A){B.document.body.scrollLeft=B.document.body.scrollLeft+scrollspeed}else{B.document.body.scrollLeft=A;sens=-1}}else{if(B.document.body.scrollLeft>0){B.document.body.scrollLeft=B.document.body.scrollLeft-scrollspeed}else{B.document.body.scrollLeft=0;sens=1}}}function doScroll(){var A=window.frames.iframe_name.document.body.offsetWidth;var B=253-(A/2);window.frames.iframe_name.scrollBy(B,0)}function scrollHandler(A){iframe_name.document.body.scrollLeft=iframe_name.document.body.scrollLeft-A}var scrolling;var sens=1;var scrollspeed=3;scrollspeed=1;function ScrollWay(A){stopScroll();if(A=="+"){sens=1}else{sens=-1}autoScroll()}function stopScroll(){clearTimeout(autoscrollTimerID)}function sendRequest(D,C){showLoading();var B=false;var A=this;if(window.XMLHttpRequest){A.xmlHttpReq=new XMLHttpRequest()}else{if(window.ActiveXObject){A.xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP")}}A.xmlHttpReq.open("POST",D,false);A.xmlHttpReq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");A.xmlHttpReq.send(getquerystring(C));if(A.xmlHttpReq.readyState==4){updatepage(A.xmlHttpReq.responseText)}}function getquerystring(A){qstr="current="+escape(document.getElementById("idpano").value);qstr+="&action="+A;return qstr}function xmlError(A){alert(A)}function formatDate(A){var B=A.substr(6,2)+"/"+A.substr(4,2)+"/"+A.substr(0,4)+" "+A.substr(8,2)+":"+A.substr(10,2);return B}function updatepage(jsontext){var myObj=eval("("+jsontext+")");idpano_returned=myObj.ResultSet.nextPano;document.getElementById("loading").innerHTML='<a href="javascript:void(0);" onClick="showPano();"><img src="'+basedir+"/small/"+idpano_returned+'.jpg"></a>';document.getElementById("otheridpano").innerHTML=formatDate(idpano_returned)}function showPano(){stopScroll();var A="iframe_pano.php?idpano="+document.getElementById("idpano").value;document.getElementById("iframe_name").src=A;document.getElementById("idpano_label").innerHTML=document.getElementById("otheridpano").innerHTML}function showNextPano(A){sendRequest("getPano.php","next");if(idpano_returned==document.getElementById("idpano").value){alert(A)}else{document.getElementById("idpano").value=idpano_returned}}function showPrevPano(A){sendRequest("getPano.php","prev");if(idpano_returned==document.getElementById("idpano").value){alert(A)}else{document.getElementById("idpano").value=idpano_returned}};

