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_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_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 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=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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);
}
