    // VV : toevoegen:
    
    function developmentToggleVisible(id) {
    	var div = document.getElementById(id);
    	if (div.developmentToggleVisibleState) {
    		div.developmentToggleVisibleState = false;
    		div.style.display="none";
    	} else {
    		div.developmentToggleVisibleState = true;
    		div.style.display="inline";
    	}		
    }

	// alle checkboxes selecteren
	function selectAll(formId) {
		var form = document.getElementById(formId).elements;
		for (var i = 0; i < form.length; i++) {
	    	if (form[i].type == 'checkbox') form[i].checked = true;
	    }
	}
	
	// alle checkboxes deselecteren
	function deselectAll(formId) {
		var form = document.getElementById(formId).elements;
		for (var i = 0; i < form.length; i++) {
	    	if (form[i].type == 'checkbox') form[i].checked = false;
	    }
	}

    // eind VV : toevoegen


	/* Common client-side functions */
	
	/* functions for form validation */

	// whitespace characters


	function handleError() {
		return true;
	}

	window.onerror = handleError;


	var whitespace = " \t\n\r";
   var intPos = 0
        
    /****************************************************************/

	// Check whether string s is empty.
	function isEmpty(s)
		{ return ((s == null) || (s.length == 0))
	}

        
    /****************************************************************/
	

	function isWhitespace (s)
	{
		var i;

		// Is s empty?
		if (isEmpty(s)) return true;

		// Search through string's characters one by one
		// until we find a non-whitespace character.
		// When we do, return false; if we don't, return true.

		for (i = 0; i < s.length; i++)
		{
			// Check that current character isn't whitespace.
			var c = s.charAt(i);

			if (whitespace.indexOf(c) == -1) return false;
		}

		// All characters are whitespace.
		return true;
	}
	
	function ForceEntry(val, str) {
		var strInput = new String(val.value);

		if (isWhitespace(strInput)) {
			alert(str);
			return false;
		} else
			return true;

	}

	function notSupported()
	{ 
		alert('your browser is not supported.'); 
	}
	
	/* functions for highlighting hits */
	function highlight(strID) 
	{
		//window.alert("Entering function highlight.");
		
		//window.parent.frames("body").document.all.item(strID).style.color = "red";
		
		if (navigator.appName == 'Microsoft Internet Explorer')
		{
			window.parent.frames("body").document.all.item(strID).scrollIntoView();
			//window.alert("ScrollIntoView");
		}
		else
		{
			var elm = window.parent.frames['body'].window.document.getElementById(strID);
			elm.scrollIntoView();
			//window.alert("ScrollIntoView");
		}
		//window.alert("Exiting function highlight.");
	}
	
	/* functions for moving the highlighted hit*/
	function moveposition(strAction) {
		var strID = "";
		var strFrameset = window.document.forms("frameset").item("framename").value;

		if (intPos != 0) {
			strID = "hit" + intPos;
			if (strFrameset == "body") {
				window.parent.frames("content").frames("body").document.all.item(strID).style.background = "white";
			} else {
				window.parent.frames("content").document.all.item(strID).style.background = "white";
			}
		}
			
		// Check intPos value
		if (strAction == "prev") {
			// Move to prev position
			if (intPos>1) {
				intPos = intPos -1;
			} else {
				document.all.item("prev").style.display= "none";
			}
		} else {
			// Move to previous position
			intPos = intPos +1
			document.all.item("prev").style.display = "block";
		}
		// Check if a next hit exists
		var intCheck = intPos + 1;
		document.all.item("next").style.display= "none";
		var strCheck = "hit" + intCheck;

		strID = "hit" + intPos;
			
		if (strFrameset == "body") {
			window.parent.frames("content").frames("body").document.all.item(strID).style.background = "black";
			window.parent.frames("content").frames("body").document.all.item(strID).scrollIntoView();

			if (window.parent.frames("content").frames("body").document.all.item(strCheck)) {
				document.all.item("next").style.display = "block";
			}

		} else {
			window.parent.frames("content").document.all.item(strID).style.background = "black";
			window.parent.frames("content").document.all.item(strID).scrollIntoView();

			if (window.parent.frames("content").document.all.item(strCheck)) {
				document.all.item("next").style.display = "block";
			}
		}
	}
	
	function hover(objElm,objSwitch) {
		if (objSwitch == "on") {
			//window.alert("in");
			objElm.style.backgroundColor = "FDF9F6";
		} else if (objSwitch == "off") {
			//window.alert("out");
			objElm.style.backgroundColor = "#ffffff";
		}
	}
	
	function showHide(e) 
	{
		var srcElm;
		var trgElm;
		//var e;
		
		//window.alert("Entering function showHide");
		
		if(window.document.all)
		{
			//window.alert('Getting event');
			var e = window.event;
		}
		//e = window.event;
		
		if (navigator.appName == 'Microsoft Internet Explorer')
		{
			//window.alert("Internet Explorer");
			srcElm = e.srcElement;
		}
		else
		{
			//window.alert("Other browser");
			srcElm = e.target;
		}
		//window.alert("source element set");
		
		//window.alert( "SourceIndex: " + srcElm.sourceIndex);
		if (srcElm.tagName == "LI") 
		{
			//window.alert("Found list item");
			trgElm = document.all.item(srcElm.sourceIndex + 3);
			if (trgElm != null) 
			{
				if(trgElm.tagName == "UL") 
				{
					//window.alert("Found list");
					if(trgElm.style.display == "none") 
					{
						// show sublist
						trgElm.style.display = "block";
						srcElm.className = "expanded";
					} 
					else if(trgElm.style.display == "block") 
					{
						// hide sublist
						trgElm.style.display = "none";
						srcElm.className = "collapsed";
					}
				}
			}
		}
		//window.alert("Exiting function showHide");
	}
	
	function showhide2() 
	{
		// get the source of the event
		var elmSrc;
		var elmSublist;				// element to refer to the sublist of the current item

		elmSrc = window.event.srcElement;

		window.alert(elmSrc.children.length);
		window.alert(elmSrc.tagName);
		// check for the tagname of the source element
		if (elmSrc.tagName == 'LI') 
		{
			// check for number of children
			if(elmSrc.children.length == 1) 
			{
				// this listitem contains a sublist
				window.alert (elmSrc.children.item(0).tagName);
				elmSublist = elmSrc.children.item(0);
				if(elmSublist.style.display == 'none') 
				{
					// show the sublist
					//blend(elmSublist);
					elmSublist.style.display = "block";
					if(elmSrc.className == "folder_plus_hit" || elmSrc.className == "folder_min_hit") 
					{
						elmSrc.style.listStyleImage = "url(images/icons/folder_min_hit.gif)";
					} 
					else 
					{
						elmSrc.style.listStyleImage = "url(images/icons/folder_min.gif)";
					}
				} 
				else 
				{
					// hide the sublist
					elmSublist.style.display = "none";
					if(elmSrc.className == "folder_plus_hit" || elmSrc.className == "folder_min_hit") 
					{
						elmSrc.style.listStyleImage = "url(images/icons/folder_plus_hit.gif)";
					} 
					else 
					{
						elmSrc.style.listStyleImage = "url(images/icons/folder_plus.gif)";
					}
				}
			}
		} 
		else 
		{
			window.alert(elmSrc.tagName);
		}
	}

	function blend(elmList) {
		//window.alert("blend");
		//document.all.item("hoi").style.filter = "blendTrans(duration=2000)";
		elmList.style.widht = "100%";
		elmList.style.height = "100%";
		elmList.style.filter = "revealTrans(transition=12 duration=1)";
		elmList.filters.revealTrans.apply();
		elmList.style.display = 'block';

		elmList.filters.revealTrans.play();
	}
	
	function toggleVisibility(id) {
		var elem = document.getElementById(id);
		if (elem == null) {
		  return;
		}
		if (elem.style.display == 'none') {
			elem.style.display = 'block';
		} else {
			elem.style.display = 'none';
		}
	}
	
	function xmopen(path) {
		var app = new ActiveXObject("XMetal.Application");
		if (app != null) {
			app.Documents.Open(path, 1);
		}
		return false;
	}
	
	// Open popup for help pages
	function OpenPopup(url) {
		newwindow = window.open(url, 'popup', 'height=300,width=400,screenY=300,screenX=400,resizable=yes,scrollbars=yes,location=no,menubar=no,status=no,toolbar=no');
		newwindow.focus();
	}


function popupWindow(link, element)
{
	var newwindow = window.open(link, "Direct_to_high_resolution_image", "height=300,width=400,screenY=300,screenX=400,resizable=yes,scrollbars=yes,location=no,menubar=no,status=no,toolbar=no");

	if ( document.getElementById )
	{
		var anchor = document.getElementById( element ) ;
		if ( anchor )
		{
			newwindow.moveTo(anchor.offsetLeft, anchor.offsetTop ) ;
			newwindow.focus();
		}
	}
}

function viewMets(identifier)
  {
        var url = "/view_mets.jsp".concat("?identifier=", identifier);
        var win = window.open("","","status=0,toolbar=0,location=0,menubar=0,resizable=1,scrollbars=1,width=1024px");

        win.location.href = url;
        win=null;

        return false;
 }

