﻿function CenterWinProps(w, h) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + 'resizable=0'
    return winprops;
}

function CenterWinPropsResize(w, h) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',resizable=1'
    return winprops;
}
function CenterWinPropsScroll(w, h) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',resizable=1,scrollbars=1'
    return winprops;
}
function OpenAdditionalFile(pDoc, ObjType, AddDocType, LinkID, DisplayType) {

    if (AddDocType == 2) {
        window.open(pDoc, "Additional", CenterWinPropsResize(805, 605));
    }
    else if (AddDocType == 1) {
        if (DisplayType.toLowerCase() == "video")
            window.open("ShowVideo.aspx?custom=false&oType=" + ObjType + "&linkid=" + LinkID, "Video", CenterWinProps(475, 380));
        else
            $find("MBVideogalley").show();
    }
    else if (AddDocType == 3) {

        $find("MBimage").show();

    }
}
function CloseImageGallery() {

    $find("MBimage").hide();
}
function CloseVideogalley() {

    //    window.location.reload();
//    $('iframe#iVideo').attr('src', "");

    var f = document.getElementById('iVideo');
    f.contentWindow.location.reload(true);
    $find("MBVideogalley").hide();
}
function CloseHelpContact() {
    $find("MBHelpContact").hide();
}

function CloseHelpBilling() {
    $find("MBHelpBilling").hide();
}
function ClosehelpShipping() {
    $find("MBHelpShipping").hide();
}
function CloseHelp1() {
    $find("MBHelpPayment").hide();
}
