//'ششششششششششיוסי כהןشششششششششش
var preventSubmitOnEnter=true;var errorColor="#ffff00";var okColor="#ffffff";var acceptFileUpExtensions="";var denyFileUpExtensions="";var fileAttachmentIsRequired=false;function fieldsAreValid(){var errFlag=false;var strvar,strvar2;var fldnm,fldnm2;var fldObj,fldObj2;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=""}}}fldnm="attachment";fldObj=document.getElementById(fldnm);if(fldObj){strvar=fldObj.value;var filext=fileExtension(strvar);var filext1=","+filext+",";var accept1=","+acceptFileUpExtensions+",";var deny1=","+denyFileUpExtensions+",";if((strvar.length>0||fileAttachmentIsRequired)&&(isOnlySpaces(strvar)||filext==""||(filext.match(/[\s]+/g)!=null)||(acceptFileUpExtensions!=""&&accept1.search(filext1)==-1)||(denyFileUpExtensions!=""&&deny1.search(filext1)!=-1))){fldObj.style.backgroundColor=errorColor;fldObj.scrollIntoView(true);errFlag=true}else{fldObj.style.backgroundColor=okColor}}fldnm="phone";fldnm2="email";fldObj=document.getElementById(fldnm);fldObj2=document.getElementById(fldnm2);if(fldObj&&fldObj2){strvar=fldObj.value;strvar2=fldObj2.value;if(!haveDigits(strvar)&&!isEmail(strvar2)){fldObj.style.backgroundColor=errorColor;fldObj2.style.backgroundColor=errorColor;fldObj.scrollIntoView(true);errFlag=true}else{fldObj.style.backgroundColor=okColor;fldObj2.style.backgroundColor=okColor}}fldnm="fullname";fldObj=document.getElementById(fldnm);if(fldObj){strvar=fldObj.value;if(isEmptyOrSpaces(strvar)){fldObj.style.backgroundColor=errorColor;fldObj.scrollIntoView(true);errFlag=true}else{fldObj.style.backgroundColor=okColor}}fldnm="fname";fldObj=document.getElementById(fldnm);if(fldObj){strvar=fldObj.value;if(isEmptyOrSpaces(strvar)){fldObj.style.backgroundColor=errorColor;fldObj.scrollIntoView(true);errFlag=true}else{fldObj.style.backgroundColor=okColor}}return!errFlag}function validateForm(){if(fieldsAreValid()){beforSubmit();document.form1.submit1.disabled=true;return true}else{return false}}var formSubmitIsActive=false;function submitFrom(){if(fieldsAreValid()){if(!formSubmitIsActive){formSubmitIsActive=true;lightSubmitLink();document.form1.submit()}}}function lightSubmitLink(){var sbObj=document.getElementById("submitButtonArea");if(sbObj&&typeof(setOpacity)=="function"){setOpacity(sbObj,20)}}function setOpacity(obj,opacity){opacity=Math.max(0,Math.min(100,opacity));var filterOpac=(opacity==100)?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+opacity+")";var Opac=(opacity==100)?"":opacity/100;obj.style.filter=filterOpac;obj.style.KHTMLOpacity=Opac;obj.style.MozOpacity=Opac;obj.style.opacity=Opac}function clearForm(){document.form1.reset();for(var i=0;i<document.form1.elements.length;i++){if(document.form1.elements[i].type=="text"||document.form1.elements[i].type=="file"||document.form1.elements[i].type=="textarea"){if(document.form1.elements[i].type!="file"){document.form1.elements[i].value=""}document.form1.elements[i].style.backgroundColor=okColor}}}function beforSubmit(){var attchObj=document.getElementById("attachment");if(attchObj){strvar=attchObj.value;if(strvar.length>0&&!isOnlySpaces(strvar)&&fileExtension(strvar)!=""){var waitDivObj=document.getElementById("pleasewait");if(waitDivObj){waitDivObj.style.display=""}}}}function preventSubmitByEnter(e){var evt=(e)?e:((event)?event:null);var target=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);if((evt.keyCode==13)&&(target.type!="textarea")&&(target.type!="submit")&&(target.type!="button")&&(target.tagName!="A")){return false}}if(preventSubmitOnEnter){window.onload=function(){document.getElementById("form1").onkeypress=preventSubmitByEnter}}