function SubmitForm(FormID){var oForm=document.getElementById(FormID);if(null==oForm){return false;}
var oPhoneField=oForm.Phone;var oEmailField=oForm.Email;var oNameField=oForm.FullName;if(undefined==oNameField){return false;}
if(undefined==oPhoneField){return false;}
if(undefined==oEmailField){return false;}
if(0==oNameField.value.length){return ShowError("עליך למלא את שמך המלא.");}
if(0==oEmailField.value.length){return ShowError("עליך למלא את כתובת המייל שלך.");}
if(false==verifyEmail(oEmailField.value)){return ShowError("כתובת המייל שהזנת אינה תיקנית");}
if(7!=oPhoneField.value.length){return ShowError("עליך למלאות את מספר הטלפון שלך");}
return oForm.submit();}
function verifyEmail(checkEmail)
{if((checkEmail.indexOf('@')<0)||((checkEmail.charAt(checkEmail.length-4)!='.')&&(checkEmail.charAt(checkEmail.length-3)!='.'))){return false;}else{return true;}}
function ShowError(ErrorToWrite){alert(ErrorToWrite);return false;}
function checkIfNeedToMove(This,oEvent, MoveToID){if(This.className=="PhoneExt"){if(This.value.length==3){document.getElementById(MoveToID).focus();}}}
function ForceNumericInput(This,oEvent)
{var AllowDot=false;var AllowMinus=false;var code=oEvent.keyCode;switch(code)
{case 8:case 9:case 37:case 39:case 46:case 116:oEvent.returnValue=true;return oEvent.returnValue;case 13:if(This.className=="Phone"){if(This.value.length==7){This.parentNode.parentNode.parentNode.parentNode.parentNode.submit();oEvent.returnValue=true;return oEvent.returnValue;}}else{oEvent.returnValue=false;return oEvent.returnValue;}}
if((code>=48&&code<=57)||(code>=96&&code<=105))
{oEvent.returnValue=true;return oEvent.returnValue;}
oEvent.returnValue=false;return oEvent.returnValue;}

var EffectTimeout=10;var EffectAdd=5;var goCurMenu=null;function HideMenu(MenuDivName){var oMenuDiv=document.getElementById(MenuDivName);if(null==oMenuDiv){return true;}
oMenuDiv.innerHTML=goCurMenu.innerHTML;if(null!=goCurMenu){document.body.removeChild(goCurMenu);goCurMenu=null;}}
function getRealLeft(el)
{xPos=parseInt(el.offsetLeft);tempEl=el.offsetParent;while(tempEl!=null){xPos+=parseInt(tempEl.offsetLeft);tempEl=tempEl.offsetParent;}
return xPos;}
function getRealTop(el)
{yPos=parseInt(el.offsetTop);tempEl=el.offsetParent;while(tempEl!=null){yPos+=parseInt(tempEl.offsetTop);tempEl=tempEl.offsetParent;}
return yPos;}
function ChangeCurDivHeight(CurHeight,FinalHeight)
{if(null!=goCurMenu){goCurMenu.style.height=CurHeight+"px";if(FinalHeight>CurHeight){setTimeout("ChangeCurDivHeight("+(CurHeight+EffectAdd)+", "+FinalHeight+");",EffectTimeout);}}}
function ShowMenu(CallingObject,e,MenuDivName,MenuClass,Hieght)
{var pageStart=(document.body.clientWidth-1004)/2;if(null!=goCurMenu){HideMenu(MenuDivName);return false;}
var oMenuDiv=document.getElementById(MenuDivName);if(null==oMenuDiv){return true;}
var sMenuContent=oMenuDiv.innerHTML;oMenuDiv.innerHTML='';goCurMenu=document.createElement('div');if(null==goCurMenu){return true;}
goCurMenu.className=MenuClass;goCurMenu.innerHTML=sMenuContent;goCurMenu.style.position='absolute';goCurMenu.style.top=getRealTop(CallingObject)+parseInt(CallingObject.offsetHeight)+'px';goCurMenu.style.left=getRealLeft(CallingObject)+'px';goCurMenu.style.zIndex=100;document.body.appendChild(goCurMenu);ChangeCurDivHeight(0,Hieght);return false;}