var is = new browserCheck();
var imgExt = ".gif";

//var statements = new Array ();

var myTimer;
function browserCheck() {
	var b = navigator.appName;
	this.agent = window.navigator.userAgent;
	this.win = (this.agent.indexOf('Win')>0);
	this.mac = (this.agent.indexOf('Mac')>0);
	switch (b) {
		case "Netscape": this.b = "ns"; break;
		case "Microsoft Internet Explorer": this.b = "ie"; break;
		default: this.b = b};
	this.version = navigator.appVersion;
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.min = (this.ns||this.ie);
	if (this.ns4) {
		var d = document; var w = window;
		if (typeof d.cs == 'undefined') {
			d.cs = new Object;
			d.cs.csFix = new Object};
		d.cs.csFix.w = w.innerWidth;
		d.cs.csFix.h = w.innerHeight;
		window.onresize = NSFixFct}};
function NSFixFct() {
	var d = document; var w = window;
	if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
		d.location = d.location}};
function clickReturn () {
	if (is.ie && (is.agent.indexOf("Mozilla/3") >= 0) && (is.mac)) {
		return true}
	else {
		return false}};
function layerObj (id) {
	this.id = id;
	this.obj = findLayer (this.id);
	if (!this.obj) {
		this.obj="";
	}
	if (is.ns4) {
		this.x = this.obj.left;
		this.y = this.obj.top
		}
	else {
		this.x = this.obj.offsetLeft;
		this.y = this.obj.offsetTop
		}
	this.pos_x = this.x;
	this.pos_y = this.y;
	this.write = writeLayer;
	this.clip = clipLayer;
	this.getWidth = getWidth;
	this.getHeight = getHeight;
	this.setHeight = setHeight;
	this.getClip = getClipValue;
	this.moveTo = moveLayerTo;
	this.moveBy = moveLayerBy;
	this.alignMiddle = alignMiddle;
	this.show = show;
	this.hide = hide};
function navObj (id) {
	this.id = id + "NavObj";
	eval (this.id+"=this");
	this.image = new imageObj (id.replace (/__/g, '_:'), new Array ("current", "h", "o"), "navigation");
	this.over = new Function (this.id + '.image.set (' + this.id + '.image.h.src)');
	this.out = new Function (this.id + '.image.set (' + this.id + '.image.o.src)');
	this.reset = new Function (this.id + '.image.set (' + this.id + '.image.current.src)')};
function logoObj (id, mouseOverSrc) {
	this.id = id + "LogoObj";
	eval (this.id+"=this");
	this.image = new imageObj (id.replace (/__/g, '_:'), new Array ("current"));
	this.image.h = new Image ();
	this.image.h.src = mouseOverSrc;
	this.over = new Function (this.id + '.image.set (' + this.id + '.image.h.src)');
	this.out = new Function (this.id + '.image.set (' + this.id + '.image.current.src)')};
function textObj (id, w, h, show) {
	this.id = id + "TextObj";
	eval(this.id+"=this");
	this.layer = new layerObj (id);
	this.layer.w = this.layer.getWidth ();
	this.layer.h = this.layer.getHeight ();
	if (w == null) {
		w = this.layer.w};
	if (h == null) {
		h = this.layer.h};
	if (show) {
		this.layer.show ()}};
function imageObj (id, preloads, urlprefix) {
	if (urlprefix == null) {
		this.url = "template/" + id.replace (/:/g, '/')}
	else {
		this.url =  urlprefix + "/" + id.replace (/:/g, '/')};
	if (is.ns4) {
		this.obj = findElement(id,0)}
	else {
		this.obj = document.images[id]};
	for (var ct=0;ct<preloads.length;ct++) {
		var suffix = "_" + preloads[ct];
		if (preloads[ct] == "_") {
			suffix = ""};
		this[preloads[ct]] = new Image ();
		if (preloads[ct] != "current") {
			this[preloads[ct]].src = imgprefix + "images/" + this.url + suffix + ".gif"}
		else {
			this[preloads[ct]].src = this.obj.src}};
	this.set = setImage};
function findElement(name, layer) {
	if (is.version < 4) {
		return document[name]};
	if (is.v == 4) {
		var curDoc = layer ? layer.document : document, elem = curDoc[name];
		if (!elem) {
			for (var i=0;i<curDoc.layers.length;i++) {
				elem = findElement (name, curDoc.layers[i]);
				if (elem) {
					return elem}}}}
	else {
		elem = document.getElementById (name)};
	return elem};
function findLayer (name) {
	if (is.ie) {
		return document.all.tags("div")[name]}
	else {
		return findElement(name,0)}};
function setImage (url) {
	this.obj.src = url};
function getWidth () {
	if (is.ns4) {
		return this.obj.clip.width}
	else if (is.ie) {
		return 500}
	else {
		return parseInt (this.obj.scrollWidth)};
	return -1};
function getHeight () {
	if (is.ns4) {
		return this.obj.clip.height}
	else if (is.ie) {
		return this.obj.clientHeight}
	else {
		return parseInt (this.obj.scrollHeight)};
	return -1};
function setHeight (value) {
	if (is.ns4) {
		this.obj.document.height = value}
	else {
		this.obj.style.height = value};
	return true};
function writeLayer (html) {
	if (is.ns4) {
		this.obj.document.open ();
		this.obj.document.write (html);
		this.obj.document.close ()}
	else {
		this.obj.innerHTML = html}};
function moveLayerTo (x, y) {
	if (x&&this.obj) {
		this.x = x;
		if (is.ie) {
			 this.obj.style.pixelLeft = this.x}
		else {
			if (is.ns4) {
				this.obj.left = this.x}
			else {
				this.obj.style.left = this.x}}};
	if (y!=null) {
		this.y = y;
		if (is.ie) {
			 this.obj.style.pixelTop = this.y}
		else {
			if (is.ns4) {
				this.obj.top = this.y}
			else {
				this.obj.style.top = this.y}}}};
function moveLayerBy (dx, dy) {
	this.moveTo(this.x+dx,this.y+dy)};
function clipLayer(clipleft, cliptop, clipright, clipbottom) {
	if (is.ns4) {
		this.obj.clip.left  = clipleft;
		this.obj.clip.top = cliptop;
		this.obj.clip.right = clipright;
		this.obj.clip.bottom = clipbottom}
	else {
		this.obj.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';}};
function getClipValue (which) {
	if (is.ns4) {
		return this.obj.clip[which]}
	else {
		if (this.obj.style.clip) {
			var clip = getIEClipValues(this.obj.style.clip);
			switch (which) {
				case "top": return clip[0];
				case "right": return clip[1];
				case "bottom": return clip[2];
				case "left": return clip[3]}}};
	return 0};
function getIEClipValues(str) {
	var clip = new Array();
	var i;
	i = str.indexOf("(");
	clip[0] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[1] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[2] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[3] = parseInt(str.substring(i + 1, str.length), 10);
	return(clip)};
function show () {
	if (is.ns4) {
		this.obj.visibility = 'show'}
	else {
		if (this.obj.style) {
		this.obj.style.visibility = "visible"}}};
function hide () {
	if (is.ns4) {
		this.obj.visibility = 'hide'}
	else {
		this.obj.style.visibility = "hidden"}};
function alignMiddle () {
	var pageWidth = 712, leftIndent = 0;
	if (is.ie) {
		leftIndent = (document.body.clientWidth-pageWidth)/2 + 8}
	else {
		leftIndent = (window.innerWidth-pageWidth)/2};
	left = leftIndent + this.pos_x;
	if (left <  this.pos_x) {
		left =  this.pos_x};
	this.moveTo (left, this.y)};
function alignLayers() {
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = eval(myLayers[ct] + "TextObj");
		myObj.layer.alignMiddle ()}};
function revealLayer() {
	var bottom = this.height-(this.inc*this.step);
	this.layer.clip (0,bottom,230,this.height);
	if (bottom > 0) {
		myTimer = setTimeout (this.id + '.reveal()', this.delay)}
	else {
		this.inc = 0};
	this.inc++};
function concealLayer() {
	var bottom = this.inc*this.step;
	this.layer.clip (0,bottom,230,this.height);
	if (bottom < this.height) {
		myTimer = setTimeout (this.id + '.conceal()', this.delay)}
	else {
		this.inc= 0};
	this.inc++};
function mainMouseAction (action, name) {
	if (showQuotes) {
		clearTimeout(myTimer);
		for (var ct=0;ct<statements.length;ct++) {
			myObj = eval (statements[ct] + "StatementTextObj");
			myObj.layer.clip (0,202,230,202);
			myObj.inc = 0};
		var myStatement = eval (name + "StatementTextObj")};
	var myNav = eval (name + "NavObj");
	switch (action) {
		case "over": {
			myNav.over ();
			if (showQuotes) {
				myStatement.reveal ()};
			break};
		case "out": {
			myNav.out ();
			if (showQuotes) {
				myStatement.conceal ()};
			break};
		case "reset": {
			myNav.reset ();
			if (showQuotes) {
				myStatement.conceal ()};
			break}}};
function showCases (section) {
	var size, s = "", js = "", myCases = eval (section + "Cases");
	myCases.length>3?size=3:size=myCases.length;
	s = "<table cellspacing=0 cellpadding=0 border=0 style='width:600px'><tr>";
	for (var ct=0;ct<size;ct++) {
		s = s + "<td style='width:200px;vertical-align:top;padding-right:10px'>";
		var myImgObj = "caseImg" + ct;
		var myImg = myCases[ct][3].toLowerCase ();
		if (myImg != "") {
			var myImgFolder = myImg.substr (0,1);
			var myImgSrc = homeprefix + "images/" + myImgFolder   + "/" + myImg;
			var myImgM = myCases[ct][4].toLowerCase ();
			var myImgMFolder = myImg.substr (0,1);
			var myImgMSrc = homeprefix + "images/" + myImgMFolder   + "/" + myImgM;
			js =  js + "new logoObj ('" + myImgObj + "', '" + myImgMSrc + "'); ";
			s = s + "<a href='" + homeprefix + myCases[ct][2] + "' onMouseOver='" + myImgObj + "LogoObj.over()' onMouseOut='" + myImgObj + "LogoObj.out()'>";
			s = s + "<img name='" + myImgObj + "' src='" +  myImgSrc + "' border=0></a><br />"};
		s = s + myCases[ct][1] + "<br />";
		s = s + "<a href='" + homeprefix + myCases[ct][2] + "'>lees meer...</a><br />";
		s = s + "</td>"};
	for (var ct=0;ct<(3-size);ct++) {
		s = s + "<td>&nbsp;</td>"};
	s = s + "</tr></table>";
	s = s + "<script language='javaScript'>" + js + "</script>";
	return s};
function positionFooter () {
	var screenHeight;
	if (is.ns) {
		 screenHeight = window.innerHeight;
		screenHeight = screenHeight + window.pageYOffset};
	if (document.all) {
		screenHeight = document.body.clientHeight;
		screenHeight = screenHeight + document.body.scrollTop};
	footerTextObj.layer.moveTo (footerTextObj.layer.x, screenHeight - footerTextObj.layer.getHeight ());
	setTimeout ("positionFooter ()", 10)};
function nudgeFooter () {
	var screenHeight, footerHeight = footerTextObj.layer.getHeight ();
	if (is.ns) {
		screenHeight = window.innerHeight;
		screenHeight = screenHeight + window.pageYOffset};
	if (is.ie) {
		screenHeight = document.body.clientHeight;
		screenHeight = screenHeight + document.body.scrollTop};
	footerTextObj.layer.moveTo (footerTextObj.layer.x, footerTextObj.layer.y-1);
	if (footerTextObj.layer.y > (screenHeight - footerHeight)) {
		setTimeout ("nudgeFooter ()", 10)}
	else {
		positionFooter ()}};
function initFooter () {
	var screenHeight;
	if (is.ns) {
		screenHeight = window.innerHeight;
		screenHeight = screenHeight + window.pageYOffset};
	if (is.ie) {
		screenHeight = document.body.clientHeight;
		screenHeight = screenHeight + document.body.scrollTop};
	footerTextObj.layer.moveTo (footerTextObj.layer.x, screenHeight);
	setTimeout ("nudgeFooter ()", 200)};
function printPage () {
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = eval (myLayers[ct] + "TextObj");
		myObj.layer.hide()};
	bodyTextObj.layer.moveTo (2,50);
	bodyTextObj.layer.show();
	printTextObj.layer.show ();
	if (is.ie) {
		window.setTimeout ("unprintPage()", 1000)}
	else {
		alert ("Klik op het pagina-icoon om terug te keren")};
	window.setTimeout ("window.print()", 100)};
function unprintPage () {
	printTextObj.layer.hide ();
	bodyTextObj.layer.moveTo (bodyTextObj.layer.pos_x, bodyTextObj.layer.pos_y);
	logoTextObj.layer.moveTo (logoTextObj.layer.pos_x, logoTextObj.layer.pos_y);
	alignLayers();
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = eval (myLayers[ct] + "TextObj");
		myObj.layer.show()}};
function init() {
	window.onresize = alignLayers;
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = new textObj (myLayers[ct], null, null, true);
		myObj.layer.pos_x = myObj.layer.x;
		myObj.layer.pos_y = myObj.layer.y;
		myObj.layer.alignMiddle ()};
	//new textObj ("print", null, null, false);
	/*
	for (var ct=0;ct<nav.length;ct++) {
		new navObj (nav[ct])};
	
	if (showQuotes) {
		for (var ct=0;ct<statements.length;ct++) {
			myObj = new textObj (statements[ct] + "Statement", null, null, false);
			myObj.reveal = revealLayer;
			myObj.conceal = concealLayer;
			myObj.layer.show ();
			myObj.layer.obj.style.backgroundColor = "#888888";
			myObj.step = 56;
			myObj.inc = 0;
			myObj.height = 224;
			myObj.delay = 10;
			myObj.layer.clip (0,myObj.height,230,myObj.height)}};
		*/	
	//initFooter ();
	initialized = true
	}
