﻿
// var myWindow = null;

function SelectAll(id) {
    document.getElementById(id).focus();
    document.getElementById(id).select();
}

function toggleDiv(divId) {
    if ($("#" + divId).css("display") == "none") {
        $("#" + divId).slideDown("slow");
    } else {
        $("#" + divId).slideUp("slow");
    }
}

function openPrintWindow(goTo) {
    myWindow = window.open(goTo, "PrintEtmosProducts", "resizable=1,width=1000,height=600,scrollbars=1");
    myWindow.moveTo(0, 0);
    myWindow.focus();
//    if (myWindow == null) {
//        myWindow = window.open(goTo, "PrintEtmosProducts", "resizable=1,width=800,height=600");
//        myWindow.moveTo(0, 0);
//    } else {
//        if (!myWindow.open) {
//            myWindow = window.open(goTo, "PrintEtmosProducts", "resizable=1,width=800,height=600")
//            myWindow.moveTo(0, 0);
//        } else {
//          myWindow.location = goTo;
//        }
//    }
}

function GenerateCloseButton(sender, e) {
    if ($(sender._popupDiv).children('.ajax__calendar_close_button').length == 0) {
        $(sender._header).before("<div class='ajax__calendar_close_button'>x</div>");
        $(sender._popupDiv).children('.ajax__calendar_close_button').bind("click", sender, function (e) {
            e.data.hide();
        });
    }
}




