


										// FUNCTION VARIABLES
var price_plan_id = 0;
var pano_array = new Array();
var pano_info_default_value = "<div class=\"pano_info_text_1\" align=\"center\">Move mouse over a seat section and click to see your view!</div>";


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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";
}


var my_os="";
if (navigator.appVersion.indexOf("Win")!=-1) my_os="windows";
else if (navigator.appVersion.indexOf("Mac")!=-1) my_os="max";
else if (navigator.appVersion.indexOf("X11")!=-1) my_os="unix";
else if (navigator.appVersion.indexOf("Linux")!=-1) my_os="linux";


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





/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// INITIALIZATION



function func_pano_init(my_status)
{
	// ENTIRE BODY FOR HTML FILES
	var html_url = window.location.href;
	html_url = html_url.split("pano_name=");
	
	//alert(html_url);
	
	var fn = html_url[1];
	if ( fn )
	{
		if ( fn.indexOf("&") > -1 )
		{
			fn = fn.split("&");
			fn = fn[0];
		}

		return fn;
	}
}



main_nav_last_url = "";
var price_plan_id_url_string = "";
function func_onload_init(my_status)
{
	// ENTIRE BODY FOR HTML FILES
	var html_url = window.location.href;
	html_url = html_url.replace("#", "");
	html_url = html_url.split("&");
		
	for ( x1=0; x1 < html_url.length; x1++ )
	{
		
		/*
		_level0.nav=5	// LEVEL TO NAVIGATE TO
		_level0.pp=1	// PRICE PLAN ID TO BE ACTIVATED
		_level0.pg=pg_red_zone_1	// PANO GROUP TO NAVIGATE TO
		_level0.pgn=pg_red_zone_1_sts_1 // PANO GROUP PANO TO SHOW
		_level0.pn=p_101_1 // WHEN SHOWING A PANO VIA THE URL-STRING, THAT PART IS HANDLED THROUGH THE INDEX.PHP
							// THIS PART IS TO SHOW THE PANO MARKER WITH THE NUMBER IN IT AND ADD THE PANO TO THE APPROPRIATE ARRAYS
		
		*/

		if ( html_url[x1].indexOf("nav_last=") > -1 )
		{
			main_nav_last_url = html_url[x1].split("nav_last=");
			main_nav_last_url = main_nav_last_url[1];
			func_main_nav_highlight_click(main_nav_last_url)
			//alert(main_nav_last);
		}
		
		
		if ( html_url[x1].indexOf("pp=") > -1 )
		{
			price_plan_id = html_url[x1].split("pp=");
			price_plan_id = price_plan_id[1];
			
						// USED TO KNOW WHEN A PPLAN COMES FROM THE URL STRING
						// URL STRING FLEX PLAN 
			price_plan_id_url_string = price_plan_id;
			
			func_display_2("", "remove_tt");
			
			func_make_instruction(price_plan_id);
		}
		
		
					// USED TO FIND THE PANO IN THE URL
					// THE PANO WINDOW IS NOT PULLED FROM HERE
					// EACH SEAT HAS CODE IN THE as_buttons_seats_mc.as FILE THAT WILL LOOK TO SEE IF
					// IT NEEDS TO SHOW THE PANO
					// LOOK FOR THIS LINE IN THE "AS" FILE ->> IF THE URL-STRING HAS PN=PANONAME, THEN SHOW THE PANO ONLOAD
		if ( html_url[x1].indexOf("pn=") > -1 )
		{
			pano_name = html_url[x1].split("pn=");
			pano_name = pano_name[1];
			func_pano_show_info_pano(pano_name);
			//alert(pano_name);
		}
					// USED TO FIND THE PANO_GROUP_NAME IN THE URL
		if ( html_url[x1].indexOf("pg=") > -1 )
		{
			pano_group_name = html_url[x1].split("pg=");
			pano_group_name = pano_group_name[1];
			func_pano_show_info_pano_group(pano_group_name);
		}

		
		//alert(pano_name);
	}
}

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







/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// MAIN NAV AND BUTTON CLICKS




function func_main_nav_highlight_rollover(my_obj)
{	
				// HIGHLIGHT OBJECT
	var my_obj_1 = document.getElementById(my_obj);
	
	if ( my_browser != "MSIE" ) my_obj_1.setAttribute("class", "nav_top_1a");
	else if ( my_browser == "MSIE" )my_obj_1.setAttribute("className", "nav_top_1a");



								// MAKE ALL OTHER PRICE PLANS THE ORIGINAL COLOR
	for ( x in parent.main_nav_array )
	{
		if ( x != my_obj && document.getElementById(x) && x != main_nav_last )
		{
			var my_obj_2 = document.getElementById(x);
			
						// UNHIGHLIGHT MAIN_NAV_LAST OBJECT
			if ( my_browser != "MSIE" ) my_obj_2.setAttribute("class", "nav_top_1");
			else if ( my_browser == "MSIE" )my_obj_2.setAttribute("className", "nav_top_1");
		}
	}
}



function func_main_nav_highlight_rollout(my_obj)
{
	if ( my_obj != main_nav_last )
	{
					// UNHIGHLIGHT MAIN_NAV_LAST OBJECT
		var my_obj_2 = document.getElementById(my_obj);
		if ( my_browser != "MSIE" ) my_obj_2.setAttribute("class", "nav_top_1");
		else if ( my_browser == "MSIE" )my_obj_2.setAttribute("className", "nav_top_1");
	}
}




function func_main_nav_right_highlight_rollover(my_obj, my_class)
{	
				// HIGHLIGHT OBJECT
	var my_obj_1 = document.getElementById(my_obj);
	
	if ( my_browser != "MSIE" ) my_obj_1.setAttribute("class", my_class);
	else if ( my_browser == "MSIE" )my_obj_1.setAttribute("className", my_class);
}



function func_main_nav_right_highlight_rollout(my_obj, my_class)
{
				// UNHIGHLIGHT MAIN_NAV_LAST OBJECT
	var my_obj_2 = document.getElementById(my_obj);
	if ( my_browser != "MSIE" ) my_obj_2.setAttribute("class", my_class);
	else if ( my_browser == "MSIE" )my_obj_2.setAttribute("className", my_class);
}




function func_main_nav_highlight_click(my_obj)
{
				// HIGHLIGHT OBJECT
	var my_obj_1 = document.getElementById(my_obj);
	if ( my_browser != "MSIE" ) my_obj_1.setAttribute("class", "nav_top_1a");
	else if ( my_browser == "MSIE" )my_obj_1.setAttribute("className", "nav_top_1a");

				// UNHIGHLIGHT MAIN_NAV_LAST OBJECT
	if ( my_obj != main_nav_last )
	{
		var my_obj_2 = document.getElementById(main_nav_last);
		if ( my_browser != "MSIE" ) my_obj_2.setAttribute("class", "nav_top_1");
		else if ( my_browser == "MSIE" )my_obj_2.setAttribute("className", "nav_top_1");
	}

	
	main_nav_last = my_obj;
}




function func_main_nav_highlight_click_1(my_obj)
{
				// HIGHLIGHT OBJECT
				//alert(my_obj);
	var my_obj_1 = parent.document.getElementById(my_obj);
	if ( my_browser != "MSIE" ) my_obj_1.setAttribute("class", "nav_top_1a");
	else if ( my_browser == "MSIE" ) my_obj_1.setAttribute("className", "nav_top_1a");

				// UNHIGHLIGHT MAIN_NAV_LAST OBJECT
	if ( my_obj != parent.main_nav_last )
	{
		var my_obj_2 = parent.document.getElementById(parent.main_nav_last);
		if ( my_browser != "MSIE" ) my_obj_2.setAttribute("class", "nav_top_1");
		else if ( my_browser == "MSIE" ) my_obj_2.setAttribute("className", "nav_top_1");
	}

	
	parent.main_nav_last = my_obj;
}



						// AUTO HIGHLIGHT THE TOP NAV BASED ON MAIN_NAV_LAST
main_nav_last = main_nav_variable_array[0];
function func_make_main_nav(my_seperator)
{
	
	var main_nav = "";
	var cnt  = 0;
	for ( x in main_nav_array )
	{
		var nav_num = main_nav_array[x][1][0][1];

									//  USE THIS TO HIGHLIGHT THE APPROPRIATE TOP NAV BUTTON ON LOAD
		var my_class = "nav_top_1";
		if ( x == main_nav_last ) my_class = "nav_top_1a";
		
		//alert(my_class + "  " +  nav_num);
		

		if ( cnt > 0 && my_os == "windows" ) main_nav += '<span class="nav_top_2"> ' + my_seperator + ' </span>';
		else if ( cnt > 0 ) main_nav += '<span class="nav_top_2_mac"> ' + my_seperator + ' </span>';
		
		main_nav += '<a href="javascript:;" name="' + x + '" id="' + x + '" onclick="func_main_nav_highlight_click(\'' + x + '\'); func_play_movie_1(\'nav_' + nav_num +  '\'); func_stat(\'main_nav_level_num__' + nav_num + '\');" onmouseover="func_main_nav_highlight_rollover(\'' + x + '\'); func_menue_list_rollover(\'' + x + '\', \'0\', \'18\');" onmouseout="func_main_nav_highlight_rollout(\'' + x + '\'); func_drop_list_rollout();" class="' + my_class + '">';
		main_nav += 	main_nav_array[x][0];
		main_nav += '</a>';
		
		cnt++;
	}
	return main_nav;
}



var drop_list_visible = false;
var button_status = false;
function func_menue_list_rollover(my_array_name, x_offset, y_offset)
{
	if ( main_nav_array[my_array_name][1].length > 1 )
	{
		//alert(main_nav_array[my_array_name][1].length);
		
		var my_obj = document.getElementById(my_array_name);
		var my_x = func_find_x(my_obj);
		var my_y = func_find_y(my_obj);
		
		my_x = my_x + Number(x_offset);
		my_y = my_y + Number(y_offset);
		
		func_drop_list_make(my_array_name);
		
		document.getElementById('drop_list').style.left = my_x + "px";
		document.getElementById('drop_list').style.top = my_y + "px";
		
		func_display_1("", "drop_list");
		
		drop_list_visible = true;
		button_status = true;
	}
	else
	{
		func_display_1("none", "drop_list");
		drop_list_visible = false;
	}
}



function func_drop_list_make(my_array_name)
{
	//alert(my_array_name);
	
	if ( main_nav_array[my_array_name][1][1][0] != "" )
	{	
		var my_return = "<table cellpadding=\"3\" cellspacing=\"0\" class=\"drop_list_background_1\">";
		var nav_num = "";
		
		for ( x=0; x < main_nav_array[my_array_name][1].length; x++ )
		{
			nav_num = main_nav_array[my_array_name][1][x][1];
			
			my_return += "<tr>";
			my_return += "	<td class='drop_list_border_1' nowrap valign='top'>";
			my_return += "		<a href='javascript:;' class='drop_list_1' name='drop_list_" + x + "_" + nav_num + "' id='drop_list_" + x + "_" + nav_num + "' onclick=\"func_play_movie_1('nav_" + nav_num + "'); func_main_nav_highlight_click('" + my_array_name + "'); func_stat('main_nav_drop_list_level_num__" + nav_num + "');\" onmouseover=\"func_drop_list_item_rollover(); func_main_nav_highlight_rollover('drop_list_" + x + "_" + nav_num + "'); \" onmouseout=\"func_drop_list_rollout(); func_main_nav_highlight_rollout('drop_list_" + x + "_" + nav_num + "'); \">";
			my_return += 				main_nav_array[my_array_name][1][x][0];
			my_return += "		</a>";
			my_return += "	</td>";
			my_return += "</tr>";
		}
		my_return += "</table>";
		
		document.getElementById('drop_list').innerHTML = my_return;
	}
}



function func_drop_list_item_rollover()
{
	drop_list_visible = true;
	button_status = true;
}



function func_drop_list_rollout()
{
		button_status = false;
	if ( drop_list_visible == true )
	{
		var t=setTimeout("func_display_3('none', 'drop_list');",2000);
		drop_list_visible = false;
	}
}



										// FIND THE X COORDINATE OF AN OBJECT ON THE SCREEN
										// obj MUST BE AN OBJECT --- obj = document.getElementById('my_obj');
function func_find_x(obj)
{
  var curleft = 0;
  if(obj.offsetParent)
      while(1) 
      {
        curleft += obj.offsetLeft;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.x)
      curleft += obj.x;
  return curleft;
}

										// FIND THE Y COORDINATE OF AN OBJECT ON THE SCREEN
										// obj MUST BE AN OBJECT --- obj = document.getElementById('my_obj');
function func_find_y(obj)
{
  var curtop = 0;
  if(obj.offsetParent)
      while(1)
      {
        curtop += obj.offsetTop;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.y)
      curtop += obj.y;
  return curtop;
}





function func_client_logo()
{
	window.open(venue_occupant_url);

	func_stat("client_logo__1");
}



function func_seats3d()
{
	window.open("http://www.seats3d.com/");

	func_stat("seats3d_logo__1");
}



function func_main_nav_right(my_button_name)
{
	if ( my_button_name == "contact" )
	{
		if ( venue_occupant_contact_url != "" ) window.open(venue_occupant_contact_url);
		else window.open(venue_occupant_url);
	}
}


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








/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// MISC



function glb_update_iframe_location_1(my_str)
{
	//alert(my_str);
	my_hidden_iframe.location = my_str;
}


			// SHOW TOOL TIP WHEN ROLLOVER <A HREF OBJECT
function glb_show_tool_tip(my_array_index, my_value, my_status, my_tool_tip_object, my_object_side)
{
	if ( my_status == "on" )
	{
		var my_obj = document.getElementById(my_tool_tip_object);
		var my_x = func_find_x(my_obj)+20;
		var my_y = func_find_y(my_obj);
		
		//alert(my_x + " " + my_y);
		
		for ( x in tool_tip[my_array_index] )
		{
			if ( tool_tip[my_array_index][x][0] == my_value )
			{
								
				document.getElementById("tool_tip_main").innerHTML = tool_tip[my_array_index][x][1];
				document.getElementById("tool_tip_main").style.left = (my_x+2) + "px";
				document.getElementById("tool_tip_main").style.top = (my_y+2) + "px";
				
				//alert(((Math.round(tool_tip[my_array_index][x][1].length/35)*25)+10));
				
				var my_height = ((Math.round(tool_tip[my_array_index][x][1].length/35)*25)+10)+"px";
				document.getElementById("tool_tip_iframe").style.left = my_x + "px";
				document.getElementById("tool_tip_iframe").style.top = my_y + "px";
				document.getElementById("tool_tip_iframe").style.height = my_height;
				
				
				if ( my_object_side == "left" )
				{
					document.getElementById("tool_tip_main").style.left = (my_x-240) + "px";
					
					document.getElementById("tool_tip_iframe").style.left = (my_x-240) + "px";
				}
				
				
				//alert(document.getElementById('tool_tip_bottom').style.top);
				document.getElementById("tool_tip_main").style.display = "";
				
				document.getElementById("tool_tip_iframe").style.display = "block";
				break;
			}
		}
	}
	else
	{
		document.getElementById("tool_tip_main").style.display = "none";
		document.getElementById("tool_tip_iframe").style.display = "none";
	}
}






function func_hide_toggle_1(my_object)
{
	if ( document.getElementById(my_object).style.display == "" ) document.getElementById(my_object).style.display = "none";
	else document.getElementById(my_object).style.display = "";

}




var sec = "";
var row = "";
var my_alert = "";
function func_fys()
{
	sec = document.getElementById('my_sec').value.toString().toUpperCase();
	row = document.getElementById('my_row').value.toString().toUpperCase();
	if ( row == "" ) row = "N/A";
	row_cvt = fys_cvt_array[row];// THIS ROW CONVERT VALUE SHOULD NOT HAVE A 1 ADDED OR MINUSED BECAUSE IT MUST MATCH THE fys_cvt_array["AA"] VALUE
	var found = "";

	if ( sec != "" )
	{
		//alert(fys_array[sec]);
		
		if ( !fys_array[sec] ) my_alert = "Please enter a valid Section!";
		else
		{
			for ( y=0; y < fys_array[sec].length; y++ )
			{
				//alert(y);
				for ( x=0; x < fys_array[sec][y].length; x++ )
				{
					//alert(y + " - " + x );
					//alert(sec + " - " + y + " - " + x + " - " + fys_array[sec][y][x][0] + " " + fys_cvt_array[fys_array[sec][y][x][0]] + " " + fys_cvt_array[fys_array[sec][y][x][1]] + " " + row_cvt );
					
					if (  row_cvt >= fys_cvt_array[fys_array[sec][y][x][0]] && row_cvt <= fys_cvt_array[fys_array[sec][y][x][1]] )
					{
						//alert(fys_cvt_array[fys_array[sec][y][x][0]] + " " + row_cvt + " " + fys_cvt_array[fys_array[sec][y][x][1]]);
						
						// my_pano = "sec_"+sec.toLowerCase()+"_"+(y+1); // THIS MUST HAVE A 1 ADDED TO MAKE SURE THE PANO COINSIDEDS WITH THE fys_array["2"] = [ [["A1", "A1"]], [["A2", "A4"]], [["A5", "A5"]] ]; KEY VALUE
						
						my_pano = fys_array[sec][y][x][2]; // THIS MUST HAVE A 1 ADDED TO MAKE SURE THE PANO COINSIDEDS WITH THE fys_array["2"] = [ [["A1", "A1"]], [["A2", "A4"]], [["A5", "A5"]] ]; KEY VALUE

						//alert(pano_last);
						
						func_pano_show(my_pano);
						func_pano_show_info_pano(my_pano, "fys");
						
						
						
						// IF IN PRICE PLAN SEND SIGNAL TO FLASH TO ADD MARKER TO PANO
						if ( price_plan_id > 0 )
						{
							func_play_movie_1("add_marker__"+my_pano)
						}

						found = true;
						break;
					}
					
							// NEEDED TO ALERT THE ROW ERROR
					if ( found != true )
					{
						found = false;
					}
					
				}
				if ( found === true ) break;
			}
		}
	}
	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 = "";

	if ( found === true ) func_stat("find_seat__1");
}




function func_get_url(my_mode, my_object)
{
	var my_url = eval(my_object + ".location;");
	if ( my_mode == "root" )
	{
		my_url = my_url.toString();
		my_url = my_url.split("/");
		var my_pop = my_url.pop();
		my_url = my_url.join("/") + "/";
	}
	return my_url;
}



// legacy update if the buttons start with "sec" or "ste"

function func_legacy_convert_pano_name(pano_name)
{
	if ( pano_name.indexOf("sec") == 0 )
	{
		pano_name = pano_name.replace(/sec/,"p");
		return pano_name;
	}
	else if ( pano_name.indexOf("ste") == 0 )
	{
		pano_name = pano_name.replace(/ste/,"pg");
		
		//alert(pano_name);
		
		return pano_name;
	}
	else return pano_name;
	
	
}


var price_plan_id_new;
function func_play_movie_1(my_value)
{
	//alert(my_value);
										// THIS PLAYS THE FLASH MOVIE THAT HANDLES PASSING OF THE VARS TO FLASH FROM JS
	movie.SetVariable("var_name", my_value);
	movie.TPlay("var_loop");
										

										// SPLIT THE NAME TO GET THE PLAN ID
	var plan_id = my_value.split("plan_id_");
	price_plan_id_new = plan_id[1];
										
										// IF THE PLAN ID IS NOT EQUAL TO THE CURRENT PLAN ID, DELETE THE CONTENTS OF THE TT
	if ( my_value.indexOf("plan_id") > -1 && price_plan_id_new != price_plan_id )
	{
		func_display_1("none", "tt_info_table");
		func_display_2("none", "other");
		func_tt_update("delete", "");
	
										// UPDATE THE CURRENT PRICE PLAN ID WITH THE NEW VALUE
		price_plan_id = price_plan_id_new;

	}
}



function func_play_movie_2(my_value)
{
										// SPLIT THE NAME TO GET THE PLAN ID
	var plan_id = my_value.split("plan_id_");
	parent.price_plan_id_new = plan_id[1];
	
	
	if ( my_value.indexOf("csc") == 0 )
	{
		parent.document.movie.SetVariable("var_name", my_value);
		parent.document.movie.TPlay("var_loop");
	}
	
	
	else if ( my_value.indexOf("nav_") == 0 )
	{
		//alert(my_value);
		parent.document.movie.SetVariable("var_name", my_value);
		parent.document.movie.TPlay("var_loop");
	}
	
	
								// THIS PLAYS THE FLASH MOVIE THAT HANDLES PASSING OF THE VARS TO FLASH FROM JS
								// MAKE SURE THE PLAN IDs ARE DIFFERENT BEFORE SENDING A COMMAND TO FLASH TO REMOVE NUMBER MARKERS
	else if ( parent.price_plan_id_new != parent.price_plan_id || parent.pano_array.length < 1 )
	{
		//alert(my_value);
		parent.document.movie.SetVariable("var_name", my_value);
		parent.document.movie.TPlay("var_loop");

									// HIDE THE PURCHASE OPTION IFRAME
		func_other_hide();

	}

	
										// IF THE PLAN ID IS NOT EQUAL TO THE CURRENT PLAN ID, DELETE THE CONTENTS OF THE TT
	else if ( my_value.indexOf("plan_id") > -1 )
	{
									// HIDE THE PURCHASE OPTION IFRAME
		func_other_hide();

										// HIDE TT IFRAME
		func_display_2("none", "tt_info_table");
	
										// UPDATE THE CURRENT PRICE PLAN ID WITH THE NEW VALUE
		parent.price_plan_id = parent.price_plan_id_new;

	}
	
										// IF THE PLAN ID IS NOT EQUAL TO THE CURRENT PLAN ID, DELETE THE CONTENTS OF THE TT
	else if ( func_on_release_pano_group_tt.indexOf("plan_id") > -1 )
	{
									// HIDE THE PURCHASE OPTION IFRAME
		func_other_hide();
		parent.document.movie.SetVariable("var_name", my_value);
		parent.document.movie.TPlay("var_loop");
	}
}



function func_play_movie_3(my_value)
{
	//alert(my_value);

	
	if ( my_value.indexOf("nav_") == 0 )
	{
		//alert(my_value);
		parent.document.movie.SetVariable("var_name", my_value);
		parent.document.movie.TPlay("var_loop");
	}
	
	else if ( my_value.indexOf("csc__") == 0 )
	{
		//alert(my_value);
		parent.document.movie.SetVariable("var_name", my_value);
		parent.document.movie.TPlay("var_loop");
	}
}

function func_play_movie_4(my_value)
{
	//alert(my_value);

	parent.document.movie.SetVariable("var_name_2", my_value);
	parent.document.movie.TPlay("var_loop");
}


function func_check_pano_array_2()
{
	var found = false;
	if ( parent.pano_array )
	{
		for ( x in parent.pano_array )
		{
			found = true;
		}
	}
	//alert(found);
	return found;
}

function func_display_1(my_value, my_object)
{
	//if ( document.getElementById(my_object) != null ) document.getElementById(my_object).style.display = my_value;
	document.getElementById(my_object).style.display = my_value;
}


function func_display_2(my_value, my_object)
{
	//alert(my_value + " " + my_object + " " + parent.document.getElementById(my_object).style.display);
	parent.document.getElementById(my_object).style.display = my_value;
}




function func_display_3(my_value, my_object)
{
	if ( button_status == false )document.getElementById(my_object).style.display = my_value;
}


function func_email(email_str)
{
	func_switch_iframe("php_email", 1008, 743, email_str);

	if ( email_str.indexOf("site") > 0 ){ func_stat("email_to_friend_site__1"); }
	else { func_stat_2("email_to_friend_pano__1"); }
}



function func_help()
{
	//func_switch_iframe("php_help", 1008, 743, "");
	
	func_display_2("", "other")
	//parent.document.getElementById("pano_window").style.display = "none";
	func_iframe_update_size_3("width", 1008);
	func_iframe_update_size_3("height", 743);

	parent.other.location = "php_help.php";
	
	//parent.pano_window.location = parent.blank_php;
}




function func_same_as_billing()
{
	my_form.ship_address.value = my_form.bill_address.value;
	my_form.ship_city.value = my_form.bill_city.value;
	my_form.glb_ship_state_id.value = my_form.glb_bill_state_id.value;
	my_form.glb_ship_country_id.value = my_form.glb_bill_country_id.value;
	my_form.ship_zip.value = my_form.bill_zip.value;
}





function func_my_div_alert(my_type, my_text)
{
	document.getElementById("my_div_popup").innerHTML = my_text;
	document.getElementById("my_div_popup").style.display = "";
}



function func_confirm_1(my_str)
{
	var my_confirm = confirm(my_str);
	if (my_confirm == true)	return true;
}



										// USED TO CHANGE THE SIZE OF AN IFRAME
function func_iframe_update_size_1(my_mode, my_value)
{
	eval("document.getElementById('tt_info').style."+my_mode+" = '"+my_value+"px';");
	//alert("1 - " + my_value);
}


										// USED TO CHANGE THE SIZE OF AN IFRAME
function func_iframe_update_size_2(my_mode, my_value)
{
	eval("parent.document.getElementById('tt_info').style."+my_mode+" = '"+my_value+"px';");
	//alert("2 - " + my_value);
}


										// USED TO CHANGE THE SIZE OF AN IFRAME
function func_iframe_update_size_3(my_mode, my_value)
{
	eval("parent.document.getElementById('other').style."+my_mode+" = '"+my_value+"px';");
	//alert("3 - " + my_value);
}


function func_switch_iframe(my_file_name, my_width, my_height, my_qry_str)
{
		//alert(my_file_name + " " + my_width + " " + my_height + " " + my_qry_str );
		
	if ( my_file_name == "php_tt_purchase" )
	{
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
										// THIS IS USED TO SEND THE PANO IDs TO THE PURCHASE WINDOW
										// BECAUSE THE PURCHASE WINDOW IS USING HTTPS, WE CAN'T CALL THE JS DATA FROM THIS PARENT PAGE
										// WE HAVE TO SEND IN THE URL
			var my_pano = "";
			var qty = "";
			var cnt = 0;
			var a = "";
			
										// THIS HANDLES ALL THE PANOS IN THE TT CART
			if ( parent.pano_array )
			{
				for ( x in parent.pano_array )
				{
					if ( cnt > 0 ) a = ",";
					cnt++;
					
					my_pano += a + x;
					//alert(parent.pano_name_array[x][3]);
				}
			}
			

			var cnt = 0;
			var a = "";
									// THIS HANDLES ALL THE PANOS THAT HAVE BEEN REMOVED FROM THE TT CART
			if ( parent.pano_history_array )
			{
				if ( parent.pano_history_array )
				{
					my_pano += "&pnh=";
					
					for ( x in parent.pano_history_array )
					{
						if ( cnt > 0 ) a = ",";
						cnt++;
						
						my_pano += a + x;
					}
				}
			}
			
			
			
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			
			var my_schedule = "";
			
			if ( parent.po_s_array )
			{
				if ( parent.po_s_array[parent.price_plan_id] )
				{
					if ( parent.po_s_array[parent.price_plan_id].length > 0 )
					{
						var cnt = 0;
						var a = "";
						
						for ( x in parent.po_s_array[parent.price_plan_id] )
						{
							var schedule_id = parent.po_s_array[parent.price_plan_id][x].split("_");
							schedule_id = schedule_id[schedule_id.length-1];
							
							if ( cnt > 0 ) a = ",";
							else a = "";
							cnt++;
							
							my_schedule += a + schedule_id;
						}
					}
				}
			}

			//alert(my_schedule);
			
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

			var my_location_1 = location.href;
			var my_location = my_location_1.split("/");
			var my_pop = my_location.pop(my_location);

			my_location = my_location.join("/") + "/";

			
			if ( my_pano != "" ) my_pano = "&pn=" + my_pano;
			if ( parent.quantity != "" ) qty = "&qty=" + parent.quantity;
			if ( my_schedule != "" ) my_schedule = "&sch=" + my_schedule;
			
				//alert(my_location + my_file_name + ".php" + my_qry_str + my_pano + qty + my_schedule);
			window.open(my_location + my_file_name + ".php" + my_qry_str + my_pano + qty + my_schedule);
	}
		
		
		
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		

	else if ( my_file_name == "php_tt_purchase_buy_now" )
	{
		//alert(my_qry_str);
		
		var my_pp_id = my_qry_str.split("=");
		my_pp_id = my_pp_id[1].split("&");
		my_pp_id = my_pp_id[0];


		//alert(my_file_name);
		
		
		var my_location_1 = location.href;
		var my_location = my_location_1.split("/");
		var my_pop = my_location.pop(my_location);
		
		my_location[0] = "https:";
			
		my_location = my_location.join("/") + "/";
		
		
		
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
									// THIS IS USED TO SEND THE PANO IDs TO THE PURCHASE WINDOW
									// BECAUSE THE PURCHASE WINDOW IS USING HTTPS, WE CAN'T CALL THE JS DATA FROM THIS PARENT PAGE
									// WE HAVE TO SEND IN THE URL
		var my_pano = "";
		var qty = "";
		var cnt = 0;
		var a = "";
		

		var cnt = 0;
		var a = "";
								// THIS HANDLES ALL THE PANOS THAT HAVE BEEN REMOVED FROM THE TT CART
		if ( parent.pano_history_array )
		{
			if ( parent.pano_history_array )
			{
				my_pano += "&pnh=";
				
				for ( x in parent.pano_history_array )
				{
					if ( cnt > 0 ) a = ",";
					cnt++;
					
					my_pano += a + x;
				}
			}
		}
		
		
		
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		var my_schedule = "";
		
		if ( parent.po_s_array )
		{
			if ( parent.po_s_array[my_pp_id] )
			{
				if ( parent.po_s_array[my_pp_id].length > 0 )
				{
					var cnt = 0;
					var a = "";
					
					for ( x in parent.po_s_array[my_pp_id] )
					{
						var schedule_id = parent.po_s_array[my_pp_id][x].split("_");
						schedule_id = schedule_id[schedule_id.length-1];
						
						if ( cnt > 0 ) a = ",";
						else a = "";
						cnt++;
						
						my_schedule += a + schedule_id;
					}
				}
			}
		}

		//alert(my_pp_id);
		
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

					
		var my_qty = price_plan_array[my_pp_id][10][0];
		
		//alert(my_location + "php_tt_purchase.php" + my_qry_str + my_pano + qty + my_schedule + "&pt_id=" + pt_id );
		
		//my_pano = "&pn=" + parent.current_pano;
		//qty = "&qty=" + my_qty;
		if ( my_schedule != "" ) my_schedule = "&sch=" + my_schedule;
		
		var pt_id = price_plan_array[my_pp_id][1];
		
		 	//alert(my_location + my_file_name + ".php" + my_qry_str + my_pano + qty + my_schedule);
		window.open(my_location + "php_tt_purchase.php" + my_qry_str + my_pano + qty + my_schedule + "&pt_id=" + pt_id );
	}
	
	
				// FLEX PLAN URL STRING
	else if ( my_file_name == "php_tt_purchase_flex_pano" )
	{
		//alert(my_file_name + " " + my_width + " " + my_height + " " + my_qry_str)
		
		func_display_2("", "other")
		parent.document.getElementById("pano_window").style.display = "none";
		func_iframe_update_size_3("width", my_width);
		func_iframe_update_size_3("height", my_height);

		var pp_id = parent.price_plan_id_url_string;
		
		parent.other.location = my_file_name + ".php" + my_qry_str + "&price_plan_id=" + pp_id ;
	}
	
	
	
				// FLEX PLAN BUY NOW		
	else if ( my_file_name == "php_tt_purchase_flex_pano_buy_now" )
	{
		//alert(my_file_name + " " + my_width + " " + my_height + " " + my_qry_str)
		
		func_display_2("", "other")
		parent.document.getElementById("pano_window").style.display = "none";
		func_iframe_update_size_3("width", my_width);
		func_iframe_update_size_3("height", my_height);
		
		parent.other.location = "php_tt_purchase_flex_pano.php" + my_qry_str;
	}
	

	else
	{
		
		//alert(my_file_name + " " + my_width + " " + my_height + " " + my_qry_str)
		
		func_display_2("", "other");
		
		parent.pano_window.location = parent.blank_php;
		
		// enabling the code below does not push the panowindow to a new location
		//parent.document.getElementById("pano_window").style.display = "none";
		
		func_iframe_update_size_3("width", my_width);
		func_iframe_update_size_3("height", my_height);

		parent.other.location = my_file_name + ".php" + my_qry_str;
		
		parent.pano_window.location = parent.blank_php;
	}
}



function func_stat(my_value)
{
	
				// IF NOT IN THE ADMIN PAGES, RECORD STATS
	var my_location = location.toString();
	
	if ( my_location.indexOf("tt3_admin") < 0 )
	{
		var my_value_1 = my_value.split("__");
		my_value_1 = my_value_1[0];
		
		if ( stat_button_click_enable.length > 0 )
		{
			for ( x1=0; x1 < stat_button_click_enable.length; x1++ )
			{
				if ( stat_button_click_enable[x1] == my_value_1 )
				{
												// THIS PLAYS THE FLASH MOVIE THAT HANDLES PASSING OF THE VARS TO FLASH FROM JS
					movie.SetVariable("var_stat", my_value);
					movie.TPlay("var_loop");
				}
			}
		}
	}
}



function func_stat_2(my_value)
{
				// IF NOT IN THE ADMIN PAGES, RECORD STATS
	var my_location = location.toString();
	if ( my_location.indexOf("tt3_admin") < 0 )
	{
		var my_value_1 = my_value.split("__");
		my_value_1 = my_value_1[0];
		
		if ( stat_button_click_enable.length > 0 )
		{
			for ( x1=0; x1 < stat_button_click_enable.length; x1++ )
			{
				if ( stat_button_click_enable[x1] == my_value_1 )
				{
												// THIS PLAYS THE FLASH MOVIE THAT HANDLES PASSING OF THE VARS TO FLASH FROM JS
					parent.document.movie.SetVariable("var_stat", my_value);
					parent.document.movie.TPlay("var_loop");
				}
			}
		}
	}
}



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





/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// PANOS
	
										// UNHIDE PANO IFRAME
										// IF IN TT MODE, ADD PANO DATA
										// COLLECT ALL PANO DATA AND STOR IN ARRAY

var current_pano = "";
function func_pano_show(pano_name)
{
	//alert(pano_name);

	pano_name = func_legacy_convert_pano_name(pano_name);
	
		
	if ( price_plan_id != 0 && !pano_array[pano_name])
	{
		func_display_1("", "tt_info_table");
		func_display_1("", "purchase_now_button");
	
											// GATHER PANO INFO AND STORE IT IN ARRAY
											// [0] = CAT name
											// [1] = CAT color
											// [2] = pano description
											// [3] = price type id / price value id combination
		pano_array[pano_name] = [category_array[pano_name_array[pano_name][1]][0], category_array[pano_name_array[pano_name][1]][1], pano_name_array[pano_name][0]];
	
		//alert(pano_name);
		
		var ppt_len = category_array[pano_name_array[pano_name][1]][2].length;			// LOOP THROUGH THE PANO PRICE TYPES AND PREP THEM FOR DISPLAY
		for ( x=0; x<ppt_len; x++ )
		{
			var t = category_array[pano_name_array[pano_name][1]][2][x].split(","); 	// GET THE PRICE TYPE AND PRICE TYPE VALUES
			var pt_id = Number(t[0]); 											// MAKE THE PRICE TYPE A NUMBER TO BE USED TO FIND THE MATCHING KEYS IN THE PRICE TYPE ARRAY
			var ptv = Number(t[1]);													// MAKE THE PRICE TYPE VALUE A NUMBER TO BE USED TO FIND THE MATCHING KEY IN THE PRICE TYPE ARRAY
			var price_type_name = price_type_array[pt_id][0]; 						// PRICE TYPE NAME
			
			var price_type_value = "";
			
			if ( ptv != 0 ) price_type_array[pt_id][1][ptv][1];



								// ADD TO ARRAY, THE PRICE TYPE THAT IS ASSIGNED TO THE SELECTED PRICE PLAN
			if ( price_plan_id != 0 )
			{
				var found = "";
				var pa_len = pano_name_array[pano_name][2].length;
				for ( y=0; y<pa_len; y++ )
				{
												// IF THE PANO NAME HAS NOT BEEN ADDED TO THE PANO_ARRAY, ADD IT
												// MAKE SURE THE PRICE_PLAN'S PRICE_TYPE IS EQUAL TO THE PANO'S CATEGORY'S PRICE_TYPE
					if ( price_plan_array[price_plan_id][1] == pt_id && !pano_array[pano_name][3] ) // IF THE PRICE TYPE IS IN THIS PRICE PLAN AND THE pano_array[pano_name][3] HAS NOT BEEN SET YET
					{
						//alert(pt_id);
						//alert(quantity);
						
						var my_pt = pt_id + "," + ptv; // THE "1" MEMBER IS THE PLAN PRICE PER GAME.. THIS IS ALWAYS THE BASE PRICE FOR A PRICE TYPE
						pano_array[pano_name].push(my_pt); 
						func_tt_update("update_table", pano_name);
					
						
						found = true;
					}
					if ( found === true ) break;
				}
			}
			
			if ( found === true ) break;
		}
	}
	
										
										// SHOW THE PANO
	
	var t=setTimeout("pano_window.location = 'php_pano_window.php?pano_name=" + pano_name + "';", 1000);
	//var t=setTimeout("a1(pano_name);", 1000);

	//alert(pano_name);
	
	document.getElementById("pano_window").style.display = "";
	
			// USED FOR EMAIL PANO TO A FRIEND
	current_pano = pano_name;
	
	
				// CANNOT TRACK PANO WHEN USING FYS
				// FLASH FILE IS NOT FAST ENOUGH TO PROCESS DATA
				// TRACKING PANO IS IN THE PANOWINDOW.PHP FILE
	//alert("pano_id__"+pano_name_array[pano_name][3]);
	//func_stat("pano_id__"+pano_name_array[pano_name][3]);
}


	function a1(pano_name)
	{
		alert(pano_name);
		pano_window.location = "php_pano_window.php?pano_name=" + pano_name;
	}



function func_pano_group_add_tt(pano_group_name)
{
	pano_name = func_legacy_convert_pano_name(pano_group_name);
	//alert(pano_name);
		
	if ( price_plan_id != 0 && !pano_array[pano_name])
	{
		
		func_display_1("", "tt_info_table");
		func_display_1("", "purchase_now_button");
	
											// GATHER PANO INFO AND STORE IT IN ARRAY
											// [0] = CAT name
											// [1] = CAT color
											// [2] = pano description
											// [3] = price type id / price value id combination
		pano_array[pano_name] = [category_array[pano_group_name_array[pano_name][1]][0], category_array[pano_group_name_array[pano_name][1]][1], pano_group_name_array[pano_name][0]];
	

		var ppt_len = category_array[pano_group_name_array[pano_name][1]][2].length;			// LOOP THROUGH THE PANO PRICE TYPES AND PREP THEM FOR DISPLAY
		
		for ( x=0; x<ppt_len; x++ )
		{
			var t = category_array[pano_group_name_array[pano_name][1]][2][x].split(","); 	// GET THE PRICE TYPE AND PRICE TYPE VALUES
			var pt_id = Number(t[0]); 		
												// MAKE THE PRICE TYPE A NUMBER TO BE USED TO FIND THE MATCHING KEYS IN THE PRICE TYPE ARRAY
			if ( t[1] == "" ) var ptv = "";
			else var ptv = Number(t[1]);		
															// MAKE THE PRICE TYPE VALUE A NUMBER TO BE USED TO FIND THE MATCHING KEY IN THE PRICE TYPE ARRAY
			var price_type_name = price_type_array[pt_id][0]; 						// PRICE TYPE NAME



			var price_type_value = "";
			
			//if ( ptv != 0 ) price_type_array[pt_id][1][ptv][1];
			
								// ADD TO ARRAY, THE PRICE TYPE THAT IS ASSIGNED TO THE SELECTED PRICE PLAN
			if ( price_plan_id != 0 )
			{
				//alert(ptv);
				
				var found = "";
				var pa_len = pano_group_name_array[pano_name][2].length;
				for ( y=0; y<pa_len; y++ )
				{
												// IF THE PANO NAME HAS NOT BEEN ADDED TO THE PANO_ARRAY, ADD IT
					if ( !pano_array[pano_name][3] ) // IF THE pano_array[pano_name][3] HAS NOT BEEN SET YET
					{
						//alert(quantity);
						
						var my_pt = pt_id + "," + ptv; // THE "1" MEMBER IS THE PLAN PRICE PER GAME.. THIS IS ALWAYS THE BASE PRICE FOR A PRICE TYPE
						pano_array[pano_name].push(my_pt); 
						//alert(my_pt);
						func_tt_update("update_table", pano_name);
					
						
						found = true;
					}
					if ( found === true ) break;
				}
			}
			
			if ( found === true ) break;
		}
	}
	
	//alert(pano_array[pano_name]);
	
			// USED FOR EMAIL PANO TO A FRIEND
	current_pano = pano_name;
}


function func_pano_group_show(pano_name)
{
	//pano_name = "pg_sterling_lng_2";
	//alert(pano_name);
	
	pano_name = func_legacy_convert_pano_name(pano_name);

	//alert(pano_name);


	document.getElementById("pano_window").style.display = "";
	pano_window.location = "php_pano_window.php?pano_name=" + pano_name;
	//alert(pano_name);
}



										// SHOW PANO INFO IN PANO INFO AREA
										// my_status IS USED TO KNOW IF SHOWING INFO ON PANO-ROLLOVER OR PANO-CLICK
var admin_mode = false;
function func_pano_show_info_pano(pano_name, my_status)
{
	//alert(pano_name + " " + my_status);
	
	if ( document.getElementById("pano_window") )
	{
		var my_display = document.getElementById("pano_window").style.display;
	}
	
	if ( ((pano_name != "" && pano_name != "no_pano") && my_status == "tt_table") ||  
		  (pano_name != "" && pano_name != "no_pano") && (my_display == "none" || my_status == "fys" || admin_mode === true) )
	{
		//alert(pano_name + " " + my_status);
		
		pano_name = func_legacy_convert_pano_name(pano_name);

		var pano_info = "";

										// SHOW CATEGORY NAME
		if ( category_array )
		{
			if ( category_array[pano_name_array[pano_name][1]] )
			{
						// CHECK TO SEE IF TT IS ON OR OFF
				var my_check_tt = func_check_tt_on_off();
				
				var cat_id = pano_name_array[pano_name][1];
						
				if ( show_category == "1" ) pano_info = "<div class=\"cat_title_1\" align=\"center\">" + category_array[pano_name_array[pano_name][1]][0] + "</div>";
				pano_info += "<div class=\"section_info_1\" align=\"center\">" + pano_name_array[pano_name][0] + "</div><br>";
				
				
				
						// LOOP THROUGH THE PANO PRICE TYPES AND PREP THEM FOR DISPLAY
				var ppt_len = category_array[pano_name_array[pano_name][1]][2].length;
				
				for ( x=0; x < ppt_len; x++ )
				{
					//alert(x);
					
					var t = category_array[pano_name_array[pano_name][1]][2][x].split(",");
					var pt_id = Number(t[0]);
					
					if ( t[1] == "" ) var ptv = "";
					else var ptv = Number(t[1]);
		
		
					var price_type_name = price_type_array[pt_id][0];
					
					var price_type_value = 0;
					
									// ASSIGN THE PRICE TYPE VALUE
					if ( ptv === "" ) price_type_value = ptv;
					else price_type_value = price_type_array[pt_id][1][ptv][1];
					
					

									// CHECK FOR AVAILABILITY AND HIGHLIGHT THE PRICE TYPE THAT IS ASSIGNED TO THE SELECTED PRICE PLAN
					var my_class = "price_type_1";
					
											// RESET VARS 
							var buy_now = "";
							var sold_out = "";
							var found_buy_now = false;

					
									// pano_name_array["sec_101_1"][2] = PRICE PLAN IDS WHERE PANO IS AVAILABLE
					var pa_len = pano_name_array[pano_name][2].length;
					
									// IF IN A PRICE PLAN
					if ( price_plan_id != 0 )
					{
						for ( y=0; y<pa_len; y++ )
						{
							if ( pano_name_array[pano_name][2][y] == price_plan_id && price_plan_array[price_plan_id][1] == pt_id )
							{
															// USE THE CORRECT CLASS NAME WHEN A PRICE PLAN IS SELECTED
								if ( price_plan_id != 0 )
								{
									my_class = "price_type_2";
								}
							}
						}
					}


					///////////////////////////////////////////////////////////////////////////////////////////////////////
					///////////////////////////////////////////////////////////////////////////////////////////////////////
									// SEARCH TO SEE IF PANOS ARE AVAILABLE AND DISPLAY BUY NOW OR SOLD OUT 
									// pano_name_array["sec_101_1"][2] = PRICE PLAN IDS WHERE PANO IS AVAILABLE
					
					else
					{
						for ( y1 in price_plan_array )
						{

							var qty = price_plan_array[y1][10][0];		// = DEFAULT TICKET QUANTITY
							
															// CHECK IF PRICE PLAN PRICE TYPE IS A MATCH WITH THE PANO-CATECORY PRICE TYPE
							if ( price_plan_array[y1][1] == pt_id )
							{
								
												// - pano_name_array["sec_101_1"][2] = PRICE PLAN IDS WHERE PANO IS AVAILABLE
												// CHECK FOR AVAILABILITY
								for ( y2=0; y2 < pano_name_array[pano_name][2].length; y2++ )
								{
												// IF AVAILABLE IN THE CURRENT PRICE PLAN LOOP ITEM
									if ( pano_name_array[pano_name][2][y2] == y1 )
									{
										//alert("BUY NOW");
										
												// IF BUY NOW IS ACTIVE
										if ( price_plan_array[y1][14] == 1 )
										{
															// CHECK FOR ACTIVE OFF-SITE URL
															// OR IF TT IS OFF
											if ( price_plan_array[y1][13] == 1 || my_check_tt === false )
											{
														// CHECK FOR OFF-SITE URL AND LINK OUT
												if ( price_plan_array[y1][3] != "" ) buy_now = "<a href='" + price_plan_array[y1][3] + "' target='_blank' class='price_type_3'>Buy now!</a>";
														// ELSE USE seat_ticket_url
												else buy_now = "<a href='" + seat_ticket_url + "' target='_blank' class='price_type_3'>Buy now!</a>";
											}
											
															// ELSE BUY NOW
											else
											{
												//alert("<a href='javascript:;' onclick='func_tt_purchase(\"buy_now\", \"?price_plan_id=" + pp_id + "&pn=" + pano_name + "&qty=" + qty + "\");' class='price_type_3'>Buy now!</a>");
												//alert(cat_id + " - " + x);

												var pp_id = category_buy_now_array[cat_id][x];
												var buy_now_key = cat_id + "," + pp_id + "," + price_type_value;
												buy_now = "<a href='javascript:;' onclick='func_tt_purchase(\"buy_now\", \"?price_plan_id=" + pp_id + "&pn=" + pano_name + "&qty=" + qty + "&buy_now_key=" + buy_now_key + "\");' class='price_type_3'>Buy now!</a>";
											}
											
											my_class = "price_type_4";
										}
										
										found_buy_now = true;

									}
								}
							}
							
							if ( price_plan_array[y1][1] == pt_id )
							{
								if ( found_buy_now == false )
								{
									//alert(y1);
									if ( price_plan_array[y1][15] == 1 )
									{
										sold_out = "<span class='price_type_5'>Sold out</span>";
										//alert(y1);
									}
								}
							}
						}
					}
		
					///////////////////////////////////////////////////////////////////////////////////////////////////////
					///////////////////////////////////////////////////////////////////////////////////////////////////////
							
								
				
					pano_info += "<div style=\"\" class=\"" + my_class + "\">" + price_type_name + " " + price_type_value + " " + buy_now + " " + sold_out + "</div>";
						
				}
				
				
				pano_info += "<br><div class=\"comment_1\" align=\"center\">" + category_array[pano_name_array[pano_name][1]][3] + "</div><br>";
				
				if ( my_status == "tt_table" ) parent.document.getElementById('pano_info').innerHTML = pano_info;
				else document.getElementById('pano_info').innerHTML = pano_info;
			}
		}
	}
	else
	{
		if (my_display == "none") 
		{
			document.getElementById('pano_info').innerHTML = pano_info_default_value;
		}
	}
}



function func_pano_group_back_button_1()
{
	//document.getElementById('pano_info').innerHTML = "";
	document.getElementById('pano_info').innerHTML = pano_info_default_value;
}




										// SHOW PANO INFO IN EMAIL
function func_pano_show_info_pano_email(pano_name)
{	

	if ( pano_name != "" && pano_name != "no_pano" && pano_name.indexOf("#") < 0 )
	{
		pano_name = func_legacy_convert_pano_name(pano_name);

		//alert(pano_name);
		var pano_info = "";
		
										// SHOW CATEGORY NAME
		if ( show_category == "1" ) pano_info = category_array[pano_name_array[pano_name][1]][0] + "\n";
		pano_info += pano_name_array[pano_name][0] + "\n\n";
		
		
				// loop through the pano price types and prep them for display
		var ppt_len = category_array[pano_name_array[pano_name][1]][2].length;
		for ( x=0; x<ppt_len; x++ )
		{
			
			var t = category_array[pano_name_array[pano_name][1]][2][x].split(",");
			var pt_id = Number(t[0]);
			var ptv = Number(t[1]);
			var price_type_name = price_type_array[pt_id][0];
			
			var price_type_value = "";
			
			if ( ptv !== "" )
			{
				price_type_value = price_type_array[pt_id][1][ptv][1];
			}
			
								// check for availability and highlight the price type that is assigned to the selected price plan
				var my_class = "";
			if ( price_plan_id != 0 )
			{
				var pa_len = pano_name_array[pano_name][2].length;
				for ( y=0; y<pa_len; y++ )
				{
									// use the correct class name when a price plan is selected
					if ( price_plan_array[pano_name_array[pano_name][2][y]] && price_plan_array[price_plan_id][1] == pt_id )	my_class = "price_type_2";
				}
			}
							
			pano_info += price_type_name + " " + price_type_value + "\n";
				
		}
		
		pano_info += "\n" + category_array[pano_name_array[pano_name][1]][3] + "\n\n";
		return pano_info;
		
	}
}


										// SHOW PANO INFO IN PANO INFO AREA
function func_pano_show_info_pano_group(pano_group_name)
{
	
	if ( pano_group_name != "" && pano_group_name != "no_pano" )
	{
		pano_group_name = func_legacy_convert_pano_name(pano_group_name);


		//alert(pano_group_name);
		var pano_info = "";
		
		//alert(pano_group_name);
		
										// SHOW CATEGORY NAME
		if ( show_category == "1" ) pano_info = "<div class=\"cat_title_1\" align=\"center\">" + category_array[pano_group_name_array[pano_group_name][1]][0] + "</div>";
		pano_info += "<div class=\"section_info_1\" align=\"center\">" + pano_group_name_array[pano_group_name][0] + "</div><br>";
		
		
		
				// LOOP THROUGH THE PANO PRICE TYPES AND PREP THEM FOR DISPLAY
		var ppt_len = category_array[pano_group_name_array[pano_group_name][1]][2].length;
		for ( x=0; x<ppt_len; x++ )
		{
			
			var t = category_array[pano_group_name_array[pano_group_name][1]][2][x].split(",");
			var pt_id = Number(t[0]);
			var ptv = Number(t[1]);
			var price_type_name = price_type_array[pt_id][0];

			var price_type_value = "";
			
			//alert(price_type_array[pt_id][1][ptv][1]);
			
			if ( price_type_array[pt_id][1][ptv][1] ) price_type_value = price_type_array[pt_id][1][ptv][1];
						
								// CHECK FOR AVAILABILITY AND HIGHLIGHT THE PRICE TYPE THAT IS ASSIGNED TO THE SELECTED PRICE PLAN
				var my_class = "";
			if ( price_plan_id != 0 )
			{
				var pa_len = pano_group_name_array[pano_group_name][2].length;
				for ( y=0; y<pa_len; y++ )
				{
									// use the correct class name when a price plan is selected
					if ( price_plan_array[pano_group_name_array[pano_group_name][2][y]] && price_plan_array[price_plan_id][1] == pt_id )	my_class = "price_type_2";
				}
			}
			
			if ( my_class != "price_type_2" ) my_class = "price_type_1";
				
				pano_info += "<div class=\"" + my_class + "\">" + price_type_name + " " + price_type_value + "</div>";
				
		}
		
		pano_info += "<br><div class=\"comment_1\" align=\"center\">" + category_array[pano_group_name_array[pano_group_name][1]][3] + "</div><br>";
		document.getElementById('pano_info').innerHTML = pano_info;
		
	}
	else document.getElementById('pano_info').innerHTML = pano_info_default_value;
}



function func_on_release_pano_group_tt(pano_group_name)
{
	func_other_hide();
	func_play_movie_2(func_on_release_pano_group_tt + "__" + pano_group_name);
	
	//alert(pano_group_name);
}



function func_pano_hide()
{
	parent.pano_window.location = parent.blank_php;
	//alert(fn);
		//	line below needs to be commented out in order for the bank_php location update to work properly
	if(fn.indexOf("pg_") < 0)
	{
		parent.document.getElementById('pano_info').innerHTML = pano_info_default_value;
	}
	func_display_2("none", "purchase_now_button");
}




function func_other_hide()
{
	/*
	var my_url = this.location.href;
	my_url = my_url.split("/");
	var my_pop = my_url.pop();
	my_url = my_url.join("/") + "/";
	*/
	
	func_iframe_update_size_3("width", 0);
	
	parent.other.location = parent.blank_php;
	//alert(parent.other.location);

}

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






/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// PURCHASE OPTIONS



function func_purchase_option(option_type)
{
	var my_check_tt = func_check_tt_on_off();
	var my_check_pp = func_purchase_option_display(option_type);
	
	//alert(my_check_tt);

	if ( my_check_pp[0] == "" ||
			 (my_check_pp[1] == 0 && option_type == "seat") ||
			 (my_check_pp[2] == 0 && option_type == "suite") ||
			 my_check_tt === false )
	{
		//alert("a1");
		if ( option_type == "suite" ) window.open(suite_ticket_url);
		else
		{
			if ( seat_ticket_url.indexOf("http") === 0 ) window.open(seat_ticket_url);
			else window.open(venue_occupant_url);
		}
	}
	else if ( my_check_tt === true )
	{
		func_switch_iframe("php_tt_purchase_option", 1008, 743, "?&option_type="+option_type);
		
		if ( option_type == "suite" ) func_stat("purchase_"+option_type+"__1");
		else func_stat("purchase_"+option_type+"__1");
	}
}



function func_purchase_option_display(option_type, pp_id)
{
	var my_return = "\n";
	var seat_price_plan_cnt = 0;
	var suite_price_plan_cnt = 0;
	
	
			// USED FOR FLEX PLANS WHEN USING URL STRING OR BUY NOW
	if ( pp_id == undefined ) pp_id = "";
	
	//alert(pp_id);
	
	var my_sort_array = new Array();
	
	if ( parent.price_plan_array )
	{
		
		////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////
		// need to rebuild the price_plan_array to make sure the list of Price Plans are sorted by their list order
		
		for ( x in parent.price_plan_array )
		{
			//alert(parent.price_plan_array[x][7] + " - " + x);
			
			my_sort_array[parent.price_plan_array[x][7] + "__" + x] = parent.price_plan_array[x][7] + "__" + x;
		}
		
		var array_temp = new Array();
		array_temp = my_sort_array;
		my_sort_array = new Array();
		var keys = new Array();
		for(k in array_temp)
		{
		     keys.push(k);
		}
		
		keys.sort( function (a, b){return (a > b) - (a < b);} );
		
		for (var i = 0; i < keys.length; i++)
		{
		     //alert(keys[i] + " , " + array_temp[keys[i]]);
		     my_sort_array[keys[i]] = array_temp[keys[i]];
		}
		
		////////////////////////////////////////////////////////////////////////////////////
		////////////////////////////////////////////////////////////////////////////////////



		for ( x in my_sort_array )
		{
			
			x = my_sort_array[x].split("__");
			x = x[1];
			
			//alert(x);
			
								// RESET COUNT GAMES MARKER
			var flex_game_count = false;
			var my_click = "";

			

					 // IF PP_ID IS SENT TO FUNCTION, LOOP WILL RESTRICT TO ONLY DISPLAYING ONE PANO_ID
			if ( (pp_id != "" && pp_id == x) || pp_id == "" )
			{
				var plan_name = price_plan_array[x][11].toLowerCase();
				var plan_title = price_plan_array[x][0];
		
				//alert(plan_name);
	
				
							// MUST NOT HAVE THE TEXT "suite" IN THE PLAN NAME
				if ( option_type == "seat" && plan_name.indexOf("suite") < 0 )
				{
					//alert("A");
					
					if ( parent.auto_remove_price_plan == "1" )
					{
						//alert("B");
						
											// COUNT THE NUMBER OF PRICE PLANS TO MAKE SURE THERE ARE ANY PLANS TO DISPLAY
						seat_price_plan_cnt++;
						
						
									// CHECK TO SEE IF THE PLANS NEED TO BE SHOWN OR NOT
						var date_split = parent.price_plan_array[x][8].split("___");
						var date_start = Number(date_split[0]);
						var date_end = Number(date_split[1]);
						
						if ( (date_start < parent.time_stamp_now && date_end > parent.time_stamp_now) ||
								 (date_start == 0 && date_end > parent.time_stamp_now) ||
								 (date_start < parent.time_stamp_now && date_end == 0) )
						{
							
										// IF FLEX PLAN PRICE PLAN TYPE
							if ( price_plan_array[x][6] == 2 || price_plan_array[x][6] == 6 )
							{
								var game_count = func_get_current_game_num(x);
								var game_count_in_plan = price_plan_schedule_array[x][1];
											
											//alert(game_count + " " + game_count_in_plan);
											
											// CHECK NUMBER OF GAMES TO KNOW IF PLAN SHOULD BE SHOWN
								if ( game_count >= game_count_in_plan ) flex_game_count = true;
							}
			
							my_return += "<ul style=\"margin:10px 0px 0px 0px;\">\n";
							
							
									// IF THERE IS AN OFF-SITE URL ACTIVE CHECKMARK
							if ( parent.price_plan_array[x][13] == 1 ) my_click = my_click = "onclick=\"parent.func_purchase_option_click('plan_id_" + x + "');\"";

							
											// IF THIS IS A FLEX PLAN, MAKE THE SCHEDULE CLICKABLE
							if ( parent.price_plan_array[x][6] == 2 || parent.price_plan_array[x][6] == 6 )
							{
								if ( flex_game_count == true )
								{
									//alert(game_count + " " + game_count_in_plan);
									my_return += "<li class=\"po_text_2\">";
									my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" " + my_click + " onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" class=\"po_text_2\">" + plan_title + "</a>\n";
									my_return += "</li>";
								}
							}
							else
							{
								//alert(game_count + " " + game_count_in_plan + " " + flex_game_count + " - B");
								my_return += "<li class=\"po_text_2\">";
								my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" onclick=\"parent.func_purchase_option_click('plan_id_" + x + "');\" class=\"po_text_2\">" + plan_title + "</a>\n";
								my_return += "</li>";
							}
							my_return += "</ul>\n";
						}
					}
					
					else
					{
						//alert("C");
						
						
						
											// COUNT THE NUMBER OF PRICE PLANS TO MAKE SURE THERE ARE ANY PLANS TO DISPLAY
						seat_price_plan_cnt++;
						
						my_return += "<ul style=\"margin:10px 0px 0px 0px;\">\n";
						
						
						
										// IF THIS IS A FLEX PLAN, MAKE THE SCHEDULE CLICKABLE
						if ( parent.price_plan_array[x][6] == 2 || parent.price_plan_array[x][6] == 6 )
						{
							if ( flex_game_count == true )
							{
								//alert(game_count + " " + game_count_in_plan);
								my_return += "<li class=\"po_text_2\">";
								my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" class=\"po_text_2\">" + plan_title + "</a>\n";
								my_return += "</li>";
							}
						}
						else
						{
							//alert(game_count + " " + game_count_in_plan + " " + flex_game_count + " - B");
							my_return += "<li class=\"po_text_2\">";
							my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" onclick=\"parent.func_purchase_option_click('plan_id_" + x + "');\" class=\"po_text_2\">" + plan_title + "</a>\n";
							my_return += "</li>";
						}
						my_return += "</ul>\n";
					}
				}
		
		
							// MUST HAVE THE TEXT "suite" IN THE PLAN NAME
				if ( option_type == "suite" && plan_name.indexOf("suite") > -1 )
				{
					//alert("AA");
					if ( parent.auto_remove_price_plan == "1" )
					{
						//alert("BB");
						
						
						
											// COUNT THE NUMBER OF PRICE PLANS TO MAKE SURE THERE ARE ANY PLANS TO DISPLAY
						suite_price_plan_cnt++;
		
									// CHECK TO SEE IF THE PLANS NEED TO BE SHOWN OR NOT
						var date_split = parent.price_plan_array[x][8].split("___");
						var date_start = Number(date_split[0]);
						var date_end = Number(date_split[1]);
						
						if ( (date_start < parent.time_stamp_now && date_end > parent.time_stamp_now) ||
								 (date_start == 0 && date_end > parent.time_stamp_now) ||
								 (date_start < parent.time_stamp_now && date_end == 0) )
						{
			
							my_return += "<ul style=\"margin:10px 0px 0px 0px;\">\n";
							
							
							
											// IF THIS IS A FLEX PLAN, MAKE THE SCHEDULE CLICKABLE
							if ( parent.price_plan_array[x][6] == 2 || parent.price_plan_array[x][6] == 6 )
							{
								if ( flex_game_count == true )
								{
									//alert(game_count + " " + game_count_in_plan);
									my_return += "<li class=\"po_text_2\">";
									my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" class=\"po_text_2\">" + plan_title + "</a>\n";
									my_return += "</li>";
								}
							}
							else
							{
								//alert(game_count + " " + game_count_in_plan + " " + flex_game_count + " - B");
								my_return += "<li class=\"po_text_2\">";
								my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" onclick=\"parent.func_purchase_option_click('plan_id_" + x + "');\" class=\"po_text_2\">" + plan_title + "</a>\n";
								my_return += "</li>";
							}
							my_return += "</ul>\n";
						}
					}
					
					else
					{
						//alert("CC");
						
											// COUNT THE NUMBER OF PRICE PLANS TO MAKE SURE THERE ARE ANY PLANS TO DISPLAY
						suite_price_plan_cnt++;
						
						my_return += "<ul style=\"margin:10px 0px 0px 0px;\">\n";
						
						
						
										// IF THIS IS A FLEX PLAN, MAKE THE SCHEDULE CLICKABLE
						if ( parent.price_plan_array[x][6] == 2 || parent.price_plan_array[x][6] == 6 )
						{
							if ( flex_game_count == true )
							{
								//alert(game_count + " " + game_count_in_plan);
								my_return += "<li class=\"po_text_2\">";
								my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" class=\"po_text_2\">" + plan_title + "</a>\n";
								my_return += "</li>";
							}
						}
						else
						{
							//alert(game_count + " " + game_count_in_plan + " " + flex_game_count + " - B");
							my_return += "<li class=\"po_text_2\">";
							my_return += "<a href=\"#\" id=\"price_plan_" + x + "\" onmouseover=\"func_purchase_option_rollover(" + x + ", this.id);\" onclick=\"parent.func_purchase_option_click('plan_id_" + x + "');\" class=\"po_text_2\">" + plan_title + "</a>\n";
							my_return += "</li>";
						}
						my_return += "</ul>\n";
					}
				}
			}
		}
	
										// [0] IS THE HTML CODE TO DISPLAY THE PRICE PLANS
										// [1] IS THE COUNT OF SEAT PRICE PLANS... USED TO POPUP THE OFFSITE URL IF THE COUNT IS 0
										// [2] IS THE COUNT OF SUITE PRICE PLANS... USED TO POPUP THE OFFSITE URL IF THE COUNT IS 0
		my_return_array = new Array(my_return, seat_price_plan_cnt, suite_price_plan_cnt);
		
		//alert(my_return_array[0]);
		
		return my_return_array;

	}
	else alert("No Price Plan Data");
}



var po_s_array = new Array();  // PURCHASE OPTION SCHEDULE ARRAY // HOLDS THE ITEMS SELECTED IN THE FLEX PLAN GAMES LIST
function func_purchase_option_right_event(my_object, my_event)
{	
	var my_obj = document.getElementById(my_object);
	//var my_obj = document.getElementById('po_right_item_28');
	//alert(my_obj.getAttribute('class'));
	
	if ( my_obj )
	{
		if ( my_event == "rollover" )
		{
										//	getAttributeNode IS NEEDED FOR IE.. FIREFOX WORKS WITH THIS TOO
			if ( my_obj.getAttributeNode("class").value != "po_text_2_click" ) 
			{
				//alert(my_obj.getAttributeNode("class").value);
				//alert(my_class);
				
				if ( my_browser != "MSIE" ) my_obj.setAttribute("class", "po_text_2_rollover");
				else if ( my_browser == "MSIE" )my_obj.setAttribute("className", "po_text_2_rollover");
					
			}
		}
		
		
		if ( my_event == "rollout" )
		{
			//alert(my_obj.getAttributeNode("class").value);
			
			if ( my_obj.getAttributeNode("class").value != "po_text_2_click" )
			{
				//alert(my_obj.getAttributeNode("class").value);
				if ( my_browser != "MSIE" )
				{
					my_obj.setAttribute("class", "po_text_2");
				}
				else if ( my_browser == "MSIE" )
				{
					my_obj.setAttribute("className", "po_text_2");
				}
			}
		}
		
		
		if ( my_event == "click" )
		{
			if ( my_obj.getAttributeNode("class").value == "po_text_2_click" )
			{
				
				if ( my_browser != "MSIE" )
				{
					my_obj.setAttribute("class", "po_text_2_rollover");
				}
				else if ( my_browser == "MSIE" )
				{
					my_obj.setAttribute("className", "po_text_2_rollover");
				}

				
				var po_s_array_new = new Array();
				po_s_array_new = parent.po_s_array[parent.price_plan_id_temp];
				parent.po_s_array[parent.price_plan_id_temp] = new Array();
				
				
				for ( x in po_s_array_new )
				{
					if ( po_s_array_new[x] != my_object ) parent.po_s_array[parent.price_plan_id_temp].push(po_s_array_new[x]);
				}
			}
			else
			{
				if ( !parent.po_s_array[parent.price_plan_id_temp] )
				{
				
					if ( my_browser != "MSIE" ) my_obj.setAttribute("class", "po_text_2_click");
					else if ( my_browser == "MSIE" ) my_obj.setAttribute("className", "po_text_2_click");

					parent.po_s_array[parent.price_plan_id_temp] = new Array();
				}



				if ( parent.po_s_array[parent.price_plan_id_temp].length < price_plan_schedule_array[parent.price_plan_id_temp][1] )
				{
					if ( my_browser != "MSIE" ) my_obj.setAttribute("class", "po_text_2_click");
					else if ( my_browser == "MSIE" ) my_obj.setAttribute("className", "po_text_2_click");

					parent.po_s_array[parent.price_plan_id_temp].push(my_object);	// ADD SELECTED ITEM TO ARRAY
				}


					//alert(parent.po_s_array[parent.price_plan_id_temp].length + " --- " + price_plan_schedule_array[parent.price_plan_id_temp][1]);
		
						////////////////////////////////////////////////////////////////////////////////
						// USED FOR FLEX PLANS VIA THE URL STRING
				if ( parent.price_plan_id_url_string != "" && price_plan_array[parent.price_plan_id_url_string][6] == 2 )
				{
					if ( parent.po_s_array[parent.price_plan_id_temp].length == price_plan_schedule_array[parent.price_plan_id_temp][1] )
					{
						var my_text = "You have selected the maximum number of games for this plan. <br>Would you like to continue to the Purchase Request Form or change your selection of games?";
						my_text += "<br><br>";
						my_text += "<div align=\"center\"><a href=\"#\" class=\"po_popup_2\" onclick=\"func_switch_iframe('php_tt_purchase', 1008, 743 , '?price_plan_id=" + parent.price_plan_id_temp + "'); func_other_hide();\">continue</a>";
						my_text += "&nbsp;&nbsp;&nbsp;";
						my_text += "<a href=\"#\" class=\"po_popup_2\" onclick=\"document.getElementById('my_div_popup').style.display = 'none';\">Change selection</a></div>";

						func_my_div_alert("flex", my_text);
					}
				}


						////////////////////////////////////////////////////////////////////////////////
						// USED FOR FLEX PLANS VIA BUY NOW
				else if ( parent.buy_now != "" && price_plan_array[parent.price_plan_id_temp][6] == 2 )
				{
					if ( parent.po_s_array[parent.price_plan_id_temp].length == price_plan_schedule_array[parent.price_plan_id_temp][1] )
					{
						var my_text = "You have selected the maximum number of games for this plan. <br>Would you like to continue to the Purchase Request Form or change your selection of games?";
						my_text += "<br><br>";
						my_text += "<div align=\"center\"><a href=\"#\" class=\"po_popup_2\" onclick=\"func_switch_iframe('php_tt_purchase_buy_now', 1008, 743 , '?price_plan_id=' + parent.price_plan_id_temp); func_other_hide();\">continue</a>";
						my_text += "&nbsp;&nbsp;&nbsp;";
						my_text += "<a href=\"#\" class=\"po_popup_2\" onclick=\"document.getElementById('my_div_popup').style.display = 'none';\">Change selection</a></div>";

						func_my_div_alert("flex", my_text);
					}
				}
						////////////////////////////////////////////////////////////////////////////////

				
				else if ( parent.po_s_array[parent.price_plan_id_temp].length == price_plan_schedule_array[parent.price_plan_id_temp][1] )
				{
					//alert("func_purchase_option_click('plan_id_" + parent.price_plan_id_temp + "');");
					//alert(price_plan_schedule_array[price_plan_array[parent.price_plan_id_temp][1]][1]);
					//my_obj.setAttribute("class", "po_text_2_click");
					//parent.po_s_array[parent.price_plan_id_temp].push(my_object);

					var my_text = "You have selected the maximum number of games for this plan. <br>Would you like to continue to selecting your seats or change your selection of games?";
					my_text += "<br><br>";
					my_text += "<div align=\"center\"><a href=\"#\" class=\"po_popup_2\" onclick=\"parent.func_purchase_option_click('plan_id_" + parent.price_plan_id_temp + "');\">Continue</a>";
					my_text += "&nbsp;&nbsp;&nbsp;";
					my_text += "<a href=\"#\" class=\"po_popup_2\" onclick=\"document.getElementById('my_div_popup').style.display = 'none';\">Change selection</a></div>";

					func_my_div_alert("flex", my_text);
				}

			}
		}
	}
}


var style_color_run_ounce = false;
var style_color_class = "";
function func_purchase_option_rollover(pp_id, my_obj)
{
	//alert(pp_id + " " + my_obj);
						/////////////////////////////////////////////////////////////////////////
						/////////////////////////////////////////////////////////////////////////
									// HIGHLIGHT PRICE PLAN
		if ( style_color_run_ounce != true )
		{
				//style_color_class = document.getElementById(my_obj).getAttribute("class");
			if ( my_browser != "MSIE" ) style_color_class = document.getElementById(my_obj).getAttribute("class");
			else if ( my_browser == "MSIE" )style_color_class = document.getElementById(my_obj).getAttribute("className");
			style_color_run_ounce = true;
		}


					// HIGHLIGHT OBJECT
		var my_obj_1 = document.getElementById(my_obj);
		
		if ( my_browser != "MSIE" ) my_obj_1.setAttribute("class", "po_text_2a");
		else if ( my_browser == "MSIE" )my_obj_1.setAttribute("className", "po_text_2a");


									// MAKE ALL OTHER PRICE PLANS THE ORIGINAL COLOR
		for ( x in parent.price_plan_array )
		{
			if ( x != pp_id && document.getElementById("price_plan_"+x) )
			{				
							// HIGHLIGHT OBJECT
				var my_obj_2 = document.getElementById("price_plan_"+x);
				
				if ( my_browser != "MSIE" ) my_obj_2.setAttribute("class", style_color_class);
				else if ( my_browser == "MSIE" )my_obj_2.setAttribute("className", style_color_class);
			}
		}
						/////////////////////////////////////////////////////////////////////////
						/////////////////////////////////////////////////////////////////////////



		
		parent.price_plan_id_temp = pp_id;	// THIS TEMPORARILY STORES THE PRICE_PLAN_ID WHEN A USER HAS ROLLED OVER A PLAN
																				// THE FINAL PRICE_PLAN_ID IS STORED IN THE price_plan_id var
																				// THE price_plan_id_temp IS ALSO USED DURING SELECTING FLEX PLAN GAMES
																				// IT STORES THE GAMES IN AN ARRAY BASED ON THE price_plan_id_temp PP_ID
																				// parent.po_s_array[parent.price_plan_id_temp]
	
		
		
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// DISPLAY SCHEDULE
		
		var my_return = "<table style=\"margin:0px;\" cellpadding=\"0\" cellspacing=\"0\" class=\"po_text_2\">\n";
		var s;
	
	
						// PREP THE price_plan_schedule_array
		if ( price_plan_schedule_array[pp_id][2].indexOf("~") > -1 )
		{
			var my_s = price_plan_schedule_array[pp_id][2].split("~");
		}
		else var my_s = new Array(price_plan_schedule_array[pp_id][2]);
		
		
			//////////////////////////////////////////////////////////////////////
			// DISPLAY PLAN COMMENT
			
			my_return += "<tr>\n";
			my_return += "	<td valign=\"top\" height=\"25\" colspan=\"5\">\n";
			my_return += "		<span style=\"margin-left:50px;\">\n";
			my_return += 				price_plan_array[pp_id][4];
			my_return += "		</span>\n";
			my_return += "	</td>\n";
			my_return += "</tr>\n";
			
			// DISPLAY PLAN COMMENT
			//////////////////////////////////////////////////////////////////////
			
			
			my_return += "<tr>\n";
			my_return += "	<td valign=\"top\">\n";
			my_return += "		<table cellpadding=\"0\" cellspacing=\"0\" class=\"po_text_2\">\n";
		
				for ( x=0; x<my_s.length; x++ )
				{
					
										// NEED TO SEPERATE THE SCHEDULE ID FROM THE SCHEDULE TITLE DISPLAY
					s = my_s[x].split("^");					
					var s_id_split = s[0].split("___");
					//alert(s_id_split);
					s_id = s_id_split[0];
					s_title = s_id_split[1];
					
					var schedule_date = s[1];
					var schedule_time_stamp = Number(s[2]);





										// IF THE auto_remove_schedule is active
					if ( parent.auto_remove_schedule == "1" )
					{
						
						//alert("A");
						
						if ( schedule_time_stamp > parent.time_stamp_now )
						{

							my_return += "<tr>\n";
							my_return += "	<td valign=\"top\" height=\"25\" width=\"250\">\n";
									
												// IF THERE IS NOT A SCHEDULE, DON'T SHOW IT
							if ( s_title != undefined )
							{
								
								my_return += "<ul type=\"circle\" style=\"margin:0px 20px 0px 50px;padding:0px;\"><li>\n";
		
												// FLEX PLAN ONLY
								if ( price_plan_array[pp_id][6] == 2 || price_plan_array[pp_id][6] == 6 )
								{
									
									////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
													// WHEN DISPLAYING THE SCHEDULE, THIS WILL CHANGE THE COLOR OF AN ITEM THAT HAS BEEN PREVIOUSLY SELECTED WITHIN A PLAN
													
									var my_highlight = "po_text_2";
									if ( parent.po_s_array )
									{
										if ( parent.po_s_array[parent.price_plan_id_temp] )
										{
											for ( y=0; y < parent.po_s_array[parent.price_plan_id_temp].length; y++ )
											{
												var po_right_item_split = parent.po_s_array[parent.price_plan_id_temp][y].split("_");
												
												if ( Number(po_right_item_split[po_right_item_split.length-1]) == s_id )
												{
													my_highlight = "po_text_2_click"; //alert(parent.po_s_array[parent.price_plan_id_temp][y]);
													break;
												}
											}
										}
									}
									////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
									
			
									
									my_return += "<a href=\"javascript:;\" name=\"po_right_item_" + s_id + "\" id=\"po_right_item_" + s_id + "\" onmouseover=\"func_purchase_option_right_event('po_right_item_" + s_id + "', 'rollover');\" onmouseout=\"func_purchase_option_right_event('po_right_item_" + s_id + "', 'rollout');\" onclick=\"func_purchase_option_right_event('po_right_item_" + s_id + "', 'click');\" class=\"" + my_highlight + "\">\n";
									my_return += 			s_title;
									my_return += "</a>\n";
								}
								else my_return += 			s_title;
								
								my_return += "				</li></ul>\n";
							
							
								my_return += "	</td>";
								
								my_return += "	<td valign=\"top\">\n";
								my_return += 			schedule_date + "";
					
								my_return += "	</td>\n";
								my_return += "</tr>\n";
								
							}  // end if ( s_title != undefined )
						} // end if ( Number(schedule_time_stamp) > Number(parent.time_stamp_now) )
					} // if ( Number(schedule_time_stamp)
					
					else
					{
						//alert("B");
						
						my_return += "<tr>\n";
						my_return += "	<td valign=\"top\" height=\"25\" width=\"250\">\n";
								
											// IF THERE IS NOT A SCHEDULE, DON'T SHOW IT
						if ( s_title != undefined )
						{
							
							my_return += "<ul type=\"circle\" style=\"margin:0px 20px 0px 50px;padding:0px;\"><li>\n";
	
							if ( price_plan_array[pp_id][6] == 2 || price_plan_array[pp_id][6] == 6 )
							{
								
								////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
												// WHEN DISPLAYING THE SCHEDULE, THIS WILL CHANGE THE COLOR OF AN ITEM THAT HAS BEEN PREVIOUSLY SELECTED WITHIN A PLAN
												
								var my_highlight = "po_text_2";
								if ( parent.po_s_array )
								{
									if ( parent.po_s_array[parent.price_plan_id_temp] )
									{
										for ( y=0; y < parent.po_s_array[parent.price_plan_id_temp].length; y++ )
										{
											var po_right_item_split = parent.po_s_array[parent.price_plan_id_temp][y].split("_");
											
											if ( Number(po_right_item_split[po_right_item_split.length-1]) == s_id )
											{
												my_highlight = "po_text_2_click"; //alert(parent.po_s_array[parent.price_plan_id_temp][y]);
												break;
											}
										}
									}
								}
								////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
								
		
								
								my_return += "<a href=\"javascript:;\" name=\"po_right_item_" + s_id + "\" id=\"po_right_item_" + s_id + "\" onmouseover=\"func_purchase_option_right_event('po_right_item_" + s_id + "', 'rollover');\" onmouseout=\"func_purchase_option_right_event('po_right_item_" + s_id + "', 'rollout');\" onclick=\"func_purchase_option_right_event('po_right_item_" + s_id + "', 'click');\" class=\"" + my_highlight + "\">\n";
								my_return += 			s_title;
								my_return += "</a>\n";
							}
							else my_return += 			s_title;
							
							my_return += "				</li></ul>\n";
						
						
							my_return += "	</td>";
							
							my_return += "	<td valign=\"top\">\n";
							my_return += 			schedule_date + "";
				
							my_return += "	</td>\n";
							my_return += "</tr>\n";
							
						}  // end if ( s_title != undefined )
					} // end else
				} // end for ( x=0; x<my_s.length; x++ )

		my_return += "			</table>\n";
		my_return += "		</td>\n";		
		my_return += "	</tr>\n";
		my_return += "</table>\n";

						// DISPLAY BENEFITS
						
						//alert(document.getElementById('po_right_ben'));
			if ( price_plan_array[parent.price_plan_id_temp][2] != "" )
			{

					var my_ben = price_plan_array[parent.price_plan_id_temp][2];
					document.getElementById('po_right_ben').innerHTML = my_ben;
					document.getElementById('po_right_ben').style.display = "";
				
			}
			else document.getElementById('po_right_ben').style.display = "none";
			
		document.getElementById('po_right').innerHTML = my_return;

		// DISPLAY SCHEDULE END
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////

}


function func_purchase_option_click(pp_id)
{	
	
										// SPLIT PP_ID VALUE BECAUSE IT LOOKS LIKE THIS "price_plan_1"
	var pp_id_1 = pp_id.split("_");
	pp_id_1 = pp_id_1[pp_id_1.length-1];

										
										// IF OFFSITE URL IS ACTIVE
										// IF THERE IS AN OFFSITE URL, LINK OUT
	if ( parent.price_plan_array[pp_id_1][13] == 1 )
	{
		if ( parent.price_plan_array[pp_id_1][3].indexOf("http") > -1 )	window.open(parent.price_plan_array[pp_id_1][3]);
		else	window.open(parent.seat_ticket_url);
	}
	
	else
	{
		var item_found = false;
		var plan_name = price_plan_array[pp_id_1][11].toLowerCase();
		
		
						// CHECK TO SEE IF THE SELECTED PLAN IS FOR SEATS
			if ( pano_name_array )
			{
				for ( x in pano_name_array )
				{
					pano_name = x;
					for ( y=0; y < pano_name_array[pano_name][2].length; y++ )
					{
						if ( pano_name_array[pano_name][2][y] == Number(pp_id_1) )
						{
							item_found = true;
							break;
						}
					}
					if ( item_found === true ) break;
				}
			}
			else alert("No Pano Name array");
		

						// CHECK TO SEE IF THE SELECTED PLAN IS FOR SUITES
			if ( pano_group_name_array )
			{
				for ( x in pano_group_name_array )
				{
					pano_name = x;

					for ( y=0; y < pano_group_name_array[pano_name][2].length; y++ )
					{
						if ( pano_group_name_array[pano_name][2][y] == Number(pp_id_1) )
						{
							item_found = true;
							break;
						}
					}
					if ( item_found === true ) break;
				}
			}
			else alert("No Pano Group Name array");
		
		
		
		if ( item_found === false )
		{
			if ( parent.seat_ticket_url != "" )	window.open(parent.seat_ticket_url);
			else if ( parent.seat_ticket_url != "" )	window.open(parent.venue_occupant_url);
		}
		else
		{
			if ( parent.price_plan_id != "" )
			{
				
											// IF THE PRICE PLAN ID IS NOT EQUAL TO THE ONE THAT IS ALREADY SET, CONFIRM THE USER WANTS TO DUMP THEIR CART
				if ( parent.price_plan_id != pp_id_1 )
				{
					var confirm_1 = func_confirm_1(my_confirm_array["change_plan"]);
					if ( confirm_1 == true )
					{
						func_other_hide();
						func_play_movie_2(pp_id);
						func_display_2("", "remove_tt");
				
						func_make_instruction(pp_id_1);
						
						}
				}
											// ELSE CLOSE THE OPTIONS WINDOW
				else func_other_hide();
			}
			else
			{
				
				func_other_hide();
				func_play_movie_2(pp_id);
				func_display_2("", "remove_tt");
				
				func_make_instruction(pp_id_1);
				
			}
		}
		
		parent.price_plan_id = pp_id_1;
	}
	
			// FUNC_STAT INTERFERES WITH RUNNING OTHER CODE
			// IT MUST BE AT THE END OF OTHER CODE THAT GETS EXECUTED
	func_stat("price_plan_id__"+pp_id_1);

}


function func_make_instruction(pp_id)
{
		var my_val = "<span class=\"instruction_header\">" + parent.price_plan_array[pp_id][0] + " Ticket Availability</span><br>";
		my_val += "<div class=\"instruction_text\" style=\"width:310px;\">Step #1. Click available seating section for seat view<br>";
		my_val += "Step #2. Compare options in table below<br>";
		my_val += "Step #3. Click purchase in table below</div>";
		
		document.getElementById("instruction").innerHTML = my_val;
		func_display_1("", "instruction");
}

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







///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PURCHASE REQUEST WINDOW



function func_purchase_create_pano_array(pano_name)
{
	//alert(pano_name);
	
	var pano_array = new Array();
	
	
	
						// IF SEATS
	if ( pano_name.indexOf("pg") < 0 )
	{
	
											// GATHER PANO INFO AND STORE IT IN ARRAY
											// [0] = CAT name
											// [1] = CAT color
											// [2] = pano description
											// [3] = price type id / price value id combination
		pano_array[pano_name] = [category_array[pano_name_array[pano_name][1]][0], category_array[pano_name_array[pano_name][1]][1], pano_name_array[pano_name][0]];
	
		//alert(pano_name);
		
		var ppt_len = category_array[pano_name_array[pano_name][1]][2].length;			// LOOP THROUGH THE PANO PRICE TYPES AND PREP THEM FOR DISPLAY
		//alert(ppt_len);
		for ( x=0; x<ppt_len; x++ )
		{
			//alert(x);
			var t = category_array[pano_name_array[pano_name][1]][2][x].split(","); 	// GET THE PRICE TYPE AND PRICE TYPE VALUES
			var pt_id = Number(t[0]); 											// MAKE THE PRICE TYPE A NUMBER TO BE USED TO FIND THE MATCHING KEYS IN THE PRICE TYPE ARRAY
			var ptv = Number(t[1]);													// MAKE THE PRICE TYPE VALUE A NUMBER TO BE USED TO FIND THE MATCHING KEY IN THE PRICE TYPE ARRAY
			var price_type_name = price_type_array[pt_id][0]; 						// PRICE TYPE NAME
			
			var price_type_value = "";
			
			if ( ptv != 0 ) price_type_array[pt_id][1][ptv][1];



								// ADD TO ARRAY, THE PRICE TYPE THAT IS ASSIGNED TO THE SELECTED PRICE PLAN
			if ( price_plan_id != 0 )
			{
				var found = "";
				var pa_len = pano_name_array[pano_name][2].length;
				for ( y=0; y<pa_len; y++ )
				{
												// IF THE PANO NAME HAS NOT BEEN ADDED TO THE PANO_ARRAY, ADD IT
												// MAKE SURE THE PRICE_PLAN'S PRICE_TYPE IS EQUAL TO THE PANO'S CATEGORY'S PRICE_TYPE
					if ( price_plan_array[price_plan_id][1] == pt_id && !pano_array[pano_name][3] ) // IF THE PRICE TYPE IS IN THIS PRICE PLAN AND THE pano_array[pano_name][3] HAS NOT BEEN SET YET
					{
						//alert(pt_id);
						//alert(quantity);
						
						var my_pt = pt_id + "," + ptv; // THE "1" MEMBER IS THE PLAN PRICE PER GAME.. THIS IS ALWAYS THE BASE PRICE FOR A PRICE TYPE
						pano_array[pano_name].push(my_pt); 
					
						
						found = true;
					}
					if ( found === true ) break;
				}
			}
			
			if ( found === true ) break;
		}
	}
	
	
	
						// IF SUITES
	else if ( pano_name.indexOf("pg") == 0 )
	{
	
											// GATHER PANO INFO AND STORE IT IN ARRAY
											// [0] = CAT name
											// [1] = CAT color
											// [2] = pano description
											// [3] = price type id / price value id combination
		pano_array[pano_name] = [category_array[pano_group_name_array[pano_name][1]][0], category_array[pano_group_name_array[pano_name][1]][1], pano_group_name_array[pano_name][0]];
	
		//alert(pano_name);
		
		var ppt_len = category_array[pano_group_name_array[pano_name][1]][2].length;			// LOOP THROUGH THE PANO PRICE TYPES AND PREP THEM FOR DISPLAY
		for ( x=0; x<ppt_len; x++ )
		{
			var t = category_array[pano_group_name_array[pano_name][1]][2][x].split(","); 	// GET THE PRICE TYPE AND PRICE TYPE VALUES
			var pt_id = Number(t[0]); 											// MAKE THE PRICE TYPE A NUMBER TO BE USED TO FIND THE MATCHING KEYS IN THE PRICE TYPE ARRAY
			var ptv = Number(t[1]);													// MAKE THE PRICE TYPE VALUE A NUMBER TO BE USED TO FIND THE MATCHING KEY IN THE PRICE TYPE ARRAY
			var price_type_name = price_type_array[pt_id][0]; 						// PRICE TYPE NAME
			
			var price_type_value = "";
			
			if ( ptv != 0 ) price_type_array[pt_id][1][ptv][1];
	
	
	
			var found = "";
			var pa_len = pano_group_name_array[pano_name][2].length;
			for ( y=0; y<pa_len; y++ )
			{
											// IF THE PANO NAME HAS NOT BEEN ADDED TO THE PANO_ARRAY, ADD IT
				if ( !pano_array[pano_name][3] ) // IF THE PRICE TYPE IS IN THIS PRICE PLAN AND THE pano_array[pano_name][3] HAS NOT BEEN SET YET
				{
					//alert(quantity);
					
					var my_pt = pt_id + "," + ptv; // THE "1" MEMBER IS THE PLAN PRICE PER GAME.. THIS IS ALWAYS THE BASE PRICE FOR A PRICE TYPE
					pano_array[pano_name].push(my_pt); 				
					
					found = true;
				}
				if ( found === true ) break;
			}
			
			if ( found === true ) break;
		}	}
	return pano_array[pano_name];
}
		
		
		
										// USED TO CHECK FOR REQUIRED FORM FIELDS
										// object_name = IS A  ^  SEPERATED STRING
function func_form_require(my_object_name, my_error_name)
{
	//alert(my_object_name + " " + my_error_name);
	//alert(my_object_name + " - " + my_error_name);
	if ( my_object_name.indexOf("^") > -1 )
	{
		var my_obj = my_object_name.split("^");
		var my_err = my_error_name.split("^");
	}
	else
	{
		var my_obj = [my_object_name];
		var my_err = [my_error_name];
	}
		
	var my_alert = "The following Items are required!\n";
	var my_fail = false;
	
	for ( x=0; x < my_obj.length; x++ )
	{
		var my_test = eval("document.getElementById('" + my_obj[x] + "').value;");
		
		//alert(my_obj[x] + " - " + my_test);
		
		if ( my_test == "" || my_test == "Select Item" )
		{
			my_alert += my_err[x] + "\n";
			my_fail = true;
		}
	}
	if ( my_fail === true )
	{
		// DON'T COMMENT THIS OUT!
		alert(my_alert);
		return false;
	}
}



function func_check_even_odd(my_value)
{
//  returns true if value is even, false if value is odd
    return ( 1 - (my_value%2) )
}



function func_glb_make_drop_list_1(my_array, my_name, my_onchange, my_class, my_select)
{
	var my_return = "";
	my_return += "<select name=\"" + my_name + "\" " + my_onchange + " " + my_class + ">";
	
	if ( my_select != "" ) my_return += "	<option value=\"\">" + my_select + "</option>";

	for ( var x in my_array )
	{
		for ( var y in my_array[x][1] )
		{
			if ( my_array[x][1][y] == parent.price_plan_id )
			{
				my_return += "<option value=\"" + x + "\">" + my_array[x][0] + "</option>";
			}
		}
	}

	my_return += "</select>";
	return my_return;
}



function func_glb_make_drop_list_2(my_array, my_name, my_onchange, my_class, my_select)
{
	var my_return = "";
	my_return += "<select name=\"" + my_name + "\" id=\"" + my_name + "\" " + my_onchange + " " + my_class + ">";
	
	if ( my_select != "" ) my_return += "	<option value=\"\">" + my_select + "</option>";

	for ( var x in my_array )
	{
		my_return += "<option value=\"" + (Number(x)+1) + "\">" + my_array[x] + "</option>";
	}

	my_return += "</select>";
	return my_return;
}



function func_glb_make_drop_list_3(my_array, my_name, my_onchange, my_class, my_select)
{
	var my_return = "";
	my_return += "<select name=\"" + my_name + "\" id=\"" + my_name + "\" " + my_onchange + " " + my_class + ">";
	
	if ( my_select != "" ) my_return += "	<option value=\"\">" + my_select + "</option>";

	for ( var x in my_array )
	{
		my_return += "<option value=\"" + x + "\">" + my_array[x] + "</option>";
	}

	my_return += "</select>";
	return my_return;
}



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










/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// TICKETING TABLE




function func_tt_update(my_mode, pano_name, my_action)
{
	pano_name = func_legacy_convert_pano_name(pano_name);
	
	if ( my_mode == "delete" )
	{
										// RECORD ALL PANO BEING REMOVED FROM THE TT INTO A HISTORY ARRAY
		for ( x in parent.pano_array )
		{
			if ( !parent.pano_history_array )
			{
				parent.pano_history_array = new Array();
			}
			parent.pano_history_array[x] = x;
			cnt++;
		}


		if ( my_action == "pano" )
		{
			var cnt = 0;
			var pano_array_new = parent.pano_array;
			parent.pano_array = new Array();
			
			for ( x in pano_array_new )
			{
				if ( x != pano_name )
				{
					//alert(x);
					parent.pano_array[x] = pano_array_new[x];
					cnt++;
				}
			}
			
			func_play_movie_2("remove_marker__" + pano_name);
			
			if ( cnt == 0 ) 
			{
				parent.document.getElementById("tt_info_table").style.display = "none";
				func_display_2("none", "purchase_now_button");
			}
			location = "php_tt_info.php";
		}
		
		
		else if ( my_action == "table" )
		{
			if ( func_confirm_1(my_confirm_array["emtpy_tt"]) == true )
			{
				func_display_2("none", "purchase_now_button");
				
				parent.pano_array = new Array();
				parent.document.getElementById("tt_info_table").style.display = "none";
				func_play_movie_2("remove_marker__all");
				//func_display_2("none", "remove_tt");
				location = "php_tt_info.php";
			}
		}
				
		
		
		else if ( my_action == "remove_tt" )
		{
			if ( func_confirm_1(my_confirm_array["remove_tt"]) == true )
			{
				func_display_2("none", "purchase_now_button");
				func_display_2("none", "remove_tt");
				func_display_2("none", "instruction");
				
				price_plan_id = 0;
				parent.pano_array = new Array();
				parent.document.getElementById("tt_info_table").style.display = "none";
				func_play_movie_2("remove_marker__price_plan");
				parent.tt_info.location = "php_tt_info.php";
				
				////////////////////////////////////////////////////////////////////////////////////////////////
				// TT3.1
				parent.pt_history_array = new Array();
				parent.pt_value_history_array = new Array();
				parent.pt_value_total_history_array = new Array();
				////////////////////////////////////////////////////////////////////////////////////////////////

				
				//alert(my_action);
			}
		}
				
				
		else
		{
			parent.pano_array = new Array();
			tt_info.location = "php_tt_info.php"; // REFRESH THE PAGE AFTER EVERY EVENT
		}
	}
	
	//alert(my_mode);
	
	if ( my_mode == "update_table" ) tt_info.location = "php_tt_info.php";
}



function func_tt_update_1(my_mode, pano_name, my_action)
{
	parent.func_display_2("none", "purchase_now_button");
	
	parent.pano_array = new Array();
	parent.document.getElementById("tt_info_table").style.display = "none";
	parent.func_play_movie_2("remove_marker__all");
	
	parent.pano_array = new Array();
	parent.tt_info.location = "php_tt_info.php"; // REFRESH THE PAGE AFTER EVERY EVENT
}




var quantity = "";
function func_quantity(my_status)
{
	var quantity = parent.price_plan_array[parent.price_plan_id][10][0];
	var quantity_min = parent.price_plan_array[parent.price_plan_id][10][1];
	var quantity_max = parent.price_plan_array[parent.price_plan_id][10][2];

	if ( parent.quantity == "" ) parent.quantity = quantity;
		
	//parent.quantity_old = quantity;
	//alert(parent.quantity_old);

	if ( my_status == "plus" )
	{
		if ( parent.quantity < quantity_max ) parent.quantity++;
		//alert(parent.quantity);
	}
	else if ( my_status == "minus" )
	{
		if ( parent.quantity > quantity_min ) parent.quantity--;
		//alert(parent.quantity);
	}
		
	var my_tt = document.getElementById('pano_tt_info');
	var my_tags = my_tt.getElementsByTagName("*");
	
	if ( my_tags )
	{
		for ( x=0; x<my_tags.length; x++ )
		{
			//alert(my_tags[x].id);
			
			if ( my_tags[x].id )
			{
				//alert(my_tags[x].id);
				
				if ( my_tags[x].id.indexOf("quantity") > -1 )
				{
					document.getElementById(my_tags[x].id).innerHTML = parent.quantity;
					//alert(my_tags[x].id+"-"+document.getElementById(my_tags[x].id).innerHTML);
				}
				
				if ( my_tags[x].id.indexOf("ppt_value") > -1 || my_tags[x].id.indexOf("pps_value") > -1 )
				{
					
					//alert(my_tags[x].id);
					
					
												// SPLIT THE ID_NAME APART TO GET THE PRICE TYPE ID AND THE PRICE TYPE VALUE ID FOR THE PRICE TYPE ARRAY
												// WE NEED TO USE THE ORIGINAL VAULES BEFORE UPDATING THEIR QUANTITY
					var m_1 = my_tags[x].id.split("__xid_");
					m_1 = m_1[1].split("_");
					
					var pt_id = m_1[0];
					var ptv_id = m_1[1];
					
					//alert(pt_id + " " + ptv_id);
					
					if ( ptv_id != "" )
					{
						//alert(price_type_array[pt_id][1]);
						if ( price_type_array[pt_id][1] != "" )
						{
							var ptv_3 = (price_type_array[pt_id][1][ptv_id][2] == "") ? "&nbsp;" : price_type_array[pt_id][1][ptv_id][2];
							var ptv_4 = (price_type_array[pt_id][1][ptv_id][3] == "") ? "&nbsp;" : price_type_array[pt_id][1][ptv_id][3];
						}
						else
						{
							var ptv_3 = "&nbsp;";
							var ptv_4 = "&nbsp;";
						}
					}
					else
					{
						var ptv_3 = "&nbsp;";
						var ptv_4 = "&nbsp;";
					}
					
					//alert(ptv_3);
					//alert(ptv_4);
					
					if ( my_tags[x].id.indexOf("ppt_value") > -1 && ptv_3 != "&nbsp;" )
					{
						var my_tag_1 = my_tags[x].id;

						if ( func_check_number(ptv_3) !== false ) ptv_3 = func_check_number(ptv_3);
						{
							//alert(ptv_3);
							document.getElementById(my_tag_1).innerHTML = ptv_3;
						}
					}
				

					if ( my_tags[x].id.indexOf("pps_value") > -1 && ptv_4 != "&nbsp;" )
					{
						if ( func_check_number(ptv_4) !== false ) ptv_4 = func_check_number(ptv_4);
						{
							document.getElementById(my_tags[x].id).innerHTML = ptv_4;
						}
					}
					
					
				}
			}
		}
	}
}



function func_check_number(my_value)
{
	//alert(my_value);
	var my_obj = "";
	
	if ( my_value.indexOf(",") > -1 )	my_obj = my_value.replace(",","");
	else my_obj = my_value;

	if ( my_obj.indexOf("$") > -1 )	my_obj = my_obj.replace("$","");
	else my_obj = my_value;
	
	var my_value_new = Number(my_obj).toString();
	
	//alert(my_value_new);
	
	if ( my_value_new.indexOf("NaN") < 0 )
	{
		//alert(my_obj);
		
		var quantity = parent.quantity;
		var price_plan_type_id = parent.price_plan_array[parent.price_plan_id][6];
		
		//alert(my_value_new);
		
		if ( price_plan_type_id == 4 ) quantity = func_check_price_plan_type("multi_discount", quantity); // CHECK FOR DIFFERENT PRICE PLAN TYPES AND MODIFY THE QUANTITY
		else if ( price_plan_type_id == 5 )
		{
			my_value_new = func_check_price_plan_type("prorate", my_value_new); // CHECK FOR DIFFERENT PRICE PLAN TYPES AND MODIFY THE QUANTITY
			//alert(my_value_new+"RRR");
		}
		
		//alert(my_value_new);		
		
		var a = "";
		var comma = "";
		var my_return = "";
		
		
					// CHECK FOR   $
		if ( my_value.indexOf("$") > -1 )
		{
			a = "$";
		}

					// CHECK FOR   ,
		if ( my_value.indexOf(",") > -1 )
		{
			comma = true;
		}
		
		
		//////////////////////////////////////////////////////////////////////////////////////////////////////
										// NEED TO GET THE ORIGINAL PRICE TYPE VALUE
		var quantity_default = parent.price_plan_array[parent.price_plan_id][10][0];
		
													// DELETE THIS... NOT USING ORIGIN ANY MORE
													//if ( origin == "quantity" && quantity_default )
													//{
			my_value_original = my_value_new/quantity_default;
													//alert(quantity_default);
													//}
		//////////////////////////////////////////////////////////////////////////////////////////////////////
		
				
		if ( my_value.indexOf(".") > -1 )
		{
			if ( comma === true )	my_return = a + func_add_commas((my_value_new*quantity).toFixed(2));
			else my_return = a + (my_value_new*quantity).toFixed(2);
		}
		else
		{
			if ( comma === true )	my_return = a + func_add_commas((my_value_new*quantity));
			else my_return = a + (my_value_new*quantity).toFixed(2);
		}



		return my_return;
	}
	else return false;
}



function func_add_commas(nStr)
{
	
	nStr += '';
	var x_val = nStr.split('.');
	x1 = x_val[0];
	x2 = x_val.length > 1 ? '.' + x_val[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
	
}





function func_check_price_plan_type(mode, my_value)
{
	//alert(price_type_value + " " + parent.price_plan_array[parent.price_plan_id][6] + " " + parent.price_plan_schedule_array[parent.price_plan_id][1]);
	
	//alert(mode+" "+my_value);
		//////////////////////////////////////////////////////////////////////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////////////////////////
										// PRORATED PLAN TYPE
	if ( mode == "prorate" )
	{
		//alert(mode + " - " + my_value);
		var price_type_value_new = "";
		price_type_value_new = my_value;
		
		if ( my_value )
		{
			if ( my_value.indexOf("$") > -1 ) price_type_value_new = my_value.replace("$", "");
		}
	

		var current_game_num = func_get_current_game_num(parent.price_plan_id);
		var pp_game_num = parent.price_plan_schedule_array[parent.price_plan_id][1];
		
		//alert(current_game_num+" "+pp_game_num);
		//alert(price_type_value_new+" "+pp_game_num);
		
			// price_type_value_new is the ticket plan price total
		price_type_value_new = Number(price_type_value_new)/pp_game_num;
			//alert(price_type_value_new);
		price_type_value_new = price_type_value_new*current_game_num;
			//alert(price_type_value_new);
		
		if ( my_value.indexOf("$") > -1 ) price_type_value_new = "$" + price_type_value_new;
		
		//alert(price_type_value_new);
		
		return price_type_value_new;
	}
		//////////////////////////////////////////////////////////////////////////////////////////////////
	
	
	
		//////////////////////////////////////////////////////////////////////////////////////////////////
		//////////////////////////////////////////////////////////////////////////////////////////////////
										// MULTI DISCOUNT
	else if ( mode == "multi_discount" )
	{
		var md_ratio = parent.price_plan_array[parent.price_plan_id][9];
		//alert(md_ratio);
		
									// THIS IS PASSED IN FROM func_check_number
		var original_quantity = my_value;
		var modify_quantity = my_value;
		

										// 2 FOR 1
		if ( md_ratio == 1 )
		{
			modify_quantity = Math.ceil(modify_quantity/2);
		}


										// 3 FOR 1
		else if ( md_ratio == 2 )
		{
			modify_quantity = modify_quantity/3;
			
			
			//alert(modify_quantity);
			
			var modify_quantity_string = modify_quantity.toFixed(2).toString();
			var modify_quantity_split = "";
			var modify_integer = "";
			var modify_decimal = "";
			var restrict = price_plan_array[parent.price_plan_id][12];
			
			if ( modify_quantity_string.indexOf(".") > -1 )
			{
				modify_quantity_split = modify_quantity_string.split(".");
				modify_integer = Number(modify_quantity_split[0]);
				modify_decimal = Number(modify_quantity_split[1]);
				
				if ( modify_decimal > 0 ) modify_quantity = modify_integer+1;
				
											// IF RESTRICT IS ON, MAKE THE QUANTITY THE HIGHER VALUE UNLESS ITS A WHOLE NUMBER
				//if ( restrict == 1 && modify_decimal > 44 ) modify_quantity++;
				if ( restrict == 1 )
				{
					if ( modify_decimal > 0 ) modify_quantity = original_quantity;
				}


			}
			
			//alert(modify_quantity);
		}
		
		
										// 3 FOR 2
		else if ( md_ratio == 3 )
		{
			modify_quantity = modify_quantity/3;
			
			
			//alert(modify_quantity);
			
			var modify_quantity_string = modify_quantity.toFixed(2).toString();
			var modify_quantity_split = "";
			var modify_integer = "";
			var modify_decimal = "";
			var restrict = price_plan_array[parent.price_plan_id][12];
			
			if ( modify_quantity_string.indexOf(".") > -1 )
			{
				//alert(modify_quantity_string);
				
				modify_quantity_split = modify_quantity_string.split(".");
				modify_integer = Number(modify_quantity_split[0]);
				modify_decimal = Number(modify_quantity_split[1]);
				//alert(" - " + modify_integer + " -  - " + modify_decimal + " - ");
				
				if ( modify_integer > 0 )
				{
					modify_quantity = original_quantity-modify_integer;
					//alert("a");
				}
				else if ( modify_integer == 0 && modify_decimal > 0 )
				{
					modify_quantity = original_quantity;
					//alert("b");
				}

											// IF RESTRICT IS ON, MAKE THE QUANTITY THE HIGHER VALUE UNLESS ITS A WHOLE NUMBER
				if ( restrict == 1 )
				{
					if ( modify_decimal > 0 ) modify_quantity = original_quantity;
				}
			}
		}
			
		
										// 4 FOR 1
		else if ( md_ratio == 4 )
		{
			modify_quantity = modify_quantity/4;
			
			
			//alert(modify_quantity);
			
			var modify_quantity_string = modify_quantity.toFixed(2).toString();
			var modify_quantity_split = "";
			var modify_integer = "";
			var modify_decimal = "";
			var restrict = price_plan_array[parent.price_plan_id][12];
			
			if ( modify_quantity_string.indexOf(".") > -1 )
			{
				modify_quantity_split = modify_quantity_string.split(".");
				modify_integer = Number(modify_quantity_split[0]);
				modify_decimal = Number(modify_quantity_split[1]);
				
				if ( modify_decimal > 0 ) modify_quantity = modify_integer+1;
				
											// IF RESTRICT IS ON, MAKE THE QUANTITY THE HIGHER VALUE UNLESS ITS A WHOLE NUMBER
				if ( restrict == 1 )
				{
					if ( modify_decimal > 0 ) modify_quantity = original_quantity;
				}

			}
			//alert(modify_quantity);
		}
		
		
		
		
										// 4 FOR 3
		else if ( md_ratio == 5 )
		{
			modify_quantity = modify_quantity/4;
			
			
			//alert(modify_quantity);
			
			var modify_quantity_string = modify_quantity.toFixed(2).toString();
			var modify_quantity_split = "";
			var modify_integer = "";
			var modify_decimal = "";
			var restrict = price_plan_array[parent.price_plan_id][12];
			
			if ( modify_quantity_string.indexOf(".") > -1 )
			{
				//alert(modify_quantity_string);
				
				modify_quantity_split = modify_quantity_string.split(".");
				modify_integer = Number(modify_quantity_split[0]);
				modify_decimal = Number(modify_quantity_split[1]);
				//alert(" - " + modify_integer + " -  - " + modify_decimal + " - ");
				
				if ( modify_integer > 0 )
				{
					modify_quantity = original_quantity-modify_integer;
					//alert("a");
				}
				else if ( modify_integer == 0 && modify_decimal > 0 )
				{
					modify_quantity = original_quantity;
					//alert("b");
				}
				
											// IF RESTRICT IS ON, MAKE THE QUANTITY THE HIGHER VALUE UNLESS ITS A WHOLE NUMBER
				if ( restrict == 1 )
				{
					if ( modify_decimal > 0 ) modify_quantity = original_quantity;
				}
			}
		}
			

					//alert(modify_quantity);
		return modify_quantity;
	}
		//////////////////////////////////////////////////////////////////////////////////////////////////


}



function func_get_current_game_num(my_price_plan_id)
{
					// ALWAYS RESET TO 0
	var current_game_num = 0;
	
	var s;
	var pp_id_1 = my_price_plan_id;

					// PREP THE price_plan_schedule_array
					//alert(pp_id_1);
	if ( price_plan_schedule_array[pp_id_1][2].indexOf("~") > -1 )
	{
		var my_s = price_plan_schedule_array[pp_id_1][2].split("~");
	}
	else var my_s = new Array(price_plan_schedule_array[pp_id_1][2]);
	
	
	
										// THIS FUNCTION IS BEING CALLED BY ANOTHER FUNCTION AND THAT OTHER FUNCTION IS IN FOR LOOP USING X
										// IF THIS FOR LOOP USES X IT WILL BECOME AN ENDLESS LOOP
										// MUST USE SOMETHING OTHER THAN THE SAME VARIABLE WHEN NESTING FUNCTIONS THAT HAVE LOOPS IN THEM!!!
	for ( x1=0; x1<my_s.length; x1++ )
	{
		
							// NEED TO SEPERATE THE SCHEDULE ID FROM THE SCHEDULE TITLE DISPLAY
		s = my_s[x1].split("^");					
		var s_id_split = s[0].split("___");
		s_id = s_id_split[0];
		s_title = s_id_split[1];
		
		var schedule_date = s[1];
		var schedule_time_stamp = Number(s[2]);


							// IF THE auto_remove_schedule is active
		if ( parent.auto_remove_schedule == "1" )
		{
			
			//alert("A");
			
			if ( schedule_time_stamp > parent.time_stamp_now )
			{

						// COUNT THE NUMBER OF GAMES SHOWN ON ROLLOVER
				current_game_num++;
				
				
			} // end if ( Number(schedule_time_stamp) > Number(parent.time_stamp_now) )
		} // if ( Number(schedule_time_stamp)
		
		else
		{
					// COUNT THE NUMBER OF GAMES SHOWN ON ROLLOVER
			current_game_num++;
				
			//alert("B");
			
		} // end else
	} // end for ( x=0; x<my_s.length; x++ )
	
	return current_game_num;
}




var buy_now = "";
function func_tt_purchase(my_mode, my_str)
{
	if ( my_mode == "table" )
	{
							//alert(parent.price_plan_id_url_string + " " + price_plan_array[parent.price_plan_id_url_string][1]);
							////////////////////////////////////////////////////////////////////////////////
							// USED FOR FLEX PLANS VIA THE URL STRING AND BUY NOW
		if ( parent.price_plan_id_url_string != "" && price_plan_array[parent.price_plan_id_url_string][6] == 2 )
		{
			var plan_name = price_plan_array[parent.price_plan_id_url_string][11].toLowerCase();
			if ( plan_name.indexOf("suite") > -1 )
			{
				func_switch_iframe("php_tt_purchase_flex_pano_group", 1008, 743 , "?option_type=suite");
			}
			else func_switch_iframe("php_tt_purchase_flex_pano", 1008, 743 , "?option_type=seat");
		}
							////////////////////////////////////////////////////////////////////////////////

		
							// ELSE THE USER CLICKED ON THE PURCHASE BUTTON
		else func_switch_iframe("php_tt_purchase", 1008, 743 , "?price_plan_id=" + parent.price_plan_id);

		// don't record the stat from here
		// should only record the stat from the "php_tt_purchase.php" page
		//func_stat_2("tt_purchase__1");
	}
		


	else if ( my_mode == "buy_now" )
	{
		//alert(my_mode + " " + my_str);
		
		buy_now = "buy_now";
		
		var my_str1 = my_str.split("price_plan_id=");
		my_str1 = my_str1[1].split("&");
		var pp_id = my_str1[0];
		
		parent.price_plan_id_temp = pp_id;
		
							////////////////////////////////////////////////////////////////////////////////
							// USED FOR FLEX PLANS VIA BUY NOW
		if ( price_plan_array[pp_id][6] == 2 )
		{
			//alert(my_str);
			func_switch_iframe("php_tt_purchase_flex_pano_buy_now", 1008, 743 , my_str + "&option_type=seat");
		}
							////////////////////////////////////////////////////////////////////////////////
		else
		{
			//alert(my_str);
			func_switch_iframe("php_tt_purchase_buy_now", 1008, 743 , my_str);
		}

		func_stat("buy_now__" + my_str);
	}
}


function func_tt_print_tt()
{
	func_switch_iframe("php_tt_print_tt", 0, 0, "");

	func_stat_2("tt_print__1");
}


function func_tt_benefit()
{
	func_switch_iframe("php_tt_benefit", 1008, 743, "");

	func_stat_2("tt_benefit__1");
}


function func_tt_email()
{
	func_switch_iframe("php_tt_email", 1008, 743, "");

	func_stat_2("tt_email__1");
}


function func_check_tt_on_off()
{
	var tt = "";
	var day_of_week = "";
	var schedule_tt_array = new Array();
	var tt_schedule_cnt = 0;
	var my_return = false;
	
	if ( glb_ballena_tt_on == "1" )
	{
		if ( show_tt == "1" )
		{
			//alert("show_tt=on");
			//alert(time_stamp_now);
			
			for ( x in parent.tt_schedule_array )
			{
				//alert(x);
				
				tt_schedule_cnt++;
				
											// CONFIGURE THE SCHEDULED TIME
				var tt_date_start = new Date();
				tt_date_start.setTime(parent.tt_schedule_array[x][2]*1000);
				var tt_date_end = new Date();
				tt_date_end.setTime(parent.tt_schedule_array[x][3]*1000);
				
											//  CHECK THE HOURS AND MINUTES FOR THE START TIME
				var day_start = tt_date_start.getDay();
				var hour_start = parent.tt_schedule_array[x][4];
				if ( hour_start > 0 ) hour_start = parent.tt_schedule_array[x][4]/2;
				var hour_minute_start = "";
				var my_str_test = hour_start.toString();
				if ( my_str_test.indexOf(".") > -1 ) hour_minute_start = Math.floor(hour_start)+.30;
				else hour_minute_start = hour_start;
				
											//  CHECK THE HOURS AND MINUTES FOR THE END TIME			
				var day_end = tt_date_end.getDay();
				var hour_end = parent.tt_schedule_array[x][5];
				if ( hour_end > 0 ) hour_end = parent.tt_schedule_array[x][5]/2;
				var hour_minute_end = "";
				var my_str_test = hour_end.toString();
				if ( my_str_test.indexOf(".") > -1 ) hour_minute_end = Math.floor(hour_end)+.30;
				else hour_minute_end = hour_end;
	
				
										// CONFIGURE THE CURRENT TIME
				var current_date = new Date();
				current_date.setTime(time_stamp_now*1000);
				var current_day = current_date.getDay();
				var current_hour = current_date.getHours();
				var current_minute = current_date.getMinutes();
				if ( current_minute.length < 2 ) current_minute = "0"+current_minute;
				var current_hour_minute = Number(current_hour+"."+current_minute);
				
				//alert(x);
				if ( parent.tt_schedule_array[x][1] == 1 )
				{
										//alert("a1");
										//alert(parent.tt_schedule_array[x][2] + " " + parent.tt_schedule_array[x][3]);
					if ( (time_stamp_now >= parent.tt_schedule_array[x][2] && time_stamp_now <= parent.tt_schedule_array[x][3]) ||
							 (time_stamp_now >= parent.tt_schedule_array[x][2] && parent.tt_schedule_array[x][3] == undefined) || 
							 (parent.tt_schedule_array[x][2] == undefined && time_stamp_now <= parent.tt_schedule_array[x][3]) || 
							 (parent.tt_schedule_array[x][2] == undefined && parent.tt_schedule_array[x][3] == undefined) )
					{
						if ( (current_hour_minute >= hour_minute_start && current_hour_minute <= hour_minute_end) ||
								 (current_hour_minute >= hour_minute_start && hour_minute_end == -1) || 
								 (hour_minute_start == -1 && current_hour_minute <= hour_minute_end) || 
								 (hour_minute_start == -1 && hour_minute_end == -1) )
						{
							//alert("a2");
							
							schedule_tt_array[x] = true;
						}
						else schedule_tt_array[x] = false;
					}
					else schedule_tt_array[x] = false;
				}
				
				
				
				if ( parent.tt_schedule_array[x][1] == 2 )
				{
					if ( current_day >= 1 && current_day <= 5 )
					{
						if ( (time_stamp_now >= parent.tt_schedule_array[x][2] && time_stamp_now <= parent.tt_schedule_array[x][3]) ||
								 (time_stamp_now >= parent.tt_schedule_array[x][2] && parent.tt_schedule_array[x][3] == undefined) || 
								 (parent.tt_schedule_array[x][2] == undefined && time_stamp_now <= parent.tt_schedule_array[x][3]) || 
								 (parent.tt_schedule_array[x][2] == undefined && parent.tt_schedule_array[x][3] == undefined) )
						{
							if ( (current_hour_minute >= hour_minute_start && current_hour_minute <= hour_minute_end) ||
									 (current_hour_minute >= hour_minute_start && hour_minute_end == -1) || 
									 (hour_minute_start == -1 && current_hour_minute <= hour_minute_end) || 
									 (hour_minute_start == -1 && hour_minute_end == -1) )
							{
								//alert("b");
								
								schedule_tt_array[x] = true;
							}
							else schedule_tt_array[x] = false;
						}
						else schedule_tt_array[x] = false;
					}
					else schedule_tt_array[x] = false;
				}
				
				
				
				if ( parent.tt_schedule_array[x][1] > 2 && parent.tt_schedule_array[x][1] < 10 )
				{
					if ( parent.tt_schedule_array[x][1] == 3 ) day_of_week = 0;
					else if ( parent.tt_schedule_array[x][1] == 4 ) day_of_week = 1;
					else if ( parent.tt_schedule_array[x][1] == 5 ) day_of_week = 2;
					else if ( parent.tt_schedule_array[x][1] == 6 ) day_of_week = 3;
					else if ( parent.tt_schedule_array[x][1] == 7 ) day_of_week = 4;
					else if ( parent.tt_schedule_array[x][1] == 8 ) day_of_week = 5;
					else if ( parent.tt_schedule_array[x][1] == 9 ) day_of_week = 6;
					
					
						if ( current_day == day_of_week )
						{
							if ( (current_hour_minute >= hour_minute_start && current_hour_minute <= hour_minute_end) ||
									 (current_hour_minute >= hour_minute_start && hour_minute_end == -1) || 
									 (hour_minute_start == -1 && current_hour_minute <= hour_minute_end) || 
									 (hour_minute_start == -1 && hour_minute_end == -1) )
							{
								//alert("c");
								
								schedule_tt_array[x] = true;
							}
							else schedule_tt_array[x] = false;
						}
						else schedule_tt_array[x] = false;
				}
			}
			
			
			if ( tt_schedule_cnt == 0 )
			{
				//alert("a1");
				////////////func_switch_iframe("php_tt_purchase_option", 1008, 743, "");
				my_return = true;
			}
			else
			{
				//alert("a2");
												// IF schedule_tt_mode == 0 THEN USE THE TT IF THERE IS A CONFLICT
				if ( schedule_tt_mode == "0" )
				{
					//alert(0);
					
					for ( x in schedule_tt_array )
					{
						//alert("sta = " + schedule_tt_array[x]);
						if ( schedule_tt_array[x] === true ) tt = true;
					}
					
					
					if ( tt === true )
					{
												// SHOW PURCHASE OPTIONS FOR TT
						///////func_switch_iframe("php_tt_purchase_option", 1008, 743, "");
						my_return = true;
						//alert("ttA");
					}
					else
					{
						////////window.open(seat_ticket_url);
						my_return = false;
						//alert("offsite_urlA");
					}
				}
				
				
												// IF schedule_tt_mode == 1 THEN USE THE OFFSITE URL IF THERE IS A CONFLICT
				else if ( schedule_tt_mode == "1" )
				{
					//alert(1);
					
					for ( x in schedule_tt_array )
					{
						//alert(schedule_tt_array[x]);
						if ( schedule_tt_array[x] === false ) tt = false;
					}
					
					
					if ( tt === false )
					{
						////window.open(seat_ticket_url);
						my_return = false;
						//alert("offsite_urlB");
					}
					else
					{
												// SHOW PURCHASE OPTIONS FOR TT
						//////func_switch_iframe("php_tt_purchase_option", 1008, 743, "");
						my_return = true;
						//alert("ttB");
					}
				}
			}
			
			//alert(my_return);
			
		}
		
		else
		{
			////////window.open(seat_ticket_url);
			my_return = false;
			//alert("show_tt is off");
		}
		//alert(my_return);
	}
	else
	{
		my_return = false;
	}
	
	return my_return;
}



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












