var	wHandleVkbd = null;
var hCurrentField = null;

function winVkbd(hFieldObj) {
   if (wHandleVkbd  && !wHandleVkbd.closed) {
	   wHandleVkbd.close();
	}
   wHandleVkbd = window.open("hebrew.html","","width=390,height=375");
   wHandleVkbd.opener = this;
   hCurrentField = hFieldObj;
  }

function closeVkbd() {
   if (wHandleVkbd)
	  wHandleVkbd.close();
	}	

function ValidateDonate()
{
  var f = document.frmDonate;
  var pt = f.PaymentType;
  
  if (f.FirstName.value == "") {
    alert("Please Input First Name.");
    f.FirstName.focus();
    return (false);
  }
  
  if (f.LastName.value == "") {
    alert("Please Input Last Name.");
    f.LastName.focus();
    return (false);
  }
  
  if (f.Phone.value == "") {
    alert("Please Input Phone.");
    f.Phone.focus();
    return (false);
  }
  
  if (f.Email.value == "") {
    alert("Please Input Email.");
    f.Email.focus();
    return (false);
  }
  
  if (f.Address.value == "") {
    alert("Please Input Address.");
    f.Address.focus();
    return (false);
  }
  
  if (f.City.value == "") {
    alert("Please Input City.");
    f.City.focus();
    return (false);
  }
  
  if (f.State.value == "") {
    alert("Please Input State.");
    f.State.focus();
    return (false);
  }
  
  if (f.ZipCode.value == "") {
    alert("Please Input Zip Code.");
    f.ZipCode.focus();
    return (false);
  }
  
  var ptype="";
  var i;
  
  for (i=0;i<pt.length;i++)
    {
	    if (pt[i].checked)
	     {
		   ptype = pt[i].value;
	      }
    }
  
  if (ptype == ""){
      alert("Please Choose Payment Method.");
      return (false);
    }
  
  if (ptype != "My Check is being sent directly to RCCS"){
     if (f.NameOnCard.value == "") {
        alert("Please Input Name On Card.");
        f.NameOnCard.focus();
        return (false);
       }
  
      if (f.CardNumber.value == "") {
         alert("Please Input Credit Card Number.");
         f.CardNumber.focus();
         return (false);
        }
  
      if (f.cc_month.value == "") {
         alert("Please Input Expiration Month.");
         f.cc_month.focus();
         return (false);
        }
    
      if (f.cc_year.value == "") {
         alert("Please Input Expiration Year.");
         f.cc_year.focus();
         return (false);
        }
      
      var c_month = f.cc_month.value;
      var c_year  = f.cc_year.value;
      var today_date = new Date();
      var today_month = today_date.getMonth();
      var today_year = today_date.getYear();
  
      if (c_year.length == 2){
         c_year = "20" + c_year;
       }
     
      if (c_year == today_year){
         if(c_month < (today_month + 1)) {
            alert ("Please Input Valid Expiration Date.");
	        return false;
	       }
         }
      else if (c_year < today_year){
           alert ("Please input Valid Expiration Date.");
	       return false;
        }
     }
           
    if (f.monthbill.checked){
        if (f.checkamt.value == "") {
           alert("Please Input Check Amount.");
           f.checkamt.focus();
           return (false);
         } 
      } 
             
    return (true);
 }   
 


