function checkSubmit()
{
	var verplicht= Array("naam", "email");
	var formfield ="";
	for (i=0;i<verplicht.length;i++) {
		formfield = eval("document.forms[0]."+verplicht[i]);
		if (formfield.value == "") {
			alert (verplicht[i]+ " is een verplicht veld");
			formfield.focus();
			return false;
		}
	}

	if ( ! document.getElementById )
	{
		return false;
	}
	var formfieldemail = document.getElementById( "email" );
	if ( ! formfieldemail )
	{
		return false;
	}
	var result1 = formfieldemail.value.match(/\./);
	var result2 = formfieldemail.value.match(/@/);
	if ((result1 == null) || (result2 == null)) {
		alert ("foutief emailadres");
		formfieldemail.focus();
		return false;
	}
}

function trim(value) {
  value = value.replace(/^\s+/,'');
  value = value.replace(/\s+$/,'');
  return value;
}

function refreshImage(imageId,imageNum) {
  image = document.getElementById(imageId);
  fullImagePath = urlPrefix + imageNum + imgExtension;
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  //alert(fullImagePath);
  image.src = fullImagePath;
  image.width = 500;
  fadeIn(imageId,0);
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity +=  fadeSpeed;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 15);
    }
  }
}


function loopImages(x) {
	//alert('x = '+x);
	refreshImage('thepix',x);
	x++;
	if (x > totalImages) { x=1; }
	window.setTimeout("loopImages("+x+")", refreshInterval);
}

	
