function onMouseOverForList(element) {
    element.style.backgroundColor = '#457fae';
    element.style.cursor='pointer';
}

function onMouseOutForList(element) {
    element.style.backgroundColor = '';
}

function onClickUrlLink(url) {
    if (url) {
        window.open(url, "new", "toolbar=yes,status=yes,resizable=yes,scrollbars=yes");
    }
}

function initOpenNewWindow() {
    var popupEvent = function(event) {
        var key = this.rel;
        var option = getWindowParam(key);
        window.open(this.href, this.rel, option).focus();
        event.preventDefault();
        event.stopPropagation();
    }

    $("a.popup").each(function(i) {
            $(this).click(popupEvent);
            $(this).keypress(popupEvent);
            });
}

function getWindowParam(key) {
    var params = new Array();
    params['catalog'] = 'scrollbars=yes,resizable=yes,width=820,height=795';

    if (params[key]) {
        return params[key];
    } else {
        return '';
    }
}

function initShowHideElement(id) {
    if (is_open == 0) {
        $(id).hide();
    }
}

function rollover() {
    $('.swap').rollover();
}

function openElement(id) {
    $(id).hide();
    $(id).slideDown('normal');
}

function closeElement(id) {
    $(id).slideUp('normal');
}

function showElement(id) {
    $(id).slideDown('normal');
}

function hideElement(id) {
    $(id).slideUp('normal');
}

function _save_cookie(id, value) {
    var cookiename = 'ini' + id;
    $.cookie(cookiename, value, { expires: 180, path: '/'});
}

function _load_cookie(id) {
    var cookiename = 'ini' + id;
    return $.cookie(cookiename);
}

function showErrorMessage() {
    blindDownEffect('message_dialog');
}


function displayText(id, str, isShow) {
    if(isShow) {
        if(document.getElementById(id).value == '') {
            document.getElementById(id).value = str;
        }
    } else {
        if(document.getElementById(id).value == str) {
            document.getElementById(id).value = '';
        }
    }
}

function showhide(id) {
    if(document.getElementById){
        if(document.getElementById(id).style.display == "none")
            document.getElementById(id).style.display = "block";
        else
            document.getElementById(id).style.display = "none";
    }
}

function showIndicator() {
    id = 'indicator'
        window.scroll(0, 0);
    document.getElementById(id).style.display = "block";
}

function disableElements(elements, flag) {
    for (var i=0; i < elements.length; i++) {
        disableElement(elements[i], flag);
    }
}

function disableElement(id, flag) {
    if (document.getElementById(id) != null) {
        document.getElementById(id).disabled = flag;
    }
}



