﻿function WinOpen(url, windowName, ext) {
    if (ext == true && url.indexOf("http://") < 0) {
        url = "http://" + url;
    }
    var winHandler = window.open(url, windowName, "left=50,top=50,width=600,height=500,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1");
    return winHandler;
}
function WinOpenFull(url, windowName, ext) {
    if (ext == true && url.indexOf("http://") < 0) {
        url = "http://" + url;
    }
    var winHandler = window.open(url, windowName);
    return winHandler;
}

/*----- key press event handler, which handle enter event to perform action script ----- */
function keyPressHandler(e, elemID, action) {
    var keynum; //key ASCII value
    if (window.event) // IE
    {
        keynum = e.keyCode;
    }
    else if (e.which) // Netscape//Firefox/Opera
    {
        keynum = e.which;
    }
    if (keynum == 13) {
        //----- perform action script -----
        if (action == "click") {
            document.getElementById(elemID).click();
        }
        else {
            eval(action);
        }
        return false; //----- return false (to mark event as handled) -----
    }
    //----- pass on the event if not enter key -----
    return true;
}
