
	function isEmpty(el)
	{
		var str = el.value;
		if(str == null || str.length == 0)
		{
			return true;	
		}
		return false;
	}
	
	function isEmailAddr(el) 
	{
		var str = el.value;
    	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	    if (!str.match(re)) 
	    {
	        return false;
	    } 
	    else 
	    {
	        return true;
	    }
	}
	
	function checkform(f)
	{
	//alert('hello');
		// clear out any currently displayed error messages
		if (isEmpty(f.first_name)) {
			f.first_name.className = 'errorborder';
			alert("Please fill out the First Name field.");
			return false;
		} else if (isEmpty(f.last_name)) {
			f.last_name.className = 'errorborder';
			alert("Please fill out the Last Name field.");
			return false;
		} else if (isEmpty(f.email)) {
			f.email.className = 'errorborder';
			alert("Please fill out the Email field.");
			return false;
		} else if (!isEmailAddr(f.email)) {
			f.email.className = 'errorborder';
			alert("Please enter a valid email address.");
			f.email.value = "";
			return false;
		} else if (isEmpty(f.state)) {
			f.state.className = 'errorborder';
			alert("Please fill out the State field.");
			return false;
		} else if (isEmpty(f.company)) {
			f.company.className = 'errorborder';
			alert("Please fill out the Company field.");
			return false;
		} else if (isEmpty(f.00N40000001YVdN)) {
			f.00N40000001YVdN.className = 'errorborder';
			alert("Please tell us how you heard about us.");
			return false;
		
		} else {
			return true;
		}
	}
	
	function hideMessage()
	{
		var errorblock = document.getElementById("errorblock");
		errorblock.innerHTML = '';
		errorblock.style.display = 'none';	
	}
	
	function showMessage(message)
	{
		var errorblock = document.getElementById("errorblock");
		var existmess = errorblock.innerHTML;
		errorblock.innerHTML = existmess + message;
		errorblock.style.display = 'block';	
	}
