/* Trim Function */
function trim(value)
 {
  temp=value;
  return temp.replace(/^\s*(\b.*\b|)\s*$/, "$1");
 }

/* Input Emphasis Function */
function input_emphasis(cell)
 {
  emphasis="document.all."+cell+".style.backgroundColor='#ffffff'";
  eval(emphasis);
  return true;
 }

/* Cell Emphasis Function */
function cell_emphasis(question, field, number_of_fields)
  {
   for (i=0; i<number_of_fields; i++)
	{
	 if (field==i)
	  {
	   emphasis="document.getElementById('"+question+"_"+i+"').style.backgroundColor='#ff0000'";
	   eval(emphasis);
	  }
	 else
	  {
	   emphasis="document.getElementById('"+question+"_"+i+"').style.backgroundColor='#ffffcc'";
	   eval(emphasis);
	  }
	}
  }

/* Checkbox Emphasis Function */
function checkbox_emphasis(cell)
 {
  cell_="document.all."+cell+".checked";
  if (eval(cell_))
     {
      emphasis="document.all."+cell+".style.backgroundColor='#ff0000'";
      eval(emphasis);
     }
  else
    {
     emphasis="document.all."+cell+".style.backgroundColor='#ffffcc'";
     eval(emphasis);
    }
 }

x=0;
/* Alter Search Area Function */
function alter_search_area()
  {
   x++;

   if (x%2!=0)
      { search_area.style.display="none"; }
   else
      { search_area.style.display=""; }
  }

/* Display Invisible Area Function */
function display_invisible_area(area_name, selection)
  {
   if (selection=="show")
      { result=area_name+".style.display=''"; }

   if (selection=="hide")
      { result=area_name+".style.display='none'"; }

   eval(result);
  }

/* validContactForm Function */
function validContactForm(form_id)
 {
  tmp="passForm=document.forms['"+form_id+"'];";
  eval(tmp);

  // Beginning of Regular Expressions Creating
  regular_phones=/^([0-9\-\+]{9,})$/;
  regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  // End of Regular Expressions Creating

  // Beginning of Full Name Checking
  temp=trim(passForm.full_name.value);
  passForm.full_name.value=temp;
  if (temp=="")
     {
      alert("אנא מלאו את שמכם המלא.");
      passForm.full_name.focus();
      return false;
     }
  // End of Full Name Checking

  // Beginning of Phone Number Checking
  temp=trim(passForm.phone_number.value);
  passForm.phone_number.value=temp;
  if (!(regular_phones.test(temp)))
     {
      alert("אנא מלאו את מספר הטלפון שלכם בספרות, קווים מפרידים וסימני + בלבד.");
      passForm.phone_number.focus();
      return false;
     }
  // End of Phone Number Checking

  // Beginning of E-mail Address Checking
  temp=trim(passForm.email_address.value);
  passForm.email_address.value=temp;
  if (temp!="")
     {
      if (!(regular_email_address.test(temp)))
	  {
          alert("אנא מלאו כתובת דואר אלקטרוני תקינה.");
          passForm.email_address.focus();
          return false;
	  }
     }
  // End of E-mail Address Checking

  /*
  // Beginning of Message Content Checking
  temp=trim(passForm.message_content.value);
  passForm.message_content.value=temp;
  if (temp=="")
     {
      alert("אנא רשמו את תוכן המסר.");
      passForm.message_content.focus();
      return false;
     }
  // End of Message Content Checking
  */
  return true;
 }

/* validEntranceForm Function */
function validEntranceForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_english=/^([a-zA-Z0-9]{2,})$/;
   // End of Regular Expressions Creating

   // Beginning of Username Checking
   temp=trim(passForm.username.value);
   passForm.username.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את שם המשתמש באותיות באנגלית ובספרות בלבד.\nרב תודות.");
	passForm.username.focus();
	return false;
      }
   // End of Username Checking

   // Beginning of Password Checking
   temp=trim(passForm.password.value);
   passForm.password.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את הסיסמה באותיות באנגלית ובספרות בלבד.\nרב תודות.");
	passForm.password.focus();
	return false;
      }
   // End of Password Checking
   return true;
  }

/* validUsersForm Function */
function validUsersForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_english=/^([a-zA-Z0-9_]{1,})$/;
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   // End of Regular Expressions Creating

   // ----------------------------------------------------------------------------------------------------

   // Beginning of Username Checking
   temp=trim(passForm.username.value);
   passForm.username.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את שם המשתמש באותיות באנגלית ובספרות בלבד.\nרב תודות.");
	passForm.username.focus();
	return false;
      }
   // End of Username Checking

   // Beginning of Password Checking
   temp=trim(passForm.password.value);
   passForm.password.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את הסיסמה באותיות באנגלית ובספרות בלבד.\nרב תודות.");
	passForm.password.focus();
	return false;
      }
   // End of Password Checking

   // Beginning of Full Name Checking
   temp=trim(passForm.full_name.value);
   passForm.full_name.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("אנא רשמו את השם המלא בעברית בלבד.\nרב תודות.");
	passForm.full_name.focus();
	return false;
      }
   // End of Full Name Checking

   // Beginning of E-mail Address Checking
   temp=trim(passForm.email_address.value);
   passForm.email_address.value=temp;
   if (temp!="")
      {
	if (!(regular_email_address.test(temp)))
	   {
	    alert("אנא רשמו את כתובת הדואר האלקטרוני האדמיניסטרטיבית בתבנית נאותה.\nרב תודות.");
	    passForm.email_address.focus();
	    return false;
          }
      }
   // End of E-mail Address Checking

   // Beginning of User Status Checking
   o1=passForm.user_status_0.checked;
   o2=passForm.user_status_1.checked;
   if ((!(o1)) && (!(o2)))
      {
	alert("אנא בחרו במצב המשתמש.\nרב תודות.");
	return false;
      }
   // End of User Status Checking
   return true;
  }

/* validParkingUsersForm Function */
function validParkingUsersForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_phones=/^([0-9\-\+]{1,})$/;
   regular_dates=/^((\d){1,2})(\.){1}((\d){1,2})(\.){1}(((\d){4}))$/;
   regular_english=/^([a-zA-Z0-9_]{1,})$/;
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   // End of Regular Expressions Creating

   // ----------------------------------------------------------------------------------------------------

   // Beginning of E-mail Address Checking
   temp=trim(passForm.email_address.value);
   passForm.email_address.value=temp;
   if (!(regular_email_address.test(temp)))
      {
	alert("אנא רשמו את כתובת הדואר האלקטרוני האדמיניסטרטיבית בתבנית נאותה.\nרב תודות.");
	passForm.email_address.focus();
	return false;
      }
   // End of E-mail Address Checking

   // Beginning of Password Checking
   temp=trim(passForm.password.value);
   passForm.password.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את הסיסמה באותיות באנגלית ובספרות בלבד.\nרב תודות.");
	passForm.password.focus();
	return false;
      }
   // End of Password Checking

   // Beginning of First Name Checking
   temp=trim(passForm.first_name.value);
   passForm.first_name.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("אנא רשמו את השם הפרטי בעברית בלבד.\nרב תודות.");
	passForm.first_name.focus();
	return false;
      }
   // End of First Name Checking

   // Beginning of Last Name Checking
   temp=trim(passForm.last_name.value);
   passForm.last_name.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("אנא רשמו את שם המשפחה בעברית בלבד.\nרב תודות.");
	passForm.last_name.focus();
	return false;
      }
   // End of Last Name Checking

   // Beginning of Cell Phone Checking
   temp=trim(passForm.cell_phone.value);
   passForm.cell_phone.value=temp;
   if (!(regular_phones.test(temp)))
      {
	alert("אנא רשמו את הטלפון הנייד בספרות בלבד.\nרב תודות.");
	passForm.cell_phone.focus();
	return false;
      }
   // End of Cell Phone Checking

   // Beginning of Home Phone Checking
   temp=trim(passForm.home_phone.value);
   passForm.home_phone.value=temp;
   if (!(regular_phones.test(temp)))
      {
	alert("אנא רשמו את הטלפון בבית בספרות בלבד.\nרב תודות.");
	passForm.home_phone.focus();
	return false;
      }
   // End of Home Phone Checking

   // Beginning of Work Phone Checking
   temp=trim(passForm.work_phone.value);
   passForm.work_phone.value=temp;
   if (temp!="")
      {
	if (!(regular_phones.test(temp)))
	   {
	    alert("אנא רשמו את הטלפון בעבודה בספרות בלבד.\nרב תודות.");
	    passForm.work_phone.focus();
	    return false;
	   }
      }
   // End of Work Phone Checking

   // Beginning of User Type Checking
   o1=passForm.user_type_0.checked;
   o2=passForm.user_type_1.checked;
   if ((!(o1)) && (!(o2)))
      {
	alert("אנא בחרו בסוג הלקוח.\nרב תודות.");
	return false;
      }
   // End of User Type Checking
   return true;
  }

/* validUploadFilesForm Function */
function validUploadFilesForm(passForm)
  {
   // Beginning of File Name Checking
   temp=trim(passForm.file_name.value);
   passForm.file_name.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את שם הקובץ.\nרב תודות.");
	passForm.file_name.focus();
	return false;
      }
   // End of File Name Checking

   // Beginning of File Selection Checking
   temp=trim(passForm.file_selection.value);
   passForm.file_selection.value=temp;
   if ((passForm.page_type.value=="insertion") && (temp==""))
      {
	alert("אנא בחרו בקובץ להעלאה.\nרב תודות.");
	passForm.file_selection.focus();
	return false;
      }

   /*
   if (temp!="")
      {
	temp=temp.substring((temp.length-3),(temp.length));
	temp=temp.toLowerCase();
	if ((temp!="doc") && (temp!="dot") && (temp!="xls") && (temp!="pdf") && (temp!="rtf") && (temp!="zip") && (temp!="rar") && (temp!="htm") && (temp!="tml"))
	   {
	    alert("תבנית הקובץ שבחרתם להעלות אינה נתמכת.\nאנא השתמשו בתבניות MS-Word, MS-Excel, RTF, PDF, ZIP, RAR, HTM או HTML בלבד.\nרב תודות.");
	    passForm.file_selection.focus();
	    return false;
	   }
      }
   */
   // End of File Selection Checking
   return true;
  }

/* validUpdatesBoardForm Function */
function validUpdatesBoardForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_date=/^((\d){1,2})(\.){1}((\d){1,2})(\.){1}((\d){4})$/;
   // End of Regular Expressions Creating

   // Beginning of Update Header Checking
   temp=trim(passForm.update_header.value);
   passForm.update_header.value=temp;
   if (temp=="")
      {
	alert("נא רשמו את כותרת העדכון.\nרב תודות.");
	passForm.update_header.focus();
	return false;
      }
   // End of Update Header Checking

   /*
   // Beginning of Update Content Checking
   temp=trim(passForm.update_content.value);
   passForm.update_content.value=temp;
   if (temp=="")
      {
	alert("נא רשמו את תוכן העדכון.\nרב תודות.");
	passForm.update_content.focus();
	return false;
      }
   // End of Update Content Checking
   */

   // Beginning of Update Status Checking
   if ((!(passForm.update_status_1.checked)) && (!(passForm.update_status_2.checked)))
      {
	alert("נא בחרו במצב העדכון.\nרב תודות.");
	return false;
      }
   // End of Update Status Checking

   // Beginning of Update Expires Checking
   temp=trim(passForm.update_expires.value);
   passForm.update_expires.value=temp;
   if (!(regular_date.test(temp)))
      {
	alert("נא רשמו את תאריך התפוגה בתבנית DD.MM.YYYY.\nרב תודות.");
	passForm.update_expires.focus();
	return false;
      }
   // End of Update Expires Checking
   return true;
  }

function validGalleryForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_digits=/^([0-9]{1,})$/;
   // End of Regular Expressions Creating

   // Beginning of PR Image Name Checking
   temp=trim(passForm.pr_image_name.value);
   passForm.pr_image_name.value=temp;
   if (passForm.page_type.value=="insertion")
      {
	temp=temp.substring((temp.length-3),(temp.length));
	temp=temp.toLowerCase();
	if ((temp!="jpg") && (temp!="jpeg") && (temp!="gif") && (temp!="png"))
	   {
	    alert("קובץ התמונה לתצוגה מקדימה שבחרתם להעלות חייב להיות באחת מן התבניות הבאות: JPG, JPEG, GIF או PNG.");
	    passForm.pr_image_name.focus();
	    return false;
	   }
      }
   // End of PR Image Name Checking

   // Beginning of OR Image Name Checking
   temp=trim(passForm.or_image_name.value);
   passForm.or_image_name.value=temp;
   if (passForm.page_type.value=="insertion")
      {
	temp=temp.substring((temp.length-3),(temp.length));
	temp=temp.toLowerCase();
	if ((temp!="jpg") && (temp!="jpeg") && (temp!="gif") && (temp!="png"))
	   {
	    alert("קובץ התמונה לתצוגה מלאה שבחרתם להעלות חייב להיות באחת מן התבניות הבאות: JPG, JPEG, GIF או PNG.");
	    passForm.or_image_name.focus();
	    return false;
	   }
      }
   // End of OR Image Name Checking

   // Beginning of Image Status Checking
   if ((!(passForm.image_status_1.checked)) && (!(passForm.image_status_2.checked)))
      {
	alert("נא לבחור במצב התמונה.");
	return false;
      }
   // End of Image Status Checking

   // Beginning of Hebrew Description Checking
   temp=trim(passForm.image_he_description.value);
   passForm.image_he_description.value=temp;
   // End of Hebrew Description Checking
   return true;
  }

/* validPagesCategoriesForm Function */
function validPagesCategoriesForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   // End of Regular Expressions Creating

   // Beginning of Category Name Checking
   temp=trim(passForm.category_name.value);
   passForm.category_name.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("אנא רשמו את שם הקטגוריה באותיות בעברית בלבד.\nרב תודות.");
	passForm.category_name.focus();
	return false;
      }
   // End of Category Name Checking
   return true;
  }

/* validPagesContentsForm Function */
function validPagesContentsForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_english=/^([a-zA-Z0-9_]{1,})$/;
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_digits=/^([0-9_]{1,})$/;
   // End of Regular Expressions Creating

   // Beginning of Page Name Checking
   temp=trim(passForm.page_name.value);
   passForm.page_name.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את שם העמוד.\nרב תודות.");
	passForm.page_name.focus();
	return false;
      }
   // End of Page Name Checking

   // Beginning of Page Title Checking
   temp=trim(passForm.page_title.value);
   passForm.page_title.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את כותרת העמוד.\nרב תודות.");
	passForm.page_title.focus();
	return false;
      }
   // End of Page Title Checking

   // Beginning of Page Description Checking
   temp=trim(passForm.page_description.value);
   passForm.page_description.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את תיאור העמוד.\nרב תודות.");
	passForm.page_description.focus();
	return false;
      }
   // End of Page Description Checking

   // Beginning of Page Keywords Checking
   temp=trim(passForm.page_keywords.value);
   passForm.page_keywords.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את מילות המפתח של העמוד.\nרב תודות.");
	passForm.page_keywords.focus();
	return false;
      }
   // End of Page Keywords Checking
   return true;
  }

/* validNavigationAppearanceOrderForm Function */
function validNavigationAppearanceOrderForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_digits=/^([0-9]{1,})$/;
   // End of Regular Expressions Creating

   pages_amount=passForm.pages_amount.value;

   for (i=1; i<=pages_amount; i++)
	{
	 exp ="temp=passForm.page_location_"+i+";";
	 eval(exp);

	 if (!(regular_digits.test(temp.value)))
	    {
	     alert("עליך לבחור בערך למספור עבור פריט "+i+" בשורה העליונה של התפריט העליון.\nהערך מוכרח להיות בספרות בלבד.");
	     temp.focus();
	     return false;
	    }
	}
   return true;
  }

/* validPagesNavigationForm Function */
function validPagesNavigationForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_english=/^([a-zA-Z0-9_]{1,})$/;
   // End of Regular Expressions Creating

   // Beginning of Page Name Checking
   temp=trim(passForm.page_name.value);
   passForm.page_name.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את שם הפריט.\nרב תודות.");
	passForm.page_name.focus();
	return false;
      }
   // End of Page Name Checking

   // Beginning of Page URL Checking
   temp=trim(passForm.page_url.value);
   passForm.page_url.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את URL הפריט.\nרב תודות.");
	passForm.page_url.focus();
	return false;
      }
   // End of Page URL Checking
   return true;
  }

/* validAdminParkingRequestsForm Function */
function validAdminParkingRequestsForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_passengers=/^((\d){1,2})$/;
   regular_times=/^(([0]?[0-5][0-9]|[0-9]):([0-5][0-9]))$/;
   regular_dates=/^((\d){1,2})(\.){1}((\d){1,2})(\.){1}(((\d){4}))$/;
   // End of Regular Expressions Creating

   // Beginning of Customer Name Checking
   temp=passForm.customer_name.value;
   if (temp=="")
      {
	alert("אנא בחר/י בלקוח/ה.\nרב תודות.");
	return false;
      }
   // End of Customer Name Checking

   // Beginning of Flight Company Checking
   temp=passForm.flight_company.value;
   if (temp=="")
      {
	alert("אנא בחר/י בחברת טיסת ההמראה.");
	passForm.flight_company.focus();
	return false;
      }
   // End of Flight Company Checking

   // Beginning of Flight Number Checking
   temp=trim(passForm.flight_number.value);
   passForm.flight_number.value=temp;
   /*
   if (temp=="")
      {
	alert("אנא ציינ/י את מספר טיסת ההמראה.");
	passForm.flight_number.focus();
	return false;
      }
   */
   // End of Flight Number Checking

   // Beginning of Flight Date Checking
   temp=trim(passForm.flight_date.value);
   passForm.flight_date.value=temp;
   if (!(regular_dates.test(temp)))
      {
	alert("אנא ציינ/י את תאריך ההגעה לחניון בתבנית DD.MM.YYYY.");
	passForm.flight_date.focus();
	return false;
      }

   current_date_manipulation=passForm.current_date.value.split(".");
   flight_date_manipulation=passForm.flight_date.value.split(".");
   current_date_full=new Date(current_date_manipulation[1] + "/" + current_date_manipulation[0] + "/" + current_date_manipulation[2]);
   flight_date_full=new Date(flight_date_manipulation[1] + "/" + flight_date_manipulation[0] + "/" + flight_date_manipulation[2]);

   if (flight_date_full<current_date_full)
      {
	alert("אנא ציינ/י תאריך הגעה לחניון שמתקיים לאחר ה-"+passForm.current_date.value);
	passForm.flight_date.focus();
	return false;
      }
   // End of Flight Date Checking

   // Beginning of Flight Time Checking
   temp=trim(passForm.flight_time.value);
   passForm.flight_time.value=temp;
   if (!(regular_times.test(temp)))
      {
	alert("אנא ציינ/י את שעת ההגעה המשוערת בפרטי ההמראה בתבנית HH:MM.");
	passForm.flight_time.focus();
	return false;
      }
   // End of Flight Time Checking

   // Beginning of To Passengers Checking
   temp=trim(passForm.to_passengers.value);
   passForm.to_passengers.value=temp;
   if (!(regular_passengers.test(temp)))
      {
	alert("אנא ציינ/י את מספר הנוסעים בפרטי ההמראה בספרות בלבד.");
	passForm.to_passengers.focus();
	return false;
      }
   // End of To Passengers Checking

   // Beginning of Flight VIP Checking
   o1=passForm.flight_vip_0.checked;
   o2=passForm.flight_vip_1.checked;

   if ((!o1) && (!o2))
      {
	alert("אנא בחר/י האם את/ה מעוניינ/ת בשירות וי.איי.פי בפרטי ההמראה.");
	return false;
      }
   // End of Flight VIP Checking

   // Beginning of Landing Company Checking
   temp=passForm.landing_company.value;
   if (temp=="")
      {
	alert("אנא בחר/י בחברת טיסת הנחיתה.");
	passForm.landing_company.focus();
	return false;
      }
   // End of Landing Company Checking

   // Beginning of Landing Number Checking
   temp=trim(passForm.landing_number.value);
   passForm.landing_number.value=temp;
   /*
   if (temp=="")
      {
	alert("אנא ציינ/י את מספר טיסת הנחיתה.");
	passForm.landing_number.focus();
	return false;
      }
   */
   // End of Landing Number Checking

   // Beginning of Landing Date Checking
   temp=trim(passForm.landing_date.value);
   passForm.landing_date.value=temp;
   if (!(regular_dates.test(temp)))
      {
	alert("אנא ציינ/י את תאריך היציאה מחו''ל בתבנית DD.MM.YYYY.");
	passForm.landing_date.focus();
	return false;
      }

   current_date_manipulation=passForm.current_date.value.split(".");
   landing_date_manipulation=passForm.landing_date.value.split(".");
   current_date_full=new Date(current_date_manipulation[1] + "/" + current_date_manipulation[0] + "/" + current_date_manipulation[2]);
   landing_date_full=new Date(landing_date_manipulation[1] + "/" + landing_date_manipulation[0] + "/" + landing_date_manipulation[2]);

   if (landing_date_full<current_date_full)
      {
	alert("אנא ציינ/י תאריך יציאה מחו''ל שמתקיים לאחר ה-"+passForm.current_date.value);
	passForm.landing_date.focus();
	return false;
      }
   // End of Landing Date Checking

   // Beginning of Landing Time Checking
   temp=trim(passForm.landing_time.value);
   passForm.landing_time.value=temp;
   if (!(regular_times.test(temp)))
      {
	alert("אנא ציינ/י את שעת היציאה מחו''ל בפרטי הנחיתה בתבנית HH:MM.");
	passForm.landing_time.focus();
	return false;
      }
   // End of Landing Time Checking

   // Beginning of From Passengers Checking
   temp=trim(passForm.from_passengers.value);
   passForm.from_passengers.value=temp;
   if (!(regular_passengers.test(temp)))
      {
	alert("אנא ציינ/י את מספר הנוסעים בפרטי הנחיתה בספרות בלבד.");
	passForm.from_passengers.focus();
	return false;
      }
   // End of From Passengers Checking

   // Beginning of Landing VIP Checking
   o1=passForm.landing_vip_0.checked;
   o2=passForm.landing_vip_1.checked;

   if ((!o1) && (!o2))
      {
	alert("אנא בחר/י האם את/ה מעוניינ/ת בשירות וי.איי.פי בפרטי הנחיתה.");
	return false;
      }
   // End of Landing VIP Checking

   // Beginning of Parking Type Checking
   o1=passForm.parking_type_0.checked;
   o2=passForm.parking_type_1.checked;

   if ((!o1) && (!o2))
      {
	alert("אנא בחר/י בסוג החניה.");
	return false;
      }
   // End of Parking Type Checking

   // Beginning of Request Content Checking
   temp=trim(passForm.request_content.value);
   passForm.request_content.value=temp;
   // End of Request Content Checking

   // Beginning of Invisible Notes Checking
   temp=trim(passForm.invisible_notes.value);
   passForm.invisible_notes.value=temp;
   // End of Invisible Notes Checking

   // Beginning of Request Decision Checking
   temp=trim(passForm.request_decision.value);
   passForm.request_decision.value=temp;
   // End of Request Decision Checking

   // Beginning of Request Status Checking
   o1=passForm.request_status_0.checked;
   o2=passForm.request_status_1.checked;
   o3=passForm.request_status_2.checked;

   if ((!o1) && (!o2) && (!o3))
      {
	alert("אנא בחר/י במצב הבקשה.\nרב תודות.");
	return false;
      }
   // End of Request Status Checking
   return true;
  }

/* validFlightCompaniesForm Function */
function validFlightCompaniesForm(passForm)
  {
   // Beginning of Company Name Checking
   temp=trim(passForm.company_name.value);
   passForm.company_name.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את שם החברה.\nרב תודות.");
	passForm.company_name.focus();
	return false;
      }
   // End of Company Name Checking
   return true;
  }

/* validParkingRequestsForm Functions Collection */

/* validFindCustomerForm Function */
function validFindCustomerForm(passForm)
  {
   // Beginning of Regular Expressions Creating
   regular_hebrew=/^([^a-zA-Z0-9_]{2,})$/;
   // End of Regular Expressions Creating

   // Beginning of Name2Find Checking
   temp=trim(passForm.name_to_find.value);
   passForm.name_to_find.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("השם לחיפוש מוכרח לכלול 2 אותיות בעברית לפחות ולא יכול לכלול ספרות או סימנים אחרים.\nנא תקנו את הרישום.\nרב תודות.");
	passForm.name_to_find.focus();
	return false;
      }
   // End of Name2Find Checking
   return true;
  }

function open_customer_window()
  {
   internal_frame.style.display="";
   myForm.find_button.disabled=true;
  }

function transfer_customer_details(full_name, customer_id)
  {
   /*
   temp=new Array();
   temp=full_name.split(" ");

   temp[0]=temp[0].replace("_", "'");
   temp[0]=temp[0].replace("_", "'");
   temp[1]=temp[1].replace("_", "'");
   temp[2]=temp[2].replace("_", "'");

   full_name_new =temp[0];
   full_name_new+=" ";
   full_name_new+=temp[1];
   full_name_new+=" ";
   full_name_new+=temp[2];
   */

   parent.internal_frame.style.display="none";
   parent.myForm.customer_id.value=customer_id;
   parent.myForm.customer_name.value=full_name;
   parent.myForm.find_button.disabled=false;
   parent.myForm.customer_name.style.backgroundColor="#ffffff";
   return true;
  }

function close_customer_window()
  {
   parent.internal_frame.style.display="none";
   parent.myForm.find_button.disabled=false;
   return true;
  }

/* validTellYourFriendForm Function */
function validTellYourFriendForm(form_id)
 {
  tmp="passForm=document.forms['"+form_id+"'];";
  eval(tmp);

  // Beginning of Regular Expressions Creating
  regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  // End of Regular Expressions Creating

  // Beginning of My Name Checking
  temp=trim(passForm.my_name.value);
  passForm.my_name.value=temp;
  if (temp=="")
     {
      alert("אנא רשמו את שמכם המלא.");
      passForm.my_name.focus();
      return false;
     }
  // End of My Name Checking

  // Beginning of My E-mail Address Checking
  temp=trim(passForm.my_email_address.value);
  passForm.my_email_address.value=temp;
  if (!(regular_email_address.test(temp)))
     {
      alert("אנא רשמו כתובת הדואר האלקטרוני שלכם בצורה תקינה.");
      passForm.my_email_address.focus();
      return false;
     }
  // End of My E-mail Address Checking

  // Beginning of Friend's Name Checking
  temp=trim(passForm.friend_name.value);
  passForm.friend_name.value=temp;
  if (temp=="")
     {
      alert("אנא רשמו את שמו המלא של חברכם.");
      passForm.friend_name.focus();
      return false;
     }
  // End of Friend's Name Checking

  // Beginning of Friend's E-mail Address Checking
  temp=trim(passForm.friend_email_address.value);
  passForm.friend_email_address.value=temp;
  if (!(regular_email_address.test(temp)))
     {
      alert("אנא רשמו כתובת הדואר האלקטרוני של חברכם בצורה תקינה.");
      passForm.friend_email_address.focus();
      return false;
     }
  // End of Friend's E-mail Address Checking
  return true;
 }

/* validPasswordRestoreForm Function */
function validPasswordRestoreForm(form_id)
 {
  tmp="passForm=document.forms['"+form_id+"'];";
  eval(tmp);

  // Beginning of Regular Expressions Creating
  regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  // End of Regular Expressions Creating

  // Beginning of Email Address Checking
  temp=trim(passForm.email_address.value);
  passForm.email_address.value=temp;
  if (!(regular_email_address.test(temp)))
     {
      alert("אנא ציינו את כתובת הדואר האלקטרוני שלכם בתבנית תקינה.");
      passForm.email_address.focus();
      return false;
     }
  // End of Email Address Checking
  return true;
 }

/* validSubscriptionForm Function */
function validSubscriptionForm(form_id)
  {
   tmp="passForm=document.forms['"+form_id+"'];";
   eval(tmp);

   // Beginning of Regular Expressions Creating
   regular_phones=/^([0-9\-\+]{1,})$/;
   regular_dates=/^((\d){1,2})(\.){1}((\d){1,2})(\.){1}(((\d){4}))$/;
   regular_english=/^([a-zA-Z0-9_]{1,})$/;
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   // End of Regular Expressions Creating

   // ----------------------------------------------------------------------------------------------------

   // Beginning of E-mail Address Checking
   temp=trim(passForm.email_address.value);
   passForm.email_address.value=temp;
   if (!(regular_email_address.test(temp)))
      {
	alert("אנא רשמו את כתובת הדואר האלקטרוני בתבנית תקינה.");
	passForm.email_address.focus();
	return false;
      }
   // End of E-mail Address Checking

   // Beginning of Password Checking
   temp=trim(passForm.password.value);
   passForm.password.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את הסיסמה המבוקשת באותיות לועזיות ובספרות בלבד.");
	passForm.password.focus();
	return false;
      }
   // End of Password Checking

   // Beginning of First Name Checking
   temp=trim(passForm.first_name.value);
   passForm.first_name.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("אנא רשמו את שמכם הפרטי בעברית בלבד.");
	passForm.first_name.focus();
	return false;
      }
   // End of First Name Checking

   // Beginning of Last Name Checking
   temp=trim(passForm.last_name.value);
   passForm.last_name.value=temp;
   if (!(regular_hebrew.test(temp)))
      {
	alert("אנא רשמו את שם המשפחה שלכם בעברית בלבד.");
	passForm.last_name.focus();
	return false;
      }
   // End of Last Name Checking

   // Beginning of Cell Phone Checking
   temp=trim(passForm.cell_phone.value);
   passForm.cell_phone.value=temp;
   if (!(regular_phones.test(temp)))
      {
	alert("אנא רשמו את הטלפון הנייד שלכם בספרות בלבד.");
	passForm.cell_phone.focus();
	return false;
      }
   // End of Cell Phone Checking

   // Beginning of Home Phone Checking
   temp=trim(passForm.home_phone.value);
   passForm.home_phone.value=temp;
   if (!(regular_phones.test(temp)))
      {
	alert("אנא רשמו את הטלפון שלכם בבית בספרות בלבד.");
	passForm.home_phone.focus();
	return false;
      }
   // End of Home Phone Checking

   // Beginning of Work Phone Checking
   temp=trim(passForm.work_phone.value);
   passForm.work_phone.value=temp;
   if (temp!="")
      {
	if (!(regular_phones.test(temp)))
	   {
	    alert("אנא רשמו את הטלפון שלכם בעבודה בספרות בלבד.");
	    passForm.work_phone.focus();
	    return false;
	   }
      }
   // End of Work Phone Checking

   // Beginning of User Type Checking
   o1=passForm.user_type_0.checked;
   o2=passForm.user_type_1.checked;
   if ((!(o1)) && (!(o2)))
      {
	alert("אנא בחרו בסוג הלקוח שאתם.");
	return false;
      }
   // End of User Type Checking
   return true;
  }

/* validLoginForm Function */
function validLoginForm(form_id)
  {
   tmp="passForm=document.forms['"+form_id+"'];";
   eval(tmp);

   // Beginning of Regular Expressions Creating
   regular_email_address=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   regular_english=/^([a-zA-Z0-9_]{1,})$/;
   // End of Regular Expressions Creating

   // Beginning of Email Address Checking
   temp=trim(passForm.email_address.value);
   passForm.email_address.value=temp;
   if (!(regular_email_address.test(temp)))
      {
	alert("אנא ציינו את כתובת הדואר האלקטרוני שלכם בתבנית תקינה.");
	passForm.email_address.focus();
	return false;
      }
   // End of Email Address Checking

   // Beginning of Password Checking
   temp=trim(passForm.password.value);
   passForm.password.value=temp;
   if (!(regular_english.test(temp)))
      {
	alert("אנא רשמו את הסיסמה המבוקשת באותיות לועזיות ובספרות בלבד.");
	passForm.password.focus();
	return false;
      }
   // End of Password Checking
   return true;
  }

/* validParkingRequestsForm Function */
function validParkingRequestsForm(form_id)
  {
   tmp="passForm=document.forms['"+form_id+"'];";
   eval(tmp);

   // Beginning of Regular Expressions Creating
   regular_passengers=/^((\d){1,2})$/;
   regular_times=/^(([0]?[0-5][0-9]|[0-9]):([0-5][0-9]))$/;
   regular_dates=/^((\d){1,2})(\.){1}((\d){1,2})(\.){1}(((\d){4}))$/;
   // End of Regular Expressions Creating

   // Beginning of Flight Company Checking
   temp=passForm.flight_company.value;
   if (temp=="")
      {
	alert("אנא בחר/י בחברת טיסת ההמראה.");
	passForm.flight_company.focus();
	return false;
      }
   // End of Flight Company Checking

   // Beginning of Flight Number Checking
   temp=trim(passForm.flight_number.value);
   passForm.flight_number.value=temp;
   /*
   if (temp=="")
      {
	alert("אנא ציינ/י את מספר טיסת ההמראה.");
	passForm.flight_number.focus();
	return false;
      }
   */
   // End of Flight Number Checking

   // Beginning of Flight Date Checking
   temp=trim(passForm.flight_date.value);
   passForm.flight_date.value=temp;
   if (!(regular_dates.test(temp)))
      {
	alert("אנא ציינ/י את תאריך ההגעה לחניון בתבנית DD.MM.YYYY.");
	passForm.flight_date.focus();
	return false;
      }

   current_date_manipulation=passForm.current_date.value.split(".");
   flight_date_manipulation=passForm.flight_date.value.split(".");
   current_date_full=new Date(current_date_manipulation[1] + "/" + current_date_manipulation[0] + "/" + current_date_manipulation[2]);
   flight_date_full=new Date(flight_date_manipulation[1] + "/" + flight_date_manipulation[0] + "/" + flight_date_manipulation[2]);

   if (flight_date_full<current_date_full)
      {
	alert("אנא ציינ/י תאריך הגעה לחניון שמתקיים לאחר ה-"+passForm.current_date.value);
	passForm.flight_date.focus();
	return false;
      }
   // End of Flight Date Checking

   // Beginning of Flight Time Checking
   temp=trim(passForm.flight_time.value);
   passForm.flight_time.value=temp;
   if (!(regular_times.test(temp)))
      {
	alert("אנא ציינ/י את שעת ההגעה המשוערת בפרטי ההמראה בתבנית HH:MM.");
	passForm.flight_time.focus();
	return false;
      }
   // End of Flight Time Checking

   // Beginning of To Passengers Checking
   temp=trim(passForm.to_passengers.value);
   passForm.to_passengers.value=temp;
   if (!(regular_passengers.test(temp)))
      {
	alert("אנא ציינ/י את מספר הנוסעים בפרטי ההמראה בספרות בלבד.");
	passForm.to_passengers.focus();
	return false;
      }
   // End of To Passengers Checking

   // Beginning of Flight VIP Checking
   o1=passForm.flight_vip_0.checked;
   o2=passForm.flight_vip_1.checked;

   if ((!o1) && (!o2))
      {
	alert("אנא בחר/י האם את/ה מעוניינ/ת בשירות וי.איי.פי בפרטי ההמראה.");
	return false;
      }
   // End of Flight VIP Checking

   // Beginning of Landing Company Checking
   temp=passForm.landing_company.value;
   if (temp=="")
      {
	alert("אנא בחר/י בחברת טיסת הנחיתה.");
	passForm.landing_company.focus();
	return false;
      }
   // End of Landing Company Checking

   // Beginning of Landing Number Checking
   temp=trim(passForm.landing_number.value);
   passForm.landing_number.value=temp;
   /*
   if (temp=="")
      {
	alert("אנא ציינ/י את מספר טיסת הנחיתה.");
	passForm.landing_number.focus();
	return false;
      }
   */
   // End of Landing Number Checking

   // Beginning of Landing Date Checking
   temp=trim(passForm.landing_date.value);
   passForm.landing_date.value=temp;
   if (!(regular_dates.test(temp)))
      {
	alert("אנא ציינ/י את תאריך היציאה מחו''ל בתבנית DD.MM.YYYY.");
	passForm.landing_date.focus();
	return false;
      }

   current_date_manipulation=passForm.current_date.value.split(".");
   landing_date_manipulation=passForm.landing_date.value.split(".");
   current_date_full=new Date(current_date_manipulation[1] + "/" + current_date_manipulation[0] + "/" + current_date_manipulation[2]);
   landing_date_full=new Date(landing_date_manipulation[1] + "/" + landing_date_manipulation[0] + "/" + landing_date_manipulation[2]);

   if (landing_date_full<current_date_full)
      {
	alert("אנא ציינ/י תאריך יציאה מחו''ל שמתקיים לאחר ה-"+passForm.current_date.value);
	passForm.landing_date.focus();
	return false;
      }
   // End of Landing Date Checking

   // Beginning of Landing Time Checking
   temp=trim(passForm.landing_time.value);
   passForm.landing_time.value=temp;
   if (!(regular_times.test(temp)))
      {
	alert("אנא ציינ/י את שעת היציאה מחו''ל בפרטי הנחיתה בתבנית HH:MM.");
	passForm.landing_time.focus();
	return false;
      }
   // End of Landing Time Checking

   // Beginning of From Passengers Checking
   temp=trim(passForm.from_passengers.value);
   passForm.from_passengers.value=temp;
   if (!(regular_passengers.test(temp)))
      {
	alert("אנא ציינ/י את מספר הנוסעים בפרטי הנחיתה בספרות בלבד.");
	passForm.from_passengers.focus();
	return false;
      }
   // End of From Passengers Checking

   // Beginning of Landing VIP Checking
   o1=passForm.landing_vip_0.checked;
   o2=passForm.landing_vip_1.checked;

   if ((!o1) && (!o2))
      {
	alert("אנא בחר/י האם את/ה מעוניינ/ת בשירות וי.איי.פי בפרטי הנחיתה.");
	return false;
      }
   // End of Landing VIP Checking

   // Beginning of Parking Type Checking
   o1=passForm.parking_type_0.checked;
   o2=passForm.parking_type_1.checked;

   if ((!o1) && (!o2))
      {
	alert("אנא בחר/י בסוג החניה.");
	return false;
      }
   // End of Parking Type Checking

   // Beginning of Request Content Checking
   temp=trim(passForm.request_content.value);
   passForm.request_content.value=temp;
   // End of Request Content Checking
   return true;
  }

/* other_company_display Function */
function other_company_display(area_id, select_id)
  {
   select_name="document.getElementById('"+select_id+"')";
   eval("selection="+select_name+".options["+select_name+".selectedIndex].value;");

   area_name="document.getElementById('"+area_id+"')";

   if (selection=="other")
      { result=area_name+".style.display=''"; }
   else
      { result=area_name+".style.display='none'"; }

   eval(result);
  }
