var uzenet;
var jumpObj;

rtstr="";
rtstr2="";
function crt(Field) {
	if (Field && Field.selectedIndex>0) {
		rtstr=rtstr+Field.id+": "+Field.selectedIndex+"\n";
		rtstr2=rtstr2+Field.id+": "+Field.selectedIndex+"<br>";
	}
	
}

function calcRoomtypes() {
rtstr="";
rtstr2="";
	crt(document.Form.rt1);
	crt(document.Form.rt2);
	crt(document.Form.rt3);
	crt(document.Form.rt4);
	crt(document.Form.rt5);
	crt(document.Form.rt6);
	crt(document.Form.rt7);
	crt(document.Form.rt8);
	crt(document.Form.rt9);
	crt(document.Form.rt10);
	crt(document.Form.rt11);
	crt(document.Form.rt12);
	document.Form.roomtypes.value=rtstr;
	document.Form.roomtypes2.value=rtstr2;
	if (rtstr=="") { return false } else { return true };
}


function hiba(huzenet, hObj) {
  uzenet+=huzenet+"\n";
  if (!jumpObj) jumpObj=hObj;
}

function gen_reno() {
document.Form.reservationnumber.value=document.Form.reno1.value+document.Form.lastname.value.toUpperCase()+document.Form.reno2.value;	
}

function formcheck() {
uzenet="";

jumpObj = null;

if (document.Form.lastname.value == "") hiba("last name", document.Form.lastname);
if (document.Form.firstname.value == "") hiba("first name", document.Form.firstname);

if (document.Form.country.value == "") hiba("country", document.Form.country);
if (document.Form.city.value == "") hiba("city", document.Form.city);
if (document.Form.zip.value == "") hiba("ZIP", document.Form.zip);
if (document.Form.street.value == "") hiba("street", document.Form.street);

if (document.Form.email.value.indexOf('@') == -1) hiba("e-mail address",document.Form.email);
if (document.Form.tel.value == "") hiba("tel", document.Form.tel);

if (document.Form.nights.value=="#") hiba("arrival and departure dates", document.Form.arry)

if (document.Form.roomtypes) {
if (!calcRoomtypes()) {hiba("room types", null); }
}

if (document.Form.adults && document.Form.adults.value<=0) hiba("Number of adults", document.Form.adults);

if (document.Form.cardname.value == "") hiba("name of card holder", document.Form.cardname);
if (document.Form.cardnumber.value == "") hiba("number of card", document.Form.cardnumber);
if (document.Form.cardid.value == "") hiba("card ID", document.Form.cardid);






/*gen_reno();*/
if (uzenet=="") return(true); else {
 		alert("The following data are missing or invalid: \n"+uzenet);		
		if (jumpObj) {jumpObj.focus(); }
		return(false);
 	} 

	
}



