
var TicketTypeWidget = DropDownWidget.build( {
style: {
frame: 'widget-frame h16',
focused_frame: 'widget-frame onFocus h16',
border: 'widget-border',
dropdown: 'widget-dropdown',
dropdown_active: 'widget-dropdown-active',
disabled: 'widget-disabled h16',
list: 'widget-dropdown-list',
choice: 'widget-dropdown-list-item',
selected: 'widget-dropdown-list-item selected',
scroll_frame: 'widget-scroll-frame',
scroll_border: 'widget-scroll-border',
scroll_up: 'widget-scroll-up',
scroll_up_active: 'widget-scroll-up-active',
scroll_down: 'widget-scroll-down',
scroll_down_active: 'widget-scroll-down-active',
scrub_frame: 'widget-scroll-scrub-frame',
scrub: 'widget-scroll-scrub'
}
} );
DialogChain = Class.create( {
tlog: TMDebug.gen_tlog( 'dialog-chain' ),
initialize: function( data ) {
this.dialogs = [];
this.begin_function = data.begin_function;
this.end_function = data.end_function;
this.cancel_function = data.cancel_function;
this.current_dialog = -1;
},
add_dialog: function( data ) {
this.dialogs.push( data );
},
start: function( context ) {
false;
this.context = context;
this.context.dialog_chain = this;
this.current_dialog = -1;
if ( this.begin_function )
this.begin_function( this );
this.show_next();
},
previous: function() {
false;
this.dialogs[this.current_dialog].hide();
this.show_previous();
},
go_to: function( dialog ) {
false;
this.dialogs[this.current_dialog].hide();
this.current_dialog = this.dialogs.indexOf( dialog );
this.show();
},
next: function() {
false;
this.dialogs[this.current_dialog].hide();
this.show_next();
},
show_previous: function() {
false;
this.current_dialog --;
this.show();
},
show_next: function() {
false;
this.current_dialog ++;
this.show();
},
show: function() {
if ( this.current_dialog < this.dialogs.length ) {
var current_dialog = this.current_dialog;
var dialog = this.dialogs[current_dialog];
dialog.dialog_chain = this;
if ( dialog.check( this.context ) ) {
if ( current_dialog == this.current_dialog )
dialog.show();
}
else {
if ( current_dialog == this.current_dialog )
this.show_next();
}
}
else
this.finish();
},
cancel: function() {
false;
this.dialogs[this.current_dialog].hide();
if ( this.cancel_function )
this.cancel_function( this );
this.finish();
},
finish: function() {
false;
this.current_dialog = -1;
if ( this.end_function )
this.end_function( this );
}
} );
TicketTypeDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-tt-dialog' ),
initialize: function( $super ) {
$super( 'ticket_type_selector' );
Event.observe( $('tts_close'), 'click', this.cancel.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
on_select_ticket_type: function( context, tt ) {
false;
var seat_data = context.seat_data;
var cart = context.cart;
cart.add_seat_to_cart( seat_data, tt );
cart.complete_cart_change();
this.hide();
this.dialog_chain.finish();
if ( tt == context.ticket_types[0] )
click_track.log_datapoint({ tt_choice:'preferred_tt' });
else
click_track.log_datapoint({ tt_choice:'non_preferred_tt' });
},
check: function( context ) {
false;
if ( context.seat_data.last_touched_seat_position.selection.is_ga )
return false;
var seat_data = context.seat_data;
var cart = context.cart;
this.cart = cart;
var ticket_types = context.ticket_types;
if ( ticket_types.length == 1 ) {
cart.add_seat_to_cart( seat_data, ticket_types[0] );
cart.complete_cart_change();
return false;
}
else {
this.prepare_to_show();
$('tts_section').innerHTML = seat_data.last_touched_seat_position.section;
$('tts_row').innerHTML = seat_data.last_touched_seat_position.row;
$('tts_seat').innerHTML = seat_data.last_touched_seat_position.seat;
var price_level = seat_data.last_touched_seat_position.price_level;
var preferred = new ISCTTSItem( cart, seat_data, ticket_types[0] );
Event.observe( preferred.$('select'), 'click', this.on_select_ticket_type.bind( this, context, ticket_types[0] ) );
$A($('tts_preferred').childNodes).each( function( node ) {
Element.remove( node );
} );
$('tts_other_offers').hide();
preferred.attach( $('tts_preferred') );
if ( ticket_types.length > 0 ) {
$A($('tts_additional').childNodes).each( function( node ) {
Element.remove( node );
} );
for ( var i = 1 ; i < ticket_types.length ; i ++ ) {
var tt = ticket_types[i];
var item = new ISCTTSItem( cart, seat_data, tt ).attach( $('tts_additional') );
Event.observe( item.$('select'), 'click', this.on_select_ticket_type.bind( this, context, tt ) );
}
$('tts_other_offers').show();
}
if ( is_IE6 && Element.getHeight($('tt_selector_overflow')) + Element.getHeight($('tts_other_offers')) > 200 ) {
$('tt_selector_overflow').style.height = '200px';
}
return true;
}
},
hide: function( $super ) {
$super();
this.cart.enable_seatmap_access();
},
show: function( $super ) {
this.cart.disable_seatmap_access();
click_track.log_datapoint({ ticket_type_popup: '' });
$super( {
anchor_id: 'map-area',
popup_align: { x: 0, y: 0 },
anchor_align: { x: 0, y: 0 }
} );
}
} );
GeneralAdmissionDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-ga-dialog' ),
initialize: function( $super ) {
$super( 'cart_ga_dialog' );
Event.observe( $('cart_ga_close'), 'click', this.cancel.bind( this ) );
Event.observe( $('cart_ga_add_button'), 'click', this.on_add.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
on_add: function() {
false;
for ( var i = 0 ; i < this.modules.length ; i ++ ) {
var module = this.modules[i];
var quantity = module.get_quantity();
while ( quantity ) {
this.cart.add_seat_to_cart( this.seat_data, module.tt );
quantity --;
}
}
this.cart.complete_cart_change();
this.hide();
this.dialog_chain.finish();
},
on_quantity_change: function() {
var selected_quantity = this.get_total_quantity();
var max = this.ticket_limit - selected_quantity;
for ( var i = 0 ; i < this.modules.length ; i ++ ) {
var module = this.modules[i];
var tt = module.tt;
var ttmax = max + module.get_quantity();
var quantity_left = tt.quantity_limits.max - this.cart.ticket_type_counts[tt.ext_ticket_type];
if ( ttmax > quantity_left )
ttmax = quantity_left;
var limits = Object.clone( tt.quantity_limits );
limits.max = ttmax;
module.update_quantity_options( limits );
module.quantity_dropdown.update_dropdown();
}
},
get_total_quantity: function () {
var total = 0;
for ( var i = 0 ; i < this.modules.length ; i ++ )
total = total + this.modules[i].get_quantity();
return total;
},
check: function( context ) {
false;
if ( context.seat_data.last_touched_seat_position.selection.is_ga ) {
this.prepare_to_show();
this.cart = context.cart;
this.seat_data = context.seat_data;
this.ticket_limit = this.cart.isc.edp.event.ticket_limit - this.cart.items.length;
if ( this.ticket_limit > this.seat_data.last_touched_seat_position.selection.largest_contig_count )
this.ticket_limit = this.seat_data.last_touched_seat_position.selection.largest_contig_count;
$A($('cart_ga_ticket_types').childNodes).each( function( node ) {
Element.remove( node );
} );
this.ticket_types = context.ticket_types;
if ( !context.ticket_types.length )
return false;
this.modules = [];
for ( var i = 0 ; i < this.ticket_types.length ; i ++ ) {
var tt = this.ticket_types[i];
var module = new ISCGAItem( tt, this.seat_data, this.cart );
module.attach( $('cart_ga_ticket_types') );
module.show();
Event.observe( module.quantity_dropdown.dropdown, 'dropdown:change', this.on_quantity_change.bind( this ) );
this.modules.push( module );
}
this.on_quantity_change();
if ( is_IE6 && Element.getHeight($('cart_ga_ticket_types')) > 200 ) {
$('cart_ga_dialog_overflow').style.height = '200px';
}
return true;
}
return false;
},
hide: function( $super ) {
$super();
this.cart.enable_seatmap_access();
},
show: function( $super ) {
this.cart.disable_seatmap_access();
$super( {
anchor_id: 'map-area',
popup_align: { x: 0, y: 0 },
anchor_align: { x: 0, y: 0 }
} );
}
} );
TicketLimitErrorDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-tlimit-error-dialog' ),
initialize: function( $super ) {
$super( 'cart_ticket_limit_error', {
zIndex: 110,
lightbox: { opacity: 0.6 }
} );
this.module = new Module( 'cart_ticket_limit_error_content_1' );
Event.observe( this.module.$('close'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('ok_button'), 'click', this.cancel.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
clear_messages: function() {
var ticket_limit_error_list = this.module.$('ticket_type_limit_errors');
while( ticket_limit_error_list.hasChildNodes() )
Element.remove( ticket_limit_error_list.firstChild );
},
check_tt_limit: function( tt, cart, options ) {
var messages = [];
options = options || {};
var limit_reached = false;
if ( options.is_checkout ) {
if ( tt.repname_quantity_limits.max &&
cart.ticket_type_counts[tt.ext_ticket_type] > tt.repname_quantity_limits.max )
limit_reached = true;
if ( tt.repname_quantity_limits.min &&
cart.ticket_type_counts[tt.ext_ticket_type] > 0 &&
cart.ticket_type_counts[tt.ext_ticket_type] < tt.repname_quantity_limits.min )
limit_reached = true;
if ( tt.repname_quantity_limits.inc &&
(cart.ticket_type_counts[tt.ext_ticket_type] % tt.repname_quantity_limits.inc) != 0 )
limit_reached = true;
if ( tt.repname_quantity_limits.exact &&
cart.ticket_type_counts[tt.ext_ticket_type] > 0 &&
cart.ticket_type_counts[tt.ext_ticket_type] < tt.repname_quantity_limits.exact )
limit_reached = true;
}
else {
if ( tt.repname_quantity_limits.max &&
cart.ticket_type_counts[tt.ext_ticket_type] >= tt.repname_quantity_limits.max )
limit_reached = true;
if ( tt.repname_quantity_limits.exact &&
cart.ticket_type_counts[tt.ext_ticket_type] >= tt.repname_quantity_limits.exact )
limit_reached = true;
}
if ( limit_reached ) {
var li = new Element( 'li' );
li.update( tt.limit_description );
this.module.$('ticket_type_limit_errors').appendChild( li );
return true;
}
return false;
},
check: function( context ) {
false;
this.context = context;
var cart = context.cart;
this.module.$('event_limit_errors').hide();
this.module.$('ticket_type_limit_errors').hide();
var event_ticket_limit = cart.isc.edp.event.ticket_limit;
this.clear_messages();
var num_tt_limits_reached = 0;
if ( context.seat_data ) {
this.module.$('ticket_type_error_type_1').show();
this.module.$('ticket_type_error_type_2').hide();
if ( cart.items.length == event_ticket_limit ) {
this.module.$('event_limit_amount').update( event_ticket_limit );
this.module.$('event_limit_errors').show();
return true;
}
if ( context.seat_data.last_touched_seat_position.selection.is_ga )
return false;
var seat_data = context.seat_data;
for ( var i = 0 ; i < context.ticket_types.length ; i ++ ) {
var tt = context.ticket_types[i];
if ( this.check_tt_limit( tt, cart ) )
num_tt_limits_reached ++;
}
if ( num_tt_limits_reached == context.ticket_types.length ) {
this.module.$('ticket_type_limit_errors').show();
return true;
}
}
else {
for ( var ext_tt in cart.ticket_type_counts ) {
var count = cart.ticket_type_counts[ext_tt];
var tt = cart.isc.edp.event.ticket_type_map[ext_tt];
if ( this.check_tt_limit( tt, cart, { is_checkout: true } ) )
num_tt_limits_reached ++;
}
if ( num_tt_limits_reached ) {
this.module.$('ticket_type_error_type_1').hide();
this.module.$('ticket_type_error_type_2').show();
this.module.$('ticket_type_limit_errors').show();
return true;
}
}
return false;
},
show: function( $super ) {
if ( this.context.seat_data ) {
click_track.log_datapoint({ err_precheckout_ticket_limit:'' });
this.module.$('checkout_msg').hide();
this.module.$('seat_selection_msg').show();
}
else {
click_track.log_datapoint({ err_checkout_ticket_limit:'' });
this.module.$('checkout_msg').show();
this.module.$('seat_selection_msg').hide();
}
$super( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
this.module.$('ok_button').focus();
}
} );
PasswordRequiredDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-pw-req-dialog' ),
initialize: function( $super ) {
this.module = new Module( 'cart_pw_dialog_1' );
$super( this.module.$('cart_pw_dialog'), {
zIndex: 110
} );
Event.observe( this.module.$('ok_button'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('close_button'), 'click', this.cancel.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
check: function( context ) {
false;
var cart = context.cart;
var seat_data = context.seat_data;
this.cart = cart;
if ( context.ticket_types.length ) {
for ( var i = 0 ; i < context.ticket_types.length ; i ++ ) {
var tt = context.ticket_types[i];
if ( !tt.is_locked )
return false;
}
if ( seat_data.last_touched_seat_position.selection.is_ga ) {
this.module.$('seat_location').hide();
this.module.$('ga_location').show();
this.module.$('ga_section').update( seat_data.last_touched_seat_position.selection.section );
}
else {
this.module.$('ga_location').hide();
this.module.$('seat_location').show();
this.module.$('section').update( seat_data.last_touched_seat_position.section );
this.module.$('row').update( seat_data.last_touched_seat_position.row );
this.module.$('seat').update( seat_data.last_touched_seat_position.seat );
}
return true;
}
else
this.cancel();
return false;
},
hide: function( $super ) {
$super();
this.cart.enable_seatmap_access();
},
show: function( $super ) {
this.cart.disable_seatmap_access();
$super( {
anchor_id: 'map-area',
popup_align: { x: 0, y: 0 },
anchor_align: { x: 0, y: 0 }
} );
this.module.$('ok_button').focus();
}
} );
ADADialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-ada-dialog' ),
initialize: function( $super ) {
this.module = new Module( 'cart_ada_dialog_1' );
$super( this.module.$('cart_ada_dialog'), {
zIndex: 110
} );
Event.observe( this.module.$('close_button'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('cancel_button'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('ok_button'), 'click', this.on_ok.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
on_ok: function() {
this.dialog_chain.cancel();
this.cart.isc.switch_to_ada();
},
check: function( context ) {
false;
var seat_data = context.seat_data;
if ( seat_data.last_touched_seat_position.seat_flags & 32 ) {
this.cart = context.cart;
var nodes = this.module.$('title').childElements();
for ( var i = 0 ; i < nodes.length ; i ++ )
nodes[i].hide();
switch ( seat_data.last_touched_seat_position.sell_class ) {
case 1:
this.module.$('wheelchair_msg').show();
break;
case 4:
this.module.$('hearing_msg').show();
break;
case 5:
this.module.$('mobility_msg').show();
break;
}
this.module.$('section').update( seat_data.last_touched_seat_position.section );
this.module.$('row').update( seat_data.last_touched_seat_position.row );
this.module.$('seat').update( seat_data.last_touched_seat_position.seat );
return true;
}
return false;
},
hide: function( $super ) {
$super();
this.cart.enable_seatmap_access();
},
show: function( $super ) {
this.cart.disable_seatmap_access();
$super( {
anchor_id: 'map-area',
popup_align: { x: 0, y: 0 },
anchor_align: { x: 0, y: 0 }
} );
}
} );
ObstructedAisleOnComboViewDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-obs-dialog' ),
initialize: function( $super ) {
$super( 'cart_obstructed_aisle_on_dialog', {
zIndex: 110,
lightbox: { opacity: 0.6 }
} );
this.module = new Module( 'cart_obstructed_aisle_on_dialog_content_1' );
Event.observe( this.module.$('close_button'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('cancel_button'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('ok_button'), 'click', this.ok.bind( this ) );
},
cancel: function() {
if ( this.context.has_obstructed_view && this.context.has_aisle_on ) {
click_track.log_datapoint( { err_aisleon_obstructed_view_to_cancel:''} );
} else if ( this.context.has_obstructed_view ) {
click_track.log_datapoint( { err_obstructed_view_to_cancel:''} );
} else if ( this.context.has_aisle_on ) {
click_track.log_datapoint( { err_aisleon_to_cancel:''} );
}
this.dialog_chain.cancel();
},
ok: function() {
if ( this.context.has_obstructed_view && this.context.has_aisle_on ) {
click_track.log_datapoint( { err_aisleon_obstructed_view_to_ok:''} );
} else if ( this.context.has_obstructed_view ) {
click_track.log_datapoint( { err_obstructed_view_to_ok:''} );
} else if ( this.context.has_aisle_on ) {
click_track.log_datapoint( { err_aisleon_to_ok:''} );
}
this.dialog_chain.next();
},
check: function( context ) {
false;
var i;
this.context = context;
var nodes = this.module.$('messages').childElements();
for ( i = 0 ; i < nodes.length ; i ++ )
nodes[i].hide();
if ( context.seat_data.last_touched_seat_position.seat_flags & 8 ) {
var section = context.seat_data.last_touched_seat_position.section;
var row = context.seat_data.last_touched_seat_position.row;
for ( i = 0 ; i < context.cart.items.length ; i ++ ) {
var seat = context.cart.items[i];
if ( section == seat.seat_data.last_touched_seat_position.section &&
row == seat.seat_data.last_touched_seat_position.row &&
seat.seat_data.last_touched_seat_position.seat_flags & 8 ) {
this.module.$('aisle_on_message').show();
context.has_aisle_on = true;
break;
}
}
}
if ( context.seat_data.last_touched_seat_position.seat_flags & 16 ) {
this.module.$('ostructed_view_message').show();
context.has_obstructed_view = true;
}
if ( context.has_obstructed_view || context.has_aisle_on ) {
if ( context.has_obstructed_view && context.has_aisle_on ) {
click_track.log_datapoint( { err_aisleon_obstructed_view:''} );
this.module.$('also').show();
} else if ( context.has_obstructed_view ) {
click_track.log_datapoint( { err_obstructed_view:''} );
} else if ( context.has_aisle_on ) {
click_track.log_datapoint( { err_aisleon_warning:''} );
}
return true;
}
return false;
},
show: function( $super ) {
$super( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
}
} );
SingleSeatLeftDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-single-left-dialog' ),
initialize: function( $super ) {
$super( 'cart_single_left_dialog', {
zIndex: 110,
lightbox: { opacity: 0.6 }
} );
this.module = new Module( 'cart_single_left_dialog_content_1' );
Event.observe( this.module.$('ok_button'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('close_button'), 'click', this.cancel.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
check: function( context ) {
false;
var cart = context.cart;
if ( !cart.allow_single_seats && cart.leaves_a_single )
return true;
return false;
},
show: function( $super ) {
$super( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
this.module.$('ok_button').focus();
click_track.log_datapoint({ err_single_unoccupied_seat:'' });
}
} );
RecaptchaDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-recaptcha' ),
initialize: function( $super ) {
$super( 'cart_recaptcha_dialog', {
zIndex: 110,
lightbox: { opacity: 0.6 }
} );
Event.observe( $('recaptcha_try_another'), 'click', this.on_try_another.bind( this ) );
Event.observe( $('recaptcha_audio_mode'), 'click', this.on_audio_mode.bind( this ) );
Event.observe( $('recaptcha_image_mode'), 'click', this.on_image_mode.bind( this ) );
Event.observe( $('recaptcha_help'), 'click', this.on_help.bind( this ) );
Event.observe( $('recaptcha_continue'), 'click', this.verify_input.bind( this ) );
Event.observe( $('recaptcha_form'), 'submit', this.verify_input.bind( this ) );
Event.observe( $('recaptcha_cancel'), 'click', this.cancel.bind( this ) );
},
on_try_another: function( event ) {
this.reset_errors();
Recaptcha.reload();
},
on_audio_mode: function( event ) {
this.reset_errors();
this.current_recaptcha_type = 'audio';
Recaptcha.switch_type( this.current_recaptcha_type );
this.update_input_type_display();
},
on_image_mode: function( event ) {
this.reset_errors();
this.current_recaptcha_type = 'image';
Recaptcha.switch_type( this.current_recaptcha_type );
this.update_input_type_display();
},
update_input_type_display: function() {
if( this.current_recaptcha_type == 'image' ) {
$('recaptcha_image_prompt').show();
$('recaptcha_audio_prompt').hide();
$('recaptcha_audio_mode').show();
$('recaptcha_image_mode').hide();
}
else {
$('recaptcha_image_prompt').hide();
$('recaptcha_audio_prompt').show();
$('recaptcha_audio_mode').hide();
$('recaptcha_image_mode').show();
}
},
on_help: function( event ) {
var new_win = window.open(
$('recaptcha_help').href,
$('recaptcha_help').target,
'scrollbars=yes,status=no,resizable=no,width=500,height=300'
);
if (window.focus)
new_win.focus();
Event.stop( event );
return false;
},
cancel: function() {
this.dialog_chain.cancel();
Recaptcha.destroy();
},
check: function( context ) {
false;
this.context = context;
this.cart = context.cart;
this.prepare_recaptcha();
return true;
},
reset_errors: function() {
$('recaptcha_error_message').hide();
var nodes = $('recaptcha_error_messages').childElements();
for ( var i = 0 ; i < nodes.length ; i ++ )
nodes[i].hide();
},
show_error: function( error ) {
$('recaptcha_error_message').show();
var id = 'recaptcha_' + error;
$(id).show();
},
verify_input: function( event ) {
Recaptcha.ajax_verify( this.on_input_verified.bind( this ) );
},
on_input_verified: function( data ) {
if ( data.is_correct ) {
this.context.verify_psig = data.verify_psig;
this.dialog_chain.next();
Recaptcha.destroy();
}
else {
this.reset_errors();
this.show_error( 'match_error' );
Recaptcha.reload();
}
},
prepare_recaptcha: function() {
var uri = this.cart.reserve_uri + "?command=create_captcha";
new Ajax.Request( uri, {
method: 'get',
evalJS: false,
evalJSON: false,
onSuccess: this.on_prepare_recaptcha_success.bind( this ),
onFailure: this.on_prepare_recaptcha_failure.bind( this ),
onException: this.on_prepare_recaptcha_exception.bind( this )
} );
},
on_prepare_recaptcha_success: function( transport ) {
var data = transport.responseText.evalJSON();
if (data.type != "reCAPTCHA") {
this.dialog_chain.next();
}
else {
this.create_recaptcha( data );
this.show_recaptcha();
}
},
on_prepare_recaptcha_failure: function( transport ) {
this.context.errors = {
failure: { recaptcha: 1 }
};
this.dialog_chain.next();
},
on_prepare_recaptcha_exception: function( reqeust, exception ) {
this.context.errors = {
failure: { recaptcha: 1 }
};
this.dialog_chain.next();
},
create_recaptcha: function( data ) {
this.expires = (new Date() - 0) + data.timeout * 1000;
Recaptcha.create(
data.public_key,
"",
{
theme: "custom",
tabindex: 0,
callback: Recaptcha.focus_response_field,
extra_challenge_params: data.params,
lang: data.lang
}
);
},
show_recaptcha: function() {
this.reset_errors();
var custLinkrecapISM = new omniCustomClick({
events: 'event8,event15',
products: ';' + tm_omni_temp.get('omnEID') + ';;;event8=' + this.cart.items.length ,
channel: omn_domain_owner + ' Checkout: Recaptcha',
prop1: omn_domain_owner + ' Checkout: Recaptcha: ISM EDP',
pageName: omn_domain_owner + ' Checkout: Recaptcha: ISM EDP',
prop16: tm_omn.prop16.gsub(/EDP: ISM:/,'Checkout: Recaptcha: ISM EDP:'),
prop2: omn_domain_owner + ' Checkout',
prop3: omn_domain_owner + ' Checkout',
eVar34: 'Interactive Seat Map'
},
clickLink = '',
newPage = true
);
custLinkrecapISM.handleClick();
if ( this.context.errors ) {
if ( this.context.errors.timeout && this.context.errors.timeout.recaptcha )
this.show_error( 'expired' );
delete this.context.errors;
}
this.current_recaptcha_type = 'image';
this.update_input_type_display();
this.show( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
}
} );
ReservePollingDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-reserve' ),
initialize: function( $super ) {
$super( 'reserve_polling_dialog', {
zIndex: 110,
lightbox: { opacity: 0.6 }
} );
},
check: function( context ) {
false;
if ( context.errors ) {
return false;
}
else {
this.context = context;
this.is_shown = false;
this.seats_reordered = false;
this.reserve_token = false;
this.show_polling( {
init: true,
poll: { wait: 0 }
} );
this.prepare_reserve();
return true;
}
},
get_seat_data_for_selection: function( selection ) {
if ( selection.is_ga )
return [];
var cart = this.context.cart;
var sorted_seats = cart.sorted_seats;
var seat_names = selection.seat_names.clone();
var section = selection.section;
var row = selection.row;
var row_seats = sorted_seats[section][row];
var transactions = [];
var last_tt;
var seat_counts = {};
var seat_range = [];
var secname;
for ( var i = 0 ; i < seat_names.length ; i ++ ) {
var seat = seat_names[i];
var item = row_seats[seat];
var tt = item.tt;
var ext_ticket_type = tt.ext_ticket_type;
if ( !i ) {
var price_level = item.display.price_level;
secname = tt.price_breakdown[price_level].price_secname;
}
if ( last_tt && last_tt.ext_ticket_type != tt.ext_ticket_type ) {
if ( tt.unsold_qualifier_value != last_tt.unsold_qualifier_value ||
( $H(seat_counts).keys().length == 5 && !seat_counts[ext_ticket_type] ) ) {
transactions.push( this.build_seat_transaction( {
secname: secname,
seat_counts: seat_counts,
section: section,
row: row,
seat_range: seat_range
} ) );
seat_counts = {};
seat_range = [];
}
else if ( seat_counts[ext_ticket_type] )
this.seats_reordered = true;
}
if ( !seat_counts[ext_ticket_type] )
seat_counts[ext_ticket_type] = 0;
seat_counts[ext_ticket_type] ++;
if ( !seat_range.length )
seat_range.push( seat );
seat_range[1] = seat;
last_tt = tt;
}
transactions.push( this.build_seat_transaction( {
secname: secname,
seat_counts: seat_counts,
section: section,
row: row,
seat_range: seat_range
} ) );
return transactions;
},
build_seat_transaction: function( data ) {
var seat_counts = data.seat_counts;
var ext_ticket_types = $H(seat_counts).keys();
var transaction = {
extended_ticket_type: [],
quantity: [],
section: data.section,
secname: data.secname
};
if ( Object.isArray( data.secname ) && data.secname.length > 1 ) {
delete transaction.section;
}
while ( ext_ticket_types.length ) {
var ext_ticket_type = ext_ticket_types.shift();
var quantity = seat_counts[ext_ticket_type];
transaction.extended_ticket_type.push( ext_ticket_type );
transaction.quantity.push( quantity );
}
if ( data.row && data.seat_range ) {
transaction.row = data.row;
transaction.begin = data.seat_range[0];
transaction.end = data.seat_range[1];
}
return transaction;
},
get_ga_seat_data: function() {
var cart = this.context.cart;
var ga_sections = cart.ga_sections;
var transactions = [];
var seat_counts = {};
for ( var section in ga_sections ) {
var last_tt = false;
var items = ga_sections[section];
var secname;
for ( var i = 0 ; i < items.length ; i ++ ) {
var item = items[i];
var tt = item.tt;
var ext_ticket_type = tt.ext_ticket_type;
if ( !i ) {
var price_level = item.display.price_level;
secname = item.tt.price_breakdown[price_level].price_secname;
var secnam = item.seat_data.last_touched_seat_position.selection.ga_secname;
if ( !Object.isUndefined( secnam ) ) {
secname = [ secname, secnam ];
}
}
if ( last_tt && last_tt.ext_ticket_type != tt.ext_ticket_type ) {
if ( tt.unsold_qualifier_value != last_tt.unsold_qualifier_value ||
( $H(seat_counts).keys().length == 5 && !seat_counts[ext_ticket_type] ) ) {
transactions.push( this.build_seat_transaction( {
secname: secname,
seat_counts: seat_counts,
section: section
} ) );
seat_counts = {};
}
}
if ( !seat_counts[ext_ticket_type] )
seat_counts[ext_ticket_type] = 0;
seat_counts[ext_ticket_type] ++;
}
transactions.push( this.build_seat_transaction( {
secname: secname,
seat_counts: seat_counts,
section: section
} ) );
}
return transactions;
},
get_seat_data: function() {
var seat_data = this.context.cart.current_seat_data;
var seats = [];
var num_contiguous_selections = 0;
if ( seat_data && seat_data.intermediate_seat_selection ) {
if ( !seat_data.intermediate_seat_selection.is_ga ) {
seats = this.get_seat_data_for_selection( seat_data.intermediate_seat_selection );
num_contiguous_selections ++;
}
if ( seat_data.intermediate_seat_selection.more_selections ) {
var more_selections = seat_data.intermediate_seat_selection.more_selections;
for ( var i = 0 ; i < more_selections.length ; i ++ ) {
if ( !more_selections[i].is_ga ) {
seats = seats.concat( this.get_seat_data_for_selection( more_selections[i] ) );
num_contiguous_selections ++;
}
}
}
}
var ga_seats = this.get_ga_seat_data();
if ( ga_seats.length ) {
num_contiguous_selections += Object.keys(this.ga_sections).length;
seats = seats.concat( ga_seats );
}
click_track.log_datapoint({ num_non_contig_seat_sets: num_contiguous_selections });
false;
return seats;
},
prepare_reserve: function() {
var cart = this.context.cart;
var ticket_types = cart.isc.search_constraints.get_unlocked_ticket_types();
var auths = [];
for ( var i = 0 ; i < ticket_types.length ; i ++ ) {
var tt = ticket_types[i];
if ( tt.primary_password ) {
auths.push( {
primary_password: tt.primary_password,
extended_ticket_type: tt.ext_ticket_type
} );
}
}
if ( auths.length ) {
var data = {
command: 'prepare_reserve',
event_id: cart.isc.edp.event.event_id,
auth: auths
};
var uri = cart.reserve_uri.replace(/http/, 'https') + '?' + MooHash.toQueryString( data );
new Sajax( uri, this.on_reserve_prepared.bind( this ), {
timeout: this.context.cart.isc.data.sajax_timeout * 1000,
on_timeout: this.on_prepare_reserve_failure.bind( this )
} );
}
else
this.start_reserve();
},
on_reserve_prepared: function( sajax, data ) {
false;
if ( data.error ) {
this.context.errors = data.error;
this.dialog_chain.next();
}
else {
this.reserve_token = data.token;
this.start_reserve();
}
},
on_prepare_reserve_failure: function( sajax ) {
this.context.errors = {
failure: { prepare_reserve: 1 }
};
this.dialog_chain.next();
},
start_reserve: function() {
var cart = this.context.cart;
var data = {
command: 'start_reserve',
edp: window.location.href,
verify_psig: this.context.verify_psig,
event_id: cart.isc.edp.event.event_id,
seat: this.get_seat_data(),
seats_reordered: this.seats_reordered
};
if ( this.reserve_token )
data.token = this.reserve_token;
new Ajax.Request( cart.reserve_uri, {
method: 'post',
evalJS: false,
evalJSON: false,
postBody: MooHash.toQueryString( data ),
onSuccess: this.on_reserve_polling_response.bind( this ),
onFailure: this.on_reserve_polling_failure.bind( this ),
onException: this.on_reserve_polling_exception.bind( this )
} );
},
stop_polling: function() {
if ( this.poll_timeout ) {
window.clearTimeout( this.poll_timeout );
delete this.poll_timeout;
}
},
on_reserve_polling_response: function( transport ) {
var data = transport.responseText.evalJSON();
this.stop_polling();
false;
if ( data.reserve ) {
this.show_reserved_seats( data );
return;
}
if ( data.error ) {
this.context.errors = data.error;
for ( var error in data.error ) {
switch ( error ) {
case "no_seats":
this.context.cart.isc.seat_map.allow_auto_refresh();
this.context.cart.isc.seat_map.refresh_availability();
return;
break;
}
}
this.dialog_chain.next();
return;
}
this.show_polling( data );
},
show_reserved_seats: function( data ) {
window.location = data.uri;
},
on_reserve_polling_failure: function( transport ) {
this.stop_polling();
this.context.errors = {
failure: { polling: 1 }
};
this.dialog_chain.next();
},
on_reserve_polling_exception: function( reqeust, exception ) {
this.stop_polling();
this.context.errors = {
failure: { polling: 1 }
};
this.dialog_chain.next();
},
poll: function( data ) {
false;
new Ajax.Request( data.uri, {
method: 'get',
evalJS: false,
evalJSON: false,
onSuccess: this.on_reserve_polling_response.bind( this ),
onFailure: this.on_reserve_polling_failure.bind( this ),
onException: this.on_reserve_polling_exception.bind( this )
} );
this.show_polling( data );
},
show_polling: function( data ) {
false;
this.update_time_remaining( data.poll.wait );
if ( !this.is_shown ) {
this.show( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
this.is_shown = true;
}
if ( !data.init )
this.poll_timeout = setTimeout( this.poll.bind( this, data ), data.poll.delay*1000 );
},
update_time_remaining: function( wait ) {
var nodes = $('reserve_polling_wait_messages').childElements();
for ( var i = 0 ; i < nodes.length ; i ++ )
nodes[i].hide();
if ( wait == 0 )
$('reserve_polling_working').show();
else {
$('reserve_polling_wait_time').show();
if ( wait < 60 ) {
$('reserve_polling_less_than_minute').show();
return;
}
if ( wait >= 60 && wait <= 90 ) {
$('reserve_polling_approx_minute').show();
return;
}
if ( wait > 870 )
$('reserve_polling_more_minutes').show();
else {
var message;
var minutes = Math.floor(wait/60);
if ( wait > 90 && wait < 300 ) {
if ( ( wait % 60 ) <= 30 )
message = $('reserve_polling_approx_num_minutes');
else {
message = $('reserve_polling_less_than_minutes');
minutes ++;
}
}
if ( wait >= 300 ) {
if ( ( wait % 60 ) <= 30 )
message = $('reserve_polling_approx_large_minutes');
else {
message = $('reserve_polling_less_than_large_minutes');
minutes ++;
}
}
message.down().update( minutes );
message.show();
}
}
}
} );
ReserveFailureDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-reserve-failure' ),
initialize: function( $super, options ) {
$super( 'reserve_failure_dialog', {
zIndex: 110,
lightbox: { opacity: 0.6 }
} );
this.recaptcha_dialog = options.recaptcha_dialog;
this.module = new Module( 'reserve_failure_dialog_content_1' );
Event.observe( this.module.$('close'), 'click', this.cancel.bind( this ) );
Event.observe( this.module.$('ok_button'), 'click', this.cancel.bind( this ) );
},
cancel: function() {
this.dialog_chain.cancel();
},
check: function( context ) {
false;
var i;
var errors = context.errors;
var flags = {};
var error_codes = [];
if ( errors.disabled ) {
return false;
}
for ( var error in errors ) {
switch ( error ) {
case "code":
error_codes.push( errors.code );
break;
case "no_seats":
flags.no_seats = true;
break;
case "ticket_limit":
flags.ticket_limit = true;
break;
case "timeout":
context.errors = {
timeout: { recaptcha: true }
};
this.dialog_chain.go_to( this.recaptcha_dialog );
return false;
break;
case "failure":
flags.system = true;
break;
case "invalid":
if ( errors.invalid.extended_ticket_type ) {
var list = this.module.$('offer_not_available_types');
while( list.hasChildNodes() )
Element.remove( list.firstChild );
var types = errors.seat;
for ( i = 0 ; i < types.length ; i ++ ) {
var ext_ticket_type = types[i].extended_ticket_type;
if ( context.cart.isc.edp.event.ticket_type_map[ext_ticket_type] ) {
var tt = context.cart.isc.edp.event.ticket_type_map[ext_ticket_type];
var li = new Element( 'li' );
li.update( tt.description );
list.appendChild( li );
flags.offsale = true;
}
}
if ( !flags.offsale )
flags.system = true;
}
else if ( errors.invalid.auth ) {
var list = this.module.$('auth_failed');
while( list.hasChildNodes() )
Element.remove( list.firstChild );
var auths = errors.auth;
for ( i = 0 ; i < auths.length ; i ++ ) {
var ext_ticket_type = auths[i].extended_ticket_type;
if ( context.cart.isc.edp.event.ticket_type_map[ext_ticket_type] ) {
var tt = context.cart.isc.edp.event.ticket_type_map[ext_ticket_type];
var message = new Element( 'p' );
message.update( tt.description + ': ' + auths[i].error_message  );
list.appendChild( message );
flags.auth_failed = true;
}
}
}
else if ( errors.invalid.psig ) {
context.errors = {
timeout: { recaptcha: true }
};
this.dialog_chain.go_to( this.recaptcha_dialog );
return false;
}
}
}
this.module.$('error_code').hide();
var nodes = this.module.$('messages').childElements();
for ( i = 0 ; i < nodes.length ; i ++ )
nodes[i].hide();
if ( error_codes.length ) {
this.module.$('codes').update( error_codes.join( ', ' ) );
this.module.$('error_code').show();
}
if ( flags.auth_failed ) {
this.module.$('auth_failed').show();
}
else if ( flags.offsale ) {
this.module.$('offer_not_available').show();
click_track.log_datapoint({ err_reserve_ticket_type_offsale:'' });
}
else if ( flags.no_seats ) {
context.do_not_continue = true;
context.cart.remove_all();
this.module.$('seats_not_available').show();
click_track.log_datapoint({ err_reserve_seat_unavail:'' });
}
else if ( flags.ticket_limit ) {
this.module.$('ticket_limit').show();
click_track.log_datapoint({ err_reserve_ticket_limit:'' });
}
else {
this.module.$('generic').show();
click_track.log_datapoint({ err_reserve_catch_all:'' });
}
return true;
},
show: function( $super ) {
$super( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
this.module.$('ok_button').focus();
}
} );
ISCDisabledDialog = {
check: function( context ) {
if ( context.errors.disabled ) {
this.seat_map = context.cart.isc.seat_map;
this.seat_map.isc_disabled_reason = context.errors.disabled;
return true;
} else {
return false;
}
},
hide: function() {},
show: function() {
this.dialog_chain.cancel();
this.seat_map.show_widget_disabled();
}
};
LeavingISCDialog = Class.create( Popup, {
tlog: TMDebug.gen_tlog( 'isc-leaving-dialog' ),
initialize: function( $super, cart ) {
$super( 'cart_leaving_isc_dialog', {
close_id: [ 'cart_leaving_isc_close', 'cart_leaving_isc_cancel' ],
zIndex: 110,
lightbox: { opacity: 0.6 },
onShow: cart.isc.seat_map.prevent_auto_refresh.bind( cart.isc.seat_map ),
onHide: cart.isc.seat_map.allow_auto_refresh.bind( cart.isc.seat_map )
} );
document.observe( 'click', this.on_leaving_link_click.bind( this, cart ) );
$('cart_leaving_isc_cancel').observe('click', this.cancel.bind( this ) );
$('cart_leaving_isc_close').observe('click', this.cancel.bind( this ) );
Event.observe( $('cart_leaving_isc_form'), 'submit', this.on_continue_leaving_isc.bindAsEventListener( this ) );
this.form_inputs = [];
this.submit_this_form = '';
},
on_leaving_link_click: function( cart, e ) {
if ( cart.isc.edp.active_mode == 'isc' &&
cart.items.length && e.target.tagName == 'A' &&
(
(/^http/.exec(e.target.protocol) && e.target.target == '') ||
e.element().hasClassName('takes_you_away')
)) {
var i;
while ( this.form_inputs.length )
Element.remove( this.form_inputs.shift() );
var parts = e.target.href.split( '?' );
if ( parts.length == 2 ) {
$('cart_leaving_isc_form').setAttribute( 'action', parts[0] );
var params = parts[1].split( '&' );
for ( i = 0 ; i < params.length ; i ++ ) {
var key_value = params[i].split( '=' );
var input = new Element( 'input' );
input.setAttribute( 'type', 'hidden' );
input.setAttribute( 'name', key_value[0] );
input.setAttribute( 'value', key_value[1] );
$('cart_leaving_isc_form').appendChild( input );
this.form_inputs.push( input );
}
}
else
$('cart_leaving_isc_form').setAttribute( 'action', e.target.href );
click_track.log_datapoint({ err_leaving_isc_seats_cleared:'' });
this.show();
Event.stop(e);
}
},
on_form_submit_attempt: function(cart, form) {
if ( cart.isc.edp.active_mode == 'isc' && cart.items.length ) {
var i;
while ( this.form_inputs.length )
Element.remove( this.form_inputs.shift() );
this.show();
this.submit_this_form = form.name;
return false;
}
else {
return true;
}
},
on_continue_leaving_isc: function(e) {
click_track.log_datapoint({ err_leaving_isc_confirmed:'' }, false);
if (this.submit_this_form != '') {
Event.stop(e);
document[this.submit_this_form].submit();
}
else {
return true;
}
},
cancel: function() {
click_track.log_datapoint( {err_leaving_isc_canceled:''} );
this.submit_this_form = '';
},
show: function( $super ) {
$super( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
}
} );
ISCCart = Class.create( {
tlog: TMDebug.gen_tlog( 'isc-cart' ),
initialize: function( data ) {
false;
this.isc = data.isc;
this.isc.cart = this;
this.tu = data.tu;
this.reserve_uri = data.reserve_uri;
this.allow_single_seats = data.allow_single_seats;
this.items = [];
this.ga_sections = {};
this.sorted_seats = {};
this.detailed_view = $('detailed_cart_view');
this.detailed_view_popup = new Popup( $('detailed_cart_view_popup'), {
zIndex: 50
} );
this.move_detailed_view_offscreen();
this.max_rows = 4;
Event.observe( $('cart_items_container'), 'scroll', function(e) {
$('cart_items_container').focus();
} );
Event.observe( this.isc.seat_map.conf.isc_div, this.isc.seat_map.conf.namespace + ':seat_selection', this.on_seat_selection.bind( this ) );
Event.observe( this.isc.seat_map.conf.isc_div, this.isc.seat_map.conf.namespace + ':show_seats_complete', this.on_show_seats_complete.bind( this ) );
Event.observe( this.isc.seat_map.conf.isc_div, this.isc.seat_map.conf.namespace + ':show_seats_error', this.on_show_seats_error.bind( this ) );
Event.observe( $('toggle_cart_view'), 'click', this.on_toggle_view.bind( this ) );
var e_cookie = new CookieTree( '_E' );
this.cart_details_viewed = e_cookie.get ( 'cdv' );
if ( this.cart_details_viewed != this.isc.edp.event.event_id ) {
this.cart_details_viewed = false;
e_cookie.remove( 'cdv' );
}
Event.observe( $('cart_checkout_button'), 'click', this.checkout.bind( this ) );
this.seat_selection_dialog_chain = new DialogChain( {
begin_function: this.on_start_dialog_chain.bind( this ),
end_function: this.on_end_dialog_chain.bind( this ),
cancel_function: this.send_cart_to_seatmap.bind( this )
} );
this.seat_selection_dialog_chain.add_dialog( new ADADialog() );
this.seat_selection_dialog_chain.add_dialog( new PasswordRequiredDialog() );
var ticket_limit_error_dialog = new TicketLimitErrorDialog();
this.seat_selection_dialog_chain.add_dialog( ticket_limit_error_dialog );
this.seat_selection_dialog_chain.add_dialog( new ObstructedAisleOnComboViewDialog() );
this.seat_selection_dialog_chain.add_dialog( new GeneralAdmissionDialog() );
this.seat_selection_dialog_chain.add_dialog( new TicketTypeDialog() );
this.checkout_dialog_chain = new DialogChain( {
begin_function: this.on_start_dialog_chain.bind( this ),
end_function: this.on_end_dialog_chain.bind( this )
} );
this.checkout_dialog_chain.add_dialog( new SingleSeatLeftDialog() );
this.checkout_dialog_chain.add_dialog( ticket_limit_error_dialog );
var recaptcha_dialog = new RecaptchaDialog();
this.checkout_dialog_chain.add_dialog( recaptcha_dialog );
this.checkout_dialog_chain.add_dialog( new ReservePollingDialog() );
this.checkout_dialog_chain.add_dialog( new ReserveFailureDialog( {
recaptcha_dialog: recaptcha_dialog
} ) );
this.checkout_dialog_chain.add_dialog( ISCDisabledDialog );
Event.observe( $('cart_remove_all'), 'click', this.show_remove_all_dialog.bind( this ) );
var remove_all_dialog_body = new Module( 'cart_remove_all_body_1' );
this.remove_all_dialog = new Popup( 'cart_remove_all_dialog', {
close_id: [ remove_all_dialog_body.$('close'), remove_all_dialog_body.$('cancel') ],
zIndex: 110,
lightbox: { opacity: 0.6 },
onShow: this.isc.seat_map.prevent_auto_refresh.bind( this.isc.seat_map ),
onHide: this.isc.seat_map.allow_auto_refresh.bind( this.isc.seat_map )
});
Event.observe( remove_all_dialog_body.$('remove_all'), 'click', this.on_remove_all.bind( this ) );
this.seats_unavailable_dialog_module = new Module( 'seats_unavailable_dialog_content_1' );
this.seats_unavailable_dialog = new Popup( 'seats_unavailable_dialog', {
zIndex: 110,
lightbox: { opacity: 0.6 },
close_id: [ this.seats_unavailable_dialog_module.$('close'),
this.seats_unavailable_dialog_module.$('ok_button')],
onShow: this.isc.seat_map.prevent_auto_refresh.bind( this.isc.seat_map ),
onHide: this.isc.seat_map.allow_auto_refresh.bind( this.isc.seat_map )
});
this.leaving_isc_dialog = new LeavingISCDialog( this );
this.currency = new Currency( $('cart_total').innerHTML );
this.ticket_type_counts = {};
var ticket_types = this.isc.edp.event.ticket_types;
for ( var i = 0 ; i < ticket_types.length ; i ++ )
this.ticket_type_counts[ticket_types[i].ext_ticket_type] = 0;
this.unsold_qualifier_mask = this.isc.qualifiers.unsold.and_mask;
this.cart_version = 0;
this.update_cart_size();
this.update_cart_total();
this.update_in_progress = true;
},
on_start_dialog_chain: function( dialog_chain ) {
false;
this.isc.seat_map.prevent_auto_refresh();
this.current_dialog_chain = dialog_chain;
},
on_end_dialog_chain: function( dialog_chain ) {
false;
this.isc.seat_map.allow_auto_refresh();
delete this.current_dialog_chain;
},
cancel_current_dialog_chain: function() {
false;
if ( this.current_dialog_chain )
this.current_dialog_chain.cancel();
},
show_remove_all_dialog: function() {
false;
this.cancel_current_dialog_chain();
this.remove_all_dialog.show( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
},
setup: function() {
this.update_in_progress = false;
},
move_detailed_view_offscreen: function() {
false;
this.detailed_view_popup.hide();
$('cart_items_container').style.overflow = 'hidden';
this.cart_visible = false;
},
show_detailed_view: function() {
$('detailed_cart_view_popup').style.height = Element.getHeight( this.detailed_view ) + 'px';
false;
this.detailed_view_popup.show ( {
anchor_id: 'map-area',
popup_align: { x: -1, y: 1 },
anchor_align: { x: -1, y: 1 },
offset: { x: 1, y: 0 }
} );
for ( var i = 0 ; i < this.items.length ; i ++ ) {
if ( is_IE6 ) {
this.items[i].display.tt_dropdown.spacer.hide();
this.items[i].display.tt_dropdown.spacer.show();
}
this.items[i].display.tt_dropdown.update_dropdown();
}
},
ready_detailed_view: function() {
false;
this.show_detailed_view();
this.detailed_view.hide();
},
finish_display_details: function() {
false;
this.cart_visible = true;
if ( !this.cart_details_viewed ) {
this.cart_details_viewed = true;
new CookieTree( '_E' ).set ( 'cdv', this.isc.edp.event.event_id );
}
this.update_item_container();
},
on_toggle_view: function( event ) {
var lid = $('cart_lid_details');
Element.remove( lid );
if ( this.cart_visible ) {
$('collapsed_cart_lid').appendChild( lid );
$('hide_cart_details').hide();
$('show_cart_details').show();
$('cart_items_container').style.overflow = 'hidden';
click_track.log_datapoint( { hide_seat_details:'' } );
var thisobj = this;
Effect.BlindUp( this.detailed_view, {
duration: .3,
afterFinish: this.move_detailed_view_offscreen.bind( this )
} );
}
else {
$('expanded_cart_lid').appendChild( lid );
$('show_cart_details').hide();
$('hide_cart_details').show();
this.ready_detailed_view();
Effect.BlindDown( this.detailed_view, {
duration: .3,
afterFinish: this.finish_display_details.bind( this )
} );
}
if ( event )
Event.stop( event );
},
update_cart_size: function() {
false;
$('cart_size').update( this.items.length );
if ( this.items.length ) {
$('cart_checkout_button').removeAttribute( 'disabled' );
$('cart_checkout_button').className = "button";
}
else {
$('cart_checkout_button').setAttribute( 'disabled', 'disabled' );
$('cart_checkout_button').className = "button-disabled";
}
},
update_cart_total: function() {
false;
var cart_total = 0;
var num_ga_sections = Object.keys(this.ga_sections).length;
this.ga_sections = {};
this.items.each( function( seat ) {
var selection = seat.seat_data.last_touched_seat_position.selection;
if ( selection.is_ga ) {
if ( !this.ga_sections[selection.section] )
this.ga_sections[selection.section] = [];
this.ga_sections[selection.section].push( seat );
}
cart_total += seat.tt.real_price_breakdown[selection.price_level].display_charges.total_price;
}, this );
if ( num_ga_sections != Object.keys(this.ga_sections).length )
this.isc.search_constraints.svl_regen_poly_script = true;
$('cart_total').update( this.currency.format( cart_total ) );
},
checkout: function() {
false;
this.cancel_current_dialog_chain();
click_track.log_datapoint({ num_seats_selected: this.items.length });
this.checkout_dialog_chain.start ( {
cart: this
} );
},
show_unavailable_seats_dialog: function ( selections ) {
var seat_list_border = this.seats_unavailable_dialog_module.$('seat_list_border');
var seat_list = this.seats_unavailable_dialog_module.$('seat_list');
var seat_list_area = this.seats_unavailable_dialog_module.$('seat_list_area');
var unavail_count = 0;
$('seats_unavailable_dialog').style.left = "-3000px";
$('seats_unavailable_dialog').show();
click_track.log_datapoint({ err_seat_became_unavail:'' });
while( seat_list.hasChildNodes() )
Element.remove( seat_list.firstChild );
seat_list_border.removeClassName( 'border_all' );
seat_list.removeClassName( 'pad10' );
for ( var s = 0 ; s < selections.length ; s ++ ) {
var selection = selections[s];
for ( var i = 0 ; i < this.items.length ; i ++ ) {
var seat = this.items[i];
if ( seat.seat_data.last_touched_seat_position ) {
var seat_details = seat.seat_data.last_touched_seat_position;
if ( seat_details.section == selection.section_name &&
seat_details.row == selection.row_name &&
seat_details.seat == selection.seat_name ) {
this.remove_item( seat );
var module = new Module( { dom: 'unavailable_seat_1' } );
module.$('section').update( seat_details.section );
module.$('row').update( seat_details.row );
module.$('seat').update( seat_details.seat );
module.attach( seat_list );
module.show();
unavail_count ++;
if ( unavail_count == 7 )
seat_list_area.style.height = Element.getHeight( seat_list_area ) + 10 + 'px';
if ( unavail_count > 7 ) {
seat_list_border.addClassName( 'border_all' );
seat_list.addClassName( 'pad10' );
}
}
}
}
}
this.complete_cart_change();
this.seats_unavailable_dialog.show( {
anchor_id: document.body,
popup_align: { x: 'center', y: 'center' }
} );
this.seats_unavailable_dialog_module.$('ok_button').focus();
},
force_seat_position: function( section, row, seat ) {
for ( var i = 0 ; i < this.items.length ; i ++ ) {
var item = this.items[i];
if ( item.seat_data.last_touched_seat_position ) {
var seat_details = item.seat_data.last_touched_seat_position;
seat_details.section = section;
seat_details.row = row;
seat_details.seat = seat;
}
}
},
on_show_seats_complete: function( event ) {
false;
this.update_in_progress = false;
var response = event.memo;
this.update_single_seat_msg();
if ( event.memo && response.seats_not_selectable && response.seats_not_selectable.length ) {
if ( this.current_dialog_chain ) {
false;
this.current_dialog_chain.cancel();
}
this.show_unavailable_seats_dialog( response.seats_not_selectable );
}
else if ( this.current_dialog_chain && this.current_dialog_chain == this.checkout_dialog_chain && !this.current_dialog_chain.context.do_not_continue ) {
false;
this.isc.seat_map.prevent_auto_refresh();
this.current_dialog_chain.next();
}
},
on_show_seats_error: function( event ) {
var response = event.memo;
false;
this.on_show_seats_complete( event );
},
send_cart_to_seatmap: function() {
false;
this.cart_version++;
var seats = [];
for ( var i = 0; i < this.items.length; i++ ) {
var seat = this.items[i];
var seat_info = seat.seat_data.last_touched_seat_position;
if ( seat_info ) {
seats.push ( {
row: seat_info.row,
begin_seat: seat_info.seat,
end_seat: seat_info.seat,
section: seat_info.section,
doNotZoom: true,
selectSeat: true,
range_member: this.cart_version
} );
}
}
this.update_in_progress = true;
this.isc.seat_map.call_iscapp( 'showSeats', { seats: seats } );
},
update_cart_ticket_types: function() {
false;
this.items.each( function( seat ) {
seat.display.update_ticket_type_dropdown();
} );
},
update_ticket_type_description: function( tt ) {
false;
for ( var price_level in tt.real_price_breakdown ) {
var id = 'cart_ticket_type_options_' + price_level + ':' + tt.ext_ticket_type;
var option = $(id);
var choice = option.down();
choice.down().update( tt.description );
choice.down().next().update( tt.real_price_breakdown[price_level].display_charges.formatted_total_price );
var select = option.down().next();
select.update( tt.description );
}
this.items.each( function( seat ) {
seat.display.update_ticket_type_dropdown( tt );
} );
},
update_cart: function() {
false;
this.update_cart_ticket_types();
this.update_cart_size();
this.update_cart_total();
this.update_item_container();
this.update_single_seat_msg();
if ( this.items.length ) {
if ( !this.cart_details_viewed )
this.on_toggle_view();
}
else if ( this.cart_visible )
this.on_toggle_view();
},
refresh_cart: function() {
this.isc.search_constraints.on_cart_changed();
this.send_cart_to_seatmap();
},
update_item_container: function() {
false;
if ( !this.cart_visible ) {
$('detailed_cart_view_popup').style.left = '-10000px';
$('detailed_cart_view_popup').show();
this.detailed_view.show();
}
if ( this.items.length ) {
$('cart_empty_display').hide();
$('cart_item_display').show();
if ( this.items.length > this.max_rows ) {
if ( $('cart_items_container').style.overflow != 'auto' ) {
var height = 0;
for ( var i = 0 ; i < this.max_rows ; i ++ ) {
var item = this.items[i];
height += Element.getHeight( item.display.$('seat_line_item') ) +
Element.getHeight( item.divider.$('seat_line_item_divider') );
}
$('cart_items_container').style.height = height + 'px';
$('cart_items_container').style.overflow = 'auto';
}
}
else {
$('cart_items_container').style.height = '';
$('cart_items_container').style.overflow = 'hidden';
}
}
else {
$('cart_empty_display').show();
$('cart_item_display').hide();
}
if ( this.cart_visible ) {
this.show_detailed_view();
}
else {
$('detailed_cart_view_popup').hide();
this.detailed_view.hide();
}
},
add_sorted_seat: function( seat ) {
if ( !seat.seat_data.last_touched_seat_position.selection.is_ga ) {
var position = seat.seat_data.last_touched_seat_position;
if ( !this.sorted_seats[position.section] )
this.sorted_seats[position.section] = {};
if ( !this.sorted_seats[position.section][position.row] )
this.sorted_seats[position.section][position.row] = {};
this.sorted_seats[position.section][position.row][position.seat] = seat;
}
},
remove_sorted_seat: function( seat ) {
if ( !seat.seat_data.last_touched_seat_position.selection.is_ga ) {
var position = seat.seat_data.last_touched_seat_position;
delete this.sorted_seats[position.section][position.row][position.seat];
if ( !$H(this.sorted_seats[position.section][position.row]).keys().length )
delete this.sorted_seats[position.section][position.row];
if ( !$H(this.sorted_seats[position.section]).keys().length )
delete this.sorted_seats[position.section];
}
},
add_seat_to_cart: function( seat_data, tt ) {
false;
var seat = {
seat_data: seat_data,
tt: tt
};
this.ticket_type_counts[tt.ext_ticket_type] ++;
seat.display = new ISCCartItem( {
seat: seat,
cart: this
} );
seat.divider = new Module( { dom: 'seat_line_item_divider' } );
seat.divider.attach( 'cart_items' );
if ( this.items.length )
seat.divider.show();
this.items.push( seat );
this.add_sorted_seat( seat );
seat.display.attach( 'cart_items' );
seat.display.show();
},
complete_cart_change: function() {
this.update_cart();
this.refresh_cart();
},
update_single_seat_msg: function() {
false;
if ( this.allow_single_seats )
return;
var seat_data = this.current_seat_data;
var leaves_a_single = false;
if ( seat_data && seat_data.intermediate_seat_selection ) {
if ( seat_data.intermediate_seat_selection.leaves_a_single )
leaves_a_single = true;
else {
if ( seat_data.intermediate_seat_selection.more_selections ) {
var more_selections = seat_data.intermediate_seat_selection.more_selections;
for ( var i = 0 ; i < more_selections.length ; i ++ ) {
if ( more_selections[i].leaves_a_single )
leaves_a_single = true;
}
}
}
}
if ( leaves_a_single ) {
$('isc_single_seat_msg').addClassName( 'highlight' );
$('isc_single_seat_msg').addClassName( 'bld' );
}
else
$('isc_single_seat_msg').className = 'left';
this.leaves_a_single = leaves_a_single;
},
selection_has_seat: function( touched_seat, selection ) {
if ( touched_seat.section == selection.section &&
touched_seat.row == selection.row &&
selection.seat_names.indexOf( touched_seat.seat ) > -1 )
return true;
return false;
},
get_selection_for_seat: function( seat_data ) {
var i;
var touched_seat = seat_data.last_touched_seat_position;
var selection = null;
if ( touched_seat ) {
if ( touched_seat.row && touched_seat.seat ) {
if ( seat_data.intermediate_seat_selection ) {
if ( this.selection_has_seat( touched_seat, seat_data.intermediate_seat_selection ) )
selection = seat_data.intermediate_seat_selection;
else {
if ( seat_data.intermediate_seat_selection.more_selections ) {
var more_selections = seat_data.intermediate_seat_selection.more_selections;
for ( i = 0 ; i < more_selections.length ; i ++ ) {
if ( this.selection_has_seat( touched_seat, more_selections[i] ) ) {
selection = more_selections[i];
break;
}
}
}
}
}
}
else {
if ( seat_data.intermediate_seat_selection.more_selections )
selection = seat_data.intermediate_seat_selection.more_selections.last();
else
selection = seat_data.intermediate_seat_selection;
}
if ( selection ) {
for ( i = 0; i < selection.seat_qualifier_bits.length; i++ )
selection.seat_qualifier_bits[i] &= this.unsold_qualifier_mask;
}
}
return selection;
},
get_selection_seat_data: function( selection, seat ) {
false;
for ( var i = 0 ; i < selection.seat_names.length ; i ++ ) {
if ( selection.seat_names[i] == seat.seat ) {
return {
seat_flags: selection.seat_flags[i],
sell_class: selection.sell_class,
seat_qualifier_bits: selection.seat_qualifier_bits[i],
seat_base_types: selection.seat_base_types[i],
price_level: selection.price_level,
secnames: selection.secnam_names,
selection: selection
};
}
}
return null;
},
update_selection: function( seat_data ) {
false;
this.current_seat_data = seat_data;
},
on_seat_selection: function( event ) {
var seat_data = event.memo;
false;
if ( this.update_in_progress ) {
this.update_selection( seat_data );
return;
}
if ( seat_data.last_touched_seat_position ) {
false;
var selection = this.get_selection_for_seat( seat_data );
if ( selection ) {
seat_data.last_touched_seat_position.selection = selection;
if ( selection.is_ga ) {
if ( selection.section.charAt(0) == '.' ) {
selection.largest_contig_count = this.isc.edp.event.ticket_limit;
selection.ga_secname = selection.section.substr( 1 );
var price_secnames =
this.isc.edp.event.get_secname_choices( 1,
this.isc.edp.event.secnames[selection.ga_secname].masks[1] );
selection.price_level = this.isc.edp.event.secnames[price_secnames[0]].price_level;
}
if ( selection.largest_contig_count > 0 ) {
false;
var ticket_types = this.get_ticket_types_for_seat( seat_data, { do_not_prefer: true } );
if ( ticket_types.length ) {
false;
this.seat_selection_dialog_chain.start ( {
seat_data: seat_data,
selection: selection,
ticket_types: ticket_types,
cart: this
} );
}
}
}
else {
this.update_selection( seat_data );
var selection_data = this.get_selection_seat_data( selection, seat_data.last_touched_seat_position );
seat_data.last_touched_seat_position = Object.extend( seat_data.last_touched_seat_position, selection_data );
var ticket_types = this.get_ticket_types_for_seat( seat_data );
false;
this.seat_selection_dialog_chain.start ( {
seat_data: seat_data,
selection: selection,
ticket_types: ticket_types,
cart: this
} );
}
}
else {
false;
this.update_selection( seat_data );
var touched_seat = seat_data.last_touched_seat_position;
for ( var i = 0 ; i < this.items.length; i ++ ) {
var seat = this.items[i];
if ( touched_seat.section == seat.seat_data.last_touched_seat_position.section &&
touched_seat.row == seat.seat_data.last_touched_seat_position.row &&
touched_seat.seat == seat.seat_data.last_touched_seat_position.seat ) {
this.remove_item( seat );
this.update_cart();
return;
}
}
}
}
},
get_seat_classes: function( seat_data, uq_values ) {
var seat_classes = [];
var selection = seat_data.last_touched_seat_position.selection;
var price_level = selection.price_level;
var i;
if ( typeof( uq_values ) == 'undefined' ) {
uq_values = [];
if ( selection.is_ga ) {
for ( i = 0 ; i < selection.seat_qualifier_bits.length ; i ++ )
uq_values.push( selection.seat_qualifier_bits[i] );
}
else
uq_values.push( seat_data.last_touched_seat_position.seat_qualifier_bits );
}
if ( this.isc.search_constraints.seat_ticket_types[price_level] )
for ( i = 0 ; i < uq_values.length ; i ++ ) {
var uq_value = uq_values[i];
if ( this.isc.search_constraints.seat_ticket_types[price_level][uq_value] )
seat_classes.push( this.isc.search_constraints.seat_ticket_types[price_level][uq_value] );
}
return seat_classes;
},
get_ticket_types_for_seat: function( seat_data, options ) {
false;
if ( typeof(options) == 'undefined' )
options = {};
var i;
var seat_classes = this.get_seat_classes( seat_data );
if ( seat_classes.length ) {
var ticket_types = {};
for ( i = 0 ; i < seat_classes.length ; i ++ ) {
var seat_class = seat_classes[i];
for ( var t = 0 ; t < seat_class.ticket_types.length ; t ++ ) {
var tt = seat_class.ticket_types[t];
if ( !ticket_types[tt.ext_ticket_type] )
ticket_types[tt.ext_ticket_type] = tt;
}
}
var preferred_tt = seat_classes[0].preferred;
var sellable_ticket_types = [];
var unlocked_tts = this.isc.search_constraints.get_unlocked_ticket_types();
for ( i = 0 ; i < unlocked_tts.length ; i ++ ) {
var tt = unlocked_tts[i];
if ( ticket_types[tt.ext_ticket_type] ) {
if ( !options.do_not_prefer && tt == preferred_tt )
sellable_ticket_types.unshift( tt );
else
sellable_ticket_types.push( tt );
}
}
if ( sellable_ticket_types.length )
return sellable_ticket_types;
else
return $H(ticket_types).values();
}
else
return [];
},
disable_seatmap_access: function() {
$('FlashOpaquePopupLayer').show();
},
enable_seatmap_access: function() {
$('FlashOpaquePopupLayer').hide();
},
remove_all: function() {
this.items.each( function( seat ) {
this.remove_item( seat );
}, this );
this.complete_cart_change();
},
on_remove_all: function() {
this.remove_all();
this.remove_all_dialog.hide();
},
on_remove_item: function( seat ) {
this.cancel_current_dialog_chain();
this.remove_item( seat );
if ( this.items.length && this.items[0].divider.visible() )
this.items[0].divider.hide();
this.complete_cart_change();
},
remove_item: function( seat ) {
$('cart_items_container').style.overflow = 'hidden';
seat.display.detach();
seat.divider.detach();
this.items = this.items.without( seat );
if ( !this.items.length )
delete this.current_seat_data;
seat.display.seat_class.selection = seat.display.seat_class.selection.without( seat.display );
this.remove_sorted_seat( seat );
this.ticket_type_counts[seat.tt.ext_ticket_type] --;
}
} );
ISCGAItem = Class.create( Module, {
tlog: TMDebug.gen_tlog( 'isc-ga-item' ),
initialize: function( $super, tt, seat_data, cart ) {
$super( { dom: 'cart_ga_ticket_type' } );
this.tt = tt;
this.seat_data = seat_data;
this.$('description').innerHTML = tt.limit_description;
var price_level = seat_data.last_touched_seat_position.selection.price_level;
var display_charges = tt.real_price_breakdown[price_level].display_charges;
this.$('total_price').innerHTML = display_charges.formatted_total_price;
if ( display_charges.sum_fees_and_taxes+0 > 0 ) {
this.$('face_value').innerHTML = display_charges.formatted_price;
this.$('sum_fees_and_taxes').innerHTML = display_charges.formatted_sum_fees_and_taxes;
this.$('fees').hide();
this.$('taxes').hide();
this.$('fees_taxes').hide();
if ( display_charges.has_fees && display_charges.has_taxes )
this.$('fees_taxes').show();
else if ( display_charges.has_fees )
this.$('fees').show();
else if ( display_charges.has_taxes )
this.$('taxes').show();
this.$('price_breakdown').show();
}
else
this.$('price_breakdown').hide();
this.update_quantity_options();
var select = this.$('quantity');
select.options[select.length] = new Option( "__", '' );
this.quantity_dropdown = new EDPWidget( this.$('quantity'), { rows: 10, zIndex: 150 } );
select.options.length = select.options.length - 1;
if ( cart.ticket_type_counts[tt.ext_ticket_type] == tt.quantity_limits.max ) {
this.$('limit_reached').show();
this.quantity_dropdown.disable();
}
},
get_quantity: function() {
var select = this.$('quantity');
false;
return parseInt( select.options[select.selectedIndex].value );
},
update_quantity_options: function( limits ) {
var select = this.$('quantity');
var quantity = limits || this.tt.quantity_limits;
var si = select.selectedIndex;
if ( !si || si < 0 )
si = 0;
select.options.length = 0;
var inc = quantity.inc || 1;
for( var i = 0 ; i <= quantity.max ; i ++ )
if ( !i || i >= quantity.min && !(i % quantity.inc) )
select.options[select.options.length] = new Option( i, i );
select.selectedIndex = si;
}
} );
ISCTTSItem = Class.create( Module, {
tlog: TMDebug.gen_tlog( 'isc-tts-item' ),
initialize: function( $super, cart, seat_data, tt ) {
$super( { dom: 'tts_item' } );
this.$('description').innerHTML = tt.limit_description;
var price_level = seat_data.last_touched_seat_position.price_level;
var display_charges = tt.real_price_breakdown[price_level].display_charges;
this.$('total_price').innerHTML = display_charges.formatted_total_price;
if ( display_charges.sum_fees_and_taxes+0 > 0 ) {
this.$('face_value').innerHTML = display_charges.formatted_price;
this.$('sum_fees_and_taxes').innerHTML = display_charges.formatted_sum_fees_and_taxes;
this.$('fees').hide();
this.$('taxes').hide();
this.$('fees_taxes').hide();
if ( display_charges.has_fees && display_charges.has_taxes )
this.$('fees_taxes').show();
else if ( display_charges.has_fees )
this.$('fees').show();
else if ( display_charges.has_taxes )
this.$('taxes').show();
this.$('price_breakdown').show();
}
else
this.$('price_breakdown').hide();
if ( cart.ticket_type_counts[tt.ext_ticket_type] == tt.quantity_limits.max ) {
this.$('select').setAttribute( 'disabled', 'disabled' );
this.$('select').className = "button-disabled";
this.$('limit_reached').show();
}
}
} );
ISCCartItem = Class.create( Module, {
tlog: TMDebug.gen_tlog( 'isc-cart-item' ),
initialize: function( $super, data ) {
$super( { dom: 'seat_line_item' } );
this.seat = data.seat;
this.cart = data.cart;
var seat_info;
if ( this.seat.seat_data.last_touched_seat_position.selection.is_ga )
seat_info = this.seat.seat_data.last_touched_seat_position.selection;
else
seat_info = this.seat.seat_data.last_touched_seat_position;
this.price_level = seat_info.price_level;
false;
this.$('ticket_type').update( this.seat.tt.description );
this.$('price').update( this.seat.tt.real_price_breakdown[this.price_level].display_charges.formatted_total_price );
this.$('section').update( seat_info.section );
if ( !seat_info.is_ga ) {
this.$('row').update( seat_info.row );
this.$('seat').update( seat_info.seat );
}
this.tt_dropdown = new TicketTypeWidget( this.$('ticket_type_select'), {
options: 'cart_ticket_type_options_' + this.price_level,
ellipsis: true,
rows: 10,
zIndex: 150,
width: 245
} ),
Event.observe( this.tt_dropdown.dropdown, 'dropdown:change', this.on_ticket_type_change.bind( this ) );
Event.observe( this.$('remove'), 'click', this.on_remove.bind( this ) );
this.set_seat_class();
},
set_seat_class: function() {
var uq_value = this.seat.tt.unsold_qualifier_value;
var seat_class = this.cart.isc.search_constraints.seat_ticket_types[this.price_level][uq_value];
seat_class.selection.push( this );
if ( !this.seat.seat_data.last_touched_seat_position.selection.is_ga )
seat_class.changed.selection = true;
this.seat_class = seat_class;
},
on_ticket_type_change: function() {
false;
var select = this.$('ticket_type_select');
var ext_tt = select.options[select.selectedIndex].value;
var new_tt = this.cart.isc.edp.event.ticket_type_map[ext_tt];
this.$('price').update( new_tt.real_price_breakdown[this.price_level].display_charges.formatted_total_price );
this.cart.ticket_type_counts[this.seat.tt.ext_ticket_type] --;
this.cart.ticket_type_counts[new_tt.ext_ticket_type] ++;
this.seat.tt = new_tt;
this.$('ticket_type').update( this.seat.tt.description );
this.cart.update_cart_ticket_types();
this.cart.update_cart_total();
this.seat_class.selection = this.seat_class.selection.without( this );
this.set_seat_class();
this.cart.cancel_current_dialog_chain();
this.cart.refresh_cart();
},
show_single_ticket_type: function() {
this.tt_dropdown.hide();
this.$('ticket_type_column').style.paddingTop = '6px';
this.$('ticket_type_column').style.paddingBottom = '5px';
this.$('ticket_type').show();
},
show_ticket_type_dropdown: function() {
this.$('ticket_type').hide();
this.$('ticket_type_column').style.paddingTop = '2px';
this.$('ticket_type_column').style.paddingBottom = '2px';
this.tt_dropdown.show();
},
update_ticket_type_dropdown: function( updated_tt ) {
this.ticket_types = this.cart.get_ticket_types_for_seat( this.seat.seat_data, { do_not_prefer: true } );
var si = 0;
var select = this.$('ticket_type_select');
select.length = 0;
for ( var i = 0 ; i < this.ticket_types.length ; i ++ ) {
var tt = this.ticket_types[i];
if ( tt == this.seat.tt )
si = select.options.length;
else if ( this.cart.ticket_type_counts[tt.ext_ticket_type] == tt.quantity_limits.max )
continue;
var option = new Option( tt.description, tt.ext_ticket_type );
select.options[select.options.length] = option;
if ( typeof( updated_tt ) != 'undefined' && tt == updated_tt ) {
var id = 'cart_ticket_type_options_' + this.price_level + ':' + tt.ext_ticket_type;
var element = $(id);
var choice = element.down();
var selected = element.down().next();
this.tt_dropdown.set_option( option, choice, selected );
}
}
if ( select.length == 1 )
this.show_single_ticket_type();
else {
this.show_ticket_type_dropdown();
select.selectedIndex = si;
this.tt_dropdown.update_dropdown();
}
},
on_remove: function( event ) {
this.cart.on_remove_item( this.seat );
Event.stop( event );
}
} );

