//'ششششششششششיוסי כהןشششششششششش

function validateForm()
{
	for (var i=0; i<document.form1.elements.length; i++)
		if (document.form1.elements[i].type=="text" || document.form1.elements[i].type=="textarea")
			if (isOnlySpaces(document.form1.elements[i].value))
				document.form1.elements[i].value="";

	var errFlag=false; 
	var strvar="";	
	var fldnm="";
	var formname="form1";
	
	fldnm="jobNum";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (isEmptyOrSpaces(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="fname";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (isEmptyOrSpaces(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="lname";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (isEmptyOrSpaces(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="cIdNum";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (!isIdNumber(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="cBirth";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (!haveDigits(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="City";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (isEmptyOrSpaces(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="plea";
	strvar=eval("document."+formname+"."+fldnm).value; 
	if (isEmptyOrSpaces(strvar)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
	}

	fldnm="phone";
	fldnm2="email"; // at least one of them...
	strvar=eval("document."+formname+"."+fldnm).value; 
	strvar2=eval("document."+formname+"."+fldnm2).value; 
	if (!haveDigits(strvar) && !isEmail(strvar2)){
		document.getElementById(fldnm).style.backgroundColor="yellow";
		document.getElementById(fldnm2).style.backgroundColor="yellow";
		errFlag=true;
	}else{
		document.getElementById(fldnm).style.backgroundColor="#ffffff";
		document.getElementById(fldnm2).style.backgroundColor="#ffffff";
	}

	if (errFlag){
		document.location.href="#cvStart";
		return false;
	}else{
		eval("document."+formname+".submit1").disabled = true;
		return true;
	}
}