
/* ------------------------------------------------------------------------------------------------------------ */

//open popup for photo related to article
function fotovenster(imageurl, caption, copyright, width, height) {
	popupUrl("/template/overGeld1-0/jsp/foto.jsp?id="+imageurl+"&amp;caption="+caption+"&amp;copyright="+copyright, width, height);
}

//Fit the window to the size of the photo
function fitWindowSize() {
	nWidth = document.images[0].width;
	nHeight = document.images[0].height;// + 70;

	if (window.innerWidth) {
		window.innerWidth = nWidth;
		window.innerHeight = nHeight;
	} else if (document.all) {
		window.resizeTo(nWidth, nHeight);
		nWidth -= (document.body.clientWidth - nWidth);
		nHeight -= (document.body.clientHeight - nHeight);
		window.resizeTo(nWidth, nHeight);
	}
}


//function to check a form for correct input

function vraagformCheck ()
{
	var allValid = true;
	//temporary skip checks
		
	var re = /^\s{1,}$/g; //match any white space including space, tab, form-feed, etc.
			
	//no reaction text
	if ((document.vraagfrm.vraag.value.length==0) || (document.vraagfrm.vraag.value==null) || (document.vraagfrm.vraag.value.search(re) > -1) || (document.vraagfrm.vraag.value=="")) {
		allValid = false ;
		history.go(0);
		alert("U heeft geen vraag ingevuld.");
		return false;
	}
	
	//no sender	
	if(document.vraagfrm.naam.value=="") {
		allValid = false ;
		history.go(0);
		alert("U heeft geen naam ingevuld.");
		return false;
	}	
	
	//no adress
	if(document.vraagfrm.woonplaats.value=="") {
		allValid = false ;
		history.go(0);
		alert("U heeft geen woonplaats ingevuld.");		
		return false;
	}	
	else 
	{
	if (allValid == true)
		window.open('about:blank','popup','width=200,height=150');
		document.vraagfrm.submit();
		history.go(-1);
		return true;
	}
}

//Functions to handle layers which are open or closed---------------------------//
//Functions to handle layers which are open or closed---------------------------//

function MM_showHideLayersClean() {
	var i, p, v, obj; 
	var args=MM_showHideLayersClean.arguments;
  		
	for (i=0; i < (args.length-2); i+=3) 
		if ((obj=MM_findObj(args[i])) != null) { 
			v=args[i+2];
		if (obj.style) { 
			obj=obj.style; 
			v=(v == 'show') ? 'visible' : (v == 'hide') ? 'hidden':v; 
		}
		obj.visibility=v; 	
	}
}
	
function MM_findObj(n, d) {
  		
	var p,i,x;  
  		
	if (!d) 
  		d=document; 
  	if ((p = n.indexOf("?")) > 0 && (parent.frames.length)) {
    	d=parent.frames[n.substring(p+1)].document; 
    	n=n.substring(0,p);
    }
  	if(!(x = d[n]) && (d.all)) 
  		x=d.all[n]; 
  	for (i=0; !x && i < d.forms.length; i++) 
  		x=d.forms[i][n];
  	for(i=0; !x && d.layers && i < d.layers.length; i++) 
  		x=MM_findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) 
  		x=d.getElementById(n); 
  	return x;
}
	
function MM_showHideLayers() {

	var i, p, v, obj; 
	var	args=MM_showHideLayers.arguments;
  	var balk = document.getElementById('menuBalk');
  	var balk2 = document.getElementById('menuBalkSluit');
	var openMenu = document.getElementById('menuOpen');
	var closeMenu = document.getElementById('menuClose');
  		
	for (i=0; i < (args.length-2); i+=3) 
		if ((obj=MM_findObj(args[i])) != null) { 
			v=args[i+2];
		if (obj.style) { 
			obj=obj.style; 
			v=(v == 'show') ? 'visible' : (v == 'hide') ? 'hidden':v; 
		}
		if (v == 'visible'){
			balk2.height = args[3];		
		}

		obj.visibility=v; 	
	}
}

//Hilight the menu items on mouse-over ----------------------------------//

function nav_menu_hilite(item, level, nav_hilite_kop_color) {
	item.style.backgroundColor = nav_hilite_kop_color;
	item.style.cursor='hand';
    item.style.color='#000';
}

function nav_menu_unhilite(item,color) {
	item.style.backgroundColor = color
    item.style.color='';
}

function findLayer(n, d) {
        var p,i,x;
        if (!d)
                d=document;
        if ((p = n.indexOf("?")) > 0 && (parent.frames.length)) {
                d=parent.frames[n.substring(p+1)].document;
                n=n.substring(0,p);
        }
        if(!(x = d[n]) && (d.all))
                x=d.all[n];
        for (i=0; !x && i < d.forms.length; i++)
                x=d.forms[i][n];
        for(i=0; !x && d.layers && i < d.layers.length; i++)
                x=findLayer(n,d.layers[i].document);
        if(!x && d.getElementById)
                x=d.getElementById(n);
        return x;
}


function showhideLayer() {
        var i, p, v, obj;
        var args=showhideLayer.arguments;

        for (i=0; i < (args.length-2); i+=3)
                if ((obj=findLayer(args[i])) != null) {
                        v=args[i+2];
                        if (obj.style) {
                                obj=obj.style;
                                v=(v == 'show') ? 'visible' : (v == 'hide') ? 'hidden':v;
                        }
                        obj.visibility=v;
                }
}
