function clearField(field, text)
{
	if(field.value==text)
	{
		field.style.color = "#000000";
		field.value = "";	
	}
	else if(field.value=="")
	{
		field.style.color = "#AAAAAA";
		field.value = text;	
	}
}

function validate()
{
	var send = true;

	// Controleren op email.
	var email = document.frm.from;
	AtPos = email.value.indexOf("@");
	StopPos = email.value.lastIndexOf(".");
			
	if ((StopPos == -1 || StopPos < AtPos) && send)
	{
		alert("U dient een correct e-mailadres in te vullen");
		document.frm.from.focus();
		send = false;
	}
	
	var email = document.frm.to;
	AtPos = email.value.indexOf("@");
	StopPos = email.value.lastIndexOf(".");
			
	if ((StopPos == -1 || StopPos < AtPos) && send)
	{
		alert("U dient een correct e-mailadres in te vullen");
		document.frm.to.focus();
		send = false;
	}
	// Einde controle.
	
	if(document.frm.letters.value=="" && send)
	{
		alert("U dient de code in te vullen");
		document.frm.letters.focus();
		send = false;
	}

	if(send)
	{
		document.frm.action = "/custom/includes/send-tell-a-friend.inc.php";
		document.frm.submit();
	}
}

function zoeken()
{
	  document.location = "/busreizen/zoekresultaat/"+document.zoekfrm.zoekterm.value.toLowerCase();	
}