function check_f(f){
	if(f.fname.value < 1){
		alert("Please enter first your name");
		if(document.all){
			f.fname.style.background = "#ffd000";
		}
		f.fname.focus();
		return (false);
	}
	if(f.lname.value < 1){
		alert("Please enter your last name");
		if(document.all){
			f.lname.style.background = "#ffd000";
		}
		f.lname.focus();
		return (false);
	}

	if(f.subject.value < 1){
		alert("Please enter your subject");
		if(document.all){
			f.subject.style.background = "#ffd000";
		}
		f.subject.focus();
		return (false);
	}

	if(f.body.value < 1){
		alert("Please enter your comments");
		if(document.all){
			f.body.style.background = "#ffd000";
		}
		f.body.focus();
		return (false);
	}

	if(!check(f.mfrom.value)){
		alert("Please enter a valid e-mail address");
		if(document.all){
			f.mfrom.style.background = "#ffd000";
		}
		f.mfrom.focus();
		return (false);
	}

	if(f.mto.value < 1){
		alert("Please enter person you want to contact.");
		if(document.all){
			f.mto.style.background = "#ffd000";
		}
		f.mto.focus();
		return (false);
	}
	
	
}

function check(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(h=0; h < e.length ;h++){
		if(ok.indexOf(e.charAt(h))<0){ 
			return (false);
		}		
	} 
	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)){
			return (-1);		
		} 
	}
}