var win = "";
function popUp(url,name,w,h,extra){
    str="height="+h+",width="+w+","+extra;
    if(parseInt(navigator.appVersion)>3)
    str+=",left="+(screen.width -w)/2+",top="+parseInt((screen.height -h)/2);
    win=window.open(url,name,str);
}
function getElement(div){
    var n = false;
    if ((document.all && document.all[div]) || (document.getElementById && document.getElementById(div))){
       n = (document.all) ? document.all[div] : document.getElementById(div);
    }
    return n;
}
function trimSpace(str){
     return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
function chgImage(obj, img){
    if ((typeof obj) == "object" && img.length > 0){
        obj.src = "/Graphics/topmenu/" + img;
    }
}
function searchCheck(){
    var frm = document.search;
    if (frm){
        var val = trimSpace(frm.keyword.value);
        frm.keyword.value = val;
        if (val.length == 0){
            alert("Indtast venligst et søgeord.          ");
            frm.keyword.focus();
        } else {
            frm.submit();
        }
    }
}
function hoverUrl(obj, stat){
    var bgColor = (colMenu.length > 0) ? colMenu : "#D95935";
    var pgColor = (colMenuLink.length > 0) ? colMenuLink : "#ffffff";
	obj.style.backgroundColor = (stat == 1) ? bgColor : "";
	obj.style.color = (stat == 1) ? pgColor : "";
}