function openSmiley(){
	w=window.open("gastenboek/smileys.html", "smileys", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=300,height=300");
  if(!w.opener){
  	w.opener=self;
  }
}

function validate_form() {
  validity = true; 
  if (!check_empty(document.form.naam.value))
        { validity = false; alert('U heeft geen naam ingevuld!'); }
  if (!check_email(document.form.email.value))
        { validity = false; alert('Het E-mail adres is ongeldig!'); }
  if (!check_empty(document.form.adres.value) && document.form.reden.value == "Brochure aanvragen") 
        { validity = false; alert('U heeft geen adres ingevuld!'); }
  if (!check_empty(document.form.postcode.value) && document.form.reden.value == "Brochure aanvragen") 
        { validity = false; alert('U heeft geen postcode ingevuld!'); } 
  if (!check_empty(document.form.plaats.value) && document.form.reden.value == "Brochure aanvragen") 
        { validity = false; alert('U heeft geen woonplaats ingevuld!'); } 
return validity;
}

function validate_form_uitgebr() {
  validity = true; 
  if (!check_empty(document.form.naam.value))
        { validity = false; alert('U heeft geen naam ingevuld!'); }
  if (!check_empty(document.form.adres.value))
        { validity = false; alert('U heeft geen adres ingevuld!'); }
  if (!check_empty(document.form.postcode.value))
        { validity = false; alert('U heeft geen postcode ingevuld!'); } 
  if (!check_empty(document.form.plaats.value))
        { validity = false; alert('U heeft geen woonplaats ingevuld!'); } 
  if (!check_email(document.form.email.value))
        { validity = false; alert('Het E-mail adres is ongeldig!'); }
return validity;
}

function check_empty(text) {
  return (text.length > 0); // returns false if empty
}

function check_email(adres) {
  if ((adres == "")
    || (adres.indexOf ('@') == -1)
    || (adres.indexOf ('.') == -1))
      return false;
  return true;
}

function showhide(menu) {
	if (menu.style.display=='') {
		menu.style.display='none';
		return;
	}
	
	sub1.style.display='none';
	sub2.style.display='none';
	sub3.style.display='none';
	sub4.style.display='none';
	sub5.style.display='none';
	sub6.style.display='none';
	sub7.style.display='none';
	sub8.style.display='none';

	menu.style.display='';
	
}

function PopUpWindow(URL, w, h)
	{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + w + ',height=' + h);");
	}

function ShowFoto(fotoId, title) {
   w=window.open('','newwin','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=480');
   w.document.write('<html>');
   w.document.write('<head>');
   w.document.write('<title>'+title+'</title>');
   w.document.write('</head>');
   w.document.write('<body topmargin=0 leftmargin=0><img border=0 src=fotos/zoom/'+fotoId+'.jpg width=640 height=480></body>');
   w.document.write('</html>');
   w.document.close();
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
	for(var i=0; i<document.images.length; i++)
	{
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		{
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") 
				imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") 
				imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) 
				imgStyle = "cursor:hand;" + imgStyle;
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
			img.outerHTML = strNewHTML;
			i = i-1;
		}
	}
}
window.attachEvent("onload", correctPNG);
