 function change_vmark(img_id)
   {
    exp="obj=document.getElementById('"+img_id+"');";
    eval(exp);
    
    exp2="my_field=document.forms['contact_form'].uid"+img_id+".value;";
    eval(exp2);
    
    eval("img_id_new='uid"+img_id+"';");
    
    var_name=img_id.split("_");
    uid=var_name[0];
    
    for (i=0; i<document.forms['contact_form'].elements.length; i++)
        {
	  e_name=document.forms['contact_form'].elements[i].name;
	  e_value=document.forms['contact_form'].elements[i].value;
	  
	  e_arr_name=e_name.split("_");
	  e_uid=e_arr_name[0];
	  e_uid=e_uid.replace("uid", "");

	  if ((e_uid==uid) && (e_name!=img_id_new) && (e_value=="1"))
	     {
	      alert("כבר סימנת מוסד זה.");
	      return false;
	     }
        }
    
    if (my_field=="0")
       {
	 exp3="document.forms['contact_form'].uid"+img_id+".value='1';";
	 eval(exp3);
	 obj.src="../images/other/v-mark.png";
	}

    if (my_field=="1")
       {
	 exp3="document.forms['contact_form'].uid"+img_id+".value='0';";
	 eval(exp3);
	 obj.src="../images/other/v-square.png";
	}
    return false;
   }
   
/* validLandingForm Function */
function validLandingForm(form_id)
  {
  tmp="passForm=document.forms['"+form_id+"'];";
  eval(tmp);
  
  count_1=0;
    my_arr="";
    for (i=0; i<document.forms['contact_form'].elements.length; i++)
        {
	  e_name_2=document.forms['contact_form'].elements[i].name;
	  e_value_2=document.forms['contact_form'].elements[i].value;
	  
	  e_arr_name_2=e_name_2.split("_");
	  e_uid_2=e_arr_name_2[0];
	  e_uid_2=e_uid_2.slice(0,3);

	  if ((e_uid_2=="uid") && (e_value_2=="1"))
	     {
	      count_1=1;
	      my_arr+=e_name_2+"|";
	     }
        }
	 
   exp ="document.getElementById('selected_arr').value='"+my_arr+"';";
   eval(exp);
	 
   if (count_1==0)
      {
	alert("אנא בחרו לפחות מוסד לימודים אחד.");
	return false;
      }

   // Beginning of Regular Expressions Creating
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_digits=/^([0-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 Full Name Checking
   temp=trim(passForm.full_name.value);
   passForm.full_name.value=temp;
   if ((temp=="") || (temp=="שם פרטי ומשפחה"))
      {
	 alert("אנא רשמו את שמכם.");
	 passForm.full_name.focus();
	 return false;
      }

   exp ="Set_Cookie('application_form[full_name]', '"+escape(temp)+"', 30, '/');";
   eval(exp);
   // End of Full Name Checking

   // Beginning of Phone Number Checking
   temp=trim(passForm.phone_number.value);
   passForm.phone_number.value=temp;

   count_digits=0;
   for (i=0; i<=temp.length; i++)
	 {
	  if (regular_digits.test(temp.charAt(i)))
	     { count_digits++; }
	 }

   if (count_digits<9)
	{
	 alert("אנא רשמו את מספר הטלפון שלכם כולל קידומת ב-9 ספרות לפחות.");
	 passForm.phone_number.focus();
	 return false;
	}

   exp ="Set_Cookie('application_form[phone_number]', '"+temp+"', 30, '/');";
   eval(exp);
   // End of Phone Number Checking

   // 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;
      }
   exp ="Set_Cookie('application_form[email_address]', '"+temp+"', 30, '/');";
   eval(exp);
   // End of E-mail Address Checking

   // Beginning of Living Area Checking
   temp=trim(passForm.living_area.value);
   passForm.living_area.value=temp;
   if (temp=="")
      {
	alert("אנא רשמו את כתובתכם.");
	passForm.living_area.focus();
	return false;
      }
   exp ="Set_Cookie('application_form[living_area]', '"+escape(temp)+"', 30, '/');";
   eval(exp);
   // End of Living Area Checking

   // Beginning of License Agreement Checking
   if (passForm.license_agreement.checked==false)
      {
	alert("עליך להסכים לתנאי השימוש.");
	return false;
      }
   // End of License Agreement Checking
  
   return true;
  }

/* validMiniContactForm Function */
function validMiniContactForm(form_id)
  {
  tmp="passForm=document.forms['"+form_id+"'];";
  eval(tmp);

   // Beginning of Regular Expressions Creating
   regular_hebrew=/^([^a-zA-Z0-9_]{1,})$/;
   regular_digits=/^([0-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 User ID Checking
   temp=trim(passForm.user_id.value);
   passForm.user_id.value=temp;
   if (temp=="")
      {
	alert("אנא בחרו מוסד לימודים.");
	passForm.user_id.focus();
	return false;
      }
   // End of User ID Checking

   // Beginning of Full Name Checking
   temp=trim(passForm.full_name.value);
   passForm.full_name.value=temp;
   if ((temp=="") || (temp=="שם פרטי ומשפחה"))
      {
	 alert("אנא רשמו את שמכם.");
	 passForm.full_name.focus();
	 return false;
      }

   exp ="Set_Cookie('application_form[full_name]', '"+escape(temp)+"', 30, '/');";
   eval(exp);
   // End of Full Name Checking

   // Beginning of Phone Number Checking
   temp=trim(passForm.phone_number.value);
   passForm.phone_number.value=temp;

   count_digits=0;
   for (i=0; i<=temp.length; i++)
	 {
	  if (regular_digits.test(temp.charAt(i)))
	     { count_digits++; }
	 }

   if (count_digits<9)
	{
	 alert("אנא רשמו את מספר הטלפון שלכם כולל קידומת ב-9 ספרות לפחות.");
	 passForm.phone_number.focus();
	 return false;
	}

   exp ="Set_Cookie('application_form[phone_number]', '"+temp+"', 30, '/');";
   eval(exp);
   // End of Phone Number Checking

   // Beginning of Bulletin Address Checking
   temp=trim(passForm.bulletin_address.value);
   passForm.bulletin_address.value=temp;
   if ((temp=="") || (temp=="כתובת למשלוח ידיעון"))
      {
	alert("אנא רשמו כתובת למשלוח ידיעון.");
	passForm.bulletin_address.focus();
	return false;
      }

   exp ="Set_Cookie('application_form[bulletin_address]', '"+escape(temp)+"', 30, '/');";
   eval(exp);
   // End of Bulletin Address Checking

   // 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;
      }

   exp ="Set_Cookie('application_form[email_address]', '"+temp+"', 30, '/');";
   eval(exp);
   // End of E-mail Address Checking

   // Beginning of License Agreement Checking
   if (passForm.license_agreement.checked==false)
      {
	alert("עליך להסכים לתנאי השימוש.");
	return false;
      }
   // End of License Agreement Checking
  
   document.getElementById('send_application_button').disabled=true;
   return true;
  }