﻿//fix for safari bug, top is offset by 10 on load then less on resize
var safoffset = 10
var HorzMenu = 1
var TheStepOn = 0
function DisplayMainMenu() {
    //OK First thing, check what browser we have
    var D6 = window, Y7 = document;
    function B8() {
        this.ver = navigator.appVersion;
        this.agent = navigator.userAgent;
        this.dom = Y7.getElementById ? 1 : 0;
        this.opera5 = this.agent.indexOf("Opera 5") > -1;
        this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom && !this.opera5) ? 1 : 0;
        this.ie6 = (this.ver.indexOf("MSIE 6") > -1 && this.dom && !this.opera5) ? 1 : 0;
        this.ie7 = (this.ver.indexOf("MSIE 7") > -1 && this.dom && !this.opera5) ? 1 : 0;
        this.ie8 = (this.ver.indexOf("MSIE 8") > -1 && this.dom && !this.opera5) ? 1 : 0;
        this.ie9 = (this.ver.indexOf("MSIE 9") > -1 && this.dom && !this.opera5) ? 1 : 0;
        this.ie4 = (Y7.all && !this.dom && !this.opera5) ? 1 : 0;
        this.safari = this.agent.indexOf("safari") > -1;
        this.ie = this.ie4 || this.ie5 || this.ie6 || this.ie7 || this.ie8 || this.ie9;
        this.ff = this.agent.indexOf("Firefox") > -1;
        this.mac = this.agent.indexOf("Mac") > -1;
        this.ns6 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;
        this.ns4 = (Y7.layers && !this.dom) ? 1 : 0;
        this.bw = (this.ie6 || this.ff || this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
        return this
    }

    //Next Build our vars
    mt = document.getElementById("NavBar").offsetTop
    ml = document.getElementById("NavBar").offsetLeft;
    m = new Array(); n = new Array(); s = new Array(); sw = new Array(); su = new Array(); st = new Array(); wm = new Array()
    z = 0;
    b = 0;
    g = "";
    w = 75;
    mh = document.getElementById("NavBar").offsetHeight;
    mw = ml - w;
    mt = mt - z;
    bw = new B8();

    //Make Browser Safe adjustments to the vars
    if (bw.opera5 || bw.ns6) { b = 2 };
    if (bw.ie) { g = " style='width: 100%'" } else { z = 6 }
    if (bw.safari) { mt += safoffset; safoffset = 1; ml += 8 }
    if (bw.ff) { mt += 0 }


    //Create Strings for attaching menu items
    p = "<a class='mi2'" + g + " href='";
    q = "' title='";
    r = "\"; return true' onmouseout='window.status=\"\"; return true'>";
    t = "</a>";
    a = "' onmouseover='window.status=\"";
    v = "<div class=sp2></div>"

    //Menu Details
    m[0] = 'Home'; n[0] = '.'; sw[0] = 85; su[0] = 'Home'; st[0] = ""; wm[0] = .120; s[0] = "";
    if (HasTickets == true) {
        m[1] = 'Attractions'; n[1] = 'Attractions.ashx'; sw[1] = 85; su[1] = 'Attractions'; st[1] = ""; wm[1] = .120; s[1] = "";
    } else {
        m[1] = '&nbsp;'; n[1] = '#'; sw[1] = 85; su[1] = ''; st[1] = ""; wm[1] = .120; s[1] = "";
    }
    if (HasMerch == true) {
        m[2] = 'Merchandise'; n[2] = 'MerchandiseSelection.aspx'; sw[2] = 85; su[2] = 'Merchandise'; st[2] = ""; wm[2] = .120; s[2] = "";
    } else {
        m[2] = '&nbsp;'; n[2] = '#'; sw[2] = 85; su[2] = ''; st[2] = ""; wm[2] = .120; s[2] = "";
    }
    if (HasPackage == true) {
        m[3] = 'Packages'; n[3] = 'PackageSelection.aspx'; sw[3] = 85; su[3] = 'Packages'; st[3] = ""; wm[3] = .120; s[3] = "";
    } else {
        m[3] = '&nbsp;'; n[3] = '#'; sw[3] = 85; su[3] = ''; st[3] = ""; wm[3] = .120; s[3] = "";
    }

    if (CustomerID > 2) {
        m[4] = 'My Profile'; n[4] = 'Profile.aspx'; sw[4] = 85; su[4] = 'Profile'; st[4] = ""; wm[4] = .120; s[4] = "";
    }
    else {
        m[4] = '&nbsp;'; n[4] = '#'; sw[4] = 85; su[4] = 'Profile'; st[4] = ""; wm[4] = .120; s[4] = "";
    }
    if (CustomerID > 2) {
        m[5] = 'My History'; n[5] = 'History.aspx'; sw[5] = 85; su[5] = 'History'; st[5] = ""; wm[5] = .120; s[5] = "";
    }
    else {
        m[5] = '&nbsp;'; n[5] = '#'; sw[5] = 85; su[5] = 'History'; st[5] = ""; wm[5] = .120; s[5] = "";
    }

    m[6] = '<span class="Steps">&nbsp;&nbsp;STEP&nbsp;&nbsp;<span id="Step1">&nbsp;1&nbsp;</span>&nbsp;<span id="Step2">&nbsp;2&nbsp;</span>&nbsp;<span id="Step3">&nbsp;3&nbsp;</span>&nbsp;<span id="Step4">&nbsp;4&nbsp;</span>&nbsp;&nbsp;</span>';
    n[6] = '#'; sw[6] = 125; su[6] = ' '; st[6] = "&nbsp;"; wm[6] = .160; s[6] = "";
    if (CustomerID > 2) {
        m[7] = 'Log Out'; n[7] = 'logout.aspx'; sw[7] = 75; su[7] = 'Log Out'; st[7] = ""; wm[7] = .120; s[7] = "";
    }
    else {
        m[7] = 'Log In'; n[7] = 'Login.aspx'; sw[7] = 75; su[7] = 'Log In'; st[7] = ""; wm[7] = .120; s[7] = "";
    }
    //Set the menu item length
    ma = m.length

    //Fix to look up any padding
    document.getElementById("NavBar").innerHTML = '<div id="PaddingTest" style="">.</div>'
    if (bw.ff) {
        ml += (document.getElementById("PaddingTest").offsetLeft - ml)
    } else {
        ml += document.getElementById("PaddingTest").offsetLeft
    }

    //Clear out any old Menu code
    document.getElementById("NavBar").innerHTML = ''

    //Determine its orientation
    NavBarHeight = document.getElementById("NavBar").offsetHeight;
    NavBarWidth = document.getElementById("NavBar").offsetWidth;
    if (NavBarHeight == 0) { try { NavBarHeight = NavHeight } catch (e) { NavBarHeight = 23 } }
    if (NavBarWidth == 0) { try { NavBarWidth = NavWidth } catch (e) { NavBarWidth = 750 } }
    if (NavBarHeight > 100) { HorzMenu = 0; mh = 25 }

    //Fix for Expanding Main bodys in style sheets
    //if(NavBarWidth>TotalWidth){
    //wm[7] +=  NavBarWidth-TotalWidth
    //if(bw.ie){wm[7] -=5}
    //}
    for (i = 0; i < ma; i++) {
        if (HorzMenu == 0) { wm[i] = NavBarWidth }
        else { wm[i] = wm[i] * NavBarWidth }
    }

    //Build Menus
    if (HorzMenu == 1) {
        mw2 = ml - w;
        for (i = 0; i < ma; i++) {
            if (i == 0) {
                (mw2 += wm[i]); (mw += wm[i])
            }
            else {
                (mw2 += wm[i - 1]); (mw += wm[i - 1])
            };
            if (s[i] == "") {
                if (st[i] == '&nbsp;') {
                    StepTop = mt + 2; StepLeft = mw2;
                    document.getElementById("NavBar").innerHTML += "<div id='blank" + i + "' onclick='' style='float:left;width:" + wm[i] + "px'><span class='MenuItem'>" + m[i] + "</span></div>"
                }
                else { document.getElementById("NavBar").innerHTML += "<div id='Mnu" + i + "' style='float:left;width:" + wm[i] + "px'><a class='MenuItem'" + g + " href='" + n[i] + q + st[i] + a + su[i] + r + m[i] + t + "</div>" } 
            }
            else {
                document.getElementById("NavBar").innerHTML += "<div id='sb" + i + "' class='MenuItem2' style='float:left;visibility:hidden; width:" + (sw[i] - b) + "' onmouseover='ShowMenu((\"sb" + i + "\"))' onmouseout='HideMenu((\"sb" + i + "\"))'>" + s[i] + "</div>"
                document.getElementById("NavBar").innerHTML += "<div id='Mnu" + i + "' style='float:left;width:" + wm[i] + "px' onmouseover='ShowMenu(\"sb" + i + "\")' onmouseout='HideMenu(\"sb" + i + "\")'><a class='MenuItem'" + g + " href='" + n[i] + q + st[i] + a + su[i] + r + m[i] + t + "</div>"
            }
        }
    }
    else {
        mw2 = mt - mh;
        mt2 = mt - mh + 2;
        //Find largest Menu item width and make them all that size
        LMW = NavBarWidth
        for (i = 0; i < ma; i++) { if (LMW < wm[i]) { LMW = wm[i] } }
        for (i = 0; i < ma; i++) {
            if (i == 0) {
                (mw2 += LMW); mw += LMW
            }
            else {
                (mw2 += LMW); mw += LMW
            }
            if (s[i] == "") {
                if (m[i] == '&nbsp;') {

                    document.getElementById("NavBar").innerHTML += "<div id='blank" + i + "' style='float:left; top:" + (mt2 += (mh + 1)) + "px;left:" + ml + "px;width:" + LMW + "px'><span class='MenuItem'>" + m[i] + "</span></div>"
                }
                else { document.getElementById("NavBar").innerHTML += "<div id='Mnu" + i + "' style='float:left; top:" + (mt2 += (mh + 1)) + "px;left:" + ml + "px;width:" + LMW + "px'><a class='MenuItem'" + g + " href='" + n[i] + q + st[i] + a + su[i] + r + m[i] + t + "</div>" } 
            }
            else {
                document.getElementById("NavBar").innerHTML += "<div id='sb" + i + "' class='MenuItem2' style='float:left; top:" + (mt2 += (mh + 1)) + "px;left:" + (ml + LMW - 10) + ";width:" + sw[i] + "' onmouseover='ShowMenu(\"sb" + i + "\")' onmouseout='HideMenu(\"sb" + i + "\")'>" + s[i] + "</div>"
                document.getElementById("NavBar").innerHTML += "<div id='Mnu" + i + "' style='float:left; top:" + (mt2 += (mh + 1)) + "px;left:" + ml + "px;width:" + LMW + "px' onmouseover='ShowMenu(\"sb" + i + "\")' onmouseout='HideMenu(\"sb" + i + "\")'><a class='MenuItem'" + g + " href='" + n[i] + q + st[i] + a + su[i] + r + m[i] + t + "</div>"
            }
        }
    }


    windowSize()

    if (myHeight < document.body.offsetHeight) {
        document.getElementById("screen").style.height = document.body.offsetHeight + "px"
    } else {
        document.getElementById("screen").style.height = myHeight + "px"
    }

    ssw = 350; sw = myWidth - 5
    document.getElementById("MiscContent").innerHTML += '<div id="SSD" style="position: absolute; top:1px;left:1px;width:' + ssw + 'px;z-index:10;"></div>'
    document.getElementById("SSD").style.left = (sw - ssw) + "px"

    document.getElementById("SSD").style.top = (-myHeight) + "px"

    SCDetails(false)
    //document.getElementById("NavBar").innerHTML +='<div style="float:right; width: 128px; height: 25px;padding-top:-2px  cursor:pointer;" id="StepLayer" class="MenuItem"></div>'
    //Progress(TheStepOn)
}
window.onresize = function() {
    windowSize()
    sw = myWidth
    try {
        document.getElementById("SSD").style.left = (sw - (document.getElementById("SSD").offsetWidth)) + "px"
    } catch (e) {

    }

    
}
var scrOfX = 0, scrOfY = 0;
var myWindowWidth = 0, myWindowHeight = 0;
function windowSize() {
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
}
function getScrollXY() {

    if (typeof (window.pageYOffset) == 'number') {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return [scrOfX, scrOfY];
}
var myWidth = 0, myHeight = 0;
function windowSize() {
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    //window.alert( 'Width = ' + myWidth );
    //window.alert( 'Height = ' + myHeight );
}
var blankobj
var StepTop
var StepLeft
function HideMenu(o) { HideMenuTimer = setTimeout("document.getElementById('" + o + "').style.visibility='hidden'", 500) }
function ShowMenu(o) { try { HideMenuTimer = clearTimeout(HideMenuTimer) } catch (err) { }; document.getElementById(o).style.visibility = 'visible' }

function Progress(s) {

    if (s > 0) { document.getElementById("Step1").className = 'stepdone' } else { document.getElementById("Step1").className = 'stepnotdone' }
    if (s > 1) { document.getElementById("Step2").className = 'stepdone' } else { document.getElementById("Step2").className = 'stepnotdone' }
    if (s > 2) { document.getElementById("Step3").className = 'stepdone' } else { document.getElementById("Step3").className = 'stepnotdone' }
    if (s > 3) { document.getElementById("Step4").className = 'stepdone' } else { document.getElementById("Step4").className = 'stepnotdone' }
    TOP = -5
    LEFT = 39
    if (bw.ff) { LEFT += 20 }

    Step1HTML = '<div style="position: absolute; width: 100px; height: 25px; z-index: 2; left: ' + (LEFT - 30) + 'px; top: ' + (TOP - 46) + 'px; visibility:hidden" id="Step1Help">'
				+ '<table border="0" cellpadding="0" cellspacing="1" width="100%" id="Step1tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+ '<tr><td><p align="center">Locate Attraction you wish you purchase tickets for</td></tr></table></div>'
    Step2HTML = '<div style="position: absolute; width: 110px; height: 25px; z-index: 2; left: ' + (LEFT - 18) + 'px; top: ' + (TOP - 33) + 'px; visibility:hidden" id="Step2Help">'
				+ '<table border="0" cellpadding="0" cellspacing="1" width="112%" id="Step2tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+ '<tr><td><p align="center">Locate the Seats you wish to purchase</td></tr></table></div>'
    Step3HTML = '<div style="position: absolute; width: 110px; height: 25px; z-index: 2; left: ' + (LEFT + 10) + 'px; top: ' + (TOP - 33) + 'px; visibility:hidden" id="Step3Help">'
				+ '<table border="0" cellpadding="0" cellspacing="1" width="112%" id="Step3tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+ '<tr><td><p align="center">Select the Type of Ticket you would like</td></tr></table></div>'
    Step4HTML = '<div style="position: absolute; width: 100px; height: 25px; z-index: 2; left: ' + (LEFT + 30) + 'px; top: ' + (TOP - 33) + 'px; visibility:hidden" id="Step4Help">'
				+ '<table border="0" cellpadding="0" cellspacing="1" width="112%" id="Step4tblhlp" class="StepHelpbg" style="font-family: Arial; font-size: 10px; border-style: groove; border-width: 3px;">'
				+ '<tr><td><p align="center">Checkout and pay for your Tickets</td></tr></table></div>'
    try { document.getElementById("StepLayer").innerHTML += Step1HTML + Step2HTML + Step3HTML + Step4HTML } catch (e) { }

}
function GotoStep(o) {
    if (grabing) { return false };
    if (o.id == 'Step1') { window.location = 'Attractions.aspx' }
    if (o.id == 'Step2') { }
    if (o.id == 'Step3') { }
    if (o.id == 'Step4') { window.location = 'checkout.aspx' }
}
var ShowStep = new Array()
var prevO
function StepHelp(o) {
    try { ShowStep[prevO.slice(prevO.length - 1, prevO.length)] = clearTimeout(ShowStep[prevO.slice(prevO.length - 1, prevO.length)]); ShowStep[prevO.slice(prevO.length - 1, i.length)] = setTimeout("document.getElementById('" + prevO + "tblhlp').style.visibility='hidden'", 50) } catch (err) { };
    i = o.id
    prevO = i
    try { ShowStep[i.slice(i.length - 1, i.length)] = clearTimeout(ShowStep[i.slice(i.length - 1, i.length)]) } catch (err) { };
    ShowStep[i.slice(i.length - 1, i.length)] = setTimeout("document.getElementById('" + i + "tblhlp').style.visibility='visible'", 500)
}
function StepHelpHide(o) {
    try { ShowStep[prevO.slice(prevO.length - 1, prevO.length)] = clearTimeout(ShowStep[prevO.slice(prevO.length - 1, prevO.length)]); ShowStep[prevO.slice(prevO.length - 1, i.length)] = setTimeout("document.getElementById('" + prevO + "tblhlp').style.visibility='hidden'", 50) } catch (err) { };
    i = o.id
    prevO = i
    try { ShowStep[i.slice(i.length - 1, i.length)] = clearTimeout(ShowStep[i.slice(i.length - 1, i.length)]); ShowStep[i.slice(i.length - 1, i.length)] = setTimeout("document.getElementById('" + i + "tblhlp').style.visibility='hidden'", 500) } catch (err) { };

}
function SCDetails(f, dm) {
    var xmlhttp = false;
    var XMLData = "No Data";
    /*@cc_on@*/
    /*@if (@_jscript_version >= 5)
    // JScript gives us Conditional compilation, we can cope with old IE versions.
    // and security blocked creation of the objects.
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            xmlhttp = false;
        }
    }
    @end@*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    if (!xmlhttp && window.createRequest) {
        try {
            xmlhttp = window.createRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    d = new Date()

    var URL = "ShoppingCart.aspx"
    if (dm != null) { URL += '?dm=' + dm }
    xmlhttp.open("GET", URL, true);
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4) {
            var Token = xmlhttp.responseText
            document.getElementById("SSD").innerHTML = getXMLToken(Token, "main")
            i = document.getElementById("SCHook").offsetHeight
            if (f != null) { document.getElementById("SSD").style.top = (-document.getElementById("SSD").offsetHeight + i) + "px" }
            //Lookup what step we are on
            try {
                step = getXMLToken(Token, "Step")
                if (step == 0) {
                    if (location.href.indexOf("Attractions.ashx") > 0 || location.href.indexOf("AttractionDetail.aspx") > 0) {
                        step = 1
                    }
                    if (location.href.indexOf("DisplayGenAdmin.aspx") > 0 || location.href.indexOf("SeatingChart.aspx") > 0) {
                        step = 2
                    }
                }
                Progress(step)
            } catch (e) { }
        }
    }
    xmlhttp.send(null);
    //count = ((document.body.offsetHeight+40)/50)
    //showSC(count,0)
    //document.getElementById('screen').className='';
}
var working = false
var showingcart = false
function showhidecart() {
    if (document.getElementById('screen').className == '') { return false }
    SCDetails()
    i = document.getElementById("SCHook").offsetHeight
    //alert(document.getElementById("SSD").offsetHeight)
    if (!showingcart) {
        count = Math.floor((document.getElementById("SSD").offsetHeight - i) / 50)

        showSC(count, 0)
    } else {
        count = Math.floor((-document.getElementById("SSD").offsetHeight + (i * 2)) / 50)
        hideSC(count, 0)
    }
    showingcart = !showingcart
}
function showSC(d, c) {
    CartOpen = true
    ClearTimeout()
    working = true
    SCTimerShow = clearTimeout(SCTimerShow)
    c++
    document.getElementById("SSD").style.top = (document.getElementById("SSD").offsetTop + d) + "px"
    if (c < 50) {
        SCTimerShow = setTimeout('showSC(' + d + ',' + c + ')', 1); showing = SCTimerShow
    } else { working = false; StartTimeout(); window.status = "Counting"; document.getElementById("SSD").style.top = "0px"; }
}
function hideSC(d, c) {
    CartOpen = false
    ClearTimeout()
    working = true
    SCTimerShow = clearTimeout(SCTimerShow)
    c++
    document.getElementById("SSD").style.top = (document.getElementById("SSD").offsetTop + d) + "px"
    if (c < 50) {
        SCTimerShow = setTimeout('hideSC(' + d + ',' + c + ')', 1)
    } else {
        i = document.getElementById("SCHook").offsetHeight
        document.getElementById("SSD").style.top = (-document.getElementById("SSD").offsetHeight + i) + "px"
        working = false; showingcart = false
    }
}
function StartTimeout() {
    if (working) { return false }
    SCTimer = clearTimeout(SCTimer)
    count = ((-document.getElementById("SSD").offsetHeight + 20) / 50)
    SCTimer = setTimeout('hideSC(' + count + ',0)', 10000)
    window.status = "Counting Down"
}
var SCTimerShow = ""
var SCTimer
function ClearTimeout() {
    SCTimer = clearTimeout(SCTimer)
    window.status = "not Counting"
}
function getXMLToken(xml, token, s) { if (s == "") { s = 0 }; token = token.toLowerCase(); tmpxml = xml.toLowerCase(); s = tmpxml.indexOf('<' + token + '>', s) + token.length + 2; e = tmpxml.indexOf('</' + token + '>', s); return xml.slice(s, e); }

var SCDetailID = -1
var SCDetailUid = ''
function DeleteSCItem() {
    if (SCDetailID < 0) {
        alert('You Must Select an item you wish to remove first.');
        return false;
    }
    var xmlhttp = false;
    var XMLData = "No Data";
    /*@cc_on@*/
    /*@if (@_jscript_version >= 5)
    // JScript gives us Conditional compilation, we can cope with old IE versions.
    // and security blocked creation of the objects.
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            xmlhttp = false;
        }
    }
    @end@*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlhttp = new XMLHttpRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    if (!xmlhttp && window.createRequest) {
        try {
            xmlhttp = window.createRequest();
        } catch (e) {
            xmlhttp = false;
        }
    }
    d = new Date()

    var URL = "ShoppingCart.aspx?del=" + SCDetailID
    xmlhttp.open("GET", URL, true);
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4) {
            var Token = xmlhttp.responseText
            var dmsg = getXMLToken(Token, "scmsg")

            try {
                msg = getXMLToken(dmsg, "msg")
                sch = getXMLToken(dmsg, "sch")
                qua = getXMLToken(dmsg, "quad")
                if (sch != '') {
                    //Check to see if our element is already there
                    URL = 'SeatingChart.aspx?ScheduleID=' + sch + '&QuadrantID=' + qua
                    var html = '<div style="position: absolute; width: 300px; height: 100px; z-index: 12; left: 40%; top: 30%; visibility:visible" id="InfoWindow">'
                    html += '<table border="0" cellpadding="0" cellspacing="1" width="300" id="table7" style="border-style: outset; border-width: 3px; background-color: #E2E2E2" height="100">'
                    html += '	<tr>'
                    html += '	    <td height="1%" width="1%" style="font-size: 8px">&nbsp;</td>'
                    html += '		<td style="font-size: 8px" height="1%">&nbsp;</td>'
                    html += '		<td height="1%" width="1%" style="font-size: 8px">&nbsp;</td>'
                    html += '	</tr><tr>'
                    html += '		<td height="100" width="1%">&nbsp;</td>'
                    html += '		<td height="100">'
                    html += '			<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table8" height="100%" bgcolor="#FFFFFF" style="border-style: inset; border-width: 2px">'
                    html += '				<tr>'
                    html += '					<td rowspan="2" align="center" width="113">'
                    html += '						<img border="0" src="images/2TixAdmit1.gif" width="108" height="96"></td>'
                    html += '					<td rowspan="2" align="center">'
                    html += '						<font size="2">' + msg + '</font>'
                    html += '						<p><button onclick="window.location.replace(\'' + URL + '\');return false">Continue</button><button onclick="document.getElementById(\'InfoWindow\').style.visibility =\'hidden\';return false">Cancel</button></td>'
                    html += '				</tr>'
                    html += '			</table>'
                    html += '		</td>'
                    html += '		<td height="100" width="1%">&nbsp;</td>'
                    html += '	</tr><tr>'
                    html += '		<td width="1%" style="font-size: 8px" height="1%">&nbsp;</td>'
                    html += '		<td style="font-size: 8px" height="1%">&nbsp;</td>'
                    html += '		<td width="1%" style="font-size: 8px" height="1%">&nbsp;</td>'
                    html += '	</tr>'
                    html += '</table>'
                    html += '</div>	'
                    try {
                        document.getElementById("SCPrompt").innerHTML = html
                    } catch (e) {
                        document.getElementById("MiscContent").innerHTML += '<div id="SCPrompt" style="z-index:100;">' + html + '</div>'
                    }

                } else {
                    alert(msg)
                    try {
                        changedelivery('d')
                    } catch (e) {

                    }
                    SCDetails()
                }
            } catch (e) { }
        }
    }
    xmlhttp.send(null);
    if (SCDetailUid != '') {
        document.getElementById(SCDetailUid).style.background = ''
    }
    SCDetailID = -1;
    SCDetailUid = ''
    //Get rid of the item!!! DO IT NOW!!!

}
function SelectSCItem(Uid, scdid) {
    SCDetailID = scdid;
    document.getElementById(Uid).style.background = '#CCFFCC'
    if (SCDetailUid != '') {
        document.getElementById(SCDetailUid).style.background = ''
    }
    SCDetailUid = Uid
}
function CurrencyFormatted(amount) {
    var i = parseFloat(amount);
    if (isNaN(i)) { i = 0.00; }
    var minus = '';
    if (i < 0) { minus = '-'; }
    i = Math.abs(i);
    i = parseInt((i + .005) * 100);
    i = i / 100;
    s = new String(i);
    if (s.indexOf('.') < 0) { s += '.00'; }
    if (s.indexOf('.') == (s.length - 2)) { s += '0'; }
    s = minus + s;
    return s;
}
var CartOpen = false
function ClearCart() {
    if (CartOpen) { window.location = 'ShoppingCart.aspx?clearCart=true'; }
}
function CheckoutCart() {
    if (CartOpen) { window.location = 'CheckOut.aspx'; }
}

