<!--

// --- CLIENTCHECK ---

function getClient() {
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()
    var apv=navigator.appVersion.toLowerCase()
    this.major = parseInt(navigator.appVersion)
    this.minor = parseFloat(navigator.appVersion)
    // browserversion
    this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
    this.ns4 = (this.ns && (this.minor >= 4.03) && (this.major < 5))
	this.ns6 = (this.ns && (this.major == 5))
	this.gecko = (this.ns && (this.major >= 5))
    this.ie   = (agt.indexOf("msie") != -1)
    this.ie4  = (this.ie && (this.major == 3))
	this.ie45 = (agt.indexOf('msie 4.5') != -1);
    this.ie5  = (this.ie && (this.major == 4))
    // platform
	this.mac = (apv.indexOf("macintosh")>0);
	this.win = (apv.indexOf("win")>0);	
    // compatible browsers
	this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
	this.ns4comp = (this.ns4);
	this.ns6comp = (this.gecko || this.ns6);
	this.comp = (this.ie4comp || this.ns4comp || this.ns6comp);
	return (this)
}

var is = new getClient()


// *************************** TOEVOEGING/AANPASSING EDEN - 20/01/2004

// -- NOT COMPATIBLE PAGE VARIABELE:
var nonCompPage = "notcompatible.html";

// -- COOKIE FUNCTIONS:


function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
		return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}

function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function doBrowserCheck(){
	SetCookie ("testMuseum.nl", 0);
	if(document.cookie){
		if(GetCookie("museum.nl") == null){
			if (!is.comp) window.location = nonCompPage;
		} 
	} 
}

// -- IF BROWSER DOES RE-PRESENT ITSELF AS NONE OF THE ABOVE AND COOKIES ARE ENABLED THEN RE-DIRECT TO MESSAGE-PAGE
//doBrowserCheck();

// *************************** EINDE TOEVOEGING/AANPASSING EDEN - 20/01/2004

// --- GET ELEMENT(LAYERREFERENCE) ---

function getElt () 
{ if (is.ns4comp)
  {
    var currentLayer = document.layers[getElt.arguments[0]];
    for (var i=1; i<getElt.arguments.length && currentLayer; i++)
    {   currentLayer = currentLayer.document.layers[getElt.arguments[i]];
    }
    return currentLayer;
  } 
  else if (is.ie4comp) {
    var elt = eval('document.all.' + getElt.arguments[getElt.arguments.length-1]);
    return(elt);
  }
  else if (is.ns6comp) {
	var elt = document.getElementById(getElt.arguments[getElt.arguments.length-1]);
	return(elt);
  }
}


// --- VISIBILITY ---

function setEltVisibility (elt, value)
{  if (is.ns4comp) elt.visibility = value;
   else if (is.ie4comp) elt.style.visibility = value;
   else if (is.ns6comp) elt.style.visibility = value;
}

function getEltVisibility (elt)
{  if (is.ns4comp) 
   {  var value = elt.visibility;
      if (value == "show") return "visible";
      else if (value == "hide") return "hidden";
      else return value;
   }
   else if (is.ie4comp) return elt.style.visibility;
   else if (is.ns6comp) return elt.style.visibility;
}


// --- POSITION ---

function moveEltTo (elt, x, y) 
{ if (is.ns4comp) elt.moveTo(x, y);
  else if (is.ie4comp) {
    elt.style.pixelLeft = x;
    elt.style.pixelTop  = y;
  }
  else if (is.ns6comp) {
    elt.style.left = x;
    elt.style.top  = y;
  }
}

// don't work with nested layers
function moveEltBy (elt, x, y) 
{ if (is.ns4comp) elt.moveBy(x, y);
  else if (is.ie4comp)  {
    elt.style.pixelLeft = parseInt(elt.offsetLeft) + x;
    elt.style.pixelTop  = parseInt(elt.offsetTop)  + y;
  }
  else if (is.ns6comp)  {
    elt.style.left = (parseInt(elt.offsetLeft) + x + "px");
    elt.style.top  = (parseInt(elt.offsetTop)  + y + "px");
  }
}

function setEltLeft (elt, x) {
  if (is.ns4comp)     elt.left=x;
  else if (is.ie4comp) elt.style.pixelLeft=x;
  else if (is.ns6comp) elt.style.left = (x + "px");
}


function setEltTop (elt, y) 
{ if (is.ns4comp)     elt.top=y;
  else if (is.ie4comp) elt.style.pixelTop=y;
  else if (is.ns6comp) elt.style.top= (y + "px");
}

function getEltLeft (elt) {
  if (is.ns4comp)     return (elt.left);
  else if (is.ie4comp) return (elt.style.pixelLeft);
  else if (is.ns6comp) return (elt.offsetLeft);
}

function getEltTop (elt) 
{ if (is.ns4comp)     return (elt.top);
  else if (is.ie4comp) return (elt.style.pixelTop);
  else if (is.ns6comp) return (elt.offsetTop);
}

function getEltWidth (elt)
{ if (is.ns4comp) return(elt.document.width);
  else if (is.ie4comp) return (elt.offsetWidth);
  else if (is.ns6comp) return (elt.offsetWidth);
}

function getEltHeight (elt)
{ if (is.ns4comp) return(elt.document.height);
  else if (is.ie4comp) return (elt.offsetHeight);
  else if (is.ns6comp) return (elt.offsetHeight);
}


// --- CLIPPING ---

function setEltClip (elt, cliptop, clipright, clipbottom, clipleft) 
{ if (is.ns4comp) {
    elt.clip.left   = clipleft;
    elt.clip.top    = cliptop;
    elt.clip.right  = clipright;
    elt.clip.bottom = clipbottom;
  }
  else if (is.ie4comp)  elt.style.clip = 'rect(' + cliptop + ' ' +  
       clipright + ' ' + clipbottom + ' ' + clipleft +')';
  else if (is.ns6comp)  elt.style.clip = 'rect(' + cliptop + ' ' +  
       clipright + ' ' + clipbottom + ' ' + clipleft +')';
}


// --- Z-INDEX ---

function getEltZIndex (elt) 
{ if (is.ns4comp) return(elt.zIndex);
  else if (is.ie4comp) return (elt.style.zIndex);
  else if (is.ns6comp) return (elt.style.zIndex);
}

function setEltZIndex (elt, z) 
{ if (is.ns4comp) elt.zIndex = z;
  else if (is.ie4comp) elt.style.zIndex = z;
  else if (is.ns6comp) elt.style.zIndex = z;
}


// --- WRITE INTO LAYERS ---

function setEltContent(elt, content) {
	if (is.ns4comp) 
	{	elt.document.open();
		elt.document.write(content);
		elt.document.close();
	} 
	else if (is.ie4comp) elt.innerHTML = content;
	else if (is.ns6comp) elt.innerHTML = content;
}

// --- WINDOW PROPERTIES ---

function getWinWidth() 
{ if (is.ns4comp) return(window.innerWidth);
  else if (is.ie4comp) return(document.body.clientWidth);
  else if (is.ns6comp) return(window.innerWidth);
}

function getWinHeight() 
{ if (is.ns4comp) return(window.innerHeight);
  else if (is.ie4comp) return(document.body.clientHeight);
  else if (is.ns6comp) return(window.innerHeight);
}

function getWinSrollLeft()
{ if (is.ns4comp) return(window.pageXOffset);
  else if (is.ie4comp) return(document.body.scrollLeft);
  else if (is.ns6comp) return(window.pageXOffset);
}

function getWinSrollTop()
{ if (is.ns4comp) return(window.pageYOffset);
  else if (is.ie4comp) return(document.body.scrollTop);
  else if (is.ns6comp) return(window.pageYOffset);
}

function getPageHeight() 
{ if (is.ns4comp) return(document.height);
  else if (is.ie4comp && is.mac) return(document.body.offsetHeight);
  else if (is.ie4comp && !is.mac) return(document.body.scrollHeight);
  else if (is.ns6comp) return(document.body.offsetHeight);
}

function getPageWidth() 
{ if (is.ns4comp) return(document.width);
  else if (is.ie4comp && is.mac) return(document.body.offsetWidth);
  else if (is.ie4comp && !is.mac) return(document.body.scrollWidth);
  else if (is.ns6comp) return(document.body.offsetWidth);
}


// ---MOUSE EVENT PROPERTIES ---

function getMouseWinLeft(e) 
{ if (is.ns4comp) return(e.pageX - window.pageXOffset);
  else if (is.ie4comp) return(event.clientX);
  else if (is.ns6comp) return(e.pageX - window.pageXOffset);
}

function getMouseWinTop(e) 
{ if (is.ns4comp) return(e.pageY - window.pageYOffset);
  else if (is.ie4comp) return(event.clientY);
  else if (is.ns6comp) return(e.pageY - window.pageYOffset);
}

function getMousePageLeft(e) 
{ if (is.ns4comp) return(e.pageX);
  else if (is.ie4comp) return(event.clientX + document.body.scrollLeft);
  else if (is.ns6comp) return(e.pageX);
}

function getMousePageTop(e) 
{ if (is.ns4comp) return(e.pageY);
  else if (is.ie4comp) return(event.clientY + document.body.scrollTop);
  else if (is.ns6comp) return(e.pageY);
}


// --- IMAGE SWAP ---

function swapImage(imgSrc, imgName, elt) { 
	if ((is.ns4comp) || (is.ie4comp)) {
		if (swapImage.arguments.length == 3) {
			eval("elt.document." + imgName + ".src = '" + imgSrc + "'");
		} else {
			eval("document." + imgName + ".src = '" + imgSrc + "'");
		}
	} else if (is.ns6comp) {
		var img = document.getElementsByName(imgName);
		img[0].src = imgSrc;
	}
}


// --- IMAGE PRELOAD ---

function preloadImages() { 
	if (document.images) {
		var imgStr = preloadImages.arguments;
		if (!document.preloadArray) document.preloadArray = new Array();
		var n = document.preloadArray.length;
		for (var i=0; i<preloadImages.arguments.length; i++) {
			document.preloadArray[n] = new Image;
			document.preloadArray[n].src = imgStr[i];
			n++;
		} 
	}
}

	
function ToggleElement(element) {
  var text = document.getElementById(element+'Text');
  var form = document.getElementById(element+'EditForm');
  if(text.style.display=='none'){
    text.style.display='block';
	form.style.display='none';
  }else{
    text.style.display='none';
	form.style.display='block';
  }
}


// Popup
function popWindow(address, width, height) {
	if (screen) {
		y=(screen.availHeight - height)/2;
		x=(screen.availWidth - width)/2;
	}
	if (screen.availWidth > 1800) {
		x=((screen.availWidth/2) - width)/2;
	}
	// UB: focus() doesn't work properly in IE on win; hence this trick
	if (navigator.appName.indexOf('Explorer') != -1 && !is.mac){
		popupWin = window.open('','popup','toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=1,scrollbars=1,width='+ width +',height='+ height +',screenX='+x+',screenY='+y+',top='+y+',left='+x);
		popupWin.close();
	}
	popupWin = window.open(address,'popup','toolbar=0,location=0,directories=0,status=1,menubar=0,resizable=1,scrollbars=1,width='+ width + ',height=' + height +',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	popupWin.focus();
}


// --- FORMS ---

function getForm(formName,elt) { 
	if ((is.ns4comp) || (is.ie4comp)) {
		if (getForm.arguments.length == 2) {
			return eval("elt.document." + formName);
		} else {
			return eval("document." + formName);
		}
	} else if (is.ns6comp) {
		return document.getElementsByName(formName);
	}
}

function formSubmit(elt,formName) { 
	formRef = getForm(formName,elt);
	formRef.submit();
}

function formReset(elt,formName) { 
	formRef = getForm(formName,elt);
	formRef.reset();
}


// --- FIX RESIZE BUG IN NETSCAPE ---

function initResizeBug() {
	document.orPageWidth = innerWidth;
	document.orPageHeight = innerHeight;
	onresize = nsResizeBug;
}

function nsResizeBug() {
	if (innerWidth != document.orPageWidth || innerHeight != document.orPageHeight) location.reload();
}

if (is.ns4comp) initResizeBug();


// -->

