function CheckEmail( ) {

	var email = document.getElementById( 'email' );
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email.value)) {
		alert( 'Please provide a valid email address' );
		email.focus;
	}
	
}



function CheckForm()
{
	var error_msg;
	var error_div = document.getElementById( "error" );
	
	var requiredfields = new Array( 'email' ); 
	CheckEmail( );
	
	for( var index = 0; index < requiredfields.length; index++ )
	{
		inputfield = document.getElementById( requiredfields[ index ] );
		if( inputfield.value == '' )
		{
			inputfield.style.backgroundColor = "#F9E5E5";
			validated = false;
		} else {
			
			order_details += inputfield.style.backgroundColor;
			inputfield.style.backgroundColor = "#FFFFFF";
		}
	}
	
	if( validated )
	{
		error_msg = document.createTextNode( "Submitting your form..." );
		error_div.replaceChild( error_msg, error_div.firstChild );
		return true;
		
	} else {
		
		error_msg = document.createTextNode( "Please enter all required fields." );
		error_div.replaceChild( error_msg, error_div.firstChild );
		
		return false;
	}
	
}