var W3CDOM = (document.createElement && document.getElementsByTagName);

function open_window_html(url, width, height, scroll, resize) {
    popup = window.open(url, "popup", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=" + resize + ",width=" + width + ",height=" + height);
    popup.focus();
};

function toggleDiv(a_obj, div_id, description)
{
    if (document.getElementById) {
        div_obj = document.getElementById(div_id);

        if (div_obj.className == "hide") {
            div_obj.className = "show";
            a_obj.innerHTML = "[ Hide " + description + "]";
        } else {
            div_obj.className = "hide";
            a_obj.innerHTML = "[ Show " + description + "]";
        }
    }
}


function switchDivs(div_to_show, div_to_hide)
{
    if (document.getElementById) {
        div_to_show = document.getElementById(div_to_show);
        div_to_hide = document.getElementById(div_to_hide);
        div_to_show.style.display = "";
        div_to_hide.style.display = "none";
    }
}

function trim(string){
    while (string.substring(0,1) == ' '){
        string = string.substring(1, string.length);
    }
    while (string.substring(string.length-1, string.length) == ' '){
        string = string.substring(0,string.length-1);
    }
    return string;
}

function showHideDiv(div_id)
{
    if (document.getElementById) {
        div_obj = document.getElementById(div_id);

        if (div_obj.style.display == "none") {
            div_obj.style.display = "block";
        } else {
            div_obj.style.display = "none";
        }
    }
}
