<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="view_tour.aspx.cs" Inherits="MYAPP.pano.view_tour" %>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title></title>
<link href="/CSS/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/odialog.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script src="/pano/swfkrpano.js"></script>
<script src="/pano/krpanoiphone.js"></script>
<script src="/pano/krpanoiphone.license.js"></script>
<script src="/pano/jquery.js"></script>
<script type="text/javascript">
var oWindow=window.opener;
var c_Tour_ID=<%=_Tour_ID%>;
var c_Scene_ID=1;
	function krpano() 
	{
			return document.getElementById("krpanoSWFObject");
	}
	function navtour(_Tour_ID)
	{
		var swf = createswf("/project/"+_Tour_ID+"/epano.aspx", "krpanoSWFObject", "100%", "100%");
		swf.addVariable("xml", "../"+_Tour_ID+"/tour.xml");
		swf.addParam("wmode", "opaque");
		swf.embed("krpanoDIV");
	}
	
	function navtourscene(_Tour_ID,_Scene_ID)
	{
		var swf = createswf("/project/"+_Tour_ID+"/epano.aspx", "krpanoSWFObject", "100%", "100%");
		swf.addVariable("xml", "../"+_Tour_ID+"/tour_xml_"+_Scene_ID+".aspx");
		//swf.addParam("wmode", "opaque");
		swf.embed("krpanoDIV");
	}
	
	function loadscene(_Scene_ID)
	{
		krpano().call("loadpano(%FIRSTXML%scene/"+_Scene_ID+"/scene.xml,, MERGE, BLEND(0.1),null);");
	}
	
	function loadtourscene(_Tour_ID,_Scene_ID)
	{
		if (_Tour_ID==c_Tour_ID)
		{
			loadscene(_Scene_ID);
		}
		else
		{
			navtourscene(_Tour_ID,_Scene_ID);
		}
	}
	
	function set_gg_zll(sceneid)
	{
		c_Scene_ID=sceneid;
		parent.map.set_toscene("cmarker_"+c_Tour_ID+"_"+sceneid);
		try
		{
			
		}catch(Exception){}
	}
	
	function get_custom_lng()
	{

		return Number(krpano().get("CustomMap.lng"));
	}
	
	function get_custom_lat()
	{
		return Number(krpano().get("CustomMap.lat"));
	}
	
	function set_heading(heading)
	{
		try
		{
			parent.map.set_heading(heading);
		}catch(Exception){}
	}

	function getcurrenturl()
	{
		window.open('/project/'+c_Tour_ID+'/vview_tour_'+c_Scene_ID+'_'+Number(krpano().get('view.hlookat')).toFixed(2)+'_'+Number(krpano().get('view.vlookat')).toFixed(2)+'.aspx');
	}
</script>
<script type="text/javascript">	
	function NoRightClick(pid){ 
		//pid:flash's parentNode id 
		var el = document.getElementById(pid); 
		if(el.addEventListener){ 
		el.addEventListener("mousedown",function(event){ 
		if(event.button == 2){ 
		event.stopPropagation(); //for firefox 
		event.preventDefault(); //for chrome 
		} 
		},true); 
		}else{ 
		el.attachEvent("onmousedown",function(){ 
		if(event.button == 2){ 
		el.setCapture(); 
		} 
		}); 
		el.attachEvent("onmouseup",function(){ 
		el.releaseCapture(); 
		}); 
		el.oncontextmenu = function(){ 
		return false; 
		}; 
		} 
	}; 
</script>
<style>
html {
	height: 100%;
}
body {
	height: 100%;
	overflow: hidden;
	margin: 0;
	padding: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	color: #FFFFFF;
	background-color: #000000;
}
a {
	color: #AAAAAA;
	text-decoration: underline;
}
a:hover {
	color: #FFFFFF;
	text-decoration: underline;
}
.pop-box {
	z-index: 9999;
	display: none;
	position: absolute;
}
</style>
</head>

<body scroll="no" onLoad="window.focus();">
<input type="button"  onclick="getcurrenturl();" value="获取当前场景地址"  style="position:absolute;top:5px;right:5px; z-index:100; width:120px; cursor:pointer; display:none "/>
<div id="krpanoDIV" style="width:100%;height:100%;">
  <noscript>
  <table style="width:100%;height:100%;">
    <tr style="valign:middle;">
      <td><div style="text-align:center;">ERROR:<br/>
          <br/>
          Javascript not activated<br/>
          <br/>
        </div></td>
    </tr>
  </table>
  </noscript>
</div>
<script>
	var viewer = createPanoViewer({swf:"/project/<%=_Tour_ID%>/epano.aspx", id:"krpanoSWFObject",html5:"<%=Request["Html5"]%>", target:"krpanoDIV"});
	//viewer.useHTML5("whenpossible");		// incomment to use the HTML5 krpanoJS viewer always when possible (Safari5)
	viewer.addVariable("xml", "tour.xml");
	viewer.addParam("wmode", "opaque");
	viewer.addParam("menu", "false");
	viewer.embed();
	NoRightClick("krpanoDIV"); 
</script>
</body>
</html>
