function checkForm(theForm) {
	    err_str = "";
	
		if (theForm.pName.value == "") {
			err_str = err_str + "<b>נא למלא שם, </b>"
           document.getElementById('pName').style.background = "#FFCCCC";               
        } else {
          document.getElementById('pName').style.background = "white";
      
        }
        
        if ((theForm.prePhone.value == "בחר...") && (theForm.pPhone.value != "")) {
			err_str = err_str + "<b>נא למלא קידומת טלפון, </b>"
           document.getElementById('prePhone').style.background = "#FFCCCC";
        } else {
          document.getElementById('prePhone').style.background = "white";
        }
        
        if ((!isPhoneNum(theForm.pPhone.value)) && (theForm.pPhone.value != "")) {
			err_str = err_str + "<b>נא למלא מספר טלפון חוקי בן 7 ספרות, </b>"
           document.getElementById('pPhone').style.background = "#FFCCCC";
        } else {
          document.getElementById('pPhone').style.background = "white";
        }
        
		if(err_str == "") {
			//alert("true");
			theForm.emailaddress1.value = theForm.pEmail.value;
			theForm.telephone1.value = theForm.prePhone.value + "-" + theForm.pPhone.value;
			theForm.firstname.value = theForm.pName.value;
			theForm.description.value = theForm.pText.value;
			return true;
		} else {
		    err_str_len = err_str.length - 6;
		    err_str = err_str.substring(0,err_str_len)
		    document.getElementById('errorPlace').innerHTML = err_str + ".</b><BR/>"
			document.getElementById('errorPlace').style.display = "inline"
			//alert("flase");
			return false;
		}
}
