function prinths(tourId,tourType,tourcatId,selectList)
{	
	printwin = window.open('http://www.vr2020.com/gtgtours/printhotspot.php?tourid='+tourId+'&tourType='+tourType+'&catId='+tourcatId+'&hsid='+selectList,'_blank')
}
function shareTourtype(type,trid,hsid)
{
	var type1 = type;
	var hsid = hsid;
	var trid = trid;
	if(hsid == "undefined"){
		var hsid = "";
	}
	if(type1 == "hs"){
		shareTour(hsid,trid);
	}else if(type1 == "tr"){
		shareTour("",trid);
	}
}
function  shareTour(hsid,trid)
{	
	var hsid = hsid;
	if(hsid == "undefined"){
		var hsid = "";
	}
	var trid= trid;
	var tourname = "";
	var descr = "";
	newwin=window.open("http://www.vr2020.com/gtgtours/uploadshareTour.php?descr="+descr+"&tname="+tourname+"&trId="+trid+"&trtype=city&dhsid="+hsid, "", "width=460,height=410,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no")
	newwin.focus();
}
var http_request = false;
function makeRequest(url) 
{
	var ua = navigator.userAgent.toLowerCase();
	if( ua.indexOf("msie") > -1){
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				http_request = null;
			}
		}
	}else if(ua.indexOf("safari") >-1 ){
		http_request = false;
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType("text/xml");
		}
	}	
	else{				
		try {					
			http_request = false;
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
			  http_request.overrideMimeType("text/xml");
			}
		} catch (e) {
			alert("Permission UniversalBrowserRead denied.");
		}	
	}
		
	http_request.open("GET", url, true);
	http_request.send(null);
	return false;	
}
function getbanneranddescr(tourid,tourtype,catid,hsid,plhsback,picname)
{
	var url = 'http://www.vr2020.com/gtgtours/getdata.php?keyword=getBannerDescription&trtype='+tourtype+'&gethsid='+hsid;
	makeRequest(url);
	http_request.onreadystatechange = handleBannerDescription;
		
	if(picname != null){
		piczoom(picname,'mov');
	}
}
function handleBannerDescription(index,plhsback)
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			var getres = http_request.responseText.split("!~!");
			document.getElementById('descHolder').innerHTML=getres[1];	
			document.getElementById('HSTitleHolder').innerHTML='<strong>'+getres[4]+'</strong>';
		}
	}
	
	/*if(plhsback != 'yes')
	if(getres[3] != null){
		if(getres[3] == ''){
			if(getres[2].indexOf(".swf") != -1){
				var bHolder = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='150px' height='587px' id='main1' ALIGN=''>";
				bHolder += "<param name=movie VALUE='admin/banners/"+getres[2]+"'>";
				bHolder += "<param name=quality VALUE=high><param name=wmode value=transparent><param name=scale value=exactfit>";
				bHolder += "<embed src='admin/banners/"+getres[2]+"' quality=high scale=exactfit wmode=transparent bgcolor=#FFFFFF width='150px' name='main1' align='' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>";
				bHolder += "</embed></object>";
				document.getElementById('bannerHolder').innerHTML= bHolder;
			}else{
				document.getElementById('bannerHolder').innerHTML='<img width="150" border="0"  src="admin/banners/'+getres[2]+'">';
			}	
		}else{
			if(getres[2].indexOf(".swf") != -1){
				var swfurl = 'main_ban.swf?link='+getres[3]+'&path=admin/banners/'+getres[2];
				var bHolder = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='150px' height='587px' id='main1' ALIGN=''>";
				bHolder += "<param name=movie VALUE='"+swfurl+"'>";
				bHolder += "<param name=quality VALUE=high><param name=wmode value=transparent><param name=scale value=exactfit>";
				bHolder += "<embed src='"+swfurl+"' quality=high wmode=transparent scale=exactfit bgcolor=#FFFFFF width='150px' name='main1' align='' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>";
				bHolder += "</embed></object>";
				document.getElementById('bannerHolder').innerHTML= bHolder;
			}else{
				document.getElementById('bannerHolder').innerHTML='<a href='+getres[3]+' target="_blank"><img width="150" border="0" src="admin/banners/'+getres[2]+'"></a>';
			}	
		}
	}*/
}
function getplacehotspotdescription(tourtype,placehsid,picname)
{
	var url = 'http://www.vr2020.com/gtgtours/getdata.php?keyword=getplacehotspotdescription&trtype='+tourtype+'&getplacehsid='+placehsid;
	makeRequest(url);
	http_request.onreadystatechange = handleplacehsDescription;
		
	if(picname != null){
		piczoom(picname,'mov');
	}	
}
function handleplacehsDescription(index)
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			var getplaceres = http_request.responseText.split("!~!");
			document.getElementById('HSTitleHolder').innerHTML='<strong>'+getplaceres[1]+'</strong>';
			document.getElementById('descHolder').innerHTML=getplaceres[0];
		}
	}	
}
function piczoom(picname,pictype)
{	
	newwin1=window.open('http://www.vr2020.com/gtgtours/showpiczoom.html?piczoom='+picname+'&piczoomimageType='+pictype, '_blank', 'width=' + screen.availWidth  + ',height=' + screen.availHeight + ',titlebar=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no')
	newwin1.moveTo(300,300);
	newwin1.focus();
}
function fullscreen(picname){
	newwin1=window.open('http://www.vr2020.com/gtgtours/showmovie.php?piczoom='+picname+'&piczoomimageType=', '_blank', "toolbar=no,width=" + screen.availWidth  + ",height=" + screen.availHeight + ",status=no,resizable=yes,fullscreen=yes,scrollbars=no")
	newwin1.focus();
}