function lightup(imageobject, opacity){
	if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5){
		imageobject.style.MozOpacity=opacity/100;
	}else{
		imageobject.filters.alpha.opacity=opacity;
	}
}

function div2front(id, color) {
	//if (color){
		resetdivs(color);
	//}else{
			
	//}
	if ((obj=fo(id))!=null){
		obj.style.zIndex = 30;
		if(color)obj.style.background = '#fff';
	}
}
ctr = 0;
function setBG(){
	bgx += xd;
	bgy += yd;
	ctr++;
	document.body.style.backgroundPosition = bgx+'px '+bgy+'px';
	if (ctr<10){
		mv = setTimeout('setBG()', 0);
	}
}

function resetdivs(color){
	for (i=0;i<10;i++){
		if ((obj=fo('log_'+i))!=null){
			obj.style.zIndex = i;
			if(color)obj.style.background = color;
		}else{
			break;	
		}
	}
	obj = fo('quote');
	obj.style.zIndex = 1;
}


function gs(id) {
	de = document.getElementById;
	da = document.all;
	if(de){return document.getElementById(id).style;} else if(da) {return document.all[id].style;} else {return document[id];}
}
function visible(id) {
	if ((obj=fo(id))!=null) {
		obj.style.display = ((obj.style.display == 'none')?'block' :'none');
	}
}

function show(id) {
	gs(id).zIndex = 200;
	gs(id).display = 'block';
	//gs(id).top = MouseX();
	//gs(id).left = MouseY();

}
function hide(id) {
	if ((obj=fo(id))!=null) {
		obj.style.display = 'none';
		obj.style.zIndex = 0;
	}
}

function MouseX() {
	var posx = 0;
	var e = window.event;
	if (e.pageX){
		posx = e.pageX;
	}else if (e.clientX){
		posx = e.clientX + document.body.scrollLeft+document.documentElement.scrollLeft;
	}
	return posx;
}
function MouseY() {
	var posy = 0;
	var e = window.event;
	if (e.pageY){
		posy = e.pageY;
	}else if (e.clientY){
		posy = e.clientY + document.body.scrollTop+document.documentElement.scrollTop;
	}
	return posy;
}

function swap(id,id2) {
	document.getElementById(id).style.display = ((document.getElementById(id).style.display == 'none')?'block' :'none');
	document.getElementById(id2).style.display = ((document.getElementById(id).style.display == 'none')?'block' :'none');
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=fo(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openSite(URLStr)
{
    var maxx = screen.width;
    var maxy = screen.height;
    windowprops = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=100,height=100,left=100,top=100";
    window.open(URLStr+"&maxx="+maxx+"&maxy="+maxy,"",windowprops);
}

function changesubmit() {
	document.forms[0].elements['opslaan'].disabled = true;
	document.forms[0].elements['opslaan'].value = 'Moment a.u.b.';
}

function expand(n) {
	document.getElementById(n).style.display = ((document.getElementById(n).style.display == 'none')?'block' :'none');
	document.getElementById('btn_'+n).src = ((document.getElementById(n).style.display == 'none')?'gfx/expand.gif' :'gfx/contract.gif');	
}

function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	} else {
		if (document.documentElement&&
			document.documentElement.clientHeight) {
			windowHeight=document.documentElement.clientHeight;
		} else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function fo(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=fo(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=fo(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function resize() {
	h = getWindowHeight() - 340;
	hcount = 0;
	for(i=0;i<3;i++) {
		if(document.getElementById('agendalistitem'+i)) {
			if(hcount < h) {
				document.getElementById('agendalistitem'+i).style.display = 'block';
				hcount += document.getElementById('agendalistitem'+i).offsetHeight;
			} else {
				document.getElementById('agendalistitem'+i).style.display = 'none';
			}
		}
	}
}

