function getStyle(obj){
	if(document.layers) return obj;
	else return obj.style;
}
function MM_findObj(n, d) { //v4.01
	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 mov(obj){
		obj.src = obj.src.substring(0,obj.src.lastIndexOf('.'))+"_over.gif";
}
function mot(obj){
		obj.src = obj.src.substring(0,obj.src.lastIndexOf('_'))+".gif";
}
var detoetsid=0;
function stemOpDePoll(){
	if(window.detoetsid) checkForm(window.document.forms.toets,detoetsid);
	//else return false;//alert("Er is geen toets om op te stemmen")
}
function writePollPercentageBar(id,perc){
	var str = "<div id='"+id+"' class='bw_toetspercentage'><div id='bar"+id+"' class='bw_toetspercentagebar' style='width:"+perc+" px'><img src='images/spacer.gif' border='0' width='100%' height='3' /></div></div>";
	document.write(str);
}
function setPollPercentage(indicatorId,perc){
	var bar = MM_findObj(indicatorId);
	if(bar!=null){
			var st = getStyle(bar);
			st.width = parseInt(perc)+"px";		
	}
}
var _pop=null;
var _poptim=null;

function ow(url,w,h,op,win,c,aot,tim){
	var sw=screen.width;
	var sh=screen.height;
	var _W=w?w:800;
	var _H=h?h:600;
	var _l=(sw-_W)/2;
	var _t=(sh-_H)/2;
	var _n=win||"nwin";
	var _o="location=0,directory=0,status=0,titlebar=0,menubar=0,resizable=1,copyhistory=0";
	var _p=",width="+_W+",height="+_H+",";
	if(c) _p+="left="+_l+",top="+_t+",screenX="+_l+",screenY="+_t;
	if(_pop&&!_pop.closed) { _pop.close(); _pop=null; clearTimeout(_poptim);}
	if(!op||op==null||op=='') _pop=window.open('about:blank',_n,_o+_p);
	else _pop=window.open('about:blank',_n,op+_p);
	_pop.location.href=url;
	if(_pop.focus()) _pop.focus();
	if(aot && !tim) _poptim=setTimeout('focPop()',1000);
	else if(tim) _poptim=setTimeout('_pop.close()',tim);
}
function focPop(){
	if(_pop&&!_pop.closed){
		_pop.focus();
		_poptim=setTimeout('focPop()',1500);
	}
}

function checkFormInput(form){
	var tst=0;
	var str="De volgende velden moeten aangepast worden:\r\n";
	if(form.emailadres.value.length<4){
		tst=1;
		str+="  - Uw e-mail is niet (correct) ingevuld. \r\n";
	}
	if(form.naamAfzender.value.length<2){
		tst=1;
		str+="  - Uw heeft uw naam niet (correct) ingevuld. \r\n";
	}if(tst) alert(str);
	else form.submit();
}

