function clearText(id)
  {	
    var mn = document.form1.elements[id];
	if ((mn.value=="your name")||(mn.value=="your email")) {mn.value="";}
	return;
  }
function clearField(name)
  {
    var fn = eval("document.profileForm." + name);
	if ((fn.value=="")||(fn.value.length <5)){return;}
	else
	{
		var firstpart = fn.value.substring(0,4);
		if ((firstpart=="your")||(firstpart=="Tele")||(firstpart=="find")) {fn.value="";}
		return;
	}
  }

function checkForm()
{

		if ((document.profileForm.titlename.value=="your title")||
		(document.profileForm.fullname.value=="your full name")||
		(document.profileForm.fullname.value=="")||
		(document.profileForm.address1.value=="your address")||
		(document.profileForm.address1.value=="")||
		(document.profileForm.address2.value=="Town")||
		(document.profileForm.address2.value=="")||
		(document.profileForm.address4.value=="Post Code")||
		(document.profileForm.address4.value=="")||
		(document.profileForm.email.value=="your email")||
		(document.profileForm.email.value=="") 
		)
		{
		 alert ("You have not filled in all the required information on the form");
		 return false;
		}
		else if(!isValidEmail2(document.profileForm.email.value))
		{	
			alert("Invalid email address has been entered");
			return false;
		}
	return true;
}
function isValidEmail2(str) 
{	// function tests for valid email address - quite a good check
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < str.length ;i++)
	{
		if(ok.indexOf(str.charAt(i))<0)
		{ 
			return (false);
		}	
	} 
	if (document.images) 
	{
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!str.match(re) && str.match(re_two)) 
		{
			return (-1);		
		} 
	}
}
