
EDPClassic = Class.create( Module, {
initialize: function( $super, config ) {
this.task_manager = new TaskManager();
this.edp = config.edp;
this.edp.classic = this;
this.v = config.v;
this.action = config.action;
$super( 'edp_classic_display', { sub_modules: [ this.edp.venue_info ] } );
var submit = new Module( 'purchase_submit_single' );
submit.attach( 'event_submit_box_' + this.edp.event.event_id );
submit.show();
$('event_reset_link').observe( 'click', this.on_reset.bind( this ) );
$('find_tickets_button').observe( 'click', this.on_submit.bind( this ) );
},
add_mastersearch: function ( mastersearch ) {
this.mastersearch = mastersearch;
this.seat_selection.mastersearch = mastersearch;
mastersearch.attach( 'mastersearch_module' );
},
add_task: function( title, id ) {
var task = {
title: title,
task: new Task( this.task_manager )
};
task.div = $(id);
task.task.add_div( task.div );
return task;
},
set_active_task: function( task ) {
task.task.select();
$('purchase_task_title').innerHTML = task.title;
},
validate: function() {
return this.seat_selection.validate();
},
on_submit: function() {
if ( !this.validate() )
return;
var form = new Element( 'form', { method: "POST", action: this.action } );
form.appendChild( new Element( 'input', { type: 'hidden', name: 'v', value: this.v } ) );
if ( this.edp.isc && Element.visible( $('edp_mode_selector') ) ) {
form.appendChild( new Element( 'input', { type: 'hidden', name: 'from_isc', value: 1 } ) );
}
this.seat_selection.add_form_values( form );
if ( this.mastersearch )
this.mastersearch.add_form_values( form );
document.body.appendChild( form );
form.submit();
},
on_reset: function() {
this.seat_selection.reset();
if ( this.mastersearch )
this.mastersearch.reset();
},
mode_init: function() {
if ( this.seat_selection ) {
this.seat_selection.setup();
}
},
switch_to_ada: function () {
this.ada.show();
},
show: function ( $super ) {
var after_element;
if ( this.gift_card )
after_element = this.gift_card.doms.last();
else {
this.edp.venue_info.insert( 'classic_right_section', 'top' );
this.edp.venue_info.$('address_break').update( ', ' );
this.edp.venue_info.$('venue_name_lid').show();
if ( this.edp.venue_info.seating_chart ) {
this.edp.venue_info.$('venue_seating_chart').show();
this.edp.venue_info.$('venue_seating_chart_divider').show();
}
var temp = this.edp.venue_info.doms.first().down('.neutral-venue');
if (temp) {
temp.removeClassName('venue-bg');
}
after_element = this.edp.venue_info.doms.last();
}
if ( this.edp.merchandise[1] ) {
this.edp.merchandise[1].insert( $('classic_right_section'), 'top' ).show();
var temp = this.edp.merchandise[1].doms.first().down('.merchant');
if (temp) {
temp.removeClassName('venue-bg');
}
}
if ( this.edp.merchandise[3] ) {
this.edp.merchandise[3].insert( after_element, 'after' ).show();
var temp = this.edp.merchandise[3].doms.first().down('.merchant');
if (temp) {
temp.removeClassName('venue-bg');
}
}
if ( this.edp.merchandise[2] ) {
this.edp.merchandise[2].insert( after_element, 'after' ).show();
var temp = this.edp.merchandise[2].doms.first().down('.merchant');
if (temp) {
temp.removeClassName('venue-bg');
}
}
$super();
$('edp_switch_isc').show();
},
hide: function ( $super ) {
$super();
this.edp.venue_info.$('venue_name_lid').hide();
this.edp.venue_info.$('venue_seating_chart').hide();
this.edp.venue_info.$('venue_seating_chart_divider').hide();
Popup.hide_group("edp");
$('edp_switch_isc').hide();
if ( this.ada && this.ada.is_visible )
this.ada.hide();
}
} );

