var loadedcolor; var unloadedcolor; var bordercolor; var barheight; var barwidth; var waitTime; var ie4; var blocksize; var loaded; var PBouter; var PBdone; var PBbckgnd; var Pid = 0; var max = "N"; var urllnk; var action = function() { LoginMethod(31); }
var seatsel = ""; function decrCount() {
    loaded--; if (loaded == 0) { clearInterval(Pid); setTimeout('hidebar()', 95); }
    resizeEl(PBdone, 0, blocksize * loaded, barheight - 2, 0);
}
function hidebar() { clearInterval(Pid); window.status = ''; action(); }
function findlayer(name, doc) {
    var i, layer; for (i = 0; i < doc.layers.length; i++) {
        layer = doc.layers[i]; if (layer.name == name) return layer; if (layer.document.layers.length > 0)
            if ((layer = findlayer(name, layer.document)) != null)
            return layer;
    }
    return null;
}
function progressBarInit() {
    loadedcolor = '#FD9100'; unloadedcolor = 'Black'; bordercolor = 'black'; barheight = 5; barwidth = 240; if ($get("ctl00_Content_ScreenLayout1_timeout")) { var seattimeout = $get("ctl00_Content_ScreenLayout1_timeout").value; if (seattimeout != null) { waitTime = seattimeout * 60; } }
    if ($get("ctl00_Content_TestFoodbeverages1_foodtimeout")) { var foodtimeout = $get("ctl00_Content_TestFoodbeverages1_foodtimeout").value; if (foodtimeout != null) { waitTime = $get("ctl00_Content_TestFoodbeverages1_foodtimeout").value; } }
    if ($get("ctl00_Content_Payment1_paymenttimeout")) { var paymenttimeout = $get("ctl00_Content_Payment1_paymenttimeout"); if (paymenttimeout != null) { waitTime = $get("ctl00_Content_Payment1_paymenttimeout").value; } }
    ie4 = (document.all) ? true : false; blocksize = (barwidth - 2) / waitTime / 10; loaded = waitTime * 10; setTimer(waitTime); PBouter = $get('PBouter'); PBdone = $get('PBdone'); resizeEl(PBdone, 0, 0, barheight - 2, 0); PBouter.style.visibility = "visible"; Pid = setInterval('decrCount()', 100);
}
function resizeEl(id, t, r, b, l) { id.style.width = r + 'px'; }
function toMinuteAndSecond(x) { return addZero(Math.floor(x / 60)) + ":" + addZero(x % 60); }
function setTimer(remain) {
    (function countdown() {
        display(toMinuteAndSecond(remain)); (remain -= 1) >= 0 && setTimeout(arguments.callee, 1000); var timeleft = $get("ctl00_Content_ScreenLayout1_timeleft"); if (timeleft != null) { $get("ctl00_Content_ScreenLayout1_timeleft").value = remain; }
        var paytimeleft = $get("ctl00_Content_TestFoodbeverages1_paymenttimeleft"); if (paytimeleft != null) { $get("ctl00_Content_TestFoodbeverages1_paymenttimeleft").value = remain; } 
    })();
}
function display(re) {
    var foodtime = $get("ctl00_Content_TestFoodbeverages1_lbl_timer"); var seatmdltime = $get("ctl00_Content_ScreenLayout1_lbl_timer"); var paymentmdltime = $get("ctl00_Content_Payment1_lbl_timer"); if (foodtime != null) { $get("ctl00_Content_TestFoodbeverages1_lbl_timer").innerHTML = re; }
    if (seatmdltime != null) { $get("ctl00_Content_ScreenLayout1_lbl_timer").innerHTML = re; }
    if (paymentmdltime != null) { $get("ctl00_Content_Payment1_lbl_timer").innerHTML = re; } 
}
function addZero(vNumber) { return ((vNumber < 10) ? "0" : "") + vNumber }
function ReceiveServerData(arg, context)
{ $get('Grid').innerHTML = arg; }
function Avoidpost(str)
{ CallServer(str, ''); }
function lnkremove(item)
{ item = item + "*remove"; CallServer(item, ''); }
function dropchange(itemname, quantity)
{ itemname = itemname + "*" + quantity + "*change"; CallServer(itemname, ''); }
function dropchange2(itemname, quantity, val) {
    if (val == "plus") { itemname = itemname + "*" + quantity + "*changeplus"; CallServer(itemname, ''); }
    else { itemname = itemname + "*" + quantity + "*changeminus"; CallServer(itemname, ''); } 
}
function Booknow(par) {
    if (FinalSelectionval != "") {
        if (par == "0" && identifyticketsel == "1") {
            st = FinalSelectionval.split('|'); if (st[9] == "A") { LoginMethod(21); }
            else
            { LoginMethod(22); } 
        }
        else {
            if (identifyticketsel != "1" && par == "0")
            { LoginMethod(20); } 
        } 
    }
    else {
        if (identifyticketsel != "1" && par == "0") {
            if (stagesel == "2") { LoginMethod(20); }
            else { LoginMethod(19); } 
        } 
    } 
}
function callme() {
    if (FinalSelectionval != "") {
        st = FinalSelectionval.split('|'); if (st[9] == "A") { LoginMethod(21); }
        else { var dt = currentdispdate; finaldate = dt[1].split(' '); selecteddatetime = finaldate[1] + " " + finaldate[2] + ", " + st[11]; FinalSelectionval = FinalSelectionval + "|" + selecteddatetime; ShowLoginPopup(st[12], st[13] + "No", st[7] + " & " + st[2], selecteddatetime); } 
    }
    else { ShowLoginPopup('Please Select', 'Please Select', 'Please Select', 'Please Select'); } 
}
function Showforgotpass() {
    var t = new String(); t = $get("ctl00_Menuright1_Rmenuforgotpassword").innerHTML; if (t == "Forgot Password") { var x = $find('forgotpassmdl'); x.show(); }
    else {
        showprogress2(); ur = window.location.pathname.split('/'); if (ur[1] == "Seats.aspx" || ur[1] == "Foodbeverages.aspx" || ur[1] == "Payment.aspx") { var w = $find('profchangemdl'); if (w != null) { urllnk = "orderhistory"; w.show(); } }
        else { window.location.href = "Orderhistory.aspx"; } 
    } 
}
function popoutover(sourc, id) { $get(id).src = sourc; }
function seatcallme() { var s = $get("ctl00_Menuright1_menuseathidden").value; return s; }
function Showcontact() {
    var t = new String(); t = $get("ctl00_Menuright1_RMenudemo").innerHTML; ur = window.location.pathname.split('/'); if (t == "Contact") {
        if (ur[1] == "Seats.aspx" || ur[1] == "Foodbeverages.aspx" || ur[1] == "Payment.aspx") { var w = $find('profchangemdl'); if (w != null) { urllnk = "contact"; w.show(); } }
        else { window.location.href = "Contact.aspx"; } 
    }
    else {
        if (ur[1] == "Seats.aspx" || ur[1] == "Foodbeverages.aspx" || ur[1] == "Payment.aspx") { var w = $find('profchangemdl'); if (w != null) { urllnk = "faq"; w.show(); } }
        else { window.open("FAQ.aspx"); } 
    }
}
function Invalidfuel() { var s = $find('invalidfuelmdl'); if (s != null) { s.hide(); } }
function Nobalance() { var s = $find('nobalancemdl'); if (s != null) { s.hide(); } }
function foodtotcheck() { var d = $get("ctl00_Content_TestFoodbeverages1_foodhiddentot").innerHTML; }
function Commentsent() { var s = $find('commentmdl'); if (s != null) { s.hide(); } }
function Contigious() { var x = $find('contigiousmdl'); if (x != null) { x.show(); } }
function showprogress() { pLoad.popOut(); setTimeout('closeload()', 120000); }
function showprogress2() {
    var p = $find('modalload')
    if (p != null) { p.show(); setTimeout('closeload()', 1000); } 
}
function showprogress1() {
    var seatremain = parseInt($get("ctl00_Content_ScreenLayout1_L_NoSeats").value); if (seatremain == 0) {
        var p = $find('modalload')
        if (p != null) { p.show(); setTimeout('closeload()', 60000); } 
    } 
}
function closeload() { pLoad.popIn(); }
function hidetandc() {
    var w = $find('tandcmdl'); if (w != null) { w.hide(); }
    var q = $find('tandcmdl2'); if (q != null) { q.hide(); } 
}
function checkurl() {
    if (urllnk == "profile") { window.location.href = "profile.aspx"; }
    else if (urllnk == "orderhistory") { window.location.href = "Orderhistory.aspx"; }
    else if (urllnk = "contact") { window.location.href = "Contact.aspx"; } 
}
function privacy() { window.open("Privacy.aspx"); }
function disclaimer() { window.open("Disclaimer.aspx"); }