/**********************************************************************************   
* IEfix mouseclick                                                                *
***********************************************************************************/
function ExplorerFix() 
{ for (a in document.links) document.links[a].onfocus = document.links[a].blur; 
}
if(document.all) document.onmousedown = ExplorerFix;

/**********************************************************************************   
* open Popup-windows                                                              *
***********************************************************************************/
var w = screen.availWidth;
var h = screen.availHeight;
var popW = 433, popH = 455;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;

function popup(file) {
open(file,'window','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos +',toolbar=0,directories=0,status=0,menubar=0,resizable=0,scrollbars=1');
}

function popup2(file,popName,popW,popH) {
	var w = screen.availWidth;
	var h = screen.availHeight;
	var popW, popH;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;

	open(file,popName,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos +',toolbar=0,directories=0,status=0,menubar=0,resizable=0,scrollbars=1');
}
/**********************************************************************************   
* show/hide script (werkt niet optimaal)                                          *
***********************************************************************************/
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.visibility='hidden'
	}	

/**********************************************************************************   
* show hide script met timeout                                                              *
***********************************************************************************/
var check=0;
var objT;
function showhide(div,nest){
	objT=bw.dom?"document.getElementById('"+div+"').style":bw.ie4?"document.all['"+div+"'].style":bw.ns4?"document.layers['"+div+"']":0; 
	obj = eval(objT);
	if(obj.visibility=='visible' || obj.visibility=='show'){
		check = setTimeout(objT+".visibility='hidden';",100);
	}else{
		obj.visibility='visible';
	}
}

/**********************************************************************************   
* show/hide script met timeout voor b.v. popup-menu's                             *
* code in link:                                                                   *
* <a href="#" onmouseover="clearTimeout(check);                                   *
*             onmouseout="showhide('[naam layer]');"                              *
***********************************************************************************/
var objT;
var check=0;
var iTimeOut = 500;

function showhide(div,nest){
	objT=bw.dom?"document.getElementById('"+div+"').style":bw.ie4?"document.all['"+div+"'].style":bw.ns4?nest?"document['"+nest+"'].document.layers['"+div+"']":"document.layers['"+div+"']":0; 
	obj = eval(objT);
	if(obj.visibility=='visible' || obj.visibility=='show'){
		check = setTimeout(objT+".visibility='hidden';",iTimeOut);
	}else{
		obj.visibility='visible';
	}
}	
	
/**********************************************************************************   
* Mouseover script / preload-images staan onderaan                                *
* (zet dit script in een aparte .js pagina, zodat de preload images               *
* niet steeds wordt ingeladen op pagina's waar het niet hoeft).                   *
***********************************************************************************/
function activateReset(){
	if (active != 0){
		checkImg(active,sDiv,0);
		active = 0;
	}
}
	
function activateUnnetpres(a,sDiv){
	if (active != a){
		checkImg(a,sDiv,0);
	}else{
		checkImg(a,sDiv,2);
	}
}

function activateUnnetpresTimer(a,sDiv){
	if (active != a){
		checkImg(a,sDiv,0);
	}else{
		checkImg(a,sDiv,2);
	}
}

function activatenetpres(a,sDiv){
	if (active != a){
		checkImg(a,sDiv,1);
	}else{
		checkImg(a,sDiv,3);
	}
}

function activateClick(a,sDiv){
	checkImg(a,sDiv,3);
	if ((active != a) && (active != 0))	checkImg(active,sDiv,0);
	active = a; 
}

//verander de prefix van de naam als dat moet, dus als je bv. 'knop_home_off.gif' hebt dan moet je de prefix 'button_' hieronder aanpassen in 'knop_'
function preloadImg(a,sOff,sO,sK,sKO,sName){
	netpres[a]=new Array();
	for(var i=0;i<4;i++) netpres[a][i] = new Image;
	netpres[a][0].src = imgDir + "knop_" + sName + "_" + sOff + imgExt;
	netpres[a][1].src = imgDir + "knop_" + sName + "_" + sO + imgExt;
	netpres[a][2].src = imgDir + "knop_" + sName + "_" + sK + imgExt;
	netpres[a][3].src = imgDir + "knop_" + sName + "_" + sKO + imgExt;
}
function checkImg(a,sDiv,iType){
	if(bw.ns4 || bw.ns5){
		sDiv?document[sDiv].document['netpres' + a].src = netpres[a][iType].src:document['netpres' + a].src = netpres[a][iType].src;
	}else{
		document['netpres' + a].src = netpres[a][iType].src;
	}
}

// Preload-images
var netpres = new Array();
var imgDir = "img/";
var imgExt = ".gif";
active = 0;
timer_id = null;

// Preload-images
//  plaatjes,id,off,mouseover,klick,klickover,filename
preloadImg(1,"off","on","klick","on","online_shop");
preloadImg(2,"off","on","klick","on","about_broekmans");
preloadImg(3,"off","on","klick","on","mailinglist");
preloadImg(4,"off","on","klick","on","downloads");
preloadImg(5,"off","on","klick","on","contact");
preloadImg(6,"off","on","klick","on","home");
preloadImg(7,"off","on","on","on","view_shoppingcart");
preloadImg(8,"off","on","on","on","sub_search");
preloadImg(9,"off","on","on","on","sub_how_to_order");
preloadImg(10,"off","on","on","on","sub_special_order_form");
preloadImg(11,"off","on","on","on","sub_new_publications");
preloadImg(12,"off","on","on","on","sub_themes");
preloadImg(13,"off","on","on","on","sub_reviews");
preloadImg(20,"off","on","on","on","about_us");
preloadImg(21,"off","on","on","on","announcements");

// Browsercheck
function browserCheck(){
		this.ver=navigator.appVersion
		this.agent=navigator.userAgent
		this.dom=document.getElementById?1:0
		this.opera5=this.agent.indexOf("Opera 5")>-1
		this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
		this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
		this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
		this.ie=this.ie4||this.ie5||this.ie6
		this.mac=this.agent.indexOf("Mac")>-1
		this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
		this.ns4=(document.layers && !this.dom)?1:0;
		this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
		return this
	}
	var bw=new browserCheck()

//stylesheets
	if (bw.ns4) {document.write('<link rel=StyleSheet href="stylesns4.css" type="text/css">');}
	else {document.write('<link rel=StyleSheet href="styles.css" type="text/css">');}

	
// info popup
function openPopup() {
	window.open('infopopup.cfm','popup','width=433,height=455,resizable=0,menubar=0,scrollbars=0');
}

function openPopup1() {
 window.open('vraag_en_aanbod_zoek.cfm','popup','width=610,height=430,resizable=0,menubar=0,scrollbars=1');
}

function MM_openBrWindow(theURL,winName,features) { //v1.0
	  window.open(theURL,winName,features);
	}
	
function theme_submit() {
	document.themaform.submit();
}

var imgNix = new Image();
imgNix.src="img/nix.gif";

