function trim(strText)
{ 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}

function formchange4site(field)
{
	if(field.value==field.name)
	{
		//field.style.color="#333333";
		field.value='';
	}
}

function checkform4site(field)
{
	if(trim(field.value)=="")
	{
		field.value=field.name	;
		field.style.color="#BBBBBB";
	}
}

function testform4site(){
	form=document.getElementById("contactform");
	x=0;
	dontsend=0;
	while(x<12)
	{
		if(form[x].value==form[x].name)
		{
			if(form[x].name=="Name" || form[x].name=="Company Name" || form[x].name=="Address 1" || form[x].name=="Address 2" || form[x].name=="Postcode" || form[x].name=="Email" || form[x].name=="Telephone" || form[x].name=="Enquiry")
			{
			} 
			else
			{
				dontsend=1;
			}
		}
		x++;		
	}
	if(dontsend==1)
	{
		alert("Your email could not be sent at this time, please re-check the data and try again.");
	}
	else
	{
		document.getElementById("contactform").submit();
	}
}
