

function validateSizeBetween(noun,size1,size2,errortext1,errortext2){
   //alert(noun.length);
   if(noun.length<size1){ return errortext1; }
   if(noun.length>size2){ return errortext2;}else{ return '';    }
}// end validate size between

function validateEmail(noun){
//noun.
  var atsign = noun;
  var atcount = atsign.split("@");
  if(atcount.length==2){
      //alert(atcount["1"]);
      var domain = atcount["1"].split(".");
      //alert(domain);
      //alert(domain.length);
      if(domain.length>=2){
         return '';
      }else{ 
         return ('Missing Email Address Ending!');       }

   }
   else{  
   	return ('Missing @ sign!');   
   }
}// end function 

function validateBirth(noun){

   var bd = noun;

   var countbd = bd.split("/");

   //alert(countbd);

   if(countbd.length==3){ return (''); }else{ return 'Invalid BirthDate format -- refer to format example!\n\n';     }

   

}// validateBirth



function validateSize(noun,size,errortext){

    //alert(noun.length);

   if(noun.length==size){ return ''; }else{

      

      return errortext;

   }

}



function validateBilling(addy1,city,state,zip){

   var message = "";



   

   if(addy1==''){ message += "Please enter at least 1 Line of your  Address.\n"; }

   if(city==''){  message += "Please enter your Billing Address City.\n"; }

   if(zip==''){  message += "Please enter your Billing Address Zip Code. \n";  }



   return message;

   

}

function validateValue(noun,errortext){

   if(noun ==''){

       

      return errortext; 

   }else{ return ''; }

}



function validator(clr, sz, lgo, nmber){

   if((clr==0)||(sz==0)||(lgo==0)||(nmber==0)){

      alert("Please select an option from all drop down fields!");

      return false;

      }

}



function validatePhone(noun){

   

   var phonecount = noun.split("-");

   if(phonecount.length==3){

      

      return '';

      

   }else{  return ('Invalid Phone number format! Please re-enter according to format!\n\n');   }

   

}



function validateZip(noun){

   

   var myzip = noun;

   var zipbreak = myzip.split("-");

      if(zipbreak.length==2){ return ''; }else{ return 'Invalid Zip Code Format! Please refer to listed format!';  } 

   

}



function validateInteger(noun,minval){

      var message = "";

   if(isNaN(noun)){

      message += "Only numbers are allowed in the Amount to Fund field!\n"; }

    if(noun < minval){ 

      message += "The minimum funding amount is 25 dollars!\n"; }

    

      return message ;

    

}

