function BlokovaniObjekt()
{
	this.datum_od=new Array();
	this.datum_do=new Array();
	this.n=0;
}

function Check2(b)
{
	var mm,yy,dd,i;
	mm=document.rez.Od_mesic.selectedIndex;
	yy=document.rez.Od_rok[document.rez.Od_rok.selectedIndex].value;
	dd=document.rez.Od_den.selectedIndex+1;
	var rez_od=new Date(yy,mm,validaceDnu(dd,mm,yy));

	mm=document.rez.Do_mesic.selectedIndex;
	yy=document.rez.Do_rok[document.rez.Do_rok.selectedIndex].value;
	dd=document.rez.Do_den.selectedIndex+1;
	var rez_do=new Date(yy,mm,validaceDnu(dd,mm,yy));

	var dnes=new Date();
	dnes.setHours(0,0,0,0);

	var pocet_dni=(rez_do-rez_od)/86400000;
	if(pocet_dni<1)
	{
		alert("The end of the stay is appointed at the earlier date than its beginning !!");
		return false;
	}
	if(rez_od<dnes)
	{
		alert("The date of the stay is appointed at the earlier date than it is today !!");
		return false;
	}
	for(i=0;i<b.n;i++)
	{
		if(!(rez_od>=b.datum_do[i]||(rez_od<b.datum_od[i]&&rez_do<=b.datum_od[i])))
		{
			alert("We are sorry but the booking form is blocked by the administrator of the hotel for this term. Probably there are not free beds. Try another hotel on "+servername+" or another term of your stay. Thank you for your understanding.\n\nThe blocked terms are displayed under the reservation form of every object.");
			return false;
		}
	}
	if(pocet_dni>31)
		return confirm("Are you sure that you would like to book a stay longer than 31 days ?");

	return true;
}
