﻿function openIT(myID, mySubCat) {
    document.getElementById('myPop').style.display = 'block';
    document.getElementById('myPop').style.top = '' + (getScrollHeight() + 50) + 'px';
    document.getElementById('myPop').style.left = '' + (alertSize() / 2 - 150) + 'px';
    document.getElementById('myFrame').src = 'manage-menu.aspx?id=' + myID + '&Cat=' + mySubCat
}
function openIT2(myID) {
    document.getElementById('myPop').style.display = 'block';
    document.getElementById('myPop').style.top = '' + (getScrollHeight() + 50) + 'px';
    document.getElementById('myPop').style.left = '' + (alertSize() / 2 - 150) + 'px';
    document.getElementById('myFrame').src = 'manage-menu.aspx?Cat=' + myID
}

function CartDisplay() {
    //alert('TEST');
    document.getElementById('ctl00_ContentPlaceHolder1_PnlCartNotification').style.top = '' + (alertSize2() / 2 - 150) + 'px';
    document.getElementById('ctl00_ContentPlaceHolder1_PnlCartNotification').style.left = '' + (alertSize() / 2 - 150) + 'px';
}
function getScrollHeight() {
    var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;

    return h ? h : 0;
}
function alertSize() {
    var myWidth = 0, myHeight = 0;
    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);
    return myWidth
}

function alertSize2() {
    var myWidth = 0, myHeight = 0;
    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);
    return myHeight
}
