/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/

// dw_syos2.js

var px="px";var overmap=0;var imagesizes=[];var currentMagnification=0.0;var magnification_increment=0.10;var fit_initial_image_option=true;var currentImageID=-1;var current_seat_map=-1;var current_seat_map_image_id=-1;var current_scroll_direction=""
var current_scroll_amount=0;var current_scroll_targetamount=100;var current_scroll_targetmillisec=50;var scrollamt_horiz;var scrollamt_vert;var sliderStart=12;var sliderHeight=200;var sliderWidth=200;var sliderIncrements=[0,10,40,70,100];var sliderPercentages=[0.0625,0.125,0.25,0.50,1.00];var sliderScale=[(sliderPercentages[1]-sliderPercentages[0])/10,(sliderPercentages[2]-sliderPercentages[1])/30,(sliderPercentages[3]-sliderPercentages[2])/30,(sliderPercentages[4]-sliderPercentages[3])/30,0];var currentSeatDotSize=0;var cursize=null;var cursize_list=[];var trackZoom=0;var seatdotsvisible=false;var GetPerformanceDetails=null;var current_price_type;var perf_no=0;var pkg_no=0;var SeatingItems=null;var dotOpacity=70;var PriceLookups=[];var ZoneDescriptions=[];var syos_proceed_visible=false;var userCartInfo=null;var hilight_timer;var hilightedZone=-1;var syos_navigation_help_status=true;var NavImageSourceDirectory="/syos/images/Nav";var tkt_unavailable_message="Sorry, no tickets available for purchase at the moment.";var click_more_dots_message="Click on more dots to add more seats. ";var target_zoomin_magnification=1.0;var show_pricetypes_radio_in_table=true;var omit_price_current_pricetype=true;var order_timer;var scrtp;var view_from_seats_imageholder_fadeMilliseconds=4000;var view_from_seat_img_magnification=1.0;var view_from_seats_visible=false;var view_from_seats_imageholder_visible=false;var current_vfs=null;var view_from_seats_imageholder_timer;var zone_not_available_behavior='skip';var nav_color="#c00";var slider_mag_lookup_values=[0.9917,0.9833,0.9750,0.9667,0.9583,0.9500,0.9417,0.9333,0.9250,0.9167,0.9083,0.9000,0.8917,0.8833,0.8750,0.8667,0.8583,0.8500,0.8417,0.8333,0.8250,0.8167,0.8083,0.8000,0.7917,0.7833,0.7750,0.7667,0.7583,0.7500,0.7417,0.7333,0.7250,0.7167,0.7083,0.7000,0.6917,0.6833,0.6750,0.6667,0.6583,0.6500,0.6417,0.6333,0.6250,0.6167,0.6083,0.6000,0.5917,0.5833,0.5750,0.5667,0.5583,0.5500,0.5417,0.5333,0.5250,0.5167,0.5083,0.5000,0.4958,0.4917,0.4875,0.4833,0.4792,0.4750,0.4708,0.4667,0.4625,0.4583,0.4542,0.4500,0.4458,0.4417,0.4375,0.4333,0.4292,0.4250,0.4208,0.4167,0.4125,0.4083,0.4042,0.4000,0.3958,0.3917,0.3875,0.3833,0.3792,0.3750,0.3708,0.3667,0.3625,0.3583,0.3542,0.3500,0.3458,0.3417,0.3375,0.3333,0.3292,0.3250,0.3208,0.3167,0.3125,0.3083,0.3042,0.3000,0.2958,0.2917,0.2875,0.2833,0.2792,0.2750,0.2708,0.2667,0.2625,0.2583,0.2542,0.2500,0.2479,0.2458,0.2438,0.2417,0.2396,0.2375,0.2354,0.2333,0.2313,0.2292,0.2271,0.2250,0.2229,0.2208,0.2188,0.2167,0.2146,0.2125,0.2104,0.2083,0.2063,0.2042,0.2021,0.2000,0.1979,0.1958,0.1938,0.1917,0.1896,0.1875,0.1854,0.1833,0.1813,0.1792,0.1771,0.1750,0.1729,0.1708,0.1688,0.1667,0.1646,0.1625,0.1604,0.1583,0.1563,0.1542,0.1521,0.1500,0.1479,0.1458,0.1438,0.1417,0.1396,0.1375,0.1354,0.1333,0.1313,0.1292,0.1271,0.1250,0.1219,0.1188,0.1156,0.1125,0.1094,0.1063,0.1031,0.1000,0.0969,0.0938,0.0906,0.0875,0.0844,0.0813,0.0781,0.0750,0.0719,0.0688,0.0656,0.0625];function get_index_for_zone_no(iZoneNo){try{for(var i=0;i<zoneinfo.length;i++){if(zoneinfo[i].zone_no==iZoneNo){return i;}}}
catch(e){alert('create zoneinfo array in syos2.ascx (averages of coordinates by zone: use GetZoneInfo(Averages).sql to setup )');}
return-1;}
function caculatePosition(dPct){for(var x=0;x<slider_mag_lookup_values.length;x++){if(dPct>slider_mag_lookup_values[x])
return x;}
return slider_mag_lookup_values.length;}
function window_scrolling(){var ww=getwindowsize();var st=getscrolltop();var syos2_holder=$g("syos2_holder");if(syos2_holder)
syos2_holder.style.top=""+Math.floor((ww.y+st.y-syos2_height)/2)+px;}
function window_resized(){if(typeof syos2_visible!="undefined"&&syos2_visible){var syos2_holder=$g("syos2_holder");var ww=getwindowsize();var st=getscrolltop();var syos2=$g("syos2");syos2_width=ww.x-(2*syos2_inset);syos2_holder.style.width=""+syos2_width+px;syos2_height=ww.y-(2*syos2_inset);syos2_holder.style.height=""+syos2_height+"px";syos2_holder.style.left=""+Math.floor((ww.x-syos2_width)/2)+px;syos2_holder.style.top=""+Math.floor((ww.y+st.y-syos2_height)/2)+px;adjustWindow();if(typeof arrange_section_selection=="function"){arrange_section_selection();}}}
function setup_syos_data(){var img=null;var width=0;var height=0;for(var seatmap_id=0;seatmap_id<20;seatmap_id++){var sm=$g("seat_map"+seatmap_id);if(sm){imagesizes[seatmap_id]={width:0,height:0,images:[]};for(var image_id=0;image_id<9;image_id++){img=$g("sm"+seatmap_id+"_"+image_id);if(img){width=parseInt(img.style.width);height=parseInt(img.style.height);imagesizes[seatmap_id].width=width;imagesizes[seatmap_id].height=height;imagesizes[seatmap_id].images[image_id]={"width":width,"height":height};}else break;}}else break;}
var syos_navigation_help_cookie=readCookie('syos_navigation_help');if(syos_navigation_help_cookie)
syos_navigation_help_status=false;window.onscroll=window_scrolling;window.onresize=window_resized;}
imageholder=function(w,h,ds,s){this.width=w;this.height=h;this.dotsize=ds;this.src=s;}
setRect=function(o,left,top,width,height){if(typeof o!="object")
o=$g(""+o);if(o.style){o.style.left=""+Math.floor(left)+px;o.style.top=""+Math.floor(top)+px;if(width)
o.style.width=""+Math.floor(width)+px;if(height)
o.style.height=""+Math.floor(height)+px;}}
function setSlider(pct){var newpos=caculatePosition(pct);var offset=0;var syos_zoom_slider=$g("syos_zoom_slider");syos_zoom_slider.style.top=""+(sliderStart+newpos)+px;}
sizeitem=function(w,h){this.width=w;this.height=h;this.left=0;this.top=0;this.center_x=0;this.center_y=0;this.magnification_increment=0.00;}
function resizeImages(x,increment){if(cursize==null)
cursize=new sizeitem(Math.floor(imagesizes[current_seat_map].width*currentMagnification),Math.floor(imagesizes[current_seat_map].height*currentMagnification));var newsize=new sizeitem(Math.floor(imagesizes[current_seat_map].width*increment.pct),Math.floor(imagesizes[current_seat_map].height*increment.pct));newsize.magnification_increment=increment.pct;var syos_panel_seats=$g("seat_map"+current_seat_map+"_container");var syos_panel_seatmaps=$g("seat_map"+current_seat_map+"_seatmaps");var targets=syos_panel_seatmaps.getElementsByTagName("img");for(var i=0;i<targets.length;i++){targets[i].style.display=((increment.inc==i||(increment.inc==targets.length&&i==(targets.length-1)))?"block":"none");targets[i].style.width=""+newsize.width+px;targets[i].style.height=""+newsize.height+px;}
var syos2_seat_selector=$g("syos2_seat_selector");var viewport_size={width:parseInt(syos2_seat_selector.style.width),height:parseInt(syos2_seat_selector.style.height)};var seatmap_pos={left:parseInt(syos_panel_seats.style.left),top:parseInt(syos_panel_seats.style.top)};if(Math.abs(seatmap_pos.left>newsize.width))
seatmap_pos.left=0;if(Math.abs(seatmap_pos.top>newsize.height))
seatmap_pos.top=0;if(true){if(newsize.width<viewport_size.width){newsize.left=Math.floor((viewport_size.width-newsize.width)/2);}else{cursize.center_x=(-1*seatmap_pos.left)+Math.floor(viewport_size.width/2);newsize.center_x=Math.floor(newsize.width*(cursize.center_x/cursize.width));if(seatmap_pos.left>0)
newsize.left=0;else
newsize.left=0-newsize.center_x+Math.floor(viewport_size.width/2);}
syos_panel_seats.style.left=""+newsize.left+px;if(newsize.height<viewport_size.height){newsize.top=Math.floor((viewport_size.height-newsize.height)/2);}else{cursize.center_y=(-1*seatmap_pos.top)+Math.floor(viewport_size.height/2);newsize.center_y=Math.floor(newsize.height*(cursize.center_y/cursize.height));if(seatmap_pos.top>0)
newsize.top=0;else
newsize.top=0-newsize.center_y+Math.floor(viewport_size.height/2);;}
syos_panel_seats.style.top=""+newsize.top+px;cursize=newsize;}}
function dofeedback(oItem){}
function calculate_resize(x){var inc=4;var newx=0;var prev=0;if(x>100)
x=100;if(x<=100){if(x>0){for(var i=0;i<sliderIncrements.length;i++){var temp=x-sliderIncrements[i];if(temp<0)
{inc=prev;newx=x-sliderIncrements[prev];break;}
else
prev=i;}}else{inc=0;newx=0;}}
return{pct:Math.abs(sliderPercentages[inc]+(newx*sliderScale[inc])),"newx":newx,"inc":inc,"x":x}}
function seatdot_visibility(sShowHide){if(seatdotsvisible&&sShowHide=='hide'){$("#seat_map"+current_seat_map+"_dots").hide();seatdotsvisible=false;}else if(!seatdotsvisible&&sShowHide=='show'){plotSeats(current_seat_map,false);$("#seat_map"+current_seat_map+"_dots").show();seatdotsvisible=true;}}
function doZoom(x,y){seatdot_visibility('hide');lastX=y;var amt=100-(Math.floor(200*(y-sliderStart)/sliderHeight))/2;var increment=calculate_resize(amt);if(trackZoom==0){trackZoom=1;}
resizeImages(amt,increment);currentMagnification=increment.pct;}
function doDragMap(x,y){dofeedback();}
function zoom_set(iDir){if(((currentMagnification+(magnification_increment*iDir))<1.0)&&((currentMagnification+(magnification_increment*iDir))>0)){var newmagnification=currentMagnification+(magnification_increment*iDir);setSlider(newmagnification);var amt=(Math.floor(newmagnification*200))/2;var increment=calculate_resize(amt);resizeImages(amt,increment);plotSeats(current_seat_map,false);currentMagnification=newmagnification;setSlider(currentMagnification);}}
function scrollmap(oImg,sDir,iAction){if(iAction==1){if(oImg.src.indexOf(NavImageSourceDirectory)==-1)
oImg.setAttribute("origsrc",oImg.src);scrollamt_horiz=Math.floor((current_scroll_targetamount*currentMagnification)*((sDir=='W')?1:sDir=='E'?-1:0));scrollamt_vert=Math.floor((current_scroll_targetamount*currentMagnification)*((sDir=='N')?1:sDir=='S'?-1:0));setTimeout("scrollmap(null,0)",current_scroll_targetmillisec);current_scroll_direction=sDir;oImg.src=NavImageSourceDirectory+sDir+"1"+".png";oImg.onmouseout=function(){scrollmap(oImg,sDir,-1);};}else if(iAction==-1){if(oImg.attributes["origsrc"]!=null&&oImg.attributes["origsrc"].nodeValue!=null)
oImg.src=oImg.attributes["origsrc"].nodeValue;else
oImg.src=NavImageSourceDirectory+sDir+"0"+".png";scrollamt_horiz=0;scrollamt_vert=0;current_scroll_direction="";oImg.onmouseout=function(){};}else{if(current_scroll_direction!=""){var seatmap_container=$g("seat_map"+current_seat_map+"_container");var left=parseInt(seatmap_container.style.left);var top=parseInt(seatmap_container.style.top);seatmap_container.style.left=""+(left+scrollamt_horiz)+px;seatmap_container.style.top=""+(top+scrollamt_vert)+px;setTimeout("scrollmap(null,0)",current_scroll_targetmillisec);}}}
function set_rowseatpricebaloon(row,seat,price,section,purchased){$('#rowseatpricebaloon_row').html(row);$('#rowseatpricebaloon_seat').html(seat);$('#rowseatpricebaloon_price').html(price);$('#rowseatpricebaloon_section').html(section);$('#rowseatpricebaloon_purchased').html(purchased>0?seatIsPurchased:seatNotPurchased)}
function hilighter(){var iMapId=this.attributes["iMapId"].nodeValue;var index=this.attributes["index"].nodeValue;var tgt=this.attributes["zone_no"].nodeValue;var loc="hilighter2("+iMapId+","+index+","+tgt+",'"+this.id+"')";hilight_timer=setTimeout(loc,100);seat_view_for_image(this);}
function hilighter2(iMapId,index,zone_no,oImgId){hilight_timer=null;var oImg=$g(oImgId);var zone_div=$g("zone"+zone_no);if(zone_div&&zone_div.childNodes.length<hilight_threshhold){for(var x=0;x<zone_div.childNodes.length;x++){zone_div.childNodes[x].src=avail1;}}
var xy=getxy(oImg);var rowseatpricebaloon=$g("rowseatpricebaloon");rowseatpricebaloon.style.left=""+(xy.x-112+Math.floor(seat_dot_sizes[iMapId]*currentMagnification*0.5))+px;rowseatpricebaloon.style.top=""+(xy.y-117)+px;var seat_price_index="pl"+oImg.attributes["zone_no"].nodeValue+"_pt"+current_price_type;var seat_price=PriceLookups[seat_price_index];var done=false;if(seat_price==null){for(var a=0;a<GetPerformanceDetails.ZonePricingItems.length;a++){if(GetPerformanceDetails.ZonePricingItems[a].ZoneNo==oImg.attributes["zone_no"].nodeValue){for(var b=0;b<GetPerformanceDetails.ZonePricingItems[a].Prices.length;b++){if(GetPerformanceDetails.ZonePricingItems[a].Prices[b].PriceTypeId==current_price_type){ZoneDescriptions[seat_price_index]=GetPerformanceDetails.ZonePricingItems[a].OriginalDesc!=null?GetPerformanceDetails.ZonePricingItems[a].OriginalDesc:GetPerformanceDetails.ZonePricingItems[a].Description;PriceLookups[seat_price_index]=GetPerformanceDetails.ZonePricingItems[a].Prices[b].PriceString;done=true;break;}}}
if(done)
break;}}
set_rowseatpricebaloon(oImg.attributes["seat_row"].nodeValue,oImg.attributes["seat_num"].nodeValue,PriceLookups[seat_price_index],ZoneDescriptions[seat_price_index],oImg.attributes["purchased"].nodeValue);$('#rowseatpricebaloon').show();}
function unhilighter(){if(hilight_timer){clearTimeout(hilight_timer);hilight_timer=null;}else
unhilighter2(this);}
function unhilighter2(oImg){var iMapId=oImg.attributes["iMapId"].nodeValue;var index=oImg.attributes["index"].nodeValue;var zone_no=oImg.attributes["zone_no"].nodeValue;var zone_div=$g("zone"+zone_no);if(zone_div&&zone_div.childNodes.length<hilight_threshhold){for(var x=0;x<zone_div.childNodes.length;x++){zone_div.childNodes[x].src=avail;}}
$('#rowseatpricebaloon').hide();}
function buyseat(){do_buyseat(this);}
centerOnPoint=function(x,y,width,height){this.x=(typeof x=="undefined")?0:x;this.y=(typeof y=="undefined")?0:y;this.width=(typeof width=="undefined")?0:width;this.height=(typeof height=="undefined")?0:height;this.viewport_size={width:0,height:0};}
function display_seat(iSeatNo){var iMapId=-1;var seat_img=$g("seat"+iSeatNo);var center_on=new centerOnPoint();var largest_image_size=null;var targetsize=null;var factor=slider_mag_lookup_values[Math.floor(200-(target_zoomin_magnification*200))]
if(!seat_img){for(var x=0;x<SeatingItems.length;x++){if(SeatingItems[x].seat_no==iSeatNo){iMapId=SeatingItems[x].syos_map_id-1;largest_image_size=imagesizes[iMapId].images[imagesizes[iMapId].images.length-1];targetsize=new sizeitem(Math.floor(largest_image_size.width*factor),Math.floor(largest_image_size.height*factor));center_on.x=Math.floor(targetsize.width/2+(SeatingItems[x].x*targetsize.width*-1));center_on.y=Math.floor(targetsize.height/2+(SeatingItems[x].y*targetsize.height*-1));break;}}}else{iMapId=seat_img.attributes["iMapId"].nodeValue;largest_image_size=imagesizes[iMapId].images[imagesizes[iMapId].images.length-1];targetsize=new sizeitem(Math.floor(largest_image_size.width*factor),Math.floor(largest_image_size.height*factor));center_on.x=Math.floor(targetsize.width/2+(seat_img.attributes["x_coord"].nodeValue*targetsize.width*-1));center_on.y=Math.floor(targetsize.height/2+(seat_img.attributes["y_coord"].nodeValue*targetsize.height*-1));}
center_on.width=largest_image_size.width;center_on.height=largest_image_size.height;center_on.magnification_increment=factor;targetsize.magnification_increment=factor;var syos2_seat_selector=$g("syos2_seat_selector");center_on.viewport_size={width:parseInt(syos2_seat_selector.style.width),height:parseInt(syos2_seat_selector.style.height)};targetsize.left=0-center_on.x+Math.floor(center_on.viewport_size.width/2);targetsize.top=0-center_on.y+Math.floor(center_on.viewport_size.height/2);cursize_list[iMapId]=targetsize;if(iMapId==current_seat_map){cursize=targetsize;}
select_map(iMapId,center_on);}
function remove_seat(iSeatNo){var img=$g("seat"+iSeatNo);do_buyseat(img);}
function format_performance_cart(oSublineItemArray){if(typeof format_performance_cart_override=="function"){format_performance_cart_override(oSublineItemArray)
return;}
if(!oSublineItemArray){$('#syos_proceed').hide();syos_proceed_visible=false;return;}
if(!syos_proceed_visible){$('#syos_proceed').show();syos_proceed_visible=true;}
var cart_details=$g("cart_details");var holder=document.createElement("div");var table=document.createElement("table");table.setAttribute("class","perf_cart");var tr=document.createElement("tr");var td=document.createElement("th");td.appendChild(document.createTextNode("Seat"));tr.appendChild(td);td=document.createElement("th");td.style.textAlign="right";td.style.paddingRight="10px";td.style.width="100px";td.appendChild(document.createTextNode("Price"));tr.appendChild(td);td=document.createElement("th");td.appendChild(document.createTextNode("Action"));tr.appendChild(td);table.appendChild(tr);var findseat_span=null;var desc_added=false;for(var a=0;a<oSublineItemArray.length;a++){desc_added=false;tr=document.createElement("tr");td=document.createElement("td");findseat_span=document.createElement("span");findseat_span.setAttribute("class","action");findseat_span.setAttribute("onclick","display_seat("+oSublineItemArray[a].seat_no+")");findseat_span.setAttribute("title","Click here to zoom to this seat.");if(GetPerformanceDetails.SinglePriceType==0&&perf_no>0){findseat_span.appendChild(document.createTextNode(oSublineItemArray[a].Location+"\u00a0"));td.appendChild(findseat_span);var img=$g("seat"+oSublineItemArray[a].seat_no);if(img){var seat_zone=img.attributes["zone_no"].nodeValue;if(seat_zone){for(var uu=0;uu<GetPerformanceDetails.ZonePricingItems.length;uu++){if(GetPerformanceDetails.ZonePricingItems[uu].Prices.length<2)
break;if(GetPerformanceDetails.ZonePricingItems[uu].ZoneNo==seat_zone){var prtype_select=document.createElement("select");prtype_select.setAttribute("class","seatpricetypeselect");prtype_select.setAttribute("onchange","changePriceForSelectedSeat("+oSublineItemArray[a].li_seq_no+","+oSublineItemArray[a].seat_no+",this.options[this.selectedIndex].value,this)");for(var yy=0;yy<GetPerformanceDetails.ZonePricingItems[uu].Prices.length;yy++){try{if(GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].Price>0){var ptOption=document.createElement("option");ptOption.setAttribute("value",""+GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].PriceTypeId);if(GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].PriceTypeId==oSublineItemArray[a].price_type_id){ptOption.setAttribute("selected","selected");}
if(GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].PriceTypeId==oSublineItemArray[a].price_type_id&&omit_price_current_pricetype)
ptOption.appendChild(document.createTextNode(GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].PriceTypeName));else
ptOption.appendChild(document.createTextNode(GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].PriceTypeName+" "+GetPerformanceDetails.ZonePricingItems[uu].Prices[yy].PriceString));prtype_select.appendChild(ptOption);}}
catch(xerr){}}
td.appendChild(prtype_select);desc_added=true;break;}}}}}
if(!desc_added){findseat_span.appendChild(document.createTextNode(oSublineItemArray[a].Location+", "+oSublineItemArray[a].price_type_name));td.appendChild(findseat_span);}
tr.appendChild(td);td=document.createElement("td");td.style.textAlign="right";td.style.paddingRight="10px";td.appendChild(document.createTextNode(oSublineItemArray[a].formattedPrice));tr.appendChild(td);td=document.createElement("td");findseat_span=document.createElement("span");findseat_span.appendChild(document.createTextNode("remove"));findseat_span.setAttribute("class","action");findseat_span.setAttribute("onclick","remove_seat("+oSublineItemArray[a].seat_no+")");td.appendChild(findseat_span);tr.appendChild(td);table.appendChild(tr);if(typeof format_performance_cart_complete=="function")
format_performance_cart_complete();}
holder.appendChild(table);var msg=document.createElement("p");msg.setAttribute("class","cart_details_msg");var cartlink=document.createElement("a");if(typeof SYOS_Close=="function"){cartlink.setAttribute("href","javascript:SYOS_Close()");cartlink.appendChild(document.createTextNode(typeof SYOS_DoneButtonText=="undefined"?"Continue »":SYOS_DoneButtonText));}else{cartlink.setAttribute("href","javascript:jump_to_cart(this)");cartlink.appendChild(document.createTextNode("Click here to view cart or checkout."));}
cartlink.setAttribute("class","cartLink");msg.appendChild(cartlink);msg.appendChild(document.createTextNode(click_more_dots_message));if(typeof click_more_dots_message_addl=="function")
msg.appendChild(document.createTextNode(click_more_dots_message_addl()));if(typeof img_wait!="undefined"){var img_wait_img=document.createElement("img");img_wait_img.id="jump_cart_wait_img";img_wait_img.style="display:none;"+(typeof img_wait_style!="undefined"?img_wait_style:"");img_wait_img.alt="";img_wait_img.src=img_wait;msg.appendChild(img_wait_img);}
holder.appendChild(msg);$('#cart_details').html($(holder).html());cart_details.style.left="-9999px";$(cart_details).show();var parxy=getxy(cart_details.parentNode);var cart_details_width=parseInt(cart_details.style.width);cart_details.style.top=""+(0-cart_details.clientHeight-1)+"px";cart_details.style.left=""+Math.floor((cart_details.parentNode.clientWidth-cart_details_width)/2)+px;var perf_cart_header=$g("perf_cart_header");perf_cart_header.style.top=""+(0-cart_details.clientHeight-21)+"px";perf_cart_header.style.left=cart_details.style.left;perf_cart_header.style.width=""+(cart_details.clientWidth)+px;$('#span_minimize_restore').html("minimize");}
function jump_to_cart(caller){var jump_cart_wait_img=$g("jump_cart_wait_img");if(jump_cart_wait_img){$(caller).hide();$(jump_cart_wait_img).show();}
location.href=(typeof cartURL=="undefined")?"/tickets/cart.aspx":cartURL;}
function get_time_remaining(){var time_remaining=$g("time_remaining");if(time_remaining){var time_remaining_parts=time_remaining.childNodes[0].nodeValue.split(":");return(parseInt(time_remaining_parts[0])*60)+parseInt(time_remaining_parts[1]);}}
function formattime(i){var o=$g("time_remaining");if(i>0&&o){j=i%60;if(j==0)
k=Math.ceil(i/60);else
k=Math.ceil(i/60)-1;if(j<10)
j="0"+j;$(o).html(""+k+":"+j);}}
function syos_decrement_timer(){var time_remaining=get_time_remaining()-1;var cookiePresent=readCookie("lang");if(cookiePresent||location.search.indexOf("lang=")>-1)
cookiePresent=true;var timeouttext="Your cart may have timed out.";if(cookiePresent)
timeouttext="Your cart may have timed out.";if(time_remaining>0){formattime(time_remaining);clearTimeout(order_timer);order_timer=setTimeout("syos_decrement_timer();",995);}else{if(typeof time_expired_handler=="function")
time_expired_handler();else
alert(timeouttext);$('#time_remaining_holder').hide();order_timer=null;}}
function count_down_timer(){if(!order_timer)
order_timer=setTimeout("syos_decrement_timer();",995);}
function do_buyseat(oImg){var req=getreq();this.handler=function(){if(req.readyState==4){document.body.style.cursor="default";$('#img_wait_seatclick').hide();if(req.status==200){var rslt=JSON.parse(req.responseText);try{rslt=rslt.d;}
catch(err){}
if(rslt.Success){var current_parent=$g("zone"+oImg.attributes["zone_no"].nodeValue);var new_parent=$g("selected_zone"+oImg.attributes["iMapId"].nodeValue);if(rslt.TimeRemaining=="00:00"){$('#time_remaining_holder').hide();}else{$('#time_remaining_holder').show();$('#time_remaining').html(rslt.TimeRemaining);count_down_timer();}
if(oImg.src.indexOf(yours)>-1){try{new_parent.removeChild(oImg);current_parent.appendChild(oImg);}
catch(e){}
oImg.setAttribute("purchased",-1);if(zoned_seat_dots&&zoned_seat_dots.length>0){var imgindex=parseInt(oImg.attributes["index"].nodeValue);oImg.src=zoned_seat_dots[SeatingItems[imgindex].zone_index%zoned_seat_dots.length];}
else
oImg.src=current_parent.childNodes.length>hilight_threshhold?avail:avail1;oImg.setAttribute("li_seq_no",0);$('#rowseatpricebaloon_purchased').html(seatNotPurchased);}else{var cImg=null;for(var a=0;a<rslt.CartInfo.SubLineItemsSeats.length;a++){cImg=$g("seat"+rslt.CartInfo.SubLineItemsSeats[a].seat_no)
if(cImg){if(rslt.CartInfo.SubLineItemsSeats[a].li_seq_no==rslt.LineItem){try{current_parent.removeChild(cImg);new_parent.appendChild(cImg);}
catch(e){}
cImg.setAttribute("purchased",1);cImg.setAttribute("li_seq_no",rslt.CartInfo.SubLineItemsSeats[a].li_seq_no);cImg.src=yours;}}}
$('#rowseatpricebaloon_purchased').html(seatIsPurchased);}
try{format_performance_cart(rslt.CartInfo.SubLineItemsSeats);}
catch(e){$('#syos_proceed').hide();syos_proceed_visible=false;}
if(typeof HandleCartSummary!="undefined"&&rslt.CartSummary)
HandleCartSummary(rslt.CartSummary);}
else
alert(rslt.ErrorMessage);}
else
alert(req.responseText);}}
this.validate=function(){var retval={"perf_no":perf_no,"seat_no":0,"price_type":current_price_type,"zone_no":0,"li_seq_no":0,"reserve":true,"leave_single":leave_single,"pkg_no":pkg_no};retval.seat_no=oImg.attributes["seat_no"].nodeValue;if(oImg.attributes["li_seq_no"]&&(oImg.attributes["li_seq_no"].nodeValue>0)){retval.li_seq_no=oImg.attributes["li_seq_no"].nodeValue;retval.reserve=false;}
retval.zone_no=oImg.attributes["zone_no"].nodeValue;if(retval.seat_no>0)
return retval;}
var sendObj=this.validate();if(sendObj&&req){var img_wait_seatclick=$g("img_wait_seatclick");var oImgXY=getxy(oImg);img_wait_seatclick.style.left=""+(oImgXY.x+24)+px;img_wait_seatclick.style.top=""+(oImgXY.y+8)+px;$(img_wait_seatclick).show();document.body.style.cursor="wait";if(pkg_no>0)
req.open(HTTP_VERB,(srvr+SYOSWS+"PackageClick"),true);else
req.open(HTTP_VERB,(srvr+SYOSWS+"SeatClick"),true);req.setRequestHeader(CONTENT_TYPE,APP_JSON);req.onreadystatechange=this.handler;req.send(JSON.serialize(sendObj));}}
function plotSeats(iMapId,bInitialize){if(current_seat_map<0)
return;if(typeof zoned_seat_dots=="undefined")
window.zoned_seat_dots=[];if(cursize==null)
cursize=new sizeitem(Math.floor(imagesizes[current_seat_map].width*currentMagnification),Math.floor(imagesizes[current_seat_map].height*currentMagnification));var seat_map_dots_div=$g("seat_map"+iMapId+"_dots");var seatdots=seat_map_dots_div.getElementsByTagName("img");var done=false;var done2=false;var dotoffset=seat_dot_sizes[iMapId]*currentMagnification/2;var current_zone=0;var current_zone_div=null;if(bInitialize){var img=null;if(SeatingItems&&(seatdots==null||seatdots.length==0)){for(var x=0;x<SeatingItems.length;x++){if(SeatingItems[x].syos_map_id==(iMapId+1)){if(SeatingItems[x].zone_no==0)
continue;img=document.createElement("img");if(SeatingItems[x].zone_no!=current_zone){if(current_zone>0)
seat_map_dots_div.appendChild(current_zone_div);current_zone=SeatingItems[x].zone_no;current_zone_div=document.createElement("div");current_zone_div.id="zone"+current_zone;}
img.src=avail;if(zoned_seat_dots&&zoned_seat_dots.length>0)img.src=zoned_seat_dots[SeatingItems[x].zone_index%zoned_seat_dots.length];img.style.position="absolute";img.style.zIndex="10";img.style.left=""+Math.floor((cursize.width/2)+(-1*cursize.width*SeatingItems[x].x)-dotoffset)+px;img.style.top=""+Math.floor((cursize.height/2)+(-1*cursize.height*SeatingItems[x].y)-dotoffset)+px;img.style.width=""+Math.floor(seat_dot_sizes[iMapId]*currentMagnification)+px;img.style.height=img.style.width;img.style.filter="alpha(opacity="+dotOpacity+")";img.style.opacity="."+dotOpacity;img.style.mozOpacity="."+dotOpacity;img.id="seat"+SeatingItems[x].seat_no;img.setAttribute("zone_no",SeatingItems[x].zone_no);img.setAttribute("x_coord",""+SeatingItems[x].x);img.setAttribute("y_coord",""+SeatingItems[x].y);img.setAttribute("iMapId",iMapId);img.setAttribute("index",x);img.setAttribute("seat_no",SeatingItems[x].seat_no);img.setAttribute("seat_num",SeatingItems[x].seat_num);img.setAttribute("seat_row",SeatingItems[x].seat_row);if(!userCartInfo)
img.setAttribute("purchased",-1);else{done2=false;for(var y=0;y<userCartInfo.SubLineItemsSeats.length;y++){if(userCartInfo.SubLineItemsSeats[y].seat_no==SeatingItems[x].seat_no){done2=true;img.setAttribute("purchased",1);img.setAttribute("li_seq_no",userCartInfo.SubLineItemsSeats[y].li_seq_no);img.src=yours;break;}}}
img.onmouseover=hilighter;img.onmouseout=unhilighter;img.onclick=buyseat;current_zone_div.appendChild(img);}}
if(current_zone_div!=null)
seat_map_dots_div.appendChild(current_zone_div);current_zone_div=document.createElement("div");current_zone_div.id="selected_zone"+iMapId;seat_map_dots_div.appendChild(current_zone_div);done=true;}}
if(!done){seatdots=seat_map_dots_div.getElementsByTagName("img");for(var i=0;i<seatdots.length;i++){seatdots[i].style.left=""+Math.floor((cursize.width/2)+(-1*cursize.width*seatdots[i].attributes["x_coord"].nodeValue)-dotoffset)+px;seatdots[i].style.top=""+Math.floor((cursize.height/2)+(-1*cursize.height*seatdots[i].attributes["y_coord"].nodeValue)-dotoffset)+px;seatdots[i].style.width=""+Math.floor(seat_dot_sizes[iMapId]*currentMagnification)+px;seatdots[i].style.height=seatdots[i].style.width;}}
seatdotsvisible=true;}
function nothing(){}
function loadMap(iMapId){var req=getreq();this.validate=function(){var zone_no=0;for(var a=0;a<GetPerformanceDetails.ZonePricingItems.length;a++){if(GetPerformanceDetails.ZonePricingItems[a].syos_map_id==(iMapId+1)){zone_no=GetPerformanceDetails.ZonePricingItems[a].ZoneNo;break;}}
var tgt=pkg_no>0?pkg_no:perf_no;var retval={"perf_no":tgt,"zone_no":zone_no,"includeAllZones":true};if(retval.perf_no>0&&retval.zone_no>0)
return retval;}
var sendObj=this.validate();this.handler=function(){if(req.readyState==4){if(req.status==200){var rslt=JSON.parse(req.responseText);try{rslt=rslt.d;}catch(err){}
if(rslt&&rslt.SeatingItems){SeatingItems=rslt.SeatingItems;plotSeats(iMapId,true);if(rslt.CartInfo&&rslt.CartInfo.SubLineItemsSeats&&rslt.CartInfo.SubLineItemsSeats.length>0){if(rslt.CartInfo.TimeRemaining=="00:00"){$('#time_remaining_holder').hide();}else{$('#time_remaining').html(rslt.CartInfo.TimeRemaining);count_down_timer();}
format_performance_cart(rslt.CartInfo.SubLineItemsSeats);for(var b=0;b<rslt.CartInfo.SubLineItemsSeats.length;b++){var reserved_seatimg=$g("seat"+rslt.CartInfo.SubLineItemsSeats[b].seat_no);if(reserved_seatimg){reserved_seatimg.src=yours;reserved_seatimg.setAttribute("purchased",1);reserved_seatimg.setAttribute("li_seq_no",rslt.CartInfo.SubLineItemsSeats[b].li_seq_no);}}
userCartInfo=rslt.CartInfo;}
$('#loading_seats').hide();if(syos_navigation_help_status)
$('#syos_navigation_help').fadeIn();else
create_syos2_seat_selector_navbar_help(true);}else alert("Unable to retrieve Seating data.");}else alert("Connection error");}}
if(sendObj&&req){req=getreq();req.open(HTTP_VERB,(srvr+SYOSWS+"PerfSeatsForZone"),true);req.setRequestHeader(CONTENT_TYPE,APP_JSON);req.onreadystatechange=this.handler;req.send(JSON.serialize(sendObj));}}
function hide_other_seatmaps(iMapId){for(var x=0;x<50;x++){var seat_map=$g("seat_map"+x);if(!seat_map)
break;if(x==iMapId)
continue;var seat_map_seatmaps=$g("seat_map"+x+"_seatmaps");if(seat_map_seatmaps){for(var y=0;y<4;y++)
{var sm=$g("sm"+x+"_"+y);if(sm)
sm.style.display="none";}}}}
function select_map(iMapId,oCenterOnPoint){if((!SeatingItems)){this.loadMap(iMapId);}else{if(cursize){cursize.magnification_increment=currentMagnification;cursize_list[current_seat_map]=cursize;cursize=null;}
cursize=typeof cursize_list[iMapId]=="undefined"?null:cursize_list[iMapId];}
var selectedImage=null;if(current_seat_map!=iMapId){$('#seat_map'+current_seat_map).hide();}
$('#seat_map'+iMapId).show();if((current_seat_map!=iMapId)||oCenterOnPoint){current_seat_map=iMapId;var tab_select_seats=$g("tab_select_seats");setTab(tab_select_seats);for(var x=0;x<imagesizes[iMapId].images.length;x++){if(cursize||(syos2_width<=imagesizes[iMapId].images[x].width)){if(oCenterOnPoint&&oCenterOnPoint.width>imagesizes[iMapId].images[x].width){currentMagnification=oCenterOnPoint.magnification_increment;cursize.magnification_increment=currentMagnification;continue;}
selectedImage=$g("sm"+iMapId+"_"+x);var targetWidth=syos2_width-(2*syos2_map_inset);var targetHeight=Math.floor(targetWidth*(imagesizes[iMapId].height/imagesizes[iMapId].width));var seat_map_container=$g("seat_map"+iMapId+"_container");var syos2_map=$g("syos2_map");var syos2_map_height=parseInt(syos2_map.style.height);if(cursize){currentMagnification=cursize.magnification_increment;targetWidth=Math.floor(imagesizes[iMapId].width*currentMagnification);targetHeight=Math.floor(imagesizes[iMapId].height*currentMagnification);}
else{var targetmag_width=targetWidth/imagesizes[iMapId].width;var targetmag_height=syos2_map_height/imagesizes[iMapId].height;currentMagnification=fit_initial_image_option?Math.min(targetmag_width,targetmag_height):targetWidth/imagesizes[iMapId].width;targetWidth=Math.floor(imagesizes[iMapId].width*currentMagnification);targetHeight=Math.floor(imagesizes[iMapId].height*currentMagnification);}
if(cursize){if(currentMagnification==0)
alert("currentMagnification = 0!");if(oCenterOnPoint){seat_map_container.style.left=SE+(0-oCenterOnPoint.x+Math.floor(oCenterOnPoint.viewport_size.width/2))+px;seat_map_container.style.top=SE+(0-oCenterOnPoint.y+Math.floor(oCenterOnPoint.viewport_size.height/2))+px;}else{if(cursize.left)
seat_map_container.style.left=SE+cursize.left+px;else
seat_map_container.style.left=SE+Math.floor((syos2_width-(2*syos2_map_inset)-targetWidth)/2)+px;if(cursize.top)
seat_map_container.style.top=SE+cursize.top+px;else
seat_map_container.style.top=SE+Math.floor((syos2_map_height-targetHeight)/2)+px;}
targetHeight=cursize.height;targetWidth=cursize.width;}else{current_seat_map_image_id=x;if(targetWidth<(syos2_width-(2*syos2_map_inset)))
seat_map_container.style.left=SE+Math.floor((syos2_width-(2*syos2_map_inset)-targetWidth)/2)+px;if(targetHeight<syos2_map_height)
seat_map_container.style.top=SE+Math.floor((syos2_map_height-targetHeight)/2)+px;selectedImage.src=img_src[iMapId][x];}
selectedImage.style.width=""+targetWidth+px;selectedImage.style.height=""+targetHeight+px;selectedImage.style.display="block";var selectedBestSize=false;for(var y=0;y<imagesizes[iMapId].images.length;y++){if(y!=x||cursize){selectedImage=$g("sm"+iMapId+"_"+y);selectedImage.style.width=""+targetWidth+px;selectedImage.style.height=""+targetHeight+px;selectedImage.src=img_src[iMapId][y];if(cursize){if(selectedBestSize||imagesizes[iMapId].images[y].width<targetWidth||imagesizes[iMapId].images[y].height<targetHeight)
selectedImage.style.display="none";else{selectedImage.style.display="block";selectedBestSize=true;}}}}
if(!cursize){cursize=new sizeitem(targetWidth,targetHeight);cursize.magnification_increment=currentMagnification;}
hide_other_seatmaps(iMapId);setSlider(currentMagnification);break;}}
var seat_map_dots_div=$g("seat_map"+iMapId+"_dots");seatdots=seat_map_dots_div.getElementsByTagName("img");plotSeats(iMapId,true);}else{if(SeatingItems!=null)
setTab($g("tab_select_seats"));}
if(current_seat_map>-1){current_vfs=vfs_images[current_seat_map];if(current_vfs!=null){var vfsimg=$g("vfs_"+(current_seat_map+1));if(vfsimg&&(vfsimg.src==null||vfsimg.src.indexOf(img_clear)>-1))
vfsimg.src=current_vfs.url;}
var view_from_seats_checkbox=$g("view_from_seats_checkbox");show_view_from_seats(view_from_seats_checkbox.checked);}}
function BuildMapPricing(iMapId){if(typeof BuildMapPricingOverride=="function"){BuildMapPricingOverride(iMapId);}else BuildMapPricingLocal(iMapId);}
function BuildMapPricingLocal(iMapId){var perfOrPkgNo=perf_no>0?perf_no:pkg_no;var done=false;var div_map_pricing=$g("div_map_pricing");var child_tables=div_map_pricing.getElementsByTagName("table");for(var b=0;b<child_tables.length;b++)
if(child_tables[b].id!=("pricing"+perfOrPkgNo+""+iMapId))
child_tables[b].style.display="none";else{child_tables[b].style.display="block";done=true;}
if(!done){var width=250;var table=document.createElement("table");table.setAttribute("cellspacing","0");table.setAttribute("class","map_pricing map_pricing"+(iMapId-1));table.style.display="block";table.id="pricing"+perfOrPkgNo+""+iMapId;var tr=document.createElement("tr");var td=document.createElement("th");var show_pricetype_selection=(GetPerformanceDetails.ZonePricingItems[0].Prices.length>1);if(show_pricetype_selection&&show_pricetypes_radio_in_table&&(!isIE||IEv>7)){td.appendChild(document.createTextNode("Selected Pricing:"));td.style.textAlign="right";td.setAttribute("class","sp_zonename");tr.appendChild(td);var inputradio=null;for(var a1=0;a1<GetPerformanceDetails.ZonePricingItems[0].Prices.length;a1++){td=document.createElement("th");td.style.textAlign="center";inputradio=document.createElement("input");inputradio.type="radio";inputradio.name="radio_currentpricetype"+iMapId;if(a1==0){inputradio.setAttribute("checked","checked");current_price_type=GetPerformanceDetails.ZonePricingItems[0].Prices[a1].PriceTypeId;}
inputradio.onclick=selectPrice;if(inputradio.value=GetPerformanceDetails.ZonePricingItems[0].Prices[a1])
inputradio.value=GetPerformanceDetails.ZonePricingItems[0].Prices[a1].PriceTypeId;else if(GetPerformanceDetails.ZonePricingItems.length>1){if(inputradio.value=GetPerformanceDetails.ZonePricingItems[1].Prices[a1])
inputradio.value=GetPerformanceDetails.ZonePricingItems[1].Prices[a1].PriceTypeId;else inputradio.value="-1";}
else inputradio.value="-1";if(inputradio.value!="-1"){td.appendChild(inputradio);tr.appendChild(td);}}
table.appendChild(tr);tr=document.createElement("tr");td=document.createElement("th");}else{try{current_price_type=GetPerformanceDetails.ZonePricingItems[0].Prices[0].PriceTypeId;}catch(e){current_price_type=GetPerformanceDetails.SinglePriceType;}}
var cookiePresent=readCookie("lang");if(cookiePresent||location.search.indexOf("lang=")>-1)
cookiePresent=true;if(cookiePresent){td.appendChild(document.createTextNode("Sección de Asientos"));}
else{td.appendChild(document.createTextNode("Seating Section"));}
td.setAttribute("class","sp_zonename");td.id="syos2_seat_sec_label";tr.appendChild(td);for(var a=0;a<GetPerformanceDetails.ZonePricingItems[0].Prices.length;a++){td=document.createElement("th");try{for(var a1=0;a1<GetPerformanceDetails.ZonePricingItems.length;a1++){if(GetPerformanceDetails.ZonePricingItems[a1]!=null&&GetPerformanceDetails.ZonePricingItems[a1].Prices[a]!=null){td.appendChild(document.createTextNode(GetPerformanceDetails.ZonePricingItems[a1].Prices[a].PriceTypeName));break;}}}catch(Error){td.appendChild(document.createTextNode("n/a"));}
td.style.textAlign="center";tr.appendChild(td);}
if(typeof BuildMapPricingTableExtend=="function"){var item=BuildMapPricingTableExtend("header");if(item)
tr.appendChild(item);}
width+=150;table.appendChild(tr);var textStyle="";var zone_added_count=0;for(var c=0;c<GetPerformanceDetails.ZonePricingItems.length;c++){if(GetPerformanceDetails.ZonePricingItems[c].syos_map_id==iMapId){var sectionIsAvailable=(GetPerformanceDetails.TotalNumberOfAvailableSeats==0||(typeof min_seat_threshhold=="undefined"||GetPerformanceDetails.ZonePricingItems[c].NumSeatsAvailable>min_seat_threshhold));if(!sectionIsAvailable&&zone_not_available_behavior=="skip")
continue;tr=document.createElement("tr");textStyle=DW.text_to_classname(GetPerformanceDetails.ZonePricingItems[c].Description.trim());tr.setAttribute("class","zone_no"+GetPerformanceDetails.ZonePricingItems[c].ZoneNo+" "+textStyle);td=document.createElement("td");td.setAttribute("class","sp_zonename");td.appendChild(document.createTextNode(GetPerformanceDetails.ZonePricingItems[c].Description));tr.appendChild(td);for(var d=0;d<GetPerformanceDetails.ZonePricingItems[c].Prices.length;d++){td=document.createElement("td");td.style.textAlign="center";try{if(sectionIsAvailable)
td.appendChild(document.createTextNode(GetPerformanceDetails.ZonePricingItems[c].Prices[d].PriceString));else{var ital=DW.ce("i");ital.appendChild(DW.ct((typeof soldOutText=="undefined"||soldOutText.length==0)?"(Sold out)":soldOutText));td.appendChild(ital);}}
catch(err){td.appendChild(document.createTextNode("n/a"));}
tr.appendChild(td);}
if(typeof BuildMapPricingTableExtend=="function"){var item=BuildMapPricingTableExtend("row",c,GetPerformanceDetails.ZonePricingItems[c]);if(item)
tr.appendChild(item);}
table.appendChild(tr);}
zone_added_count++;}
if(zone_added_count==0){tr=DW.ce("tr");td=DW.ce("td");td.setAttribute("colspan",(1+GetPerformanceDetails.ZonePricingItems[0].Prices.length))
td.appendChild(DW.ct("Sorry no seating availability on this level"));tr.appendChild(td);table.appendChild(tr);}
table.style.width="100%";var holder=document.createElement("div");holder.appendChild(table);if(isIE&&(IEv<8)){if(show_pricetype_selection){var pricing_div=document.createElement("div");pricing_div.setAttribute("id","ie7_pricing_div");pricing_div.appendChild(document.createTextNode("Please select your price level: "));var ie_pricing_select=document.createElement("select");ie_pricing_select.setAttribute("onchange","current_price_type=this.options[this.selectedIndex].value");for(var a1=0;a1<GetPerformanceDetails.ZonePricingItems[0].Prices.length;a1++){if(a1==0)
current_price_type=GetPerformanceDetails.ZonePricingItems[0].Prices[a1].PriceTypeId;var pricing_option=document.createElement("option");pricing_option.setAttribute("value",GetPerformanceDetails.ZonePricingItems[0].Prices[a1].PriceTypeId);pricing_option.appendChild(document.createTextNode(GetPerformanceDetails.ZonePricingItems[0].Prices[a1].PriceTypeName));ie_pricing_select.appendChild(pricing_option);}
pricing_div.appendChild(ie_pricing_select);holder.appendChild(pricing_div);}
var ieHTML=$(holder).html();$('#div_map_pricing').html(ieHTML);}else div_map_pricing.appendChild(holder);if(typeof BuildMapPricingComplete=="function")
BuildMapPricingComplete();}}
function selectPrice(){current_price_type=this.value;}
function setover(iFacilNo,iMap){overmap=iMap;var img=$g("f"+iFacilNo+"_"+iMap);if(img&&(iMap>0)){img.style.mozOpacity=".9999";img.style.opacity=".9999";img.style.filter="alpha(opacity=99)";dosetout(iFacilNo,0);}
BuildMapPricing(iMap);}
function dosetout(iFacilNo,iMap){var img=$g("f"+iFacilNo+"_"+iMap);if(img&&(iMap>0)){img.style.mozOpacity=".0001";img.style.opacity=".0001";img.style.filter="alpha(opacity=00)";}
if(overmap==0){img=$g("f"+iFacilNo+"_0");img.style.mozOpacity=".9999";img.style.opacity=".9999";img.style.filter="alpha(opacity=99)";}}
function setout(iFacilNo,iMap){setTimeout("dosetout("+iFacilNo+","+iMap+")",100);overmap=0;}
function setRowSeatPriceSection(r,s,p,t){$('#rowseatpricebaloon_row').html(r);$('#rowseatpricebaloon_seat').html(s);$('#rowseatpricebaloon_price').html(p);$('#rowseatpricebaloon_section').html(t);}
function toggle_pricing(oImg,r,s,p,t){var loc=getxy(oImg);var loc2=getxy("syos2_seat_selector");var img_width=parseInt(oImg.style.width);var rowseatpricebaloon=$g("rowseatpricebaloon");rowseatpricebaloon.style.left=""+(loc.x-loc2.x-113+Math.floor(img_width/2))+px;rowseatpricebaloon.style.top=""+(loc.y-loc2.y-117+2)+px;if(r){setRowSeatPriceSection(r,s,p,t);$(rowseatpricebaloon).show();}else
$(rowseatpricebaloon).hide();}
function setTab(oTabDiv){if(oTabDiv.id!=syos2_current_tab&&(oTabDiv.id!="tab_select_seats"||current_seat_map>-1)){var img=$g(syos2_current_tab+"_img");img.src="/syos/images/TabDimmed64_170x35.png";img=$g(oTabDiv.id+"_img");img.src="/syos/images/TabSelected170x35.png";syos2_current_tab=oTabDiv.id;if(oTabDiv.id=="tab_select_seats"){$('#syos2_seat_selector').show();if(vfs_images[current_seat_map]!=null)
$('#view_from_seats_holder').show();else{$('#view_from_seats_holder').hide();view_from_seats_visible=false;}}else{$('#syos2_seat_selector').hide();view_from_seats_visible=false;}
if(oTabDiv.id=="tab_syos_help")
$('#syos2_help').show();else
$('#syos2_help').hide();}
if(oTabDiv.id=="tab_select_seats"&&current_seat_map==-1)
alert("Please select a seating section.");}
function adjustWindow(){var syos2=$g("syos2");syos2.style.width=""+(syos2_width)+px;syos2.style.height=""+(syos2_height)+px;var syos2_map=$g("syos2_map");var syos2_map_top=parseInt(syos2_map.style.top);var syos2_map_height=syos2_height-syos2_map_top-syos2_map_inset;var syos2_map_width=syos2_width-(2*syos2_map_inset);syos2_map.style.height=""+syos2_map_height+px;syos2_map.style.width=""+syos2_map_width+px;syos2_map.style.left=""+syos2_map_inset+px;var syos_proceed=$g("syos_proceed");syos_proceed.style.top=""+(syos2_map_top+syos2_map_height)+px;var cart_details=$g("cart_details");syos_proceed.style.width=cart_details.style.width;syos_proceed.style.left=""+Math.floor((syos2_map_width-parseInt(cart_details.style.width))/2)+px;var syos2innershad_v=$g("syos2innershad_v");syos2innershad_v.style.left=""+syos2_map_inset+px;syos2innershad_v.style.top=""+syos2_map_top+px;syos2innershad_v.style.height=syos2_map.style.height;var syos2innershad_h=$g("syos2innershad_h");syos2innershad_h.style.left=""+syos2_map_inset+px;syos2innershad_h.style.top=""+syos2_map_top+px;syos2innershad_h.style.width=syos2_map.style.width;var syos2_section_selector=$g("syos2_section_selector");syos2_section_selector.style.width=syos2_map.style.width;syos2_section_selector.style.height=syos2_map.style.height;var syos2_seat_selector=$g("syos2_seat_selector");syos2_seat_selector.style.width=syos2_map.style.width;syos2_seat_selector.style.height=syos2_map.style.height;var syos2_help=$g("syos2_help");syos2_help.style.width=syos2_map.style.width;syos2_help.style.height=syos2_map.style.height;if(typeof syos_key_placement_adjust=="function")
syos_key_placement_adjust();addShadow("syos2");}
function set_performance_summary(){var div=document.createElement("div");div.id="performance_summary_details";var h3=document.createElement("h3");h3.appendChild(document.createTextNode(GetPerformanceDetails.Title));div.appendChild(h3);var p=document.createElement("p");p.setAttribute("class","perf_summary_details");p.appendChild(document.createTextNode(GetPerformanceDetails.VenueName+", "+GetPerformanceDetails.Date));div.appendChild(p);$('#performance_summary').html($(div).html());}
function toggle_syos2(iFacilityNo,iSelectedMap,oCenterOnPoint){if(imagesizes.length==0)
setup_syos_data()
var syos2_section_selector_imageholder=$g("syos2_section_selector_imageholder");var selectorImages=null;var syos2_holder=$g("syos2_holder");if(syos2_visible){document.body.style.cursor="wait";show_view_from_seats(false);$('#rowseatpricebaloon').hide();selectorImages=syos2_section_selector_imageholder.getElementsByTagName("img");var target="f"+default_facility_no+"_";for(var x=0;x<selectorImages.length;x++){if(selectorImages[x].id.substr(0,3)==target.substr(0,3))
selectorImages[x].style.display="block";else
selectorImages[x].style.display="none";}
for(var x=0;x<50;x++){var cseatmap=$g("seat_map"+x);if(!cseatmap)
break;var seat_map_container=$g("seat_map"+x+"_container");if(seat_map_container){seat_map_container.style.left="0px";seat_map_container.style.top="0px";}
var seat_map_dots_div=$g("seat_map"+x+"_dots");if(!seat_map_dots_div)
continue;var seat_map_dots_div_nodecount=seat_map_dots_div.childNodes.length;for(var y=seat_map_dots_div_nodecount-1;y>-1;y--)
seat_map_dots_div.removeChild(seat_map_dots_div.childNodes[y]);}
setTab($g("tab_select_section"));overmap=0;currentMagnification=0.0;currentImageID=-1;current_seat_map_image_id=-1;current_scroll_direction=""
current_scroll_amount=0;currentSeatDotSize=0;cursize=null;cursize_list=[];trackZoom=0;GetPerformanceDetails=null;current_price_type=0;perf_no=0;pkg_no=0;SeatingItems=null;PriceLookups=[];ZoneDescriptions=[];syos_proceed_visible=false;userCartInfo=null;hilightedZone=-1;CartInfo=null;$('#syos_proceed').hide();seatdotsvisible=false;document.body.style.cursor="default";$('#loading_seats').show();current_seat_map=-1;$(syos2_holder).hide();syos2_visible=false;var div_map_pricing=$g("div_map_pricing");var child_tables=div_map_pricing.getElementsByTagName("table");for(var b=0;b<child_tables.length;b++)
child_tables[b].style.display="none";}else{selectorImages=syos2_section_selector_imageholder.getElementsByTagName("img");var target="f"+iFacilityNo+"_";for(var x=0;x<selectorImages.length;x++){if(selectorImages[x].id.substr(0,target.length)==target)
selectorImages[x].style.display="block";else
selectorImages[x].style.display="none";}
var ww=getwindowsize();scrtp=getscrolltop();var syos2=$g("syos2");syos2_width=ww.x-(2*syos2_inset);syos2_holder.style.width=""+syos2_width+px;syos2_height=ww.y-(2*syos2_inset);syos2_holder.style.height=""+syos2_height+"px";syos2_holder.style.left=""+Math.floor((ww.x-syos2_width)/2)+px;syos2_holder.style.top=""+(scrtp.y+syos2_inset)+px;var syos_label_text=$g("syos_label_text");syos_label_text.style.backgroundColor=syos2.style.backgroundColor;adjustWindow();if(typeof arrange_section_selection=="function"){arrange_section_selection();}
set_performance_summary();if(iSelectedMap){if(oCenterOnPoint)
select_map(iSelectedMap,oCenterOnPoint);else
select_map(iSelectedMap);}
$(syos2_holder).show();syos2_visible=true;var view_from_seats_checkbox=$g("view_from_seats_checkbox");if(view_from_seats_checkbox!=null){if(typeof view_from_seats_checkbox_checked_default!="undefined")
view_from_seats_checkbox.checked=view_from_seats_checkbox_checked_default;else
view_from_seats_checkbox.checked=false;}}}
function track_view_from_seats(e){if(current_vfs){var offsetAmt={x:14,y:14};var view_from_seats_imageholder=$g('view_from_seats_imageholder');if(!e){e=event;}
if(e.clientX>syos2_inset&&e.clientY>syos2_inset){if(e.clientX<(syos2_inset+syos2_width)&&e.clientY<(syos2_inset+syos2_height)){var trialX=(offsetAmt.x+e.clientX);if(trialX+view_from_seats_imageholder.offsetWidth+15>(syos2_inset*2)+syos2_width)
trialX=(syos2_inset*2)+syos2_width-view_from_seats_imageholder.offsetWidth-15;view_from_seats_imageholder.style.left=""+trialX+px;view_from_seats_imageholder.style.top=""+(scrtp.y+offsetAmt.y+e.clientY)+px;}
else if(view_from_seats_visible){$(view_from_seats_imageholder).hide();view_from_seats_imageholder_visible=false;if(view_from_seats_imageholder_timer!=null){clearTimeout(view_from_seats_imageholder_timer);view_from_seats_imageholder_timer=null;}}}
else if(view_from_seats_visible){$(view_from_seats_imageholder).hide();view_from_seats_imageholder_visible=false;if(view_from_seats_imageholder_timer!=null){clearTimeout(view_from_seats_imageholder_timer);view_from_seats_imageholder_timer=null;}}}}
function show_view_from_seats(bShow){if(bShow){if(current_seat_map>-1){current_vfs=vfs_images[current_seat_map];if(current_vfs!=null){var vfsimg=$g("vfs_"+(current_seat_map+1));if(vfsimg){if(vfsimg.src==null||vfsimg.src.indexOf(img_clear)>-1)
vfsimg.src=current_vfs.url;var sibling_images=vfsimg.parentNode.getElementsByTagName("img");for(var x=0;x<sibling_images.length;x++){if(sibling_images[x].id!=vfsimg.id)
$(sibling_images[x]).hide();else
$(sibling_images[x]).show();}
var view_from_seats_imageholder=$g('view_from_seats_imageholder');$(view_from_seats_imageholder).show();var syos2_map=$g('syos2_map');var xy=getxy(syos2_map);view_from_seats_visible=true;}
else if(view_from_seats_visible){$('#view_from_seats_imageholder').hide();view_from_seats_visible=false;}}}}else{current_vfs=null;$('#view_from_seats_imageholder').hide();view_from_seats_visible=false;}}
function obscureVFSimageholder(){view_from_seats_imageholder_timer=null;$("#view_from_seats_imageholder").fadeOut(200);view_from_seats_imageholder_visible=false;}
function seat_view_for_image(oImg){if(view_from_seats_visible){scrtp=getscrolltop();var x_coord=Math.floor(((cursize.width/2)+(-1*oImg.attributes["x_coord"].nodeValue*cursize.width))/(cursize.width/current_vfs.cols));var y_coord=Math.floor(((cursize.height/2)+(-1*oImg.attributes["y_coord"].nodeValue*cursize.height))/(cursize.height/current_vfs.rows));var vfsimg=$g("vfs_"+(current_seat_map+1));if(vfsimg){vfsimg.style.left=""+Math.floor((-1*x_coord*current_vfs.width)/current_vfs.cols)+px;vfsimg.style.top=""+Math.floor((-1*y_coord*current_vfs.height)/current_vfs.rows)+px;}}}
function RemoveAllSeats(iPerfNo,iPkgNo,fCompletionAction){var req=getreq();this.handler=function(){if(req.readyState==4){if(req.status==200){var rslt=JSON.parse(req.responseText);try{rslt=rslt.d;}catch(err){}
if(rslt.Success){if(fCompletionAction)
fCompletionAction(rslt);}}}}
this.validate=function(){return{"perf_no":iPerfNo,"pkg_no":iPkgNo};}
var sendObj=this.validate();if(sendObj&&req){req=getreq();req.open(HTTP_VERB,(srvr+SYOSWS+"RemoveAllSeats"),true);req.setRequestHeader(CONTENT_TYPE,APP_JSON);req.onreadystatechange=this.handler;req.send(JSON.serialize(sendObj));}}
function show_help(oCaller){$("#syos2_seat_selector_navbar_help").hide();$("#syos_navigation_help").show();}
function create_syos2_seat_selector_navbar_help(bShow){var syos2_seat_selector_navbar_help=document.createElement("div");syos2_seat_selector_navbar_help.setAttribute("id","syos2_seat_selector_navbar_help");syos2_seat_selector_navbar_help.setAttribute("style","position: absolute; display:none; z-index:20; left: 19px; top:17px; font-family: Arial; font-size:13px; color: #fff; text-align:center; background-color: "+nav_color+"; padding:2px;  width:9px;height:14px;");syos2_seat_selector_navbar_help.appendChild(DW.ct("?"));var syos2_seat_selector_navbar=$g("syos2_seat_selector_navbar");if(syos2_seat_selector_navbar)
syos2_seat_selector_navbar.appendChild(syos2_seat_selector_navbar_help);if(bShow)
$(syos2_seat_selector_navbar_help).show();$(syos2_seat_selector_navbar_help).bind("click",function(){show_help();});return syos2_seat_selector_navbar_help;}
function hide_help(sHowlong){var syos2_seat_selector_navbar_help=$g("syos2_seat_selector_navbar_help");if(!syos2_seat_selector_navbar_help)
syos2_seat_selector_navbar_help=create_syos2_seat_selector_navbar_help;var syos_navigation_help=$g("syos_navigation_help");if(syos_navigation_help){var xy=getxy(syos_navigation_help);var xy2=getxy("syos2_seat_selector_navbar");var rect={top:xy.y,left:xy.x,width:syos_navigation_help.offsetWidth,height:syos_navigation_help.offsetHeight};xy2.x+=26;xy2.y+=26;$(syos_navigation_help).hide();animate.close(syos2_seat_selector_navbar_help,function(){$('#syos2_seat_selector_navbar_help').show();},null,xy2,rect);}
if(sHowlong=='permanent')
createCookie('syos_navigation_help','hide',1000);else if(sHowlong=="session")
createCookie('syos_navigation_help','hide');}
function toggle_cart_display(oSpan,minText,maxText){var cart_details=$g("cart_details");var perf_cart_header=$g("perf_cart_header");if($(oSpan).html()==maxText){var parxy=getxy(cart_details.parentNode);var cart_details_width=parseInt(cart_details.style.width);cart_details.style.top=""+(0-cart_details.clientHeight-1)+"px";cart_details.style.left=""+Math.floor((cart_details.parentNode.clientWidth-cart_details_width)/2)+px;perf_cart_header.style.top=""+(0-cart_details.clientHeight-21)+"px";perf_cart_header.style.left=cart_details.style.left;perf_cart_header.style.width=""+(cart_details.clientWidth)+px;$(oSpan).html(minText);}else{$(oSpan).html(maxText);cart_details.style.left="-9999px";perf_cart_header.style.top=""+(0-perf_cart_header.clientHeight)+px;}}
function doshowsyos(iPerfNo,iFacilityNo,oCaller){if(typeof doshowsyos_override=="function")
doshowsyos_override(iPerfNo,iFacilityNo,oCaller);else
doshowsyos_local(iPerfNo,iFacilityNo,oCaller);}
function doshowsyos_local(iPerfNo,iFacilityNo,oCaller,postCallBackHandler){var req=getreq();this.handler=function(){if(req.readyState==4){document.body.style.cursor="default";if(oCaller.style)
oCaller.style.cursor="default";if(req.status==200){var rslt=JSON.parse(req.responseText);try{rslt=rslt.d;}catch(err){}
if(rslt.Success){GetPerformanceDetails=rslt;if(GetPerformanceDetails.SinglePriceType>0)
current_price_type=GetPerformanceDetails.SinglePriceType;toggle_syos2(iFacilityNo);if(GetPerformanceDetails.SingleMapID>0)
setover(iFacilityNo,GetPerformanceDetails.SingleMapID);}else{alert(tkt_unavailable_message);}
if(postCallBackHandler)
postCallBackHandler(rslt);}else if(postCallBackHandler)
postCallBackHandler();}}
this.validate=function(){var retval={"perf_no":0};retval.perf_no=iPerfNo;perf_no=retval.perf_no;if(retval.perf_no>0)
return retval;}
var sendObj=this.validate();if(req&&sendObj){document.body.style.cursor="wait";if(oCaller.style)
oCaller.style.cursor="wait";req=getreq();req.open(HTTP_VERB,(srvr+SYOSWS+"GetPerformanceDetails"),true);req.setRequestHeader(CONTENT_TYPE,APP_JSON);req.onreadystatechange=this.handler;req.send(JSON.serialize(sendObj));}}
function changePriceForSelectedSeat(iLiSeqNo,iSeatNo,iPriceType,oCaller){var req=getreq();this.handler=function(){if(req.readyState==4){document.body.style.cursor="default";if(req.status==200){var rslt=JSON.parse(req.responseText);try{rslt=rslt.d;}catch(err){}
if(rslt.PerformanceNumber)
format_performance_cart(rslt.SubLineItemsSeats);else alert(req.responseText);}else alert(req.responseText);}}
this.validate=function(){return{"iLiSeqNo":iLiSeqNo,"iSeatNo":iSeatNo,"iPriceType":iPriceType};}
var sendObj=this.validate();if(req&&sendObj){$(oCaller).hide();document.body.style.cursor="wait";req=getreq();req.open(HTTP_VERB,(srvr+SYOSWS+"ChangePriceForSelectedSeat"),true);req.setRequestHeader(CONTENT_TYPE,APP_JSON);req.onreadystatechange=this.handler;req.send(JSON.serialize(sendObj));}}
$(document).ready(setup_syos_data);

