function check(form, message) {
	if (form.value == "") {
		alert(message);
		form.focus();
		return false;
	}
	else return true;
}
var testresults;
function checkmail(form){
	var str=form.value;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str))
		testresults=true;
	else{
		alert("Please input a valid email address!");
		form.focus();
		testresults=false;
	}
	return (testresults);
}
function checkform() {
	stat = true;
	if (stat == true) stat = check(document.gbform.name, 'Please compleat field "name"!');
	if (stat == true) stat = checkmail(document.gbform.email);
	if (stat == true) stat = check(document.gbform.location, 'Where are you from?');
	if (stat == true) stat = check(document.gbform.message, 'Please compleat field "message"!');
	if (stat == true) stat = check(document.gbform.randomtxt, 'Please compleat field "Random text!');
	return stat; 
}
function http_function_focus(){
	if(document.gbform.homepage.value==''){
		document.gbform.homepage.value='http://';
	}
}
function http_function_blur(){
	if(document.gbform.homepage.value=='http://'){
		document.gbform.homepage.value='';
	}
}
function colorate(field){
	field.style.backgroundColor="#E9FEDA";	
}
function decolorate(field){
	field.style.backgroundColor="#EFEFEF";	
}

