
////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////

	// ENTIRE BODY FOR HTML FILES

var html_url = window.location.href;
var html_url_split = html_url.split("/");
var fn;

for (x=0; x<html_url_split.length; x++){
	if ( html_url_split[x].indexOf(".html") != -1 ){
		filename_split = html_url_split[x].split(".");
		fn = filename_split[0];
		break;
	}
}

function PassFlash(){
	movieObject = document.getElementById( "movie" );
	//window.document.movie.SetVariable("suite_name", pano_data[fn][1][0]);
	movieObject.SetVariable("suite_name", pano_data[fn][1][0]);
}

function BuyNow(pano_name, price_type) {
	current_window = window.location.href;

	if(current_window.indexOf("price_plan_selected") != -1) {
		if(opener && !opener.closed) {
			window.opener.document.movie.SetVariable("buy_now_pano_name",pano_name);
			window.opener.document.movie.SetVariable("buy_now_suite_name",pano_data[fn][1][0]);
			window.opener.document.movie.SetVariable("buy_now_price_type",price_type);
		} else {
			current_window = current_window.split(fn);
			open(current_window[0]+"?buy_now_pano_name="+pano_name+"&buy_now_suite_name="+pano_data[fn][1][0]+"&buy_now_price_type="+price_type);
		}
	} else {
		current_window = current_window.split(fn);
		open(current_window[0]+"?buy_now_pano_name="+pano_name+"&buy_now_suite_name="+pano_data[fn][1][0]+"&buy_now_price_type="+price_type);
	}
}

function Purchase(pano_name, price_plan) {
	current_window = window.location.href;

	if(current_window.indexOf("price_plan_selected") != -1) {
		if(opener && !opener.closed) {
			window.opener.document.movie.SetVariable("purchase_pano_name",pano_name);
			window.opener.document.movie.SetVariable("purchase_price_plan",price_plan);
			window.close();
		} else {
			current_window = current_window.split(fn);
			open(current_window[0]+"?purchase_pano_name="+pano_name+"&purchase_price_plan="+price_plan);
		}
	} else {
		current_window = current_window.split(fn);
		open(current_window[0]+"?purchase_pano_name="+pano_name+"&purchase_price_plan="+price_plan);
	}
}

document.write('<div class="toplayer" id="interface">');
document.write('<applet archive=panoapplet_110102.jar code=panoapplet width=420 height=340');
	document.write('<param name="altImage" value="img_logo.gif">');
	document.write('<param name="altSplash" value="img_logo.gif">');
	document.write('<param name="autospin" value="' + pano_data[fn][0][0] + '">');
	document.write('<param name="initialView" value="' + pano_data[fn][0][1] + ',' + pano_data[fn][0][2] + ',' + pano_data[fn][0][3] + '">');
	document.write('<param name="file" value="' + fn + '.ivr">');
document.write('</applet>');
document.write('</div>');

document.write('<object class="btmlayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('	codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
document.write('	id="movie"');
document.write('	width=730 height=575>');
document.write('	<param name=movie value="level_00_pano_window.swf?suite_name='+ pano_data[fn][1][0] +'">');
document.write('	<param name=quality value=high>');
document.write('	<param name=bgcolor value=#000000>');
document.write('	<embed wmode="transparent"');
document.write('	src="level_00_pano_window.swf?'+ pano_data[fn][1][0] +'"');
document.write('	quality=high bgcolor=#000000');
document.write('	width=730 height=575');
document.write('	type="application/x-shockwave-flash"');
document.write('	pluginspage="https://www.macromedia.com/go/getflashplayer"');
document.write('	name="movie" swLiveConnect="true"');
document.write('	id="movie"');
document.write('	swliveconnect="true">');
document.write('	</embed>');
document.write('</object>');

//document.write('<body onLoad="PassFlash()" >');
