﻿function OpenBookingMessage() {
    var m = 'You will now be transferred to our secure Express Book online booking system.';
    alert(m);
}

function OpenPopup(url, windowname, showstatus, popupleft, popuptop, popupwidth, popupheight) {

    if (screen.width && screen.height) {
        if (screen.width - 50 < popupwidth) {
            popupwidth = screen.width - 50;
        }
        if (screen.height - 110 < popupheight) {
            popupheight = screen.height - 110;
        }
    }
    
    var properties = 'toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=' + popupleft.toString() + ',top=' + popuptop.toString() + ',status=' + showstatus + ',width=' + popupwidth.toString() + ', height=' + popupheight.toString() + ',titlebar=no,directories=no';
    Popup = window.open(url, windowname, properties);
    if (Popup) {
        // All good
    } else {
        alert('If the booking screen doesn\'t appear, please ensure that your browser is not blocking pop-up windows.');
    }
}

function OpenBookingPopup(url) {
//    // If Booking system is down block access here
//    alert('Online booking is currently unavailable.\nPlease try again after the 25th March 2010.');
//    return;

    OpenBookingMessage();
    OpenPopup(url, 'NewBooking', 'yes', 0, 0, 1200, 850);
}