// browser and platform controle
// org. code http://developer.apple.com/internet/_javascript/

	var its;
	var browserName;
	var browserNameLong;
	var browserNew;
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser versie
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versies van mozilla zijn niet ns navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// ie5 zegt dattie 4.0 is, workaround hiervoor
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// DOM-enabled?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// naam?
		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		// versie?
		browserNameLong = browserName + its.major;
	}
	

// weghalen lelijke stippelvakjes bij links

	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if ((browserNew) || (browserName == "IE")) {
			if (browserNew) {
				links = document.getElementsByTagName("a");
			}
			else {
				links = document.all.tags("a");
			}
			for(i=0; i<links.length; i++) {
				links[i].onfocus = unblur
			}
		}
		if (browserName == "IE") {
			if (browserNew) {
				drops = document.getElementsByTagName("select");
			}
			else {
				drops = document.all.tags("select");
			}
			for(i=0; i<drops.length; i++) {
				drops[i].onfocus = unblur
			}
		}
	}


// DOM / GET PROPERTY
// original code from http://www.alistapart.com/

	function getIdProperty(id,property) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
				if (styleObject[property]) {
					return styleObject[ property ];
				}
			}
		return (styleObject != null) ?
		styleObject[property] :
		null;
	}


// DOM / SET PROPERTY
// original code from http://www.alistapart.com/

	function setIdProperty(id,property,value) {
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}


// hide en show layers

	function hide(id) {
		if (browserNew) {
			setIdProperty(id,"visibility","hidden");
		}
		else {
			if (browserName == "NS") { document.layers[id].visibility = "hide"; }
			else { document.all[id].style.visibility = "hidden"; }
		}
	}

	function show(id) {
		if (browserNew) {
			setIdProperty(id,"visibility","visible");
		}
		else {
			if (browserName == "NS") { document.layers[id].visibility = "show"; }
			else { document.all[id].style.visibility = "visible"; }
		}
	}


// CHANGE DISPLAY VALUE FOR LAYERS

	function switchDisplay(id,value) {
		if (browserNew) {
			setIdProperty(id,"display",value);
		}
		else {
			if (browserName == "NS") {
				document.layers[id].display = value;
			}
			else {
				document.all[id].style.display = value;
			}
		}
	}




function toggle(id, divName) {
    //for (var i=1;i<=30;i++) { document.getElementById('antw'+i).style.display = 'none'; }
    if (id.value != 'on') {
        id.value = 'on'
    } else {
        id.value = 'off'
    }
    divStyle = document.getElementById(divName).style;
    if (id.value=='on') {
        divStyle.display = 'block';
    } else {
        divStyle.display = 'none';
    }
}

function noSpam(user,domain) {
  locationstring = "mailto:" + user + "@" + domain;
  window.location = locationstring;
}

function ShowBigPicture(directory,image,orgWidth,orgHeight) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open('bigpicture.php?Directory="+directory+"&Picture="+image+"&orgWidth="+orgWidth+"&orgHeight="+orgHeight+"', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=480');");  
}

