// JavaScript Document

function menuOver(obj)
    {
        //document.getElementById(obj).style.border="1px Solid #667ab3"
    }
function menuOut(obj,color)
    {
        //document.getElementById(obj).style.border="1px Solid #000000"
    }
function subMenuOver(submenuItem)
    {
        submenuItem.style.background="#e8eef4"
    }
function subMenuOut(submenuItem)
    {
        submenuItem.style.background="url(image/subMenuBG.jpg)"
    }
function nav(url)
    {
        document.location.href=url
    }
function showError()
    {
        document.getElementById("errorBox").style.display="inline"  
    }
function hideError()
    {
        document.getElementById("errorBox").style.display="none"    
    }
    
function mainOver(id)
    {
        id.style.filter="alpha(opacity=50)"
        id.style.opacity=".50"      
    }
function mainOut(id)
    {
        id.style.filter="alpha(opacity=100)"
        id.style.opacity="1"        
    }
function showHideText(obj)
        {
        if (obj.style.display=="none")
            {
                obj.style.display="inline"
            }
        else
            {
                obj.style.display="none"
            }
        }
function showHide(obj)
        {
        if (document.getElementById(obj).style.display=="none")
            {
                document.getElementById(obj).style.display="inline"
            }
        else
            {
                document.getElementById(obj).style.display="none"
            }
        }
function show(obj)
        {
                document.getElementById(obj).style.display="inline"
        }
        
function checkForm(formObj,objStr)
    {
        var x;
        var submitForm =true;
        var objArray=objStr.split(",");
        
        for (x in objArray)
            {
                if (document.getElementById(objArray[x]).value=="")
                    {
                        submitForm=false
                        document.getElementById(objArray[x]).style.border="1px solid #FF0000"
                        document.getElementById(objArray[x]).style.background="#ffebeb"                     
                    }

}
    
        if (submitForm==true)
            {
                document.getElementById(formObj).submit();
            }
        else
            {alert("Vul a.u.b. deze velden in")}
    }
    
function checkFormII(formObj,objStr,emailStr)
    {
        var msgTxt =""
        var msgTxt1 = "ROOD:Deze velden moeten worden ingevuld"
        var msgTxt2 = "BLAUW:Er moet een geldig e-mail adres worden ingevuld"       
        var msg1 =false;
        var msg2 =false;
        var x;
        var submitForm =true;
        var objArray=objStr.split(",");
        var emlArray=emailStr.split(",");
        for (x in objArray)
            {
                if (document.getElementById(objArray[x]).value.length <1)
                    {
                        submitForm=false
                        document.getElementById(objArray[x]).style.border="1px solid #FF0000"
                        document.getElementById(objArray[x]).style.background="#ffebeb"                     
                        msg1=true
                    }
                else    
{
                        document.getElementById(objArray[x]).style.border="none"
                        document.getElementById(objArray[x]).style.background="#FFFFFF"                     

}                   
            }
        
        for (xx in emlArray)
            {
                
                
            if (document.getElementById(emlArray[xx]).value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.name)|(\..{2,2}))$)\b/gi)){
                        document.getElementById(emlArray[xx]).style.border="none"
                        document.getElementById(emlArray[xx]).style.background="#FFFFFF"

}
            else
            {

                        submitForm=false
                        document.getElementById(emlArray[xx]).style.border="1px solid #0000FF"
                        document.getElementById(emlArray[xx]).style.background="#ffebeb"
                        msg2=true
                    }
            }



        if (submitForm==true)
            {
                document.forms[formObj].submit();
            }
        else
            {
                if (msg1==true)
                    {msgTxt=msgTxt1+" \r"}
                    
                if (msg2==true)
                                
                    {msgTxt=msgTxt + msgTxt2}
                    
                    alert(msgTxt)
                    }
    }
    
function disclaimer()
    {
        window.open("/copyright.asp","","width=800,height=600,toolbar=no,scrolling")
    }

function wachten()
    {
        document.getElementById("wachten").style.display="inline"   
    }
function checkToSubmit(id)
    {
        if (window.event.keyCode==13) { wachten();id.submit()
            
    }
    return true;
    }

function myWidth()
{
    if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    return window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    return document.body.clientWidth;
  }

}
function checkZoekBoxIn()
{
   if (document.getElementById("zoekBox").value=="Voer trefwoord of isbn in")
   {
       document.getElementById("zoekBox").value=""


   }
          document.getElementById("zoekBox").style.color="#000000"
}
function checkZoekBoxOut()
{

    if (document.getElementById("zoekBox").value=="")
   {
     document.getElementById("zoekBox").value="Voer trefwoord of isbn in"

    }
     document.getElementById("zoekBox").style.color="#999999"
}

function imgChk()
{  var i,src, img;
  for (i = 0; i < document.images.length; i++) {
    src=document.images[i].src.replace(url,"")
    src=src.replace(/www/,"")
    src=src.replace(/http:\/\//,"")
    src=src.replace(/\//,"")
    srcArray=src.split(".",2)
    
    //alert(document.images[i].width +" "+document.images[i].height)
    
    if (document.images[i].noResize != "true")
      {
      if (srcArray[1].toLowerCase() == "jpg") {    
    
        if (document.images[i].width > 503) 
          {
          document.images[i].height = document.images[i].height * 503 / document.images[i].width 
          document.images[i].width = 503;
          document.images[i].src= "/resizeImage.asp?width="+document.images[i].width+"&height="+document.images[i].height+"&img="+src          
          }
        
        //document.images[i].src=srcArray[1]

      }
    }
    
  }

}