function Booking_system() {
// initialize the member function references
this.create_booking_system = create_booking_system;
this.display_booking_system = display_booking_system;
this.close_booking_system=close_booking_system;
this.get_page_scroll=get_page_scroll;
this.get_page_height=get_page_height;
pay = new Pay();
calendar = new Calendar(pay);
booking_form = new Booking_form(calendar);
price = new Price();
contact = new Contact();
//define methods
function create_booking_system() {
$("#booking_system").click(function(){
$("#booking_system").css('visibility', 'hidden');
display_booking_system();
});
}
function display_booking_system() {
$('
').attr('id', 'overlay').attr('class', 'overlay').appendTo('body');
var y_scroll = get_page_scroll();
if (y_scroll != 0) {
var page_height = get_page_height();
var overlay_height = page_height+y_scroll;
$('#overlay').css('height', overlay_height);
}
$('#overlay').fadeIn("medium",function(){
$('
![]()
').attr('id', 'booking_system_loader').attr('src', 'http://www.rocklandsboulders.com/images/booking_system_loader.gif').attr('style','left:525px;top:230px;position:absolute;z-index:100;').appendTo('#main-container');
$('
').attr('id', 'tabs').attr('class', 'tabs').appendTo('#main-container');
$('#tabs').html('
');
$('
').attr('id', 'all-payment-info').appendTo('#fragment-3');
$('#all-payment-info').append('
PayPal
');
$('
').attr('id', 'close-booking-system').attr('style', '').prependTo('#tabs');
$('#close-booking-system').html('
close');
close_booking_system();
$('
').attr('id', 'check_progress').attr('style', 'background-color:#fff;color:#000;position:absolute;z-index:200;top:0;display:none;').appendTo('main-container');
booking_form.get_booking_form_info();
price.create_price_tab();
contact.create_contact_tab();
});
}
function close_booking_system() {
$('#close_booking_system').click(function() {
$('#tabs').fadeOut('slow', function() {
$('#overlay').fadeOut('slow', function() {
$('#overlay').remove();
$('#tabs').remove();
$('#booking_system').css('visibility', 'visible');
});
});
});
}
function get_page_scroll() {
var yScroll;
if (self.pageYOffset) {
yScroll = self.pageYOffset;
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
yScroll = document.documentElement.scrollTop;
} else if (document.body) {// all other Explorers
yScroll = document.body.scrollTop;
}
return yScroll;
};
function get_page_height() {
var windowHeight;
if (self.innerHeight) { // all except Explorer
windowHeight = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowHeight = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowHeight = document.body.clientHeight;
}
return windowHeight;
}
}