var error=""; var ma_ev="2024"; var ma_ho="11"; var ma_nap="15"; var fields=new Array("foglalas_guests_adult","foglalas_guests_child","foglalas_persone_lastname","foglalas_persone_firstname","foglalas_persone_email","foglalas_persone_tel"); fields.push("foglalas_billing_name"); fields.push("foglalas_billing_address"); if(document.forms.pageform.arrivallist.value==0){ fields.push("foglalas_arrival"); fields.push("foglalas_departure"); } var errorMessages=new Array(); errorMessages["foglalas_guests_adult"]="Please, indicate the number of guests!\n"; errorMessages["foglalas_guests_adult_ERROR"]=false; errorMessages["foglalas_guests_child"]="Please enter the age of each child on the day of departure!\n"; errorMessages["foglalas_guests_child_ERROR"]=false; errorMessages["foglalas_arrival"]="Please, give the date of you arrival!\n"; errorMessages["foglalas_arrival_ERROR"]=false; errorMessages["foglalas_departure"]="Please, give the date of your departure!\n"; errorMessages["foglalas_departure_ERROR"]=false; errorMessages["foglalas_persone_email"]="Please, give your e-mail address!\n"; errorMessages["foglalas_persone_email_ERROR"]=false; errorMessages["foglalas_persone_lastname"]="Please, give your surname!\n"; errorMessages["foglalas_persone_lastname_ERROR"]=false; errorMessages["foglalas_persone_firstname"]="Please, give your first name!\n"; errorMessages["foglalas_persone_firstname_ERROR"]=false; errorMessages["foglalas_persone_tel"]="Please enter your phone number!\n"; errorMessages["foglalas_persone_tel_ERROR"]=false; errorMessages["foglalas_aszf"]="Please check that you agree to the Terms and Conditions.\n"; errorMessages["foglalas_aszf_ERROR"]=false; errorMessages["foglalas_privacy"]="Kérjük, pipálja ki, hogy elfogadja az Adatkezelési Szabályzatot!\n"; errorMessages["foglalas_privacy_ERROR"]=false; errorMessages["foglalas_hotel_lang_code"]="Please, choose a hotel!\n"; errorMessages["foglalas_hotel_lang_code_ERROR"]=false; errorMessages["board"]="Please choose what kind of care you need!\n"; errorMessages["board_ERROR"]=false; errorMessages["foglalas_billing_name"]="Please enter the billing name!\n"; errorMessages["foglalas_billing_name_ERROR"]=false; errorMessages["foglalas_billing_address"]="Please enter your billing address!\n"; errorMessages["foglalas_billing_address_ERROR"]=false; function formsubmit(){ checkErrors(); if(error==""){ with(document.forms.pageform){ submit(); frm_submit.disabled=true; frm_submit.value="Sending..."; } } else { showErrors(fields,errorMessages); alert(form_format_alert_text(error)+"Thank You!\n"); } } function checkErrors(){ error=""; var counter=0; if(document.forms.pageform.foglalas_departure_year!=null)fields.push("foglalas_departure"); with(document.forms.pageform){ miez='foglalas_guests_adult'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='foglalas_persone_lastname'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='foglalas_persone_firstname'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; if(foglalas_persone_email.value==""){error+=errorMessages["foglalas_persone_email"]; errorMessages["foglalas_persone_email_ERROR"]=true; } else if(!is_email(foglalas_persone_email.value)){error+=errorMessages["foglalas_persone_email"]; errorMessages["foglalas_persone_email_ERROR"]=true; } else errorMessages["foglalas_persone_email_ERROR"]=false; miez='foglalas_persone_tel'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='foglalas_guests_child'; errorMessages[miez+"_ERROR"]=false; for(i=1;i<=foglalas_guests_child.value;i++){ if($("#childage_"+i).val()==-1){ error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; break; } } //ha listabol valaszt, akkor nem ellenorizzuk a megadott datumokat if(arrivallist.value=='0'){ //kotelezo erkezes és elutazás datumot megadni miez='foglalas_arrival'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='foglalas_departure'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; /* if(foglalas_arrival_interestx.value==''){ error+=errorMessages["foglalas_arrival"]; errorMessages["foglalas_arrival_ERROR"]=true; } if(foglalas_departure_interestx.value==''){ error+=errorMessages["foglalas_departure"]; errorMessages["foglalas_departure_ERROR"]=true; } else { if(foglalas_arrival_year.value==ma_ev){ if((parseInt(foglalas_arrival_month.value)<=ma_ho && parseInt(foglalas_arrival_day.value)parseInt(foglalas_arrival_year.value)) { errorMessages["foglalas_departure_ERROR"]=false; //kulonben hiba } else { errorMessages["foglalas_departure_ERROR"]=true; error+=errorMessages["foglalas_departure"]; } } } } */ } miez='foglalas_hotel_lang_code'; if(eval(miez+'.value=="0"')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='foglalas_billing_name'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='foglalas_billing_address'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; } }