﻿// JScript 파일

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != "function") {
        window.onload = func;
    }
    else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

function resizeIframe(td, frame){
    td.height = "100%";
    var myHeight = parseInt(frame.contentWindow.document.body.scrollHeight) + 22;
    frame.height = myHeight;
    td.height = myHeight;
}

function resizeIframe2(td, frame, parentTd, parentFrame){
    resizeIframe(td, frame);
    var myHeight = parseInt(document.body.offsetHeight);
    parentFrame.height = myHeight;
    parentTd.height = myHeight;
}

function disableSelection(target) {
    if (typeof target.onselectstart != "undefined") //IE route
        target.onselectstart = function() { return false }
    else if (typeof target.style.MozUserSelect != "undefined") //Firefox route
        target.style.MozUserSelect = "none"
    else //All other route (ie: Opera)
        target.onmousedown = function() { return false }
    target.style.cursor = "default"
}

function leftmenuClick(oMenu, menu) {
    for (i = 0; i < oMenu.rows.length; i++) {
        if (oMenu.rows[i].id != "") {
            oMenu.rows[i].style.cursor = "pointer";
            if (oMenu.rows[i].id == menu) {
                oMenu.rows[i].style.backgroundColor = "#a3e4ff";
                oMenu.rows[i].onmouseover = function() { this.style.backgroundColor = "#a3e4ff"; };
                oMenu.rows[i].onmouseout = function() { this.style.backgroundColor = '#a3e4ff'; };
            }
            else {
                oMenu.rows[i].style.backgroundColor = "white";
                oMenu.rows[i].onmouseover = function() { this.style.backgroundColor = "#DBF4FF"; };
                oMenu.rows[i].onmouseout = function() { this.style.backgroundColor = 'white'; };
            }
        }
    }
}