// checkbox check
function FnCheck(yCheck){
document.getElementById(yCheck).checked=!document.getElementById(yCheck).checked;
}

// bookmark
function bookmark(title,url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}

/*function setFocus(){
document.getElementById("searchBox").focus();
}*/

//search

function checksearchcode() {
    searchfield = document.getElementById('searchBox').value.length
	searchfield2 = document.getElementById('searchBox').value
    if (searchfield == 0){
        alert('Tip: Gebruik een Productnaam of Productcode om te zoeken');
        return false;
    }
    else if(searchfield < 2){
        alert('Zoek met tenminste 2 tekens');
        return false;
    }
	else if(searchfield2 == "Type hier uw zoekwoorden of Konig productcode"){
        alert('Tip: Gebruik een Productnaam of Productcode om te zoeken');
        return false;
    }
    else {
        return true;
    }
}

function clearMe(formfield){
   if (formfield.defaultValue=="Type hier uw zoekwoorden of Konig productcode")
    formfield.value = ""
}

function clearfield(thisfield){ 
	thisfield.value = "";
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
     if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external nofollow") 
     anchor.target = "_blank"; 
 } 
} 


function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
//addLoadEvent(setFocus);  
addLoadEvent(externalLinks);
/* more code to run on page load */ 
addLoadEvent(function() {	
});





