/**
 * T.H.E. Tiny Homepage Engine
 * Main Javascript
 * @author Matthias Nothhaft
 */

function confirm_click(message, link)
{
    check = confirm(message);
    if (check == true) {
        document.location.href = link;
    }
}

function open_subWin(url, title, width, height)
{
    win = window.open(src, title, "width="+width+", height="+height+
        ", resizable=yes, location=no, menubar=no, status=no, "+
        "scrollbars=yes, toolbar=no, directories=no");
    win.focus();
    return true;
}

/**
 * load click_url and open a sub window with open_url
 */
function click_and_open(click_url, open_url, title, width, height)
{
    win = window.open(open_url, title, "width="+width+", height="+height+
        ", resizable=yes, location=no, menubar=no, status=no, "+
        "scrollbars=yes, toolbar=no, directories=no");
    /* win.focus(); */
    document.location.href = click_url;
    return true;
}


function mabiz_enable_element(enable_switch, id)
{
    if (enable_switch == true) {
        set = true;
    } else {
        set = false;
    }

    document.getElementById(id).disabled = set;
    //document.forms[form_name].element_name.disabled = true; //(enable_switch == true);
    return true;
}


function mabizSetValueById(id, value)
{
    document.getElementById(id).value = value;
    return true;
}