function checkemail()
{
  var str=document.frm_klant.txtemail.value
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  if (filter.test(str))
  {
    return true;
  }
  else
  {
    return false;
  }
}

function FormValidator()
{
  if (document.frm_klant.txtfirstname.value == "")
  {
    alert("Please fill out your first name.");
    document.frm_klant.txtfirstname.focus();
    return (false);
  }
  if (document.frm_klant.txtfirstname.value.length < 4)
  {
    alert("Please fill out your first name.");
    document.frm_klant.txtfirstname.focus();
    return (false);
  }
  if (document.frm_klant.txtlastname.value == "")
  {
    alert("Please fill out your last name.");
    document.frm_klant.txtlastname.focus();
    return (false);
  }
  if (document.frm_klant.txtlastname.value.length < 4)
  {
    alert("Please fill out your last name.");
    document.frm_klant.txtlastname.focus();
    return (false);
  }  

  if (document.frm_klant.txtemail.value == "")
  {
    alert("Please fill out your e-mail.");
    document.frm_klant.txtemail.focus();
    return (false);
  }
  if (!checkemail())
  {
    alert("Please fill out your e-mail:  name@domainname.be");
    document.frm_klant.txtemail.focus();
    return (false);
  }
  if (document.frm_klant.email.value.length < 6)
  {
    alert("Please fill out your e-mail:  name@domainname.be");
    document.frm_klant.txtemail.focus();
    return (false);
  }
return (true);
}

function CheckForm()
{
	if (document.frm_inlogpagina.gebruikersnaam.value == "")
	{
		alert("Gelieve een gebruikersnaam in te geven.");
		document.frm_inlogpagina.gebruikersnaam.focus();
		return false;
	}
	if (document.frm_inlogpagina.wachtwoord.value == "")
	{
		alert("Gelieve een wachtwoord in te geven.");
		document.frm_inlogpagina.wachtwoord.focus();
		return false;
	}
	return true;
}

function PopupPicHTM(sPicURL)
{
  window.open("../../../popupd41d.htm?"+sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}


function PopupPic(sPicURL)
{
  window.open("../../../popup.html" +sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}

function PopupPic2(sPicURL)
{
  window.open("../../../popup2.html" +sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}

function PopupPic2Print(sPicURL)
{
  window.open("../../../popup-print.html" +sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}

var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic()
{
  iWidth = (NS)?window.innerWidth:document.body.clientWidth;
  iHeight = (NS)?window.innerHeight:document.body.clientHeight;
  iWidth = document.images[0].width - iWidth;
  iHeight = document.images[0].height - iHeight;
  window.resizeBy(iWidth, iHeight);
  self.focus();
};


function Toggle(item)
{
  obj=document.getElementById(item);
  visible=(obj.style.display!="none")
  key=document.getElementById("x" + item);
  if (visible)
  {
    obj.style.display="none";
  }
  else
  {
    obj.style.display="block";
  }
}

function Expand()
{
  divs=document.getElementsByTagName("DIV");
  for (i=0;i<divs.length;i++)
  {
    divs[i].style.display="block";
    key=document.getElementById("x" + divs[i].id);
  }
}

function Collapse()
{
  divs=document.getElementsByTagName("DIV");
  for (i=0;i<divs.length;i++)
  {
    divs[i].style.display="none";
    key=document.getElementById("x" + divs[i].id);
  }
}


function checkemailYouMail()
{
  var str=document.frm_tellafriend.txtYouMail.value
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  if (filter.test(str))
  {
    return true;
  }
  else
  {
    return false;
  }
}

function checkemailFriendMail()
{
  var str=document.frm_tellafriend.txtFriendMail.value
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  if (filter.test(str))
  {
    return true;
  }
  else
  {
    return false;
  }
}



function FormValidatorTellaFriend()
{
  if (document.frm_tellafriend.txtYouName.value == "")
  {
    alert("Please fill out your name.");
    document.frm_tellafriend.txtYouName.focus();
    return (false);
  }
  if (document.frm_tellafriend.txtYouName.value.length < 4)
  {
    alert("Please fill out your name.");
    document.frm_tellafriend.txtYouName.focus();
    return (false);
  }
  if (document.frm_tellafriend.txtFriendName.value == "")
  {
    alert("Please fill out your friends name.");
    document.frm_tellafriend.txtFriendName.focus();
    return (false);
  }
  if (document.frm_tellafriend.txtFriendName.value.length < 4)
  {
    alert("Please fill out your friends name.");
    document.frm_tellafriend.txtFriendName.focus();
    return (false);
  }  
  
  if (document.frm_tellafriend.txtYouMail.value == "")
  {
    alert("Please fill out your e-mail.");
    document.frm_tellafriend.txtYouMail.focus();
    return (false);
  }
  if (!checkemailYouMail())
  {
    alert("Please fill out your e-mail: name@domainname.be");
    document.frm_tellafriend.txtYouMail.focus();
    return (false);
  }
  if (document.frm_tellafriend.txtYouMail.value.length < 6)
  {
    alert("Please fill out your e-mail:  name@domainname.be");
    document.frm_tellafriend.txtYouMail.focus();
    return (false);
  }

  if (document.frm_tellafriend.txtFriendMail.value == "")
  {
    alert("Please fill out your friends e-mail.");
    document.frm_tellafriend.txtFriendMail.focus();
    return (false);
  }
  if (!checkemailFriendMail())
  {
    alert("Please fill out your friends e-mail: name@domainname.be");
    document.frm_tellafriend.txtFriendMail.focus();
    return (false);
  }
  if (document.frm_tellafriend.txtFriendMail.value.length < 6)
  {
    alert("Please fill out your friends e-mail:  name@domainname.be");
    document.frm_tellafriend.txtFriendMail.focus();
    return (false);
  }
return (true);
}