// This Script is for the Div Layer. This Script will work with IE5+ & Netscape 6+

var d = document, n = navigator; 

var agent = n.userAgent.toLowerCase(); 

var mX, mY; 



//Browser sniff hash obj 

var sniff = { 

bw: { 

ns:d.layers, 

ie:d.all && !d.getElementById, 

ie4:agent.indexOf("msie 4.") != -1, 

ie5:agent.indexOf("msie 5.") != -1, 

ie6:agent.indexOf("msie 6.") != -1, 

dom:d.getElementById, 

ns6:d.getElementById && agent.indexOf("gecko") != -1 

}, 

os: { 

win:agent.indexOf("win") != -1, 

mac:agent.indexOf("mac") != -1 

} 

}; 







function mMove(e) { 

mX = (sniff.bw.ns || sniff.bw.ns6)?e.pageX:event.x; 

mY = (sniff.bw.ns || sniff.bw.ns6)?e.pageY:event.y; 

} 



function init() { 

if (sniff.bw.ns) { 

d.captureEvents(Event.MOUSEMOVE) 

} 

d.onmousemove = mMove; 

} 



function changeSheets(whichSheet){

whichSheet=whichSheet-1;

if(document.styleSheets){

var c = document.styleSheets.length;

for(var i=0;i<c;i++){

if(i!=whichSheet){

document.styleSheets[i].disabled=true;

}else{

document.styleSheets[i].disabled=false;

}}}}

changeSheets(1)



function checkBrowser(){

	this.ver=navigator.appVersion

	this.dom=document.getElementById?1:0

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;

	this.ie4=(document.all && !this.dom)?1:0;

	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;

	this.ns4=(document.layers && !this.dom)?1:0;

	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)

	return this

}

bw=new checkBrowser()





function showhide(div,nest){



	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 

	if(obj.display=='block' || obj.display=='block') obj.display='none'

	else obj.display='block'

}



function show(div,nest){

	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 

	obj.display='block'

}



function hide(div,nest){

	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 

	obj.display='none'

}



		function cl(t){if (t.defaultValue==t.value) t.value = '';}





function popUp(URL) {

day = new Date();

id = day.getTime();

eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=685,height=600');");

}





function stringFilter (input) {

s = input.value;

filteredValues = "abcdefghijklmnopqrstuvwxyzABCBEFGHIKLMNOPQRSTUVW.,/?!'";     // Characters stripped out

var i;

var returnString = "";

for (i = 0; i < s.length; i++) {  // Search through string and append to unfiltered values to returnString.

var c = s.charAt(i);

if (filteredValues.indexOf(c) == -1) returnString += c;

}

input.value = returnString;

}





function dept_onchange(zoekklein) {

	zoekklein.submit(); 

}

function dept_onchange(zoekvergelijk) {

	zoekvergelijk.submit(); 

}



		function cl(t){if (t.defaultValue==t.value) t.value = '';}



//-->



function testVisited(sites, handler) {

	function visited(link) {

		var color;

		if (document.defaultView && document.defaultView.getComputedStyle) {

			color = document.defaultView.getComputedStyle(link, '').color;

		} 

			else if (link.currentStyle) {

			color = link.currentStyle.color;

		}

		return /0/.test(color);

	}

	var head = document.getElementsByTagName('head')[0];

	var body = document.getElementsByTagName('body')[0];

	var id = 'zomaareenID';

	var goodSel = '#' + id + ' a';

	var badSel  = '#' + id + ' a:visited';

	var good = 'color: #FFF !important;';

	var bad  = 'color: #000 !important;';



	var style = document.createElement('style');

	head.appendChild(style);

	var stylesheet = document.styleSheets[document.styleSheets.length - 1];



	if (stylesheet.insertRule) {

		stylesheet.insertRule(goodSel + ' {' + good + '}', 0);

		stylesheet.insertRule(badSel  + ' {' + bad  + '}', 0);

	} else if (stylesheet.addRule) {

		stylesheet.addRule(goodSel, good);

		stylesheet.addRule(badSel,  bad);

	}



	var div = document.createElement('div');

	div.id = id;

	div.setAttribute('style', 'width: 0px; height: 0px;');

	body.appendChild(div);



	for (var index = 0; index < sites.length; index++) {

		var a = document.createElement('a');

		a.href = sites[index];

		div.appendChild(a);

		sites[index] = {url: sites[index], visited: visited(a)};

	}

	head.removeChild(style);

	body.removeChild(div);	

	handler(sites);		

}



function FrontPage_Form1_Validator(theForm)

{



  if (theForm.Keyword.value == "U zoekt?")

  {

    alert("Type een artikelnummer of een kort trefwoord in, bijv. Inductie.");

    theForm.Keyword.focus();

    return (false);

  }



  if (theForm.Keyword.value == "")

  {

    alert("Type een artikelnummer of een kort trefwoord in, bijv. Inductie.");

    theForm.Keyword.focus();

    return (false);

  }



  return (true);

}





function stringFilter (input) {

s = input.value;

filteredValues = "' .,_&/-;";     // Characters stripped out

var i;

var returnString = "";

for (i = 0; i < s.length; i++) {  // Search through string and append to unfiltered values to returnString.

var c = s.charAt(i);

if (filteredValues.indexOf(c) == -1) returnString += c;

}

input.value = returnString;

}




