var message="Copyright WULOPLANT"; // Message for the alert box
// Don't edit below!
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

document.oncontextmenu=new Function("event.returnValue=false; return false;")
document.onselectstart=new Function("event.returnValue=false; return false;")
document.onCopy=new Function("event.returnValue=false; return false;")
document.onPaste=new Function("event.returnValue=false; return false;")
document.ondragstart=new Function("event.returnValue=false; return false;")
document.onselect=new Function("event.returnValue=false; return false;")
document.ondragdrop=new Function("event.returnValue=false; return false;")
document.onmousedown=new Function("event.returnValue=false; return false;")

function checkemail()
{
  var str=document.frm_wuloplant.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_wuloplant.txtnaam.value == "")
  {
    alert("Gelieve een naam in te vullen.");
    document.frm_wuloplant.txtnaam.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtnaam.value.length < 3)
  {
    alert("Gelieve een naam in te vullen.");
    document.frm_wuloplant.txtnaam.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtfirma.value == "")
  {
    alert("Gelieve een firma in te vullen.");
    document.frm_wuloplant.txtfirma.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtfirma.value.length < 3)
  {
    alert("Gelieve een firma in te vullen.");
    document.frm_wuloplant.txtfirma.focus();
    return (false);
  }
  
  if (document.frm_wuloplant.txtbtw.value == "")
  {
    alert("Gelieve een BTW nummer in te vullen.");
    document.frm_wuloplant.txtbtw.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtbtw.value.length < 11)
  {
    alert("Gelieve een BTW nummer in te vullen.");
    document.frm_wuloplant.txtbtw.focus();
    return (false);
  }  
  
  if (document.frm_wuloplant.txtstraat.value == "")
  {
    alert("Gelieve een straat in te vullen.");
    document.frm_wuloplant.txtstraat.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtstraat.value.length < 6)
  {
    alert("Gelieve een straat in te vullen.");
    document.frm_wuloplant.txtstraat.focus();
    return (false);
  }
  
  if (document.frm_wuloplant.txtpostcode.value == "")
  {
    alert("Gelieve een postcode in te vullen.");
    document.frm_wuloplant.txtpostcode.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtpostcode.value.length < 4)
  {
    alert("Gelieve een postcode in te vullen.");
    document.frm_wuloplant.txtpostcode.focus();
    return (false);
  }
  
  if (document.frm_wuloplant.txtgemeente.value == "")
  {
    alert("Gelieve een gemeente in te vullen.");
    document.frm_wuloplant.txtgemeente.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtgemeente.value.length < 2)
  {
    alert("Gelieve een gemeente in te vullen.");
    document.frm_wuloplant.txtgemeente.focus();
    return (false);
  }  

  if (document.frm_wuloplant.txttelefoon.value == "")
  {
    alert("Gelieve een telefoonnummer in te vullen.");
    document.frm_wuloplant.txttelefoon.focus();
    return (false);
  }
  if (document.frm_wuloplant.txttelefoon.value.length < 3)
  {
    alert("Gelieve een telefoonnummer in te vullen.");
    document.frm_wuloplant.txttelefoon.focus();
    return (false);
  }
  if (document.frm_wuloplant.txtemail.value == "")
  {
    alert("Gelieve een e-mailadres in te vullen.");
    document.frm_wuloplant.txtemail.focus();
    return (false);
  }
  if (!checkemail())
  {
    alert("Gelieve een geldig e-mailadres in te vullen: bijvoorbeeld naam@domeinnaam.be");
    document.frm_wuloplant.txtemail.focus();
    return (false);
  }
  if (document.frm_wuloplant.email.value.length < 3)
  {
    alert("Gelieve een geldig e-mailadres in te vullen: bijvoorbeeld naam@domeinnaam.be");
    document.frm_wuloplant.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("/popup.htm?"+sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}


function PopupPic(sPicURL)
{
  window.open("/popup.asp" +sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}

function PopupPic2(sPicURL)
{
  window.open("/popup2.asp" +sPicURL, "beeldpopup","resizable=1,height=200,width=200");
}

function PopupPic2Print(sPicURL)
{
  window.open("/popup-print.asp" +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);
  }
}
