// JavaScript Document
// -- MENU FUNKTION TIL IE //
sfHover = function() {
    if(document.getElementById("nav")){
        var sfEls = document.getElementById("nav").getElementsByTagName("LI");
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                this.className+=" sfhover";
            }
            sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
            }
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
function chgImg(obj,img){
    document.getElementById(obj).src = img;
}
// -- MENU END --//

function select_newVariant(tVal){
    document.location.href=tVal
}
function select_variant(tVal){
document.location.href=tVal
}


function select_o(tVal){
    document.formSort.submit()
}

function select_b(tVal){
    document.formSort.submit()
}

function confirmUserDelete(){
    try{
        return confirm('Er du sikker på, at du vil udmelde dig?')
    }catch(e){
        return false
    }
}

function checkUserlogin(){
    myform=document.userloginform
    if((myform.userName.value=="")||(myform.userPwd.value=="")){
        alert("Udfyld venligst begge felter"); return false    
    }else{
         submitThisForm("userloginform"); return false    
    }
}

function select_paymentType(tStr){
//    alert(tStr)
}

function select_country(tStr){
//    alert(tStr)
}

function showContactForm(){
    ncms_getPageSize()
    document.getElementById("overlay").style.display=""
    document.getElementById("overlay").style.height=arrayPageSize[1]+"px"
    document.getElementById("overlay").style.filter = "alpha(opacity=60)";
    document.getElementById("overlay").style.opacity = "0.6";
    document.getElementById("contact-newsletter-form").style.display=""
}
function hideContactForm(){
    document.getElementById("overlay").style.display="none"
    document.getElementById("contact-newsletter-form").style.display="none"
}

function clearField(iVal,defVal,fieldName){
    if(iVal==defVal){document.userLoginForm[fieldName].value=""}
    if((navigator.userAgent.indexOf("MSIE 9")>0) || (navigator.userAgent.indexOf("MSIE")<0)){
        if(fieldName=="userPwd"){document.userLoginForm.userPwd.type="password"}
    }
    if(iVal==""){
        document.userLoginForm[fieldName].type="text";
        document.userLoginForm[fieldName].value=defVal;
    }
}
