var DMD_SHARED_CANVAS=DMD_SHARED_CANVAS || document.createElement("canvas"); DMD_SHARED_CANVAS.id="dmd_shared_canvas"; DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; DMD_SHARED_CANVAS.style.transition="opacity 0.25s"; DMD_SHARED_CANVAS.style.webkitUserSelect="none"; DMD_SHARED_CANVAS.style.userSelect="none"; DMD_SHARED_CANVAS.style.mozUserSelect="none"; function dmd_webGLSupported() { var succ=false; if(!DMD_SHARED_CANVAS)return false; var splits=navigator.userAgent.split("Windows Phone"); if((splits.length>1)&&(window.WebGLRenderingContext)) { splits=splits[1].replace(" ", "").split("."); if(splits.length>1) splits=splits[0]; else splits=null; succ=(splits&&(parseInt(splits)>8)); succ=succ&&(DMD_SHARED_CANVAS.getContext("experimental-webgl")||DMD_SHARED_CANVAS.getContext("webgl")); return succ; } splits=navigator.userAgent.split("Android"); if(splits.length>1) { if(splits.length>1) splits=splits[1].split(";"); else splits=null; if(splits&&splits.length>1) splits=splits[0].replace(" ", ""); if(splits)splits=splits.split("."); else splits=null; if(splits&&splits.length>0)splits=splits[0]; succ=(!splits||(splits&&(parseInt(splits)>4))); if(!window.WebGLRenderingContext)succ=false; succ=succ&&(DMD_SHARED_CANVAS.getContext("experimental-webgl")||DMD_SHARED_CANVAS.getContext("webgl")); return succ; } var isIOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?true:false); if(isIOS) { splits=navigator.userAgent.split(" OS"); if(splits.length>1) splits=splits[1].replace(" ", "").split("_"); else splits=null; if(splits&&splits.length>0)splits=splits[0]; succ=(splits&&(parseInt(splits)>7)); if(!window.WebGLRenderingContext)succ=false; succ=succ&&(DMD_SHARED_CANVAS.getContext("experimental-webgl")||DMD_SHARED_CANVAS.getContext("webgl")); return succ; } return window.WebGLRenderingContext&&(DMD_SHARED_CANVAS.getContext("experimental-webgl")||DMD_SHARED_CANVAS.getContext("webgl")); } var dmd_isWebGLSupported=dmd_webGLSupported(); function dmdLoadScript(url, id, callback) { if(document.getElementById("dmd_player_script_"+id)!=null) { callback(); return; } var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.type = "text/javascript"; script.src = url; script.onreadystatechange = callback; script.onload = callback; script.callbackHandled-false; script.id="dmd_player_script_"+id; script.viewerHolder=DMD_SHARED_CANVAS.id; head.appendChild(script); } function dmd_HTML5SupportDetection1() { var s_t_div=document.createElement("div"); s_t_div.id="s_t"; if (document.getElementsByTagName("body")[0]) document.getElementsByTagName("body")[0].appendChild(s_t_div); else return true; var parentDiv=document.createElement("div"); document.getElementById("s_t").appendChild(parentDiv); parentDiv.style.position="absolute"; parentDiv.style.display="block"; parentDiv.style.width="200px"; parentDiv.style.height="200px"; parentDiv.style.left="0px"; parentDiv.style.top="0px"; parentDiv.style.backgroundColor="black"; parentDiv.style.WebkitTransformStyle="preserve-3d"; parentDiv.style.MozTransformStyle="preserve-3d"; var getOffset=function(elem) { var lft=window.getComputedStyle(elem, null).getPropertyValue("left"); var tp=window.getComputedStyle(elem, null).getPropertyValue("top"); var point={x:0, y:0}; if (window.webkitConvertPointFromNodeToPage) point = window.webkitConvertPointFromNodeToPage(elem, new WebKitPoint(0, 0)); else if (elem.getBoundingClientRect) { var ofst=elem.getBoundingClientRect(); point = {x:ofst.left, y:ofst.top}; } else if (childDiv.offsetParent) { var elm=childDiv; var left=0; var top=0; do { left+=elm.clientLeft; top+=elm.clientTop; } while(elm=elm.offsetParent); point={x:left, y:top}; } return {left:point.x, top:point.y}; } var childDiv=document.createElement("div"); parentDiv.appendChild(childDiv); childDiv.style.position="absolute"; childDiv.style.display="block"; childDiv.style.width="100px"; childDiv.style.height="100px"; childDiv.style.left="0px"; childDiv.style.top="0px"; childDiv.style.WebkitTransform="rotateY(19deg)"; childDiv.style.MozTransform="rotateY(19deg)"; childDiv.style.backgroundColor="red"; childDiv.style.WebkitTransformStyle="preserve-3d"; childDiv.style.MozTransformStyle="preserve-3d"; var old_pos=getOffset(childDiv); parentDiv.style.WebkitPerspective="100px"; parentDiv.style.MozPerspective="100px"; var new_pos=getOffset(childDiv); var elem=document.getElementById("s_t"); elem.parentNode.removeChild(elem); if ((Math.abs(old_pos.left-new_pos.left) > 1E-3) || (Math.abs(old_pos.top-new_pos.top) > 1E-3)) { return true; } else { return false; } }; var DMD_GETREFERRER=function() { return ((window.location != window.parent.location) ? document.referrer : location.href); }; var dmd_HTML5SupportDetection = dmd_HTML5SupportDetection1; function getLBWidth() { return parseInt(document.body.clientWidth); }; function getLBHeight() { var winH = 460; if (document.body && document.body.offsetWidth) { winH = document.body.offsetHeight; } if (document.compatMode=="CSS1Compat" && document.documentElement && document.documentElement.offsetWidth ) { winH = document.documentElement.offsetHeight; } if (window.innerHeight) { winH = window.innerHeight; } return winH; }; function isSizePercentaged(for_element_id) { var divViewer = document.getElementById(for_element_id); var sWidth = divViewer.style.width.toString(), sHeight = divViewer.style.height.toString(); if ((sWidth.indexOf("%") > -1) || (sHeight.indexOf("%") > -1)) return true; return false; }; function setOpacity(obj, oVal) { if ((typeof(obj.filters) !== "undefined") && (typeof(obj.filters.alpha) !== "undefined")) obj.style.filter="alpha(opacity:" + oVal*100 + ")"; else obj.style.opacity=oVal; }; function getOpacity(obj) { if ((typeof(obj.filters) !== "undefined") && (typeof(obj.filters.alpha) !== "undefined")) return parseInt(obj.filters.alpha.opacity) / 100; else return parseFloat(obj.style.opacity); }; if(!window.addEventListener) window.addEventListener = function (type, listener, useCapture) { attachEvent("on" + type, function() { listener(event) }); }; function animate(attributes, duration, callback) { clearInterval(this.interval); this.t=16; this.fps_60=duration/this.t; this.animateOpacity=0; if(typeof(attributes["opacity"]) !== "undefined") this.animateOpacity=parseFloat(attributes["opacity"]); else { this.animateOpacity = isNaN(parseFloat(getOpacity(this))) ? 1 : parseFloat(getOpacity(this)); } this.animateLeft=0; if(typeof(attributes["left"]) !== "undefined") this.animateLeft=parseInt(attributes["left"]); else this.animateLeft = isNaN(parseFloat(this.style.left)) ? 0 : parseFloat(this.style.left); this.animateTop=0; if(typeof(attributes["top"]) !== "undefined") this.animateTop=parseInt(attributes["top"]); else this.animateTop = isNaN(parseFloat(this.style.top)) ? 0 : parseFloat(this.style.top); this.animateWidth=0; if(typeof(attributes["width"]) !== "undefined") this.animateWidth=parseInt(attributes["width"]); else this.animateWidth = parseFloat(this.clientWidth); this.animateHeight=0; if(typeof(attributes["height"]) !== "undefined") this.animateHeight=parseInt(attributes["height"]); else this.animateHeight = parseFloat(this.clientHeight); if (duration < this.t) { this.style.left = this.animateLeft + "px"; this.style.top = this.animateTop + "px"; this.style.width = this.animateWidth + "px"; this.style.height = this.animateHeight + "px"; setOpacity(this, this.animateOpacity); this.cnt=0; if (callback) callback(); return false; }; this.animateOpacityStep=0; this.animateOpacityStep=(this.animateOpacity-(isNaN(parseFloat(getOpacity(this))) ? 1 : parseFloat(getOpacity(this))))/this.fps_60; this.animateLeftStep=0; this.animateLeftStep=(this.animateLeft-(isNaN(parseFloat(this.style.left)) ? 0 : parseFloat(this.style.left)))/this.fps_60; this.animateTopStep=0; this.animateTopStep=(this.animateTop-(isNaN(parseFloat(this.style.top)) ? 0 : parseFloat(this.style.top)))/this.fps_60; this.animateHeightStep=0; this.animateHeightStep=(this.animateHeight-parseFloat(this.clientHeight))/this.fps_60; this.animateWidthStep=0; this.animateWidthStep=(this.animateWidth-parseFloat(this.clientWidth))/this.fps_60; this.cnt=0; this.cWidth=parseFloat(this.clientWidth); this.cHeight=parseFloat(this.clientHeight); this.cTop=isNaN(parseFloat(this.style.top)) ? 0 : parseFloat(this.style.top); this.cLeft=isNaN(parseFloat(this.style.left)) ? 0 : parseFloat(this.style.left); this.cOpacity=isNaN(getOpacity(this)) ? 1 : parseFloat(getOpacity(this)); var f=function(obj) { if (obj.cnt>=parseInt(obj.fps_60)) { clearInterval(obj.interval); obj.interval=-1; obj.style.left=obj.animateLeft + "px"; obj.style.top=obj.animateTop + "px"; obj.style.width=obj.animateWidth + "px"; obj.style.height=obj.animateHeight + "px"; setOpacity(obj, obj.animateOpacity); obj.cnt=0; if (callback) callback(); } else { obj.cWidth+=obj.animateWidthStep; obj.cHeight+=obj.animateHeightStep; obj.cTop+=obj.animateTopStep; obj.cLeft+= obj.animateLeftStep; obj.cOpacity+=obj.animateOpacityStep; obj.cnt++; setOpacity(obj, obj.cOpacity); obj.style.left = obj.cLeft + "px"; obj.style.top = obj.cTop + "px"; obj.style.height = obj.cHeight + "px"; obj.style.width = obj.cWidth + "px"; } }; var param=this; this.interval=setInterval(function() { f(param) }, this.t); }; var DMD_AUTOPLAY=((typeof(DMD_AUTOPLAY) !== "undefined") ? DMD_AUTOPLAY : 1); var DMD_LAST_RUNNING=((typeof(DMD_LAST_RUNNING) !== "undefined") ? DMD_LAST_RUNNING : ""); var DMD_CURRENT_RUNNING=((typeof(DMD_CURRENT_RUNNING) !== "undefined") ? DMD_CURRENT_RUNNING : ""); var DMD_JS_EMBED=true; var getAjax=function(url, callback) { var xmlhttp=null; xmlhttp=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { try { callback(JSON.parse(xmlhttp.responseText)); } catch(e) { setTimeout(function() { getAjax(url, callback); }, 1000); } } else if (xmlhttp.readyState==4 && xmlhttp.status!=200) { setTimeout(function() { getAjax(url, callback); }, 1000); } } xmlhttp.open("GET",url,true); xmlhttp.send(); } var DMD_Embeding=function() { var DMD_CURRENT_PANO=0; var DMD_PANOS_LIST = []; var DMD_EMBEDCODE=""; var DMD_ISOPENED=false; var EMPTY_AREA=60; var DURATION=100; var _this=this; this.init=function() { var lftOff=typeof(document.body.scrollLeft)!=="undefined" ? document.body.scrollLeft : window.pageXOffset, topOff=typeof(document.body.scrollTop)!=="undefined" ? document.body.scrollTop : window.pageYOffset; lftOff = parseInt(lftOff); topOff = parseInt(topOff); if (!document.getElementById("dmd_style")) { var styleDiv = document.createElement("div"); styleDiv.id="dmd_style"; document.getElementsByTagName("body")[0].appendChild(styleDiv); styleDiv.innerHTML = ""; }; var dmd_embedder=document.getElementById("dmd_lb"); if (dmd_embedder) dmd_embedder.parentNode.removeChild(dmd_embedder); dmd_embedder = document.createElement("div"); dmd_embedder.id="dmd_lb"; dmd_embedder.style.position="absolute"; dmd_embedder.style.left=lftOff + "px"; dmd_embedder.style.top=topOff + "px"; dmd_embedder.style.display="block"; dmd_embedder.style.width="100%"; dmd_embedder.style.height="100%"; dmd_embedder.style.overflow="hidden"; dmd_embedder.style.zIndex="999999"; document.getElementsByTagName("body")[0].appendChild(dmd_embedder); var dmd_mwindow = document.createElement("div"); dmd_mwindow.id="dmd_mw"; dmd_mwindow.style.width="0"; dmd_mwindow.style.height="0"; dmd_mwindow.style.position="absolute"; dmd_mwindow.style.left=lftOff + "px"; dmd_mwindow.style.top=topOff + "px"; dmd_mwindow.style.display="block"; dmd_mwindow.style.backgroundColor="#000000"; dmd_mwindow.style.zIndex="1000000"; dmd_embedder.appendChild(dmd_mwindow); var dmd_swindow = document.createElement("div"); dmd_swindow.id="dmd_sw"; dmd_swindow.style.zIndex="1000003"; dmd_swindow.style.width="0"; dmd_swindow.style.height="0"; dmd_swindow.style.position="absolute"; dmd_swindow.style.left=lftOff + "px"; dmd_swindow.style.top=topOff + "px"; dmd_swindow.style.display="block"; dmd_swindow.style.backgroundColor="#000000"; dmd_embedder.appendChild(dmd_swindow); var dmd_target = document.createElement("div"); dmd_target.id="dmd_trgt"; dmd_target.style.width="100%"; dmd_target.style.height="100%"; dmd_swindow.appendChild(dmd_target); var dmd_cwindow = document.createElement("div"); dmd_cwindow.id="dmd_cw"; dmd_cwindow.addEventListener("click", function() { dmd_Embedding.close(); }, false); dmd_cwindow.style.width="0px"; dmd_cwindow.style.height="0px"; dmd_cwindow.style.position="absolute"; dmd_cwindow.style.left=0 + "px"; dmd_cwindow.style.top=0 + "px"; dmd_cwindow.style.display="block"; dmd_cwindow.style.backgroundColor="transparent"; dmd_cwindow.style.zIndex="1000001"; dmd_embedder.appendChild(dmd_cwindow); var dmd_closebutton = document.createElement("div"); dmd_closebutton.id="dmd_closebtn"; dmd_closebutton.style.zIndex="1002"; dmd_closebutton.style.fontSize="12px"; dmd_closebutton.style.fontWeight="bold"; dmd_closebutton.style.display="block"; dmd_closebutton.style.border="1px solid #ffffff"; dmd_closebutton.style.position="absolute"; dmd_closebutton.style.padding="5px"; dmd_closebutton.style.color="#ffffff"; dmd_closebutton.style.cursor="pointer"; dmd_closebutton.onmouseover=function(e) { e.target.className="hovered" }; dmd_closebutton.onmouseout=function(e) { e.target.className="" }; dmd_cwindow.appendChild(dmd_closebutton); dmd_closebutton.innerHTML="X"; var dmd_nxt = document.createElement("div"); dmd_nxt.id="dmd_next"; dmd_nxt.style.zIndex="1002"; dmd_nxt.style.fontSize="12px"; dmd_nxt.style.fontWeight="bold"; dmd_nxt.style.display="block"; dmd_nxt.style.border="1px solid #ffffff"; dmd_nxt.style.position="absolute"; dmd_nxt.style.padding="5px"; dmd_nxt.style.color="#ffffff"; dmd_nxt.style.cursor="pointer"; dmd_nxt.onmouseover=function() { this.className="hovered" }; dmd_nxt.onmouseout=function() { this.className="" }; dmd_cwindow.appendChild(dmd_nxt); dmd_nxt.innerHTML=">"; var dmd_prv = document.createElement("div"); dmd_prv.id="dmd_prev"; dmd_prv.style.zIndex="1002"; dmd_prv.style.fontSize="12px"; dmd_prv.style.fontWeight="bold"; dmd_prv.style.display="block"; dmd_prv.style.border="1px solid #ffffff"; dmd_prv.style.position="absolute"; dmd_prv.style.padding="5px"; dmd_prv.style.color="#ffffff"; dmd_prv.style.cursor="pointer"; dmd_prv.onmouseover=function() { this.className="hovered" }; dmd_prv.onmouseout=function() { this.className="" }; dmd_cwindow.appendChild(dmd_prv); dmd_prv.innerHTML="<"; var dmd_fst = document.createElement("div"); dmd_fst.id="dmd_first"; dmd_fst.style.zIndex="1002"; dmd_fst.style.fontSize="12px"; dmd_fst.style.fontWeight="bold"; dmd_fst.style.display="block"; dmd_fst.style.border="1px solid #ffffff"; dmd_fst.style.position="absolute"; dmd_fst.style.padding="5px"; dmd_fst.style.color="#ffffff"; dmd_fst.style.cursor="pointer"; dmd_fst.onmouseover=function() { this.className="hovered" }; dmd_fst.onmouseout=function() { this.className="" }; dmd_cwindow.appendChild(dmd_fst); dmd_fst.innerHTML="<<"; var dmd_lst = document.createElement("div"); dmd_lst.id="dmd_last"; dmd_lst.style.zIndex="1002"; dmd_lst.style.fontSize="12px"; dmd_lst.style.fontWeight="bold"; dmd_lst.style.display="block"; dmd_lst.style.border="1px solid #ffffff"; dmd_lst.style.position="absolute"; dmd_lst.style.padding="5px"; dmd_lst.style.color="#ffffff"; dmd_lst.style.cursor="pointer"; dmd_lst.onmouseover=function() { this.className="hovered" }; dmd_lst.onmouseout=function() { this.className="" }; dmd_cwindow.appendChild(dmd_lst); dmd_lst.innerHTML=">>"; var dmd_count = document.createElement("div"); dmd_count.id="dmd_counter"; dmd_count.style.zIndex="1002"; dmd_count.style.fontSize="12px"; dmd_count.style.fontWeight="bold"; dmd_count.style.display="block"; dmd_count.style.border="1px solid #ffffff"; dmd_count.style.position="absolute"; dmd_count.style.padding="5px"; dmd_count.style.color="#ffffff"; dmd_count.style.width="100px"; dmd_count.style.display="block"; dmd_cwindow.appendChild(dmd_count); dmd_count.innerHTML=""; var dmd_titlebar = document.createElement("div"); dmd_titlebar.id="dmd_title"; dmd_titlebar.style.display="none"; dmd_titlebar.style.whiteSpace="nowrap"; dmd_titlebar.style.position="absolute"; dmd_titlebar.style.backgroundColor="#555555"; dmd_titlebar.style.padding="10px"; dmd_titlebar.style.border="1px solid #666666"; dmd_titlebar.style.color="#ffffff"; dmd_titlebar.style.zIndex="1000002"; dmd_cwindow.appendChild(dmd_titlebar); dmd_titlebar.animate = animate; dmd_embedder.style.visibility = "hidden"; dmd_mwindow.style.visibility = "hidden"; setOpacity(dmd_mwindow, 0); dmd_swindow.style.visibility = "hidden"; setOpacity(dmd_swindow, 0); dmd_cwindow.style.visibility = "hidden"; setOpacity(dmd_titlebar, 0); dmd_titlebar.animate({ top: -parseInt(dmd_titlebar.clientHeight) }, 0); // 2 for border dmd_closebutton.onclick = function() { _this.close(); }; dmd_target.style.display="none"; }; var DMD_OVERLAY_ORIGIN_LEFT=0; var DMD_OVERLAY_ORIGIN_TOP=0; this.show=function(_new_pano, code, callback,spd) { if (DMD_ISOPENED) return false; var new_pano=DMD_PANORAMAS_LIST[_new_pano[0]][_new_pano[1]]; DMD_CURRENT_PANO=_new_pano[1]; //new 2 lines DMD_OVERLAY_ORIGIN_LEFT=typeof(window.pageXOffset)=="undefined" ? parseInt(document.body.scrollLeft) : parseInt(window.pageXOffset); DMD_OVERLAY_ORIGIN_TOP=typeof(window.pageYOffset)=="undefined" ? parseInt(document.body.scrollTop) : parseInt(window.pageYOffset); DMD_CURRENT_RUNNING=new_pano["elem"].dmd_id; dmdHidePopups(); var C_ID = new_pano["id"]; var availableHeight=parseInt(new_pano["elem"].loadedLevel); if(isNaN(availableHeight)) availableHeight = -1; var httpOrHttps = "http"; if (window.location.protocol == "https:") httpOrHttps = "https"; var embedcode=''; code = (dmd_isWebGLSupported&&(!(this.flashSupported()>=10))?code:embedcode); DMD_ISOPENED=true; var lftOff=typeof(window.pageXOffset)=="undefined" ? document.body.scrollLeft : window.pageXOffset, topOff=typeof(window.pageYOffset)=="undefined" ? document.body.scrollTop : window.pageYOffset; lftOff = parseInt(lftOff); topOff = parseInt(topOff); var dmd_embedder = document.getElementById("dmd_lb"); var dmd_mwindow = document.getElementById("dmd_mw"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_cwindow = document.getElementById("dmd_cw"); var dmd_titlebar = document.getElementById("dmd_title"); var dmd_closebutton = document.getElementById("dmd_closebtn"); var dmd_count = document.getElementById("dmd_counter"); var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); var dmd_target = document.getElementById("dmd_trgt"); dmd_embedder.style.visibility="visible"; dmd_embedder.style.left=DMD_OVERLAY_ORIGIN_LEFT+"px"; dmd_embedder.style.top=DMD_OVERLAY_ORIGIN_TOP+"px"; //Target Element to be displayed dmd_target.innerHTML=code; dmd_target.style.display="block"; //Title of the image dmd_titlebar.animate = animate; dmd_titlebar.innerHTML = "";//(new_pano[1] == "") ? "Untitled" : new_pano[1]; dmd_titlebar.style.left=(getLBWidth() - dmd_titlebar.clientWidth)*0.5-parseInt(dmd_titlebar.style.paddingLeft) + "px"; dmd_titlebar.style.top=-parseInt(dmd_titlebar.clientHeight) - 2*parseInt(dmd_titlebar.style.paddingTop) - 2 + "px"; //Close Button dmd_closebutton.style.left=getLBWidth()-parseInt(dmd_closebutton.clientWidth) - 5 + "px"; dmd_closebutton.style.top=5 + "px"; //Next Button dmd_nxt.style.left=getLBWidth() / 2 + 100 + "px"; dmd_nxt.style.top=(getLBHeight()-5-parseInt(dmd_nxt.clientHeight)) + "px"; dmd_nxt.onclick = function (e) { if(e.preventDefault)e.preventDefault(); if(e.stopPropagation)e.stopPropagation(); if(e.returnValue)e.returnValue=false; dmd_Embedding.next(); return false; }; dmd_nxt.style.display = (DMD_PANORAMAS_LIST[_new_pano[0]].length <= 1) ? "none" : "block"; dmd_nxt.dmd_grp=_new_pano[0]; dmd_nxt.dmd_index=_new_pano[1]; //Prev Button dmd_prv.style.left=(getLBWidth() / 2 - 100 - parseInt(dmd_prv.clientWidth)) + "px"; dmd_prv.style.top=(getLBHeight()-5-parseInt(dmd_prv.clientHeight)) + "px"; dmd_prv.onclick = function (e) { if(e.preventDefault)e.preventDefault(); if(e.stopPropagation)e.stopPropagation(); if(e.returnValue)e.returnValue=false; dmd_Embedding.previous(); return false; }; dmd_prv.style.display = (DMD_PANORAMAS_LIST[_new_pano[0]].length <= 1) ? "none" : "block"; dmd_prv.dmd_grp=_new_pano[0]; dmd_prv.dmd_index=_new_pano[1]; //First Button dmd_fst.style.left=(getLBWidth() / 2 - 100 - parseInt(dmd_prv.clientWidth) - parseInt(dmd_fst.clientWidth) - 5) + "px"; dmd_fst.style.top=(getLBHeight()-5-parseInt(dmd_fst.clientHeight)) + "px"; dmd_fst.onclick = function (e) { if(e.preventDefault)e.preventDefault(); if(e.stopPropagation)e.stopPropagation(); if(e.returnValue)e.returnValue=false; dmd_Embedding.first(); return false; }; dmd_fst.style.display = (DMD_PANORAMAS_LIST[_new_pano[0]].length <= 1) ? "none" : "block"; dmd_fst.dmd_grp=_new_pano[0]; dmd_fst.dmd_index=_new_pano[1]; //Last Button dmd_lst.style.left=(getLBWidth() / 2 + 100 + parseInt(dmd_nxt.clientWidth) + 5) + "px"; dmd_lst.style.top=(getLBHeight()-5-parseInt(dmd_lst.clientHeight)) + "px"; dmd_lst.onclick = function (e) { if(e.preventDefault)e.preventDefault(); if(e.stopPropagation)e.stopPropagation(); if(e.returnValue)e.returnValue=false; dmd_Embedding.last(); return false; }; dmd_lst.style.display = (DMD_PANORAMAS_LIST[_new_pano[0]].length <= 1) ? "none" : "block"; dmd_lst.dmd_grp=_new_pano[0]; dmd_lst.dmd_index=_new_pano[1]; //Counter dmd_count.innerHTML='
' + (DMD_CURRENT_PANO+1) + '/' + (DMD_PANORAMAS_LIST[_new_pano[0]].length) + '
'; dmd_count.style.left=getLBWidth() / 2 - parseInt(dmd_count.clientWidth)/2 + "px"; dmd_count.style.top=(getLBHeight()-5-parseInt(dmd_count.clientHeight)) + "px"; dmd_count.style.display = (DMD_PANORAMAS_LIST[_new_pano[0]].length <= 1) ? "none" : "block"; //Controls Window dmd_cwindow.style.width="100%"; dmd_cwindow.style.height="100%"; dmd_cwindow.style.visibility="hidden"; //Main Window dmd_mwindow.style.left=0; dmd_mwindow.style.top=0; dmd_mwindow.style.width=getLBWidth()+"px"; dmd_mwindow.style.height=getLBHeight()+"px"; setOpacity(dmd_mwindow, 0); dmd_mwindow.animate=animate; dmd_mwindow.style.visibility="visible"; dmd_mwindow.animate({ opacity:0.5}, DURATION, function() { dmd_cwindow.style.visibility="visible"; }); //Sub Window dmd_swindow.style.left=EMPTY_AREA/2+"px"; dmd_swindow.style.top=EMPTY_AREA/2+"px"; dmd_swindow.style.width=(getLBWidth()-EMPTY_AREA)+"px"; dmd_swindow.style.height=(getLBHeight()-EMPTY_AREA)+"px"; setOpacity(dmd_swindow, 0); dmd_swindow.animate=animate; dmd_swindow.style.visibility="visible"; dmd_swindow.animate({opacity:1}, DURATION, function() { dmd_titlebar.animate({ top: 0 }, DURATION); }); return false; }; var cTimeout=-1; this.flashSupported=function() { var flashVersion = "0,0,0"; try { try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); try { axo.AllowScriptAccess = "always"; } catch(e) { flashVersion = "6,0,0"; } } catch(e) {} flashVersion = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, "","").match(/^,?(.+),?$/)[1]; } catch(e) { try { if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ flashVersion = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; } } catch(e) {} } flashVersion = flashVersion.split(",").shift(); return flashVersion*(!dmd_isWebGLSupported?1:0); }; this.close=function() { dmdHidePopups(); if (!DMD_ISOPENED) return false; DMD_ISOPENED=false; var dmd_embedder = document.getElementById("dmd_lb"); var dmd_mwindow = document.getElementById("dmd_mw"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_cwindow = document.getElementById("dmd_cw"); var dmd_target = document.getElementById("dmd_trgt"); //dmd_target.style.display="none"; dmd_cwindow.style.visibility="hidden"; dmd_swindow.animate({ opacity:0}, DURATION, function() { dmd_swindow.style.visibility="hidden"; }); dmd_mwindow.animate({ opacity:0}, DURATION, function() { dmd_mwindow.style.visibility="hidden"; dmd_target.style.display="none"; dmd_embedder.style.visibility="hidden"; }); var isFSupported=this.flashSupported()>=10; if(!isFSupported&&dmd_isWebGLSupported) { if(DMD_CURRENT_RUNNING!="") { var parenttmp=DMD_SHARED_CANVAS.parentNode; if(parenttmp) { parenttmp.removeChild(DMD_SHARED_CANVAS); parenttmp.parentNode.removeChild(parenttmp); } DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; if(eval("typeof(pano_"+DMD_CURRENT_RUNNING+")!=\"undefined\"")) { var x=eval("pano_"+DMD_CURRENT_RUNNING); if(x!=null) { x.release(); delete x; x=null; eval("pano_"+DMD_CURRENT_RUNNING+"=null;"); } } } } DMD_CURRENT_RUNNING=""; DMD_LAST_RUNNING=""; return false; }; this.next=function() { if (!DMD_ISOPENED) return; var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); if (dmd_nxt.dmd_index+1 >= DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp].length) return; DMD_CURRENT_PANO=dmd_nxt.dmd_index+1; dmd_nxt.dmd_index=DMD_CURRENT_PANO; var NEXT_ID = DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp][DMD_CURRENT_PANO]["id"]; DMD_CURRENT_RUNNING=NEXT_ID; dmd_nxt.dmd_index=DMD_CURRENT_PANO; dmd_prv.dmd_index=DMD_CURRENT_PANO; dmd_fst.dmd_index=DMD_CURRENT_PANO; dmd_lst.dmd_index=DMD_CURRENT_PANO; dmdHidePopups(); var httpOrHttps = "http"; if (window.location.protocol == "https:") httpOrHttps = "https"; var availableHeight=parseInt(DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp][dmd_nxt.dmd_index]["elem"].loadedLevel); if(isNaN(availableHeight)) availableHeight = -1; var spd=DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp][DMD_CURRENT_PANO]["spd"]; var fsicon=DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp][DMD_CURRENT_PANO]["fsicon"]; var cpicon=DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp][DMD_CURRENT_PANO]["cpicon"]; var embedcode=''; embedcode=(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))?"":embedcode); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { if(DMD_LAST_RUNNING!="") { var parenttmp=DMD_SHARED_CANVAS.parentNode; if(parenttmp) { parenttmp.removeChild(DMD_SHARED_CANVAS); parenttmp.parentNode.removeChild(parenttmp); } DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; if(eval("typeof(pano_"+DMD_LAST_RUNNING+")!=\"undefined\"")) { var x=eval("pano_"+DMD_LAST_RUNNING); if(x!=null) { x.release(); delete x; x=null; eval("pano_"+DMD_LAST_RUNNING+"=null;"); } } DMD_LAST_RUNNING=""; } } var dmd_target = document.getElementById("dmd_trgt"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_titlebar = document.getElementById("dmd_title"); var dmd_count = document.getElementById("dmd_counter"); dmd_count.animate=animate; dmd_count.innerHTML='
' + (DMD_CURRENT_PANO+1) + '/' + DMD_PANORAMAS_LIST[dmd_nxt.dmd_grp].length + '
'; dmd_count.style.left=getLBWidth() / 2 - parseInt(dmd_count.clientWidth)/2 + "px"; dmd_count.style.top=(getLBHeight()-5-parseInt(dmd_count.clientHeight)) + "px"; dmd_titlebar.animate=animate; //dmd_swindow.animate=animate; dmd_titlebar.animate({ top: -parseInt(dmd_titlebar.clientHeight) }, DURATION); dmd_target.style.display="none"; //dmd_swindow.animate({ width:0, height:0, left:getLBWidth()/2, top:getLBHeight()/2, opacity:0}, DURATION, function() { dmd_swindow.style.width="0px"; dmd_swindow.style.height="0px"; dmd_swindow.style.left=getLBWidth()/2; dmd_swindow.style.top=getLBHeight()/2; dmd_target.innerHTML=embedcode; dmd_swindow.animate({ width:getLBWidth(), height:getLBHeight(), left:0, top:0, opacity:.9}, DURATION, function() { dmd_swindow.animate({ width:getLBWidth()-EMPTY_AREA, height:getLBHeight()-EMPTY_AREA, left:EMPTY_AREA/2, top:EMPTY_AREA/2, opacity:1}, DURATION, function() { dmd_target.style.display="block"; dmd_titlebar.innerHTML="";/*(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1];*/ dmd_titlebar.styleleft=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); }); }); }); dmd_target.style.display="block"; dmd_titlebar.innerHTML="";//(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1]; dmd_titlebar.styleleft=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+NEXT_ID, NEXT_ID, function() { var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+NEXT_ID+"=new DMDEquiViewer_"+NEXT_ID+"(DMD_SHARED_CANVAS.id); pano_"+NEXT_ID+".resize(); pano_"+NEXT_ID+".controls.dmd_playspeed_x="+spd+"; pano_"+NEXT_ID+".enableFullscreenIcon("+(fsicon==0?"false":"true")+"); pano_"+NEXT_ID+".enableCompassIcon("+(cpicon==0?"false":"true")+"); pano_"+NEXT_ID+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=NEXT_ID; var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=embedcode; var dmd_target2=document.getElementById("dmd_trgt"); dmd_target2.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=NEXT_ID; }); } else { dmd_target.innerHTML=embedcode; } }; this.previous=function() { if (!DMD_ISOPENED) return; var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); if (dmd_prv.dmd_index-1 < 0) return; DMD_CURRENT_PANO=dmd_prv.dmd_index-1; dmd_prv.dmd_index=DMD_CURRENT_PANO; var PREV_ID = DMD_PANORAMAS_LIST[dmd_prv.dmd_grp][DMD_CURRENT_PANO]["id"]; DMD_CURRENT_RUNNING=PREV_ID; dmd_nxt.dmd_index=DMD_CURRENT_PANO; dmd_prv.dmd_index=DMD_CURRENT_PANO; dmd_fst.dmd_index=DMD_CURRENT_PANO; dmd_lst.dmd_index=DMD_CURRENT_PANO; dmdHidePopups(); var httpOrHttps = "http"; if (window.location.protocol == "https:") httpOrHttps = "https"; var availableHeight=parseInt(DMD_PANORAMAS_LIST[dmd_prv.dmd_grp][dmd_prv.dmd_index]["elem"].loadedLevel); if(isNaN(availableHeight)) availableHeight = -1; var spd=DMD_PANORAMAS_LIST[dmd_prv.dmd_grp][DMD_CURRENT_PANO]["spd"]; var fsicon=DMD_PANORAMAS_LIST[dmd_prv.dmd_grp][DMD_CURRENT_PANO]["fsicon"]; var cpicon=DMD_PANORAMAS_LIST[dmd_prv.dmd_grp][DMD_CURRENT_PANO]["cpicon"]; var embedcode=''; embedcode=(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))?"":embedcode); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { if(DMD_LAST_RUNNING!="") { var parenttmp=DMD_SHARED_CANVAS.parentNode; if(parenttmp) { parenttmp.removeChild(DMD_SHARED_CANVAS); parenttmp.parentNode.removeChild(parenttmp); } DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; if(eval("typeof(pano_"+DMD_LAST_RUNNING+")!=\"undefined\"")) { var x=eval("pano_"+DMD_LAST_RUNNING); if(x!=null) { x.release(); delete x; x=null; eval("pano_"+DMD_LAST_RUNNING+"=null;"); } } DMD_LAST_RUNNING=""; } } var dmd_target = document.getElementById("dmd_trgt"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_titlebar = document.getElementById("dmd_title"); var dmd_count = document.getElementById("dmd_counter"); dmd_count.animate=animate; dmd_count.innerHTML='
' + (DMD_CURRENT_PANO+1) + '/' + DMD_PANORAMAS_LIST[dmd_prv.dmd_grp].length + '
'; dmd_count.style.left=getLBWidth() / 2 - parseInt(dmd_count.clientWidth)/2 + "px"; dmd_count.style.top=(getLBHeight()-5-parseInt(dmd_count.clientHeight)) + "px"; dmd_titlebar.animate=animate; dmd_swindow.animate=animate; dmd_titlebar.animate({ top: -parseInt(dmd_titlebar.clientHeight)}, DURATION); dmd_target.style.display="none"; //dmd_swindow.animate({ width:0, height:0, left:getLBWidth()/2, top:getLBHeight()/2, opacity:0}, DURATION, function() { dmd_swindow.style.width="0px"; dmd_swindow.style.height="0px"; dmd_swindow.style.left=getLBWidth()/2; dmd_swindow.style.top=getLBHeight()/2; dmd_target.innerHTML=embedcode; dmd_swindow.animate({ width:getLBWidth(), height:getLBHeight(), left:0, top:0, opacity:.9}, DURATION, function() { dmd_swindow.animate({ width:getLBWidth()-EMPTY_AREA, height:getLBHeight()-EMPTY_AREA, left:EMPTY_AREA/2, top:EMPTY_AREA/2, opacity:1}, DURATION, function() { dmd_target.style.display="block"; dmd_titlebar.innerHTML="";/*(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1];*/ dmd_titlebar.style.left=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); }); }); }); dmd_target.style.display="block"; dmd_titlebar.innerHTML="";//(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1]; dmd_titlebar.styleleft=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+PREV_ID, PREV_ID, function() { var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+PREV_ID+"=new DMDEquiViewer_"+PREV_ID+"(DMD_SHARED_CANVAS.id); pano_"+PREV_ID+".resize(); pano_"+PREV_ID+".controls.dmd_playspeed_x="+spd+"; pano_"+PREV_ID+".enableFullscreenIcon("+(fsicon==0?"false":"true")+"); pano_"+PREV_ID+".enableCompassIcon("+(cpicon==0?"false":"true")+"); pano_"+PREV_ID+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=PREV_ID; var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=embedcode; var dmd_target2=document.getElementById("dmd_trgt"); dmd_target2.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=PREV_ID; }); } else { dmd_target.innerHTML=embedcode; } }; this.first=function() { if (!DMD_ISOPENED) return; var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); if (DMD_CURRENT_PANO == 0) retun; DMD_CURRENT_PANO=0; dmd_fst.dmd_index=DMD_CURRENT_PANO; var NEXT_ID = DMD_PANORAMAS_LIST[dmd_fst.dmd_grp][DMD_CURRENT_PANO]["id"]; DMD_CURRENT_RUNNING=NEXT_ID; dmd_nxt.dmd_index=DMD_CURRENT_PANO; dmd_prv.dmd_index=DMD_CURRENT_PANO; dmd_fst.dmd_index=DMD_CURRENT_PANO; dmd_lst.dmd_index=DMD_CURRENT_PANO; dmdHidePopups(); var httpOrHttps = "http"; if (window.location.protocol == "https:") httpOrHttps = "https"; var availableHeight=parseInt(DMD_PANORAMAS_LIST[dmd_fst.dmd_grp][dmd_fst.dmd_index]["elem"].loadedLevel); if(isNaN(availableHeight)) availableHeight = -1; var spd=DMD_PANORAMAS_LIST[dmd_fst.dmd_grp][DMD_CURRENT_PANO]["spd"]; var fsicon=DMD_PANORAMAS_LIST[dmd_fst.dmd_grp][DMD_CURRENT_PANO]["fsicon"]; var cpicon=DMD_PANORAMAS_LIST[dmd_fst.dmd_grp][DMD_CURRENT_PANO]["cpicon"]; var embedcode=''; embedcode=(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))?"":embedcode); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { if(DMD_LAST_RUNNING!="") { var parenttmp=DMD_SHARED_CANVAS.parentNode; if(parenttmp) { parenttmp.removeChild(DMD_SHARED_CANVAS); parenttmp.parentNode.removeChild(parenttmp); } DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; if(eval("typeof(pano_"+DMD_LAST_RUNNING+")!=\"undefined\"")) { var x=eval("pano_"+DMD_LAST_RUNNING); if(x!=null) { x.release(); delete x; x=null; eval("pano_"+DMD_LAST_RUNNING+"=null;"); } } DMD_LAST_RUNNING=""; } } var dmd_target = document.getElementById("dmd_trgt"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_titlebar = document.getElementById("dmd_title"); var dmd_count = document.getElementById("dmd_counter"); dmd_count.animate=animate; dmd_count.innerHTML='
' + (DMD_CURRENT_PANO+1) + '/' + DMD_PANORAMAS_LIST[dmd_fst.dmd_grp].length + '
'; dmd_count.style.left=getLBWidth() / 2 - parseInt(dmd_count.clientWidth)/2 + "px"; dmd_count.style.top=(getLBHeight()-5-parseInt(dmd_count.clientHeight)) + "px"; var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); dmd_nxt.dmd_index=DMD_CURRENT_PANO; dmd_prv.dmd_index=DMD_CURRENT_PANO; dmd_fst.dmd_index=DMD_CURRENT_PANO; dmd_lst.dmd_index=DMD_CURRENT_PANO; dmd_titlebar.animate=animate; dmd_swindow.animate=animate; dmd_titlebar.animate({ top: -parseInt(dmd_titlebar.clientHeight) }, DURATION); dmd_target.style.display="none"; //dmd_swindow.animate({ width:0, height:0, left:getLBWidth()/2, top:getLBHeight()/2, opacity:0}, DURATION, function() { dmd_swindow.style.width="0px"; dmd_swindow.style.height="0px"; dmd_swindow.style.left=getLBWidth()/2; dmd_swindow.style.top=getLBHeight()/2; dmd_target.innerHTML=embedcode; dmd_swindow.animate({ width:getLBWidth(), height:getLBHeight(), left:0, top:0, opacity:.9}, DURATION, function() { dmd_swindow.animate({ width:getLBWidth()-EMPTY_AREA, height:getLBHeight()-EMPTY_AREA, left:EMPTY_AREA/2, top:EMPTY_AREA/2, opacity:1}, DURATION, function() { dmd_target.style.display="block"; dmd_titlebar.innerHTML="";/*(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1];*/ dmd_titlebar.styleleft=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); }); }); }); dmd_target.style.display="block"; dmd_titlebar.innerHTML="";//(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1]; dmd_titlebar.styleleft=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+NEXT_ID, NEXT_ID, function() { var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+NEXT_ID+"=new DMDEquiViewer_"+NEXT_ID+"(DMD_SHARED_CANVAS.id); pano_"+NEXT_ID+".resize(); pano_"+NEXT_ID+".controls.dmd_playspeed_x="+spd+"; pano_"+NEXT_ID+".enableFullscreenIcon("+(fsicon==0?"false":"true")+"); pano_"+NEXT_ID+".enableCompassIcon("+(cpicon==0?"false":"true")+"); pano_"+NEXT_ID+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=NEXT_ID; var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=embedcode; var dmd_target2=document.getElementById("dmd_trgt"); dmd_target2.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=NEXT_ID; }); } else { dmd_target.innerHTML=embedcode; } }; this.last=function() { if (!DMD_ISOPENED) return; var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); if (DMD_CURRENT_PANO == DMD_PANORAMAS_LIST[dmd_lst.dmd_grp].length-1) return; DMD_CURRENT_PANO = DMD_PANORAMAS_LIST[dmd_lst.dmd_grp].length-1; var PREV_ID = DMD_PANORAMAS_LIST[dmd_lst.dmd_grp][DMD_CURRENT_PANO]["id"]; DMD_CURRENT_RUNNING=PREV_ID; dmd_nxt.dmd_index=DMD_CURRENT_PANO; dmd_prv.dmd_index=DMD_CURRENT_PANO; dmd_fst.dmd_index=DMD_CURRENT_PANO; dmd_lst.dmd_index=DMD_CURRENT_PANO; dmdHidePopups(); var httpOrHttps = "http"; if (window.location.protocol == "https:") httpOrHttps = "https"; var availableHeight=parseInt(DMD_PANORAMAS_LIST[dmd_lst.dmd_grp][dmd_lst.dmd_index]["elem"].loadedLevel); if(isNaN(availableHeight)) availableHeight = -1; var spd=DMD_PANORAMAS_LIST[dmd_lst.dmd_grp][DMD_CURRENT_PANO]["spd"]; var fsicon=DMD_PANORAMAS_LIST[dmd_lst.dmd_grp][DMD_CURRENT_PANO]["fsicon"]; var cpicon=DMD_PANORAMAS_LIST[dmd_lst.dmd_grp][DMD_CURRENT_PANO]["cpicon"]; var embedcode=''; embedcode=(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))?"":embedcode); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { if(DMD_LAST_RUNNING!="") { var parenttmp=DMD_SHARED_CANVAS.parentNode; if(parenttmp) { parenttmp.removeChild(DMD_SHARED_CANVAS); parenttmp.parentNode.removeChild(parenttmp); } DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; if(eval("typeof(pano_"+DMD_LAST_RUNNING+")!=\"undefined\"")) { var x=eval("pano_"+DMD_LAST_RUNNING); if(x!=null) { x.release(); delete x; x=null; eval("pano_"+DMD_LAST_RUNNING+"=null;"); } } DMD_LAST_RUNNING=""; } } var dmd_target = document.getElementById("dmd_trgt"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_titlebar = document.getElementById("dmd_title"); var dmd_count = document.getElementById("dmd_counter"); dmd_count.animate=animate; dmd_count.innerHTML='
' + (DMD_CURRENT_PANO+1) + '/' + DMD_PANORAMAS_LIST[dmd_lst.dmd_grp].length + '
'; dmd_count.style.left=getLBWidth() / 2 - parseInt(dmd_count.clientWidth)/2 + "px"; dmd_count.style.top=(getLBHeight()-5-parseInt(dmd_count.clientHeight)) + "px"; var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); dmd_nxt.dmd_index=DMD_CURRENT_PANO; dmd_prv.dmd_index=DMD_CURRENT_PANO; dmd_fst.dmd_index=DMD_CURRENT_PANO; dmd_lst.dmd_index=DMD_CURRENT_PANO; dmd_titlebar.animate=animate; dmd_swindow.animate=animate; dmd_titlebar.animate({ top: -parseInt(dmd_titlebar.clientHeight)}, DURATION); dmd_target.style.display="none"; //dmd_swindow.animate({ width:0, height:0, left:getLBWidth()/2, top:getLBHeight()/2, opacity:0}, DURATION, function() { dmd_swindow.style.width="0px"; dmd_swindow.style.height="0px"; dmd_swindow.style.left=getLBWidth()/2; dmd_swindow.style.top=getLBHeight()/2; dmd_target.innerHTML=embedcode; dmd_swindow.animate({ width:getLBWidth(), height:getLBHeight(), left:0, top:0, opacity:.9}, DURATION, function() { dmd_swindow.animate({ width:getLBWidth()-EMPTY_AREA, height:getLBHeight()-EMPTY_AREA, left:EMPTY_AREA/2, top:EMPTY_AREA/2, opacity:1}, DURATION, function() { dmd_target.style.display="block"; dmd_titlebar.innerHTML="";/*(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1];*/ dmd_titlebar.style.left=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); }); }); }); dmd_target.style.display="block"; dmd_titlebar.innerHTML="";//(DMD_PANOS_LIST[DMD_CURRENT_PANO][1] == "") ? "Untitled" : DMD_PANOS_LIST[DMD_CURRENT_PANO][1]; dmd_titlebar.styleleft=(getLBWidth() - dmd_titlebar.clientWidth)*0.5; dmd_titlebar.animate({ top: 0 }, DURATION); if(dmd_isWebGLSupported&&(!(this.flashSupported()>=10))) { dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+PREV_ID, PREV_ID, function() { var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+PREV_ID+"=new DMDEquiViewer_"+PREV_ID+"(DMD_SHARED_CANVAS.id); pano_"+PREV_ID+".resize(); pano_"+PREV_ID+".controls.dmd_playspeed_x="+spd+"; pano_"+PREV_ID+".enableFullscreenIcon("+(fsicon==0?"false":"true")+"); pano_"+PREV_ID+".enableCompassIcon("+(cpicon==0?"false":"true")+"); pano_"+PREV_ID+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=PREV_ID; var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=embedcode; var dmd_target2=document.getElementById("dmd_trgt"); dmd_target2.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=PREV_ID; }); } else { dmd_target.innerHTML=embedcode; } }; var _this = this; var resTimeout=0; this.resize=function() { //if (DMD_ISOPENED) this.close(); clearTimeout(resTimeout); resTimeout=setTimeout(function() { var dmd_mwindow = document.getElementById("dmd_mw"); var dmd_swindow = document.getElementById("dmd_sw"); var dmd_cwindow = document.getElementById("dmd_cw"); var dmd_titlebar = document.getElementById("dmd_title"); var dmd_closebutton = document.getElementById("dmd_closebtn"); var dmd_count = document.getElementById("dmd_counter"); var dmd_nxt = document.getElementById("dmd_next"); var dmd_prv = document.getElementById("dmd_prev"); var dmd_fst = document.getElementById("dmd_first"); var dmd_lst = document.getElementById("dmd_last"); //Title of the image dmd_titlebar.style.left= (getLBWidth() - dmd_titlebar.clientWidth)*0.5 + "px"; dmd_titlebar.style.top=-parseInt(dmd_titlebar.clientHeight) + "px"; //Close Button dmd_closebutton.style.left=getLBWidth()-parseInt(dmd_closebutton.clientWidth)-5 + "px"; dmd_closebutton.style.top=5 + "px"; //Controls Window dmd_cwindow.style.width="100%"; dmd_cwindow.style.height="100%"; //Main Window dmd_mwindow.style.left=0+"px"; dmd_mwindow.style.top=0+"px"; dmd_mwindow.style.width=getLBWidth()+"px"; dmd_mwindow.style.height=getLBHeight()+"px"; //Sub Window dmd_swindow.style.left=EMPTY_AREA/2 + "px"; dmd_swindow.style.top=EMPTY_AREA/2 + "px"; dmd_swindow.style.width=getLBWidth()-EMPTY_AREA+"px"; dmd_swindow.style.height=getLBHeight()-EMPTY_AREA+"px"; dmd_count.style.left=getLBWidth() / 2 - parseInt(dmd_count.clientWidth)/2 + "px"; dmd_count.style.top=(getLBHeight()-5-parseInt(dmd_count.clientHeight)) + "px"; dmd_nxt.style.left=getLBWidth() / 2 + 100 + "px"; dmd_nxt.style.top=(getLBHeight()-5-parseInt(dmd_nxt.clientHeight)) + "px"; dmd_prv.style.left=(getLBWidth() / 2 - 100 - parseInt(dmd_prv.clientWidth)) + "px"; dmd_prv.style.top=(getLBHeight()-5-parseInt(dmd_prv.clientHeight)) + "px"; dmd_fst.style.left=(getLBWidth() / 2 - 100 - parseInt(dmd_prv.clientWidth) - parseInt(dmd_fst.clientWidth) - 5) + "px"; dmd_fst.style.top=(getLBHeight()-5-parseInt(dmd_fst.clientHeight)) + "px"; dmd_lst.style.left=(getLBWidth() / 2 + 100 + parseInt(dmd_nxt.clientWidth) + 5) + "px"; dmd_lst.style.top=(getLBHeight()-5-parseInt(dmd_lst.clientHeight)) + "px"; try { if(dmd_isWebGLSupported&&(!(_this.flashSupported()>=10))) { var cPanoID=DMD_PANORAMAS_LIST[dmd_lst.dmd_grp][DMD_CURRENT_PANO]["id"]; var x=eval("pano_"+cPanoID); x.windowResize(); } } catch(e) { } return false; },500); }; /* this.scroll=function() { var dmd_embedder=document.getElementById("dmd_lb"); dmd_embedder.style.left=typeof(window.pageXOffset)=="undefined" ? document.body.scrollLeft + "px" : window.pageXOffset + "px" ; dmd_embedder.style.top=typeof(window.pageYOffset)=="undefined" ? document.body.scrollTop + "px" : window.pageYOffset + "px"; }; */ this.scroll=function () { if(document.getElementById("dmd_trgt").style.display == "none") return; if (typeof(window.scrollY) !== "undefined") { window.scroll(DMD_OVERLAY_ORIGIN_LEFT, DMD_OVERLAY_ORIGIN_TOP); return;}; typeof(window.pageXOffset)=="undefined" ? document.body.scrollLeft=DMD_OVERLAY_ORIGIN_LEFT + "px" : window.pageXOffset=DMD_OVERLAY_ORIGIN_LEFT + "px" ; typeof(window.pageYOffset)=="undefined" ? document.body.scrollTop=DMD_OVERLAY_ORIGIN_TOP + "px" : window.pageYOffset= DMD_OVERLAY_ORIGIN_TOP + "px"; window.scroll(DMD_OVERLAY_ORIGIN_LEFT, DMD_OVERLAY_ORIGIN_TOP); } }; if(!document.getElementById("dmd_reporting")) { var styleDiv = document.createElement("div"); styleDiv.id="dmd_codeFuncs"; styleDiv.innerHTML = '
'; var scr=document.createElement("script"); scr.innerHTML='function dmdSwfReady() { var objs=document.getElementsByTagName("object"); var objs2=document.getElementsByTagName("embed"); if(objs) for(var i=0; i 0) { dmdEmbeds.pop(); } }; this.closeLastPanorama=function() { if(DMD_LAST_RUNNING!="") { var parenttmp=DMD_SHARED_CANVAS.parentNode; if(parenttmp) { parenttmp.removeChild(DMD_SHARED_CANVAS); parenttmp.parentNode.removeChild(parenttmp); } DMD_SHARED_CANVAS.style.display="none"; DMD_SHARED_CANVAS.style.opacity="0"; if(eval("typeof(pano_"+DMD_LAST_RUNNING+")!=\"undefined\"")) { var x=eval("pano_"+DMD_LAST_RUNNING); if(x!=null) { x.release(); delete x; x=null; eval("pano_"+DMD_LAST_RUNNING+"=null;"); } } } }; this.loadPanorama = function(id, force10) { var dts=new Date(); var dmd_embed_ts=dts.getTime(); delete dts; var element=document.getElementById("dmd_pano_" + id); var elementInfo=document.getElementById("holder_info_" + id); var elementMainInfo=document.getElementById("holder_main_info_" + id); var dmd_ps=1.0; var dmd_cpicon=1; var dmd_fsicon=1; var dmd_index=-1; if (element==null) { //element=document.getElementById("dmd_pano_" + id + "_loaded"); return; } else { if(element.getAttribute("dmd_ps")!=null) { dmd_ps=parseFloat(element.getAttribute("dmd_ps")); if(isNaN(dmd_ps))dmd_ps=1.0; } if(element.getAttribute("dmd_fs")!=null) { dmd_fsicon=parseInt(element.getAttribute("dmd_fs")); if(isNaN(dmd_fsicon))dmd_fsicon=1; } if(element.getAttribute("dmd_cp")!=null) { dmd_cpicon=parseInt(element.getAttribute("dmd_cp")); if(isNaN(dmd_cpicon))dmd_cpicon=1; } var grp=0; if(element.getAttribute("dmd_group")!=null) { grp=parseInt(element.getAttribute("dmd_group")); if(isNaN(grp))grp=0; } element.dmd_ts=dmd_embed_ts; element.dmd_grp=grp; element.dmd_id=id; if(elementInfo!=null) elementInfo.id=elementInfo.id+"_"+dmd_embed_ts; if(elementMainInfo!=null) elementMainInfo.id=elementMainInfo.id+"_"+dmd_embed_ts; element.id = "dmd_pano_" + id + "_loaded_"+element.dmd_ts; dmd_index=addPanoToList({"id":id, "elem":element, "grp":grp, "spd":dmd_ps, "fsicon":dmd_fsicon, "cpicon":dmd_cpicon}); element.dmd_index=dmd_index; } //element.style.position="relative"; //element.style.boxSizing="border-box"; var code = ""; var httpOrHttps = "http"; if (window.location.protocol == "https:") httpOrHttps = "https"; var iOS = navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i); var ANDROID = navigator.userAgent.toLowerCase().match(/android/i); var enableDmd_Embedding = true; if (typeof(dmd_overlay) !== "undefined")if (typeof(dmd_overlay) !== "undefined")enableDmd_Embedding=dmd_overlay; var frmTwitter=false; if (typeof(dmd_from_twitter) !== "undefined") if (dmd_from_twitter) frmTwitter = dmd_from_twitter; var putHover=false; var isInsideIframe=((window.location != window.parent.location) ? true : false); var isInIframe = isInsideIframe || !enableDmd_Embedding; if (this.flashSupported && !iOS && !ANDROID) { dmd_isWebGLSupported=false; var code = ""; if ((this.getFlashVersion() >= 11) && !force10) { code = "\ \ \ \ \ \ \ \ \ \ "; DMD_AUTOPLAY=0; } else { code = "" + ""+ ""+ ""+ ""+ ""+ ""+ ""+ ""; DMD_AUTOPLAY = 0; }; if (isInIframe && !frmTwitter) { element.innerHTML = code; if(infoBar)infoBar.style.visibility="hidden"; } else { putHover=true; var info_effect="hover"; if(element.getAttribute("dmd_pano_info_effect")!=null) { info_effect=element.getAttribute("dmd_pano_info_effect"); } var with_hover=putHover&&(info_effect=="hover"); //element.style.width="100%"; //element.style.height="100%"; //element.style.minWidth="100%"; //element.style.minHeight="100%"; element.style.overflow="hidden"; element.level=128; element.loadedLevel=-1; element.isLoading=false; element.style.backgroundColor="black"; element.fixSize=function() { if(this.isLoading)return; var width = parseInt(this.clientWidth); var height = parseInt(this.clientHeight); if(!width || !height) return; var sdsty=(typeof(window.devicePixelRatio)!=="undefined"?parseFloat(window.devicePixelRatio):1); if((element.level==128) && (element.loadedLevel==128) && (height*sdsty>element.level*1.25)) { element.level=256; } else if((element.level==256) && (element.loadedLevel==256) && (height*sdsty>element.level*1.25)) { element.level=512; } if((this.level!=this.loadedLevel)&&!this.isLoading) { var sdsty=(typeof(window.devicePixelRatio)!=="undefined"?parseFloat(window.devicePixelRatio):1); var img=new Image(); img.onload=function() { element.loadedLevel=img.height; element.isLoading=false; element.style.background="url("+httpOrHttps+"://static.dermandar.com/php/getimage.php?epid=" + id + "&equi=1&h="+element.loadedLevel+"&r=1) 50% 50% no-repeat black"; element.style.backgroundSize="cover"; if((element.level==128) && (height*sdsty>element.level*1.25)) { element.level=256; } else if((element.level==256) && (height*sdsty>element.level*1.25)) { element.level=512; } element.fixSize(); }; this.isLoading=true; img.src=httpOrHttps+"://static.dermandar.com/php/getimage.php?epid=" + id + "&equi=1&h="+this.level+"&r=1"; } }; element.fixSize(); element.style.display="block"; if(document.getElementById("dmd_play_btn_"+id+"_"+element.dmd_ts)==null) { var playBtn=document.createElement("div"); playBtn.id="dmd_play_btn_"+id+"_"+element.dmd_ts; playBtn.dmd_grp=element.dmd_grp; playBtn.dmd_index=element.dmd_index; playBtn.style.width="100%"; playBtn.style.height="100%"; playBtn.style.minWidth="100%"; playBtn.style.minHeight="100%"; playBtn.style.cursor="pointer"; playBtn.style.position="relative"; playBtn.style.visibility="hidden"; var playOverlay=document.createElement("div"); playOverlay.dmd_grp=element.dmd_grp; playOverlay.dmd_index=element.dmd_index; playOverlay.style.width="100%"; playOverlay.style.height="100%"; playOverlay.style.position="absolute"; playOverlay.style.left="-50%"; playOverlay.style.top="0px"; playOverlay.style.backgroundColor="rgba(0,0,0,0)"; playOverlay.onclick=function(e) { var code = "\ \ \ \ \ \ \ \ \ \ "; DMD_CURRENT_RUNNING=id; if (!frmTwitter) { if(DMD_LAST_RUNNING!="") { if(document.getElementById("dmd_flash_"+DMD_LAST_RUNNING)!=null) { document.getElementById("dmd_flash_"+DMD_LAST_RUNNING).parentNode.parentNode.removeChild(document.getElementById("dmd_flash_"+DMD_LAST_RUNNING).parentNode); } } dmd_Embedding.show([this.dmd_grp,this.dmd_index], code, function() {dmdEmbedder.hookEvent(document.getElementById("dmd_flash_"+id));}, dmd_ps); DMD_LAST_RUNNING=id; } else { element.innerHTML = code; } DMD_LAST_RUNNING=id; }; playBtn.appendChild(playOverlay); var playInplace=document.createElement("div"); playInplace.dmd_grp=element.dmd_grp; playInplace.dmd_index=element.dmd_index; playInplace.style.width="100%"; playInplace.style.height="100%"; playInplace.style.position="absolute"; playInplace.style.left="50%"; playInplace.style.top="0px"; playInplace.style.backgroundColor="rgba(0,0,0,0)"; playInplace.onclick=function(e) { var code = "\ \ \ \ \ \ \ \ \ \ "; DMD_CURRENT_RUNNING=id; if (!frmTwitter) { if(DMD_LAST_RUNNING!="") { if(document.getElementById("dmd_flash_"+DMD_LAST_RUNNING)!=null) { document.getElementById("dmd_flash_"+DMD_LAST_RUNNING).parentNode.parentNode.removeChild(document.getElementById("dmd_flash_"+DMD_LAST_RUNNING).parentNode); } } DMD_LAST_RUNNING=id; element.style.position="relative"; var d=document.createElement("div"); d.style.position="absolute"; d.style.zIndex="4"; d.style.left=0; d.style.top=0; d.style.width="100%"; d.style.height="100%"; d.innerHTML=code; element.appendChild(d); } else { element.innerHTML = code; } }; playBtn.appendChild(playInplace); getAjax(httpOrHttps+"://www.dermandar.com/featurescheck.php?epid="+id+"&cl=1", function(data) { if(!data || (data["custom_logo"]==null) || (data["custom_logo"]=="")) playBtn.style.background="url("+httpOrHttps+"://static.dermandar.com/design/images/play.png) 50% 50% no-repeat transparent"; else playBtn.style.background="url("+httpOrHttps+"://static.dermandar.com/design/images/"+data["custom_logo"]+") 50% 50% no-repeat transparent"; }); playBtn.style.backgroundSize="initial"; element.appendChild(playBtn); playBtn.timeoutFixSize=0; playBtn.fixSize=function() { if(playBtn.timeoutFixSize) { clearTimeout(playBtn.timeoutFixSize); playBtn.timeoutFixSize=0 } playBtn.timeoutFixSize=setTimeout(function() { var width = parseInt(element.clientWidth); var height = parseInt(element.clientHeight); if((!width)||(!height)) return; playBtn.style.zoom=Math.min(Math.min(1,width/400.0), Math.min(1,height/200.0)); playBtn.style.MozTransform="scale("+Math.min(Math.min(1,width/400.0), Math.min(1,height/200.0))+","+Math.min(Math.min(1,width/400.0), Math.min(1,height/200.0))+")"; }, 500); }; playBtn.fixSize(); } }; this.hookEvent(element); } else { var isWP=(navigator.userAgent.match(/(Windows Phone)/g)?true:false); var isAndroid=(navigator.userAgent.match(/(Android)/g)?true:false); var isIOS=(navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?true:false); var isMobile=isIOS||isAndroid||isWP; putHover=dmd_isWebGLSupported&&!isMobile; var info_effect="hover"; if(element.getAttribute("dmd_pano_info_effect")!=null) { info_effect=element.getAttribute("dmd_pano_info_effect"); } var with_hover=putHover&&(info_effect=="hover"); element.style.overflow="hidden"; element.level=128; element.loadedLevel=-1; element.isLoading=false; element.style.backgroundColor="black"; element.fixSize=function() { var sdsty=(typeof(window.devicePixelRatio)!=="undefined"?parseFloat(window.devicePixelRatio):1); if(this.isLoading)return; var width = parseInt(this.clientWidth); var height = parseInt(this.clientHeight); if(!width || !height)return; if((element.level==128) && (element.loadedLevel==128) && (height*sdsty>element.level*1.25)) { element.level=256; } else if((element.level==256) && (element.loadedLevel==256) && (height*sdsty>element.level*1.25)) { element.level=512; } if((this.level!=this.loadedLevel)&&!this.isLoading) { var img=new Image(); img.onload=function() { var sdsty=(typeof(window.devicePixelRatio)!=="undefined"?parseFloat(window.devicePixelRatio):1); element.loadedLevel=img.height; element.isLoading=false; element.style.background="url("+httpOrHttps+"://static.dermandar.com/php/getimage.php?epid=" + id + "&equi=1&h="+element.loadedLevel+"&r=1) 50% 50% no-repeat black"; element.style.backgroundSize="cover"; if((element.level==128) && (height*sdsty>element.level*1.25)) { element.level=256; } else if((element.level==256) && (height*sdsty>element.level*1.25)) { element.level=512; } setTimeout(function() { element.fixSize(); }, 250); }; this.isLoading=true; img.src=httpOrHttps+"://static.dermandar.com/php/getimage.php?epid=" + id + "&equi=1&h="+this.level+"&r=1"; } }; element.fixSize(); //element.style.display="block"; if(document.getElementById("dmd_play_btn_"+id)==null) { var playBtn=document.createElement("div"); playBtn.id="dmd_play_btn_"+id+"_"+element.dmd_ts; playBtn.style.zIndex=1; playBtn.style.width="100%"; playBtn.style.height="100%"; playBtn.style.minWidth="100%"; playBtn.style.minHeight="100%"; playBtn.style.cursor="pointer"; playBtn.style.visibility=(putHover?"hidden":"visible"); playBtn.runningInProgress=false; var playOverlay=document.createElement("a"); playOverlay.style.width="100%"; playOverlay.style.height="100%"; playOverlay.style.position="absolute"; playOverlay.style.left="-50%"; playOverlay.style.top="0px"; playOverlay.style.outline="0px none transparent"; playOverlay.style.userSelect="none"; playOverlay.style.webkitUserSelect="none"; playOverlay.style.MozUserSelect="none"; playOverlay.style.webkitTapHighlightColor="transparent"; playOverlay.style.MozTapHighlightColor="transparent"; playOverlay.style.tapHighlightColor="transparent"; playOverlay.style.backgroundColor="rgba(0,0,0,0)"; playOverlay.target="_blank"; playOverlay.dmd_grp=element.dmd_grp; playOverlay.dmd_index=element.dmd_index; playOverlay.onclick=function(e) { if(playBtn.runningInProgress) { e.preventDefault(); return false; } if(dmd_isWebGLSupported) { playBtn.runningInProgress=true; dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+id, id, function() { if(eval("typeof DMDEquiViewer_"+id + "!=\"function\""))return; var code = ""; var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+id+"=new DMDEquiViewer_"+id+"(DMD_SHARED_CANVAS.id); pano_"+id+".resize(); pano_"+id+".controls.dmd_playspeed_x="+dmd_ps+"; pano_"+id+".enableFullscreenIcon("+(dmd_fsicon==0?"false":"true")+"); pano_"+id+".enableCompassIcon("+(dmd_cpicon==0?"false":"true")+"); pano_"+id+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=id; if (!frmTwitter) { dmdEmbedder.closeLastPanorama(); dmd_Embedding.show([playOverlay.dmd_grp,playOverlay.dmd_index], code, function() { }, dmd_ps); var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=code; var dmd_target=document.getElementById("dmd_trgt"); dmd_target.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=id; } else { element.innerHTML = code; } playBtn.runningInProgress=false; }); return false; } else { DMD_LAST_RUNNING=""; } return true; }; playOverlay.href=httpOrHttps+"://www.dermandar.com/p/"+id+(dmd_ps!=1?"?a="+dmd_ps:""); playBtn.appendChild(playOverlay); var playInplace=document.createElement("a"); playInplace.style.width="100%"; playInplace.style.height="100%"; playInplace.style.position="absolute"; playInplace.style.left="50%"; playInplace.style.top="0px"; playInplace.style.outline="0px none transparent"; playInplace.style.userSelect="none"; playInplace.style.webkitUserSelect="none"; playInplace.style.MozUserSelect="none"; playInplace.style.webkitTapHighlightColor="transparent"; playInplace.style.MozTapHighlightColor="transparent"; playInplace.style.tapHighlightColor="transparent"; playInplace.style.backgroundColor="rgba(0,0,0,0)"; playInplace.target="_blank;" playInplace.dmd_grp=element.dmd_grp; playInplace.dmd_index=element.dmd_index; playInplace.onclick=function(e) { if(playBtn.runningInProgress) { e.preventDefault(); return false; } if(dmd_isWebGLSupported) { playBtn.runningInProgress=true; dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+id, id, function() { if(eval("typeof DMDEquiViewer_"+id + "!=\"function\""))return; var code = ""; var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+id+"=new DMDEquiViewer_"+id+"(DMD_SHARED_CANVAS.id); pano_"+id+".resize(); pano_"+id+".controls.dmd_playspeed_x="+dmd_ps+"; pano_"+id+".enableFullscreenIcon("+(dmd_fsicon==0?"false":"true")+"); pano_"+id+".enableCompassIcon("+(dmd_cpicon==0?"false":"true")+"); pano_"+id+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=id; if (!frmTwitter) { dmdEmbedder.closeLastPanorama(); var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=code; element.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=id; } else { element.innerHTML = code; } playBtn.runningInProgress=false; }); return false; } return true; }; playInplace.href=httpOrHttps+"://www.dermandar.com/p/"+id+(dmd_ps!=1?"?a="+dmd_ps:""); playBtn.appendChild(playInplace); if(dmd_isWebGLSupported) { getAjax(httpOrHttps+"://www.dermandar.com/featurescheck.php?epid="+id+"&cl=1", function(data) { if(!data || (data["custom_logo"]==null) || (data["custom_logo"]=="") || (data["custom_logo"]=="play.png")) playBtn.style.background="url("+httpOrHttps+"://static.dermandar.com/design/images/play.png) 50% 50% no-repeat transparent"; else playBtn.style.background="url("+httpOrHttps+"://static.dermandar.com/design/images/"+data["custom_logo"]+") 50% 50% no-repeat transparent"; }); } else{ getAjax(httpOrHttps+"://www.dermandar.com/featurescheck.php?epid="+id+"&cl=1", function(data) { if(!data || (data["custom_logo"]==null) || (data["custom_logo"]=="") || (data["custom_logo"]=="play.png")) playBtn.style.background="url("+httpOrHttps+"://static.dermandar.com/design/images/dmd_play.png) 50% 50% no-repeat"; else playBtn.style.background="url("+httpOrHttps+"://static.dermandar.com/design/images/"+data["custom_logo"]+") 50% 50% no-repeat transparent"; }); } playBtn.style.backgroundSize="initial"; element.appendChild(playBtn); playBtn.timeoutFixSize=0; playBtn.fixSize=function() { if(playBtn.timeoutFixSize) { clearTimeout(playBtn.timeoutFixSize); playBtn.timeoutFixSize=0 } playBtn.timeoutFixSize=setTimeout(function() { var width = parseInt(element.clientWidth); var height = parseInt(element.clientHeight); if((!width)||(!height)) return; playBtn.style.zoom=Math.min(Math.min(1,width/200.0), Math.min(1,height/200.0)); playBtn.style.MozTransform="scale("+Math.min(Math.min(1,width/200.0), Math.min(1,height/200.0))+","+Math.min(Math.min(1,width/200.0), Math.min(1,height/200.0))+")"; }, 500); }; playBtn.fixSize(); // window.addEventListener("load", function() { playBtn.fixSize(); element.fixSize(); }); // window.addEventListener("resize", function() { playBtn.fixSize(); element.fixSize(); }); } if(isInIframe&&dmd_isWebGLSupported&&!this.flashSupported&&(dmd_lst.length==1)) { playBtn.runningInProgress=true; dmdLoadScript("//static.dermandar.com/js/DMDEquiViewer.js.php?v=107.17.6&pano="+id, id, function() { if(eval("typeof DMDEquiViewer_"+id + "!=\"function\""))return; var code = ""; var scriptPlayer=document.createElement("script"); scriptPlayer.innerHTML="DMD_SHARED_CANVAS.style.display=\"\"; var panoid=DMD_CURRENT_RUNNING; pano_"+id+"=new DMDEquiViewer_"+id+"(DMD_SHARED_CANVAS.id); pano_"+id+".resize(); pano_"+id+".controls.dmd_playspeed_x="+dmd_ps+"; pano_"+id+".enableFullscreenIcon("+(dmd_fsicon==0?"false":"true")+"); pano_"+id+".enableCompassIcon("+(dmd_cpicon==0?"false":"true")+"); pano_"+id+".loadPano(DMD_CURRENT_RUNNING); setTimeout(function() { DMD_SHARED_CANVAS.style.opacity=\"1\"; },16);"; scriptPlayer.async=false; DMD_CURRENT_RUNNING=id; if (!frmTwitter) { dmdEmbedder.closeLastPanorama(); var holderTmp=document.createElement("div"); holderTmp.style.width="100%"; holderTmp.style.height="100%"; holderTmp.style.position="absolute"; holderTmp.style.left="0"; holderTmp.style.top="0"; holderTmp.style.zIndex=102; holderTmp.innerHTML=code; element.appendChild(holderTmp); holderTmp.appendChild(DMD_SHARED_CANVAS); holderTmp.appendChild(scriptPlayer); DMD_LAST_RUNNING=id; } else { element.innerHTML = code; } playBtn.runningInProgress=false; }); } } var divMore=document.getElementById("dmd_pano_"+id+"_more"); if(divMore!=null) { element.style.height="65%"; element.style.minHeight="65%"; divMore=document.createElement("div"); divMore.id="dmd_pano_"+id+"_more"+"_"+element.dmd_ts; divMore.style.boxSizing="border-box"; divMore.style.width="100%"; divMore.style.minWidth="100%"; divMore.style.height="35%"; divMore.style.minHeight="35%"; divMore.style.backgroundColor="#f8f8f8"; divMore.style.overflow="hidden"; divMore.style.border="1px solid #e5e5e5"; divMore.style.textAlign="left"; divMore.style.color="#888888"; element.parentNode.appendChild(divMore); } var infoBar=document.getElementById("dmd_info_"+id+"_"+element.dmd_ts); if(infoBar==null) { infoBar=document.createElement("div"); infoBar.id="dmd_info_"+id+"_"+element.dmd_ts; infoBar.style.position="absolute"; infoBar.style.visibility=(with_hover?"hidden":"visible"); infoBar.style.left="0px"; infoBar.style.bottom="0px"; //infoBar.style.height="25%"; infoBar.style.width="100%"; infoBar.style.minWidth="100%"; infoBar.style.background="rgba(0,0,0,0.5)"; infoBar.style.background="linear-gradient(top, transparent, rgba(0,0,0,0.5), rgba(0,0,0,0.75))"; infoBar.style.background="-webkit-linear-gradient(top, transparent, rgba(0,0,0,0.5), rgba(0,0,0,0.75))"; infoBar.style.background="-moz-linear-gradient(top, transparent, rgba(0,0,0,0.5), rgba(0,0,0,0.75))"; infoBar.style.background="-o-linear-gradient(top, transparent, rgba(0,0,0,0.5), rgba(0,0,0,0.75))"; infoBar.style.background="-ms-linear-gradient(top, transparent, rgba(0,0,0,0.5), rgba(0,0,0,0.75))"; infoBar.style.zIndex=2; infoBar.style.padding="4px"; infoBar.style.color="#ffffff"; infoBar.style.boxSizing="border-box"; if(elementMainInfo==null) { infoBar.style.textAlign="left"; } else { infoBar.style.textAlign="center"; } infoBar.style.fontSize="12px"; infoBar.timeoutFixSize=0; infoBar.fixSize=function() { if(infoBar.timeoutFixSize) { clearTimeout(infoBar.timeoutFixSize); infoBar.timeoutFixSize=0 } infoBar.timeoutFixSize=setTimeout(function() { var width = parseInt(element.clientWidth); var height = parseInt(element.clientHeight); if((!width)||(!height)) return; infoBar.style.fontSize=Math.min((Math.min(Math.min(1,width/200.0), Math.min(1,height/200.0))*2.0*12),12)+"px"; }, 500); } infoBar.fixSize(); infoBar.style.backgroundSize="initial"; infoBar.style.whiteSpace="no-wrap"; element.appendChild(infoBar); infoBar.style.display=(isInIframe&&!iOS && !ANDROID?"none":""); } if(putHover) { element.onmouseover=function() { playBtn.style.visibility="visible"; if(with_hover)infoBar.style.visibility="visible"; }; element.onmouseout=function() { playBtn.style.visibility="hidden"; if(with_hover)infoBar.style.visibility="hidden"; }; } var copyLinkElem=document.getElementById("dmd_copylink_"+id+"_"+element.dmd_ts); if(copyLinkElem==null) { copyLinkElem=document.createElement("div"); copyLinkElem.innerHTML=""; copyLinkElem.id="dmd_copylink_"+id+"_"+element.dmd_ts; copyLinkElem.style.position="absolute"; copyLinkElem.style.left="0px"; copyLinkElem.style.top="0px"; copyLinkElem.style.width="20px"; copyLinkElem.style.minWidth="20px"; copyLinkElem.style.height="20px"; copyLinkElem.style.minHeight="20px"; copyLinkElem.style.background="rgba(255,255,255,0.75)"; copyLinkElem.style.zIndex=100; copyLinkElem.style.padding="2px"; copyLinkElem.style.boxSizing="border-box"; copyLinkElem.style.backgroundSize="initial"; copyLinkElem.style.whiteSpace="no-wrap"; copyLinkElem.style.cursor="pointer"; element.appendChild(copyLinkElem); copyLinkElem.showCopyDialog=function() { this.style.zIndex=101; var obj=document.getElementById("dmd_copylink_"+id+"_"+element.dmd_ts+"_content"); if(obj==null) { obj=document.createElement("div"); obj.id="dmd_copylink_"+id+"_"+element.dmd_ts+"_content"; copyLinkElem.appendChild(obj); obj.style.position="fixed"; obj.style.left="0px"; obj.style.top="0px"; obj.style.boxSizing="border-box"; obj.style.width="100%"; obj.style.minWidth="100%"; obj.style.height="100%"; obj.style.minHeight="100%"; obj.style.backgroundColor="rgba(0,0,0,0.8)"; obj.hideCopyDialog=function() { this.style.display="none"; this.hide=true; }; obj.onclick=function(e) { if(e.target!=this)return; this.hideCopyDialog(); copyLinkElem.style.zIndex=100; e.preventDefault(); return false; }; obj.hide=false; obj.innerHTML="
Panorama Link
"; } if(!obj.hide) obj.style.display="block"; else obj.hide=false; }; copyLinkElem.onclick=function(e) { this.showCopyDialog(); }; copyLinkElem.style.display=(isInIframe&&!iOS && !ANDROID?"none":""); } getAjax(httpOrHttps+"://www.dermandar.com/api/browse/id/"+id+"/", function(data) { if(data&&data.panos.length) { var dMoreText=""; var dMainMoreText=""; var tags=""; for(var i=0; i"+data.panos[0].tags[i]+""+(i"+data.panos[0].name + ""; } if(data.panos[0].owner_username!="") { var ownerName=data.panos[0].owner_username.toLowerCase(); if(!((ownerName=="iospublic2")||(ownerName=="iospublic")||(ownerName=="mirrorball")||(ownerName=="twit360"))) { dMainMoreText+="
"; } } if(data.panos[0].views!="") { dMainMoreText+="
"+data.panos[0].views+"
"; } if(!((data.panos[0].latitude==0)&&(data.panos[0].longitude==0))) { dMainMoreText+="
"; } //dMoreText+=(tags.length>0?"
Tags: "+tags+"
":""); if(data.panos[0].description!="") { dMoreText+="
"+data.panos[0].description+"
"; } if(tags!="") { dMoreText+="
"+tags+"
"; } var olInfo=true; if(elementInfo!=null) { olInfo=false; elementInfo.style.fontSize="14px"; elementInfo.innerHTML=dMoreText; } if(elementMainInfo!=null) { elementMainInfo.innerHTML=dMainMoreText; } //if(divMore!=null)divMore.innerHTML=dMoreText; if(!olInfo) infoBar.style.display="none"; infoBar.innerHTML=""+data.panos[0].name+""; if(elementMainInfo==null) { var ownerName=data.panos[0].owner_username.toLowerCase(); if(!((ownerName=="iospublic2")||(ownerName=="iospublic")||(ownerName=="mirrorball")||(ownerName=="twit360"))) { infoBar.innerHTML+="
Created by "+data.panos[0].owner_username + ""; } } if(elementMainInfo==null) { infoBar.innerHTML+=""+data.panos[0].views+""; } if(divMore!=null)divMore.innerHTML=dMoreText; if(element.getAttribute("dmd_info")!=null) { var info=element.getAttribute("dmd_info"); var splits=info.split(","); var res=""; if(splits.length==3) { if(splits[0]=="fav") { if(splits[1]!="") res="by "+splits[1] + ", favorited by "+splits[2] + ""; else res="favorited by "+splits[2] + ""; } else if(splits[0]=="upl") { if(splits[1]!="") res="uploaded by "+splits[1] + ""; else res="new panorama has uploaded"; } } if(res=="") infoBar.style.display="none"; else infoBar.innerHTML=""+data.panos[0].name+"
"+res; } else { infoBar.innerHTML=""+data.panos[0].name+""; if(elementMainInfo==null) { var ownerName=data.panos[0].owner_username.toLowerCase(); if(!((ownerName=="iospublic2")||(ownerName=="iospublic")||(ownerName=="mirrorball")||(ownerName=="twit360"))) { infoBar.innerHTML+="
Created by "+data.panos[0].owner_username + ""; } infoBar.innerHTML+=""+data.panos[0].views+""; } } } }); DMD_FUNCTIONS_LIST.push(function() { if(!isInIframe) { if(playBtn&&playBtn.fixSize)playBtn.fixSize(); if(element&&element.fixSize)element.fixSize(); if(infoBar&&infoBar.fixSize)infoBar.fixSize(); } }); }; this.getFlashVersion = function() { var flashVersion = "0,0,0"; try { try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); try { axo.AllowScriptAccess = "always"; } catch(e) { flashVersion = "6,0,0"; } } catch(e) {} flashVersion = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, "","").match(/^,?(.+),?$/)[1]; } catch(e) { try { if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ flashVersion = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; } } catch(e) {} } flashVersion = flashVersion.split(",").shift(); return flashVersion*(!dmd_isWebGLSupported?1:0); }; this.flashSupported = (this.getFlashVersion()>=10); this.handleWheel = function (e) { e = e || window.e; var wheelData = e.detail ? e.detail * -1 : e.wheelDelta / 40; var flashApp = e.target || e.srcElement; if (!flashApp) return true; var o = { x : e.screenX, y : e.screenY, delta : wheelData, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }; if(flashApp.handleWheel) flashApp.handleWheel(o); else { return false; } if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); e.cancelBubble = true; e.cancel = true; e.returnValue = false; return false; }; this.hookEvent = function (element) { if (element == null) return; if (element.addEventListener) { document.addEventListener("DOMMouseScroll", this.handleWheel, false); element.addEventListener("mousewheel", this.handleWheel, false); element.addEventListener("MozMousePixelScroll", this.handleWheel, false); element.addEventListener("wheel", this.handleWheel, false); } else if (element.attachEvent) element.attachEvent("onmousewheel", this.handleWheel); }; }; var dmdEmbedder = dmdEmbedder || new DermandarEmbedder(); var dmd_lst = dmd_lst || []; for(var ind=0;ind < dmdEmbeds.length; ind++) { var passthis = false; for(var ind2=0;ind2 < dmd_lst.length; ind2++) { if ((typeof(dmdEmbeds[ind]) == "undefined") || (dmd_lst[ind2] == dmdEmbeds[ind])) { passthis = true; break; } } if (passthis) continue; dmd_lst.push(dmdEmbeds[ind]); } if (navigator.userAgent.match(/MSIE/)) { if (document.readyState !== "complete") window.addEventListener("load",function() { dmdEmbedder.loadPanoramas(); }); else dmdEmbedder.loadPanoramas(); } else dmdEmbedder.loadPanoramas(); var dmd_Embedding=null; function dmd_closeOverlay() { dmd_Embedding.close(); } function initDMD_Embeding() { if(dmd_Embedding==null) dmd_Embedding=new DMD_Embeding(); dmd_Embedding.init(); //window.onkeydown=function(e) { if(!e) e=window.event; /*if (e.keyCode == 37) { dmd_Embedding.prev(); } else if (e.keyCode == 39) { dmd_Embedding.next(); } else if (e.keyCode == 38) { dmd_Embedding.add(["cKufNm", "Stade Mbombela, Mbombela"]); } else*/ if (e.keyCode == 27) { dmd_Embedding.close(); } }; window.addEventListener("keydown", function(e) { if(!e) e=window.event; if (e.keyCode == 27) { dmd_closeOverlay(); } }); window.addEventListener("resize", function() { dmd_Embedding.resize(); }); window.addEventListener("scroll", function() { dmd_Embedding.scroll(); }); }; if (navigator.userAgent.match(/MSIE/)) { if (document.readyState !== "complete") window.addEventListener("load",initDMD_Embeding); else initDMD_Embeding(); } else initDMD_Embeding(); function loadF10(id) { if (dmdEmbedder.getFlashVersion() >= 10) dmdEmbedder.loadPanorama(id, true); }; var dmd_functions_fix=function() { for(var i=0; i