
ISCSinglePrice = Class.create( ISCPriceDisplay, {
tlog: function () {},
initialize: function( data ) {
this.search_constraints = data.search_constraints;
this.search_constraints.single_price = this;
},
setup: function() {
this.module = new Module( 'single_price_display_1' );
this.module.show();
this.setup_display();
new Popup( 'single_price_info_popup', {
close_id: 'single_price_close_box',
zIndex: 105,
links: [ {
group: 'edp',
link_id: this.module.$('info_link'),
toggle: true,
anchor_align: { x:  1, y: -1 },
popup_align:  { x: -1, y: -1 },
offset:       { x: 5, y: 0 }
} ]
} );
},
on_ticket_type_unlock: function( tt ) {
if ( tt == this.preferred ) {
var display_charges = tt.real_price_breakdown[this.price_level].display_charges;
this.update_price_display( display_charges );
}
},
update_price_display: function ( display_charges ) {
this.module.$('total_price').update( display_charges.formatted_total_price );
if ( display_charges.sum_fees_and_taxes+0 > 0 ) {
this.module.$('face_value').innerHTML = display_charges.formatted_price;
this.module.$('sum_fees_and_taxes').innerHTML = display_charges.formatted_sum_fees_and_taxes;
this.module.$('fees').hide();
this.module.$('taxes').hide();
this.module.$('fees_taxes').hide();
if ( display_charges.has_fees && display_charges.has_taxes )
this.module.$('fees_taxes').show();
else if ( display_charges.has_fees )
this.module.$('fees').show();
else if ( display_charges.has_taxes )
this.module.$('taxes').show();
this.module.$('price_breakdown').show();
}
else
this.module.$('price_breakdown').hide();
},
setup_display: function() {
var enabled_tts = this.search_constraints.isc.edp.event.get_enabled_ticket_types();
if ( enabled_tts.length > 1 )
this.module.$('standard_admissio_msg').show();
var preferred = this.search_constraints.preferred;
var price_level = $H(preferred.price_breakdown).keys()[0];
this.preferred = preferred;
this.price_level = price_level;
var display_charges = preferred.price_breakdown[price_level].display_charges;
this.update_price_display( display_charges );
}
} );

