/*----- 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;
}


/*----- help section ----- */
function helpPopup(url) {
    var wHandler = window.open(url, "_help", "top=50,left=50,width=400,height=300,location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1");
    return wHandler;
}
function popup(url) {
    var wHandler = window.open(url, "_pop", "top=50,left=50,width=800,height=450,location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1");
    return wHandler;
}
function popWin(url, name,width, height) {
    var wHandler = window.open(url, name, "top=50,left=50,width=" + width + ",height=" + height + ",location=0,menubar=0,toolbar=0,resizable=1,scrollbars=1");
    return wHandler;
}

/*----- position div tag -----*/
function setCenter(tagName, w) {
    var wWidth = $(window).width();
    var left = (wWidth - w) / 2;

    $(tagName).css({ 'width': w, 'display': 'block', 'background': '#FFFFFF', 'border': '1px solid #AAAAAA', 'position': 'absolute', 'top': '10px', 'left': left, 'z-index': '100' });
    $("#bg").css({ 'display': 'block', 'height' : $(document).height() });

    //$(tagName).dialog({ modal:true, width: w});
}

function showRIHdr() {
    $(document).ready(function(event) {
        $(".relInfo").css({ "display": "block" });
        $(".sideNav").css({"padding-left":"15px", "padding-right": "50px", "padding-bottom":"30px", "width":"285px"});
    });
}
