function incrementPT(tid) { var fileName='https://www.phototours.com/' + tid + ".awstats.PhotoTour?pagename=" + tid; var image = new Image(); image.src = fileName; } document.write(""); var useResize = false; function PT_onMouseOver() { try { Page_onMouseOver(); } catch(e) { } } function initPhotoTour() { var div = document.createElement("div"); var iframe = document.createElement("iframe"); //iframe is child of div div.appendChild(iframe); //div is child of body document.body.appendChild(div); //setup div div.id = 'PTViewer'; div.style.position = 'absolute'; div.style.left = '-5500' + 'px'; div.style.top = '-5500' + 'px'; div.style.zIndex = '100'; div.style.visibility='hidden'; div.style.color = 'white'; div.style.fontWeight = 'bold'; div.style.textAlign = 'center'; //div.style.filter = "progid:DXImageTransform.Microsoft.Shadow(Color=\"black\",Direction=\"135\",Strength=\"8\")"; div.style.overflow = 'hidden'; //setup iframe iframe.scrolling = 'no'; iframe.frameBorder = '0'; iframe.id = 'PTIframe'; iframe.style.overflow = 'hidden'; } function flashChangeSize(w, h) { useResize = true; try { window.parent.popupResize(w, h); } catch(e) { } changeSize(w, h); } function changeSize(w, h) { try { playerIFrame = document.getElementById("PTIframe"); playerIFrame.style.height = h + 'px'; playerIFrame.style.width = w + 'px'; fnPositionViewer(); } catch (e) { playerIFrame = document.getElementById("tour"); playerIFrame.style.height = h + 'px'; playerIFrame.style.width = w + 'px'; } } var v; var f; var windowWidth=500; var windowHeight=500; var divloadedinterval; var dah=0; function checkDivLoaded() { try { dah++; if(window.frames["PTIframe"].document.getElementById("slideShow") || dah>20) { document.getElementById("PTViewer").style.visibility='visible'; clearInterval(divloadedinterval); } } catch(e) { document.getElementById("PTViewer").style.visibility='visible'; clearInterval(divloadedinterval); } } function ShowTourDiv(id,width,height,closeURL,emailURL,xmlRegen,preview,varsityPix) { if(!(width > 0)) width = 900; if(!(height > 0)) height = 600; if (incrementPT) incrementPT(id); v = document.getElementById("PTViewer"); f = document.getElementById("PTIframe"); if(v.style) if (v.style.visibility != 'visible') { appendEmail=""; if (emailURL) appendEmail = "&emailURL=" + emailURL; if (closeURL) appendEmail += "&closeURL=" + escape(closeURL); //alert("appendEmail value is " + appendEmail); if (xmlRegen) appendEmail += "&xmlRegen=1"; if (preview) appendEmail += "&preview=1"; if(varsityPix) appendEmail += "&varsitypix=" + varsityPix; appendEmail += "&resize=1"; theinterval=setInterval("fnPositionViewer();",50); f.src = "mirror_pt.php?f="+escape("https://www.phototours.com/player.asp?orbuttonmask=2&TID="+id+appendEmail); // v.style.visibility = 'visible'; divloadedinterval = setInterval("checkDivLoaded()",100); } else { v.style.visibility = 'hidden'; f.src = ""; } if(width) f.style.width=width + 'px'; if(height) f.style.height=height + 'px'; } function ShowTourFull(tid) { targeturl = "mirror_pt.php?f="+escape("https://www.phototours.com/player.asp?forceskin=none&fullScreen=1&andbuttonmask=4094&TID="+tid); window.open(targeturl,"TourPlayer","scrollbars=0,resizable=1") } function ShowTourFullscreen(tid) { targeturl = 'mirror_pt.php?f='+escape('https://www.phototours.com/Player.asp?forceskin=none&scale=1&width='+screen.width+'&height='+screen.height+'&andbuttonmask=4094&TID='+tid); window.open(targeturl,"TourPlayer","fullscreen=1,scrollbars=0,status=0,toolbar=0") } function ShowTourWindow(tid,width,height) { if(!width) width=533; if(!height) height=460; targeturl = 'mirror_pt.php?f='+escape('https://www.phototours.com/Player.asp?popup=yes&andbuttonmask='+(255-2)+'&TID='+tid+'TourPlayer'+tid); opener = window.open(targeturl,'TourPlayerPopUp_'+tid,'toolbar=no,scrollbars=no,resizable=yes,height='+height+',width='+width); } function ShowTourIFrame(tid,width,height,closebutton,preview, emailURL, isPopup) { if (closebutton == 1) mask = "orbuttonmask=2"; else mask= "closebtn=FALSE"; if(preview) { preview = "&preview=1"; } else preview=""; if(isPopup) preview += "&ispopup=1"; var href = 'mirror_pt.php?f='+escape('https://www.phototours.com/Player.asp?TID='+tid+'&width='+width+'&height='+height+"&"+mask+preview); if(frames["tour"+tid]) { //alert("found frame: "+frames["tour"+tid]); frames["tour"+tid].location.href= href; //alert("showing iframe a: "+frames["tour"+tid].location.href); } else if(document.getElementById("tour"+tid)) { //alert("showing iframe b"); if(!document.getElementById("tour"+tid).location) document.getElementById("tour"+tid).src=href; else document.getElementById("tour"+tid).location.href= href; } else alert("no iframe found"); var tour = document.getElementById('tour'+tid); tour.style.width=width+'px'; tour.style.height=height+'px'; } var theinterval; function fnCloseTour(tourid) { clearInterval(theinterval); var tour = document.getElementById('tour'+tourid); if(tour!=null) { tour.src=""; tour.style.width=0; tour.style.height=0; } tour = document.getElementById("PTIframe"); if(tour!=null) { tour.src=""; } tour = document.getElementById("PTViewer"); if(tour!=null) tour.style.visibility='hidden'; return 1; } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; } function getWindowSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return [ myWidth, myHeight ]; } function fnPositionViewer() { var xy = getScrollXY(); var fwidth = parseInt(f.style.width); var fheight = parseInt(f.style.height); if(!v.style) return; v.style.pixelWidth = fwidth; v.style.pixelHeight = fheight; var widthHeight = getWindowSize(); var windowHeight = widthHeight[1]; var windowWidth = widthHeight[0]; if(!v.style.top) v.style.top=-100 + 'px'; if (windowHeight > fheight) { if(useResize) v.style.top = xy[1] + Math.round((windowHeight - fheight)/2) + 'px'; else v.style.top = parseInt(v.style.top)-(parseInt(v.style.top)-(xy[1]+Math.round((windowHeight - fheight)/2)))/6 + 'px'; } else v.style.top = '0px'; if (windowWidth > fwidth) v.style.left = xy[0] + Math.round((windowWidth - fwidth)/2) + 'px'; else v.style.left = '0px'; } var theOldLocation; function fnViewTour(id,width,height,closeURL,nada,xmlRegen) { if(window.location.href.indexOf("closedptplayer")>0) return; ShowTourDiv(id,width,height,closeURL, 0, xmlRegen); } var AutoplayDiv = fnViewTour; var fnShowTour = ShowTourDiv; function ShowIPage(tid) { targeturl = 'mirror_pt.php?f=https://www.phototours.com/IPage.asp?TID='+tid, window.open(targeturl,'TourIPage','toolbar=no,scrollbars=no,resizable=yes,height=500,width=600'); } function fnChangeType(tourid, type, emailURL) { // type = 2 - Legacy // type = 1 - KBPro // In the database 0 = legacy, 1 = KBPro, 2 = Video player if(type == 2) type = 0; changeTo = "mirror_pt.php?f="+escape("https://www.phototours.com/player.asp?TID=" + tourid + "&changeType=" + type + "&orbuttonmask=2&emailURL=" + emailURL); var tour = document.getElementById('tour'+tourid); if(tour!=null) { tour.src=changeTo; } tour = document.getElementById("PTIframe"); if(tour!=null) { tour.src=changeTo; } return 1; }