if (document.images) {

but1_normal = new Image(); but1_normal.src = "img/but_home1.gif"; 
but1_hiLite = new Image(); but1_hiLite.src = "img/but_home2.gif";

but2_normal = new Image(); but2_normal.src = "img/but_over1.gif";  
but2_hiLite = new Image(); but2_hiLite.src = "img/but_over2.gif"; 

but3_normal = new Image(); but3_normal.src = "img/but_diensten1.gif"; 
but3_hiLite = new Image(); but3_hiLite.src = "img/but_diensten2.gif"; 

but4_normal = new Image(); but4_normal.src = "img/but_contact1.gif"; 
but4_hiLite = new Image(); but4_hiLite.src = "img/but_contact2.gif"; 

}

function hiLiteImage(normal, hiLite)
{
  if (document.images) document.images[normal].src = eval(hiLite + ".src");
  return;
}

function myTrim()
{

	var str = "";
	var n = document.form1.length;

	for (var k=0;k<n;k++)
	{
		str = "" + document.form1[k].value;

		//trim the end
		while('' + str.charAt(str.length-1) == ' ')
		{
			str = str.substring(0,str.length-1);
		}
		//trim the front
		while('' + str.charAt(0) == ' ')
		{
			str = str.substring(1,str.length);
		}

		document.form1[k].value = str;
	}


}

function checkEmail()
{
	var i = document.form1.email.value.indexOf("@");
	if (i==-1)
	{
		return false;
	}
	else if (document.form1.email.value.substring(i).indexOf(".") == -1)
	{
		return false;
	}

	return true;
}

function form1_regist()
{
	myTrim();
	if (document.form1.naam.value =="" )
	{
	   alert("Vul aub uw naam in.");
	   document.form1.naam.focus();
	   return false;
	}
	else if (document.form1.bedrijf.value =="" )
	{
	   alert("Vul aub uw bedrijfsnaam in.");
	   document.form1.bedrijf.focus();
	   return false;
	}
	if (document.form1.telefoon.value =="" )
	{
	   alert("Vul aub uw telefoonnummer in.");
	   document.form1.telefoon.focus();
	   return false;
	}
	else if (document.form1.email.value =="" )
	{
	   alert("Vul aub uw emailadres in.");
	   document.form1.email.focus();
	   return false;
	}
	else if (!checkEmail())
	{
	   alert("Vul aub een geldig emailadres in.");
	   document.form1.email.focus();
	   return false;
	}
	else
	{
 	   document.form1.submit();
 	   return false;
	}
}

function form_reset()
{
	document.form1.reset();
}

function MarkMe(obj) {
    if (obj.style.backgroundColor == "")
	{
	   obj.style.backgroundColor = "#FAEEF1"
	}
    else obj.style.backgroundColor = "";
}

