

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DETECT BROWSER TYPE

var my_browser;
if(navigator.userAgent.indexOf("Firefox") != -1)
{
	//alert("Firefox");
	var document_width = window.innerWidth;
	var document_hieght = window.innerHeight;
	my_browser = "Firefox";
	
}
else if(navigator.userAgent.indexOf("MSIE") != -1)
{
	//alert("MSIE");
	var document_width = window.innerWidth;
	var document_hieght = window.innerHeight;
	my_browser = "MSIE";
}
else if(navigator.userAgent.indexOf("Netscape") != -1)
{
	//alert("Netscape");
	var document_width = window.innerWidth;
	var document_hieght = window.innerHeight;
	my_browser = "Netscape";
}
else
{
	//alert("Other");
	var document_width = window.innerWidth;
	var document_hieght = window.innerHeight;
	my_browser = "Other";
}



function func_onload()
{
	window_left_val();
	make_vip();
	make_vip_seat();
	check_url();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CHECK URL STRING FOR VARIABLES

function check_url()
{
	var my_url = window.location.href;
	var url_pano_name = "";
	
	if ( my_url.indexOf("?") > -1 )
	{
		var my_url_var = my_url.split("?");
		var my_url_arr = my_url_var[1].split("&");
		var my_final_url_arr = Array();
		
		for ( x=0; x<my_url_arr.length; x++ )
		{
				a = my_url_arr[x].split("=");
				eval("var url_" + a[0] + " = '" + a[1] + "';");
		}
	}
	if ( url_pano_name != "" ) func_pano_window_show(url_pano_name+".html");
}





///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MOVE PANO IFRAME INTO CORRECT POSITION

function window_left_val()
{
	if ( my_browser == "MSIE" )
	{
		//alert(document.body.clientWidth);
		document.getElementById("pano_window").style.left = document.body.clientWidth/2-417+"px";
	}
	else if ( my_browser == "Firefox" )
	{
		//alert(window.innerWidth);
		document.getElementById("pano_window").style.left = window.innerWidth/2-418+"px";
	}
}		




///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SHOW PANO IFRAME
var init_pano = "";
var init_pano_load = "";

function func_pano_window_show(pano_name)
{
	if ( pano_name != ".html" )
	{
		init_pano = true;
		init_pano_load = true;
		
		document.getElementById('pano_window').style.display = "";
		pano_window.location = pano_name;
				//alert(pano_window.location);
		window_left_val();
		if ( pano_window.document.getElementById('pano_applet') ) pano_window.document.getElementById('pano_applet').style.display = "";
		window.document.movie.SetVariable('pano_hide_status', 'unhide');
	}
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HIDE PANO IFRAME

function func_pano_window_hide()
{
	init_pano = false;
	init_pano_load = false;
	pano_window_display = "none";
	document.getElementById('pano_window').style.display = 'none';
	window.document.movie.SetVariable('pano_hide_status', 'hide');
	window_left_val();
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FIND YOUR SEAT

var sec = "";
var row = "";
var my_alert = "";
function func_fys(sec)
{
	sec = document.getElementById('EnterSection').value.toUpperCase();
	row = document.getElementById('EnterRow').value.toUpperCase();
	
	//alert(sec);
	
	if ( sec == "PIT 1" ) sec = "PIT_1";
	else if ( sec == "PIT1" ) sec = "PIT_1";
	else if ( sec == "PIT 2" ) sec = "PIT_2";
	else if ( sec == "PIT2" ) sec = "PIT_2";

	
	
	if ( row == "" ) row = "N/A";
	row_cvt = cvt[row];
	var found = "";

	if ( sec != "" )
	{
		if ( !find_seat[sec] ) my_alert = "Please enter a valid Section!";
		else
		{
			for ( x=0; x<find_seat[sec][0].length; x++ )
			{
				if (  row_cvt >= cvt[find_seat[sec][0][x][0]] && row_cvt <= cvt[find_seat[sec][0][x][1]] )
				{
					//alert(cvt[find_seat[sec][0][x][0]]);
					//alert(cvt[find_seat[sec][0][x][1]]);
					//alert(row_cvt);
					my_pano = "sec_"+sec.toLowerCase()+"_"+(x+1)+".html";
					func_pano_window_show(my_pano);
					found = true;
					break;
				}
				else
				{
					//alert(row);
					found = false;
				}
			}
		}
		window_left_val();
	}
	else my_alert = "Please enter your Section and Row info!";
	if ( found === false )
	{
		my_alert = "Please enter a valid Row!";
	}

	if ( my_alert != "" ) alert(my_alert);
	my_alert = "";
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FORWARD TO A FRIEND

function func_ftf(email_type)
{	
	init_pano = true;
	init_pano_load = true;
		
	pano_window.document.getElementById('pano_applet').style.display = "none";
	pano_window.document.getElementById('ftf').style.display = "none";
	
	window_left_val();
	
	if ( email_type == "pano" )
	{
		pano_window.document.getElementById('email_to_friend').style.display = "";
		pano_window.document.getElementById('comment_pano').style.display = "";
		pano_window.document.getElementById('comment_site').style.display = "none";
		pano_window.document.getElementById('pano_title_1').innerHTML = "Forward this view to a friend";
		pano_window.document.getElementById('pano_title_2').innerHTML = "Forward this view to a friend";
		pano_window.document.getElementById('email_type').value = "email_pano";
	}
	else if ( email_type == "site" )
	{
		if ( document.getElementById('pano_window').style.display == "none" )
		{
			window.document.movie.SetVariable('pano_hide_status', 'unhide');
		}
		
		pano_window.document.getElementById('email_to_friend').style.display = "";
		pano_window.document.getElementById('comment_pano').style.display = "none";
		pano_window.document.getElementById('comment_site').style.display = "";
		document.getElementById('pano_window').style.display = "";
		pano_window.document.getElementById('pano_title_1').innerHTML = "Forward this site to a friend";
		pano_window.document.getElementById('pano_title_2').innerHTML = "Forward this site to a friend";
		pano_window.document.getElementById('email_type').value = "email_site";

	}
}




///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CREATE AND ADD VIP DROP LIST TO DOCUMENT

function make_vip()
{
 	var my_select = '<select name="vip" id="vip" onchange="func_pano_window_show(this.value+\'.html\');" style="margin-left: 0px; margin-top: 25px; font-size:12px; width:90px; ">\n<option value="">Suite Seats</option>\n"';
	for ( a in find_seat )
	{
		if ( a.indexOf("vip") > -1 && a.indexOf("vip_seat") < 0 )
		{
 			//alert(a);
 			my_select += "<option value='" + find_seat[a][1] + "'>" + find_seat[a][2] + "</option>\n";
 		}
	}
	my_select += '</select>\n';
	document.getElementById("vip").innerHTML = my_select;
	//alert(find_seat['vip_a1'][2]);
}


function make_vip_seat()
{
 	var my_select = '<select name="vip_seat" id="vip_seat" onchange="func_pano_window_show(this.value+\'.html\');" style="margin-left: 0px; margin-top: 19px; font-size:12px; width:90px; visibility: hidden; ">\n<option value="">Prem. Seats</option>\n"';
	for ( a in find_seat )
	{
		if ( a.indexOf("vip_seat") > -1 )
		{
 			//alert(a);
 			my_select += "<option value='" + find_seat[a][1] + "'>" + find_seat[a][2] + "</option>\n";
 		}
	}
	my_select += '</select>\n';
	document.getElementById("vip_seat").innerHTML = my_select;
	//alert(find_seat['vip_a1'][2]);
}


function func_change_button_img(my_object, my_status)
{
	eval("document.getElementById('" + my_object + "').src = 'img/" + my_object + my_status + ".jpg'");
}





