// JavaScript Document
function CheckMyMail(MayMail)
{
	var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(MayMail)) return(MayMail);
	else  return(0);
}
/////////////////////////////////////////////////////////////////////////////////////
function IsEmptyVal(Val)
{
	if((!Val) || (Val=='') )  return(0);
	else return(Val)
}
/////////////////////////////////////////////////////////////////////////////////////
function AlertMsg(srt,Id)
{
	alert(srt);
	document.getElementById(Id).focus();
	document.getElementById(Id).select();
}

function sendMsg(){
	var uName=IsEmptyVal(document.getElementById('uName').value);
	var uMessage=IsEmptyVal(document.getElementById('uMsg').value);
	var uMail=CheckMyMail(document.getElementById('uMail').value);
	if(uName==0){
		AlertMsg('הכנס שם','uName');
		return false;
	}
	if(uMail==0){
		AlertMsg('אנא הכנס כתובת מייל נכונה ותקפה','uMail');
		return false;
	}
	if(uMessage==0){
		AlertMsg('הכנס הודעה','uMsg');
		return false;
	}
	document.getElementById('sendMail').value='send';
	return true;
}

