
function validateEmail(email) {
	var matches = email.match(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);
	return (matches != null && email == matches[0]);
}
function strTrim(str){
  str=str.replace(/(^\s*)|(\s*$)/g, "");
  if (str.length==0){
    return false;
  }
  return true;
}  
function checkForm(){
  if( !strTrim(document.all['FromName'].value) || !validateEmail(document.all['email'].value) || !strTrim(document.all['RecipientName'].value) || !validateEmail(document.all['to'].value)){
    alert(' *Please, fill in all mandatory fields and correct Email addresses');
    return false;
  }   
return true;
}

function checkField()
{
	if (document.all['JobTitle'][2].checked==true)
	{
		//alert('xxx');
		document.all['OtherJobTitle'].focus();
	}
	else if ((document.all['JobTitle'][0].checked==true)||(document.all['JobTitle'][1].checked==true))
	{
		
		document.all['OtherJobTitle'].value='';
	}		
}
function type1()
{
	document.all['JobTitle'][2].checked=true;
}
function checkField1()
{
	if (document.all['HowOftenUseSite'][2].checked==true)
	{
		document.all['OtherUseSite'].focus();
	}
	else if ((document.all['HowOftenUseSite'][0].checked==true)||(document.all['HowOftenUseSite'][1].checked==true))
	{
		document.all['OtherUseSite'].value='';
	}
}
function type2()
{
	document.all['HowOftenUseSite'][2].checked=true;
}

function checkFeedbackForm(contactFrom){

 if(!validateEmail(document.all['contactEmail'].value)) {
    alert(' נא למלא דואר אלקטרוני');
	document.all['contactEmail'].focus();
    return false;
  }
  document.all['idform'].value=contactFrom;
  return true;
}
function checknews(){
//alert(document.getElementById('e').value);
if(!validateEmail(document.getElementById('e').value)){
alert("Please, fill in correct Email addresses");
return false;
}
return true;
}


