<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="view_tour.aspx.cs" Inherits="MYAPP.pano.view_tour" %>
<html>
<head>
<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 language='JavaScript' type='text/javascript' src='/js/common.js'></script>
<script src="/pano/swfkrpano.js"></script>
<script type="text/javascript">
var oWindow=window.opener;
	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 initload()
	{
		krpano().call("lookat("+<%=Request.QueryString["ath"]%>+","+<%=Request.QueryString["atv"]%>+")");
	}
	function loadhotspot(_Scene_ID)
	{
	runScript('http://<%=Request.Url.Host%>:8080/pano/get_scene_hotspots.aspx?Scene_ID='+_Scene_ID);

	}
	
	function c_hotspot(_Company_ID,_Name,_Scene_ID,_atv,_ath)
	{
				
		var name="company_"+_Company_ID;
		krpano().call("addhotspot("+name+");");

		krset(name,"url",'http://<%=Request.Url.Host%>:8080/pano/info.png');
		krset(name,"ath",_ath);
		krset(name,"atv",_atv);
		
		krset(name,"zoom","true");	
		krset(name,"smoothing","true");	
		krset(name,"distorted","true");		
		krset(name,"scale","1");
		krset(name,"rotatewithview","true");
		krset(name,"onclick","js(openWindow(http://<%=Request.Url.Host%>:8080/Manage/company/AD_Company_Info.aspx?ret=1&action=view&Company_ID="+_Company_ID+",1020,502,"+_Name+",no));");
	}
	function krset(name,field,value)
	{
		if (value!="")
		{
			try
			{
				parseFloat(value);
				krpano().call("set(hotspot["+name+"]."+field+","+value+");");
			}catch(excetion)
			{
				krpano().call("set(hotspot["+name+"]."+field+",'"+value+"');");
			}
			
		}
	}
</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;
}
</style>
</head>
<body scroll="no" onLoad="window.focus();">
<div id="krpanoDIV" style="height:100%">
	<noscript><table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br><br>Javascript not activated<br><br></center></td></tr></table></noscript>
</div>
<script>
	var viewer = createPanoViewer({swf:"/project/<%=_Tour_ID%>/epano.aspx", id:"krpanoSWFObject", target:"krpanoDIV"});
	//viewer.useHTML5("whenpossible");		// incomment to use the HTML5 krpanoJS viewer always when possible (Safari5)
	viewer.addVariable("xml", "tour_template.aspx?Scene_ID=<%=Request.QueryString["Scene_ID"]%>");
	viewer.addParam("wmode", "opaque");
	viewer.embed();
</script>
</body>
</html>
