function FormsChecker(l) {
	this.l = l;

	this.larr = [];
	
	this.larr['pl'] = [];
	this.larr['pl']['zlyprzedzialczasowy'] = 'Źle określiłeś przedział czasowy rezerwacji.';
	this.larr['pl']['prosimywybracrodzajpokoju'] = 'Prosimy wybrać rodzaj pokoju.';
	this.larr['pl']['zlaliczbapokoi'] = 'Źle określono liczbę pokoi.';
	this.larr['pl']['makslap'] = 'Maksymalna liczba apartamentów to 4.';
	this.larr['pl']['makslpd'] = 'Maksymalna liczba pokoi dwuosobowych to 31.';
	this.larr['pl']['makslpj'] = 'Maksymalna liczba pokoi jednoosobowych to 7.';
	this.larr['pl']['makslpt'] = 'Maksymalna liczba pokoi trzyosobowych to 2.';
	this.larr['pl']['prosimywypelnicobowiazkowepola'] = 'Prosimy wypełnić obowiązkowe pola formularza.';
	
	this.larr['en'] = [];
	this.larr['en']['zlyprzedzialczasowy'] = 'Error - wrong date.';
	this.larr['en']['prosimywybracrodzajpokoju'] = 'Choose room type, please.';
	this.larr['en']['zlaliczbapokoi'] = 'Error - incorrect number of rooms.';
	this.larr['en']['makslap'] = 'Max. number of apartaments is 4.';
	this.larr['en']['makslpd'] = 'Max. number of single rooms is 31.';
	this.larr['en']['makslpj'] = 'Max. number of double rooms is 7.';
	this.larr['en']['makslpt'] = 'Max. number of triple rooms is 2.';
	this.larr['en']['prosimywypelnicobowiazkowepola'] = 'Correct the form - complete obligatory fileds, please.';
	
	this.larr['de'] = [];
	this.larr['de']['zlyprzedzialczasowy'] = 'Fehler - falsches Datum.';
	this.larr['de']['prosimywybracrodzajpokoju'] = 'Wählen Sie Bitte die Zimmersart.';
	this.larr['de']['zlaliczbapokoi'] = 'Die Zahl der Zimmer wurde falsch gegeben.';
	this.larr['de']['makslap'] = 'Die höchste Zahl von Appartement ist 4.';
	this.larr['de']['makslpd'] = 'Die höchste Zahl von Einzelzimmer ist 3.';
	this.larr['de']['makslpj'] = 'Die höchste Zahl von Doppelzimmerist 7.';
	this.larr['de']['makslpt'] = 'Die höchste Zahl von zDreibettimmer ist 2.';
	this.larr['de']['prosimywypelnicobowiazkowepola'] = 'Korrigieren Sie das Formular - füllen Sie alle obligatorischen Felder aus.';
};
var fcr = FormsChecker.prototype;
fcr.CheckMPReservation = function() {
	var t = document.forms['mpreservation'];
	
	var start_date_d = t.start_d[t.start_d.selectedIndex].value;
	var start_date_m = t.start_m[t.start_m.selectedIndex].value;
	var start_date_y = t.start_y[t.start_y.selectedIndex].value;
	var start_date = new Date(start_date_y,start_date_m-1,start_date_d).getTime();
	
	var end_date_d = t.end_d[t.end_d.selectedIndex].value;
	var end_date_m = t.end_m[t.end_m.selectedIndex].value;
	var end_date_y = t.end_y[t.end_y.selectedIndex].value;
	var end_date = new Date(end_date_y,end_date_m-1,end_date_d).getTime();
	
	var tmp = new Date();
	var today = new Date(tmp.getFullYear(), tmp.getMonth(), tmp.getDate()).getTime();
	
	var l = this.l;
	
	if(start_date<today || start_date>=end_date) return this.FCAlert(this.larr[l]['zlyprzedzialczasowy']);
	if(t.rooms_types[t.rooms_types.selectedIndex].value==0) return this.FCAlert(this.larr[l]['prosimywybracrodzajpokoju']);
	if(t['rooms_qty'].value=='' || isNaN(t['rooms_qty'].value)==true) return this.FCAlert(this.larr[l]['zlaliczbapokoi']);
	
	if(t.rooms_types[t.rooms_types.selectedIndex].value==7 && parseInt(t['rooms_qty'].value)>4) return this.FCAlert(this.larr[l]['makslap']);
	if(t.rooms_types[t.rooms_types.selectedIndex].value==2 && parseInt(t['rooms_qty'].value)>31) return this.FCAlert(this.larr[l]['makslpd']);
	if(t.rooms_types[t.rooms_types.selectedIndex].value==1 && parseInt(t['rooms_qty'].value)>7) return this.FCAlert(this.larr[l]['makslpj']);
	if(t.rooms_types[t.rooms_types.selectedIndex].value==3 && parseInt(t['rooms_qty'].value)>2) return this.FCAlert(this.larr[l]['makslpt']);
	return true;
}
fcr.CheckCReservation = function() {
	var t = document.forms['reservCForm'];
	
	var email = t.email.value;
	var name = t.name.value;
	var phone = t.phone.value;
	
	var l = this.l;
	
	if(email=='' || name=='' || phone=='') return this.FCAlert(this.larr[l]['prosimywypelnicobowiazkowepola']);
	return true;
}
fcr.CheckContact = function() {
	var t = document.forms['contactForm'];
	
	var question = t.question.value;
	var name = t.name.value;
	var email = t.email.value;
	
	var l = this.l;
	
	if(question=='' || name=='' || email=='') return this.FCAlert(this.larr[l]['prosimywypelnicobowiazkowepola']);
	return true;
}
fcr.CheckConference = function() {
	var t = document.forms['conferenceForm'];
	
	var term = t.term.value;
	var quantity = t.quantity.value;
	var oth = t.oth.value;
	var contact = t.contact.value;
	
	var l = this.l;
	
	if(term=='' || quantity=='' || oth=='' || contact=='') return this.FCAlert(this.larr[l]['prosimywypelnicobowiazkowepola']);
	return true;
}
fcr.FCAlert = function(v) {
	alert(v);
	return false;
}
