/* Creation date: 2005-03-12 */

/* Modified: Halina Jasklowska */

// dist - string began with 1 (for 'all' category). 1 indicates hotel should be displayed during listing suitable category, 0 - no display

function hotel(dist, cat, fit, bus, price, instant, cur, dir, name, town)
{
	this.dist = dist;
	this.cat = cat;
	this.fit = fit;
	this.bus = bus;
	this.price = price;
	this.instant = instant;
	this.cur = cur;
	this.dir = dir;
	this.name = name;
	this.town = town;
}

i=0;
hotels = new Array();
hotels[i++] = new hotel ('110000',5,1,1,235,0, 'EUR','/Palace','Palace','Milan');
hotels[i++] = new hotel ('110000',5,1,1,235,0, 'EUR','/Palace','Palace','Milan');
hotels[i++] = new hotel ('110000',5,1,1,261,0, 'EUR','/PrincipediSavoia','Principe di Savoia','Milan');
hotels[i++] = new hotel ('110000',5,1,1,400,0, 'EUR','/DucaDiMilano','Duca Di Milano','Milan');
hotels[i++] = new hotel ('110000',5,0,0,98,0, 'EUR','/DoriaGrand','Doria Grand','Milan');
hotels[i++] = new hotel ('110000',5,0,0,205,0, 'EUR','/GrandDuomo','Grand ','Duomo','Milan');
hotels[i++] = new hotel ('110000',5,1,0,250,0, 'EUR','/GrandetdeMilan','Grand ','et de Milano','Milan');
hotels[i++] = new hotel ('110000',5,0,0,230,0, 'EUR','/CarltonBaglioni','Carlton ','Baglioni','Milan');
hotels[i++] = new hotel ('110000',5,0,0,191,0, 'EUR','/PierreMilano','Pierre Milano','Milan');
hotels[i++] = new hotel ('110000',5,1,1,170,0, 'EUR','/ExcelsiorGallia','Excelsior Gallia','Milan');
hotels[i++] = new hotel ('110000',5,0,1,99,0, 'EUR','/GrandBrun','Grand ','Brun','Milan');
hotels[i++] = new hotel ('110000',5,0,1,135,0, 'EUR','/GoldenTulipExecutive','Golden Tulip Executive','Milan');
hotels[i++] = new hotel ('110000',5,0,0,165,0, 'EUR','/Brunelleschi','Brunelleschi','Milan');
hotels[i++] = new hotel ('110000',4,0,0,153,0, 'EUR','/GrandPuccini','Grand ','Puccini','Milan');
hotels[i++] = new hotel ('110000',4,0,0,140,0, 'EUR','/Windsor','Windsor','Milan');
hotels[i++] = new hotel ('110000',4,0,1,135,0, 'EUR','/Berna','Berna','Milan');
hotels[i++] = new hotel ('101000',4,0,0,194,0, 'EUR','/JollyMilanoDue','Jolly ','Milano Due','Milan');
hotels[i++] = new hotel ('110000',4,0,1,136,0, 'EUR','/CenturyTower','Century Tower','Milan');
hotels[i++] = new hotel ('110000',4,1,0,222,0, 'EUR','/CapitolMillenium','Capitol Millenium','Milan');
hotels[i++] = new hotel ('110000',4,0,0,95,0, 'EUR','/GoldenTulipManin','Golden Tulip ','Manin','Milan');
hotels[i++] = new hotel ('110000',4,0,0,86,0, 'EUR','/StarAnderson','Star','Anderson','Milan');
hotels[i++] = new hotel ('110000',4,0,0,103,0, 'EUR','/Alexander','Alexander','Milan');
hotels[i++] = new hotel ('110000',4,0,0,209,0, 'EUR','/StarSplendido','Star','Splendido','Milan');
hotels[i++] = new hotel ('110000',4,0,1,152,0, 'EUR','/JollyTouringMilano','Jolly ','Touring Milano','Milan');
hotels[i++] = new hotel ('110000',4,1,0,132,0, 'EUR','/StarRosa','Star','Rosa','Milan');
hotels[i++] = new hotel ('110000',4,1,0,84,0, 'EUR','/StarTourist','Star','Tourist','Milan');
hotels[i++] = new hotel ('101000',4,0,0,160,0, 'EUR','/JollyMilanofiori','Jolly ','Milanofiori','Milan');
hotels[i++] = new hotel ('110000',4,0,0,449,0, 'EUR','/JollyPresident','Jolly ','President','Milan');
hotels[i++] = new hotel ('110000',4,0,0,98,0, 'EUR','/Atlantic','Atlantic','Milan');
hotels[i++] = new hotel ('110000',4,0,1,83,1, 'EUR','/Sanpi','<font>Sanpi</font>','Milan');
hotels[i++] = new hotel ('110000',4,0,0,104,0, 'EUR','/GoldenTulipCrivis','Golden Tulip Crivis','Milan');
hotels[i++] = new hotel ('110000',4,0,1,175,0, 'EUR','/Michelangelo','Michelangelo','Milan');
hotels[i++] = new hotel ('110000',4,1,0,181,0, 'EUR','/SheratonDianaMajestic','Sheraton Diana Majestic','Milan');
hotels[i++] = new hotel ('110000',4,1,0,125,0, 'EUR','/NovotelMilanoNordCaGranda','Novotel Milano Nord Ca Granda','Milan');
hotels[i++] = new hotel ('110000',4,1,0,155,0, 'EUR','/NovotelMilanoEstAeroporto','Novotel Milano Est Aeroporto','Milan');
hotels[i++] = new hotel ('110000',4,1,1,101,0, 'EUR','/GoldenTulipQuark','Golden Tulip Quark','Milan');
hotels[i++] = new hotel ('110000',4,1,1,165,0, 'EUR','/HolidayInnMilan','Holiday Inn Milan','Milan');
hotels[i++] = new hotel ('110000',4,1,1,80,0, 'EUR','/LeonardoDaVinci','Leonardo Da Vinci','Milan');
hotels[i++] = new hotel ('110000',4,0,0,108,0, 'EUR','/SantaBarbara','Santa Barbara','Milan');
hotels[i++] = new hotel ('110000',4,0,0,150,0, 'EUR','/Auriga','Auriga','Milan');
hotels[i++] = new hotel ('110000',4,0,1,171,0, 'EUR','/HiltonInternational','Hilton International','Milan');
hotels[i++] = new hotel ('110000',4,0,0,203,0, 'EUR','/CarlyleBrera','Carlyle Brera','Milan');
hotels[i++] = new hotel ('110000',4,0,0,153,0, 'EUR','/Cavour','Cavour','Milan');
hotels[i++] = new hotel ('110000',4,0,0,178,0, 'EUR','/RadissonSasBonaparte','Radisson Sas Bonaparte','Milan');
hotels[i++] = new hotel ('110000',4,1,0,180,0, 'EUR','/DeLaVille','De La Ville','Milan');
hotels[i++] = new hotel ('110000',4,0,0,161,0, 'EUR','/Lloyd','Lloyd','Milan');
hotels[i++] = new hotel ('110000',4,0,0,162,0, 'EUR','/Galileo','Galileo','Milan');
hotels[i++] = new hotel ('110000',4,0,0,95,0, 'EUR','/PalazzodelleStelline','Palazzo delle Stelline','Milan');
hotels[i++] = new hotel ('110000',4,0,0,149,0, 'EUR','/DeiCavalieri','Dei Cavalieri','Milan');
hotels[i++] = new hotel ('110000',4,0,0,65,1, 'EUR','/Madison','<font>Madison</font>','Milan');
hotels[i++] = new hotel ('110000',4,0,0,65,0, 'EUR','/Mozart','Mozart','Milan');
hotels[i++] = new hotel ('110000',4,0,0,88,0, 'EUR','/Poliziano','Poliziano','Milan');
hotels[i++] = new hotel ('110000',4,0,0,126,0, 'EUR','/Regency','Regency','Milan');
hotels[i++] = new hotel ('110000',4,0,0,155,0, 'EUR','/Raffaello','Raffaello','Milan');
hotels[i++] = new hotel ('110000',4,0,0,147,0, 'EUR','/Mirage','Mirage','Milan');
hotels[i++] = new hotel ('110000',4,0,0,131,0, 'EUR','/Ambasciatori','Ambasciatori','Milan');
hotels[i++] = new hotel ('110000',4,0,0,140,0, 'EUR','/Bristol','Bristol','Milan');
hotels[i++] = new hotel ('110000',4,0,1,89,0, 'EUR','/StarRitz','Star','Ritz','Milan');
hotels[i++] = new hotel ('110000',4,0,0,227,0, 'EUR','/Andreola','Andreola','Milan');
hotels[i++] = new hotel ('110000',4,0,0,78,0, 'EUR','/BestWesternAscot','Best Western ','Ascot','Milan');
hotels[i++] = new hotel ('110000',4,0,0,99,0, 'EUR','/Galles','Galles','Milan');
hotels[i++] = new hotel ('110000',4,0,0,165,0, 'EUR','/Major','Major','Milan');
hotels[i++] = new hotel ('110000',4,0,0,110,0, 'EUR','/BlaiseFrancis','Blaise Francis','Milan');
hotels[i++] = new hotel ('100100',4,1,0,108,0, 'EUR','/GrandImperiale','Grand ','Imperiale','Moltrasio');
hotels[i++] = new hotel ('100100',4,0,0,120,0, 'EUR','/CappelloDOro','Cappello D Oro','Bergamo');
hotels[i++] = new hotel ('100100',4,0,0,84,0, 'EUR','/Lodi','Lodi','Lodi');
hotels[i++] = new hotel ('100100',4,0,0,99,0, 'EUR','/DelaVille2','De la Ville ',' Monza');
hotels[i++] = new hotel ('100100',4,0,0,82,0, 'EUR','/Sporting','Sporting','Opera');
hotels[i++] = new hotel ('100100',4,0,1,110,0, 'EUR','/ForteCrest','Crowne Plaza','San Donato Milanese');
hotels[i++] = new hotel ('110000',4,0,0,86,1, 'EUR','/Mediolanum','<font>Mediolanum</font>','Milan');
hotels[i++] = new hotel ('110000',4,0,1,189,0, 'EUR','/GrandVerdi','Grand ','Verdi','Milan');
hotels[i++] = new hotel ('110000',4,0,1,119,0, 'EUR','/Rubens','Rubens','Milan');
hotels[i++] = new hotel ('110000',4,1,1,160,0, 'EUR','/Hermitage','Hermitage','Milan');
hotels[i++] = new hotel ('110000',4,0,1,190,0, 'EUR','/Concorde','Concorde','Milan');
hotels[i++] = new hotel ('110000',4,0,0,100,0, 'EUR','/Accademia','Accademia','Milan');
hotels[i++] = new hotel ('101000',4,0,0,96,1, 'EUR','/plaza','<font>Plaza</font>','Milan');
hotels[i++] = new hotel ('101000',4,0,0,60,1, 'EUR','/accursio','<font>Accursio</font>','Milan');
hotels[i++] = new hotel ('110000',3,0,1,50,0, 'EUR','/Demo','Demo ','Milan');
hotels[i++] = new hotel ('110000',3,1,1,89,0, 'EUR','/Zefiro','Zefiro ','Milan');
hotels[i++] = new hotel ('110000',3,0,0,70,1, 'EUR','/ComfortRitter','<font>Comfort ','Ritter</font>','Milan');
hotels[i++] = new hotel ('100100',3,1,0,107,1, 'EUR','/Montini','<font>Montini</font>','Peschiera Borromeo');
hotels[i++] = new hotel ('110000',3,0,1,91,0, 'EUR','/Cervo','Cervo','Milan');
hotels[i++] = new hotel ('110000',3,0,0,195,0, 'EUR','/MercureMilanoRoyal','Mercure Milano Royal','Milan');
hotels[i++] = new hotel ('110000',3,1,0,125,0, 'EUR','/Mediterraneo','Mediterraneo','Milan');
hotels[i++] = new hotel ('110000',3,0,0,103,0, 'EUR','/Alga','<font>Alga</font>','Milan');
hotels[i++] = new hotel ('110000',3,0,0,106,0, 'EUR','/MercureMilanoCorsoGeneva','Mercure Milano Corso Geneva','Milan');
hotels[i++] = new hotel ('110000',3,0,1,103,0, 'EUR','/Admiral','Admiral','Milan');
hotels[i++] = new hotel ('110000',3,0,1,72,0, 'EUR','/Rex','Rex','Milan');
hotels[i++] = new hotel ('110000',3,0,0,64,1, 'EUR','/Marconi','Marconi','Milan');
hotels[i++] = new hotel ('110000',3,0,0,80,0, 'EUR','/CristoforoColombo','Cristoforo Colombo','Milan');
// hotels[i++] = new hotel ('110000',3,1,0,90,0, 'EUR','/Ambrosiano','Ambrosiano','Milan');
hotels[i++] = new hotel ('110000',4,0,0,67,0, 'EUR','/Baviera','Baviera','Milan');
hotels[i++] = new hotel ('110000',3,0,0,68,0, 'EUR','/Mennini','Mennini','Milan');
hotels[i++] = new hotel ('110000',3,0,0,199,0, 'EUR','/SanCarlo','San Carlo','Milan');
hotels[i++] = new hotel ('110000',3,0,0,62,0, 'EUR','/DelleNazioni','Delle Nazioni','Milan');
hotels[i++] = new hotel ('110000',3,0,0,45,0, 'EUR','/Garda','Garda','Milan');
hotels[i++] = new hotel ('110000',3,0,0,61,0, 'EUR','/MonopoleDeLaGare','Monopole De La Gare','Milan');
hotels[i++] = new hotel ('110000',3,1,0,78,0, 'EUR','/TulipInnMilanScalaNord','Tulip Inn Milan Scala Nord','Milan');
hotels[i++] = new hotel ('110000',3,0,0,83,0, 'EUR','/IbisCaGranda','Ibis Ca Granda','Milan');
hotels[i++] = new hotel ('110000',3,0,0,100,0, 'EUR','/Puccini','Grand Puccini','Milan');																			
hotels[i++] = new hotel ('110000',3,0,0,58,1, 'EUR','/Cristallo','<font>Cristallo</font>','Milan');																								
hotels[i++] = new hotel ('110000',3,0,0,83,0, 'EUR','/Augustus','Augustus','Milan');																								
hotels[i++] = new hotel ('110000',3,0,0,79,0, 'EUR','/Soperga','<font>Soperga</font>','Milan');																								
hotels[i++] = new hotel ('110000',3,0,0,91,0, 'EUR','/GoldenTulipGrandFieramilano','Golden Tulip Grand ','Fieramilano','Milan');																								
hotels[i++] = new hotel ('110000',3,0,0,98,0, 'EUR','/Astoria','Astoria','Milan');																								
hotels[i++] = new hotel ('110000',3,0,0,85,0, 'EUR','/Albert','Albert','Milan');																								
//hotels[i++] = new hotel ('110000',3,0,0,75,0, 'EUR','/FeliceCasati','Felice Casati','Milan');																	160	Double	room	++	85	--	180	**
hotels[i++] = new hotel ('110000',3,0,0,75,0, 'EUR','/BestWesternCity','Best Western ','City','Milan');																								
hotels[i++] = new hotel ('100100',3,0,0,78,0, 'EUR','/Continental','Continental','Como');																								



function sortCategory()
{
	for (p=1; p<hotels.length; p++)
	{
		for(q=0; q<(hotels.length-1); q++)
		{
			if (hotels[q].cat < hotels[q+1].cat) 
			{
				a = new hotel;
				a = hotels[q];
				hotels[q] = hotels[q+1];
				hotels[q+1] = a;
			} 
		}
	}
}

function sortPrice()
{
//	alert("sortPrice()");

	for (p=1; p<hotels.length; p++)
	{
		for (q=0; q<(hotels.length-1); q++)
		{
			if (hotels[q].price > hotels[q+1].price) 
			{
				a = new hotel;
				a = hotels[q];
				hotels[q] = hotels[q+1];
				hotels[q+1] = a;
			} 
		}
	}
}

function listHotels()
{
	category = document.theForm['category'].value;
	locationSearch = document.theForm['location'].value;
	priceRange = document.theForm['priceRange'].value;
	fitness = document.theForm['fitness'].checked;
	business = document.theForm['business'].checked;

// tablice wartosci domyslnych

	selCategory = new Array();
	selLocation = new Array();
	selPrice = new Array();
	var selFitness, selBusiness;

	for (m=1; m<6; m++) if (category==m) selCategory[m]="selected";
	for (m=1; m<5; m++) if (locationSearch==m) selLocation[m] = "selected";
	for (m=0; m<=200; m=m+50) if (priceRange==m) selPrice[m] = "selected";
	if (fitness) selFitness = "checked";
	if (business) selBusiness = "checked";

// koniec wartosci domyslnych =================

	location.reload();

// Headers & main text

	document.write('<html>\r\n<head>\r\n<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r\n<title>Milan Hotels - Search Results</title>\r\n<link rel=stylesheet type=text/css href=http://www.polhotels.com/cities_gfx/citystyles.css>\r\n');
	document.write('<script language=javascript src=milan_hotels/milan_hotels.js></script>\r\n</head>\r\n\r\n<body>\r\n\r\n<table name=LAYOUT WIDTH=85% BORDER=0 align=center>\r\n');
	document.write('<TR><TD colspan=3> <table cellspacing=0 cellpadding=0 border=0 width=100%>\r\n');
	document.write('<tr><td><img src=http://www.polhotels.com/cities_gfx/hotels.gif alt=\"Milan Hotels\"><span style="position: relative; left: -119px; top: -2px; font-size: 22px;"><nobr>Milan Hotels</nobr></span></td><td align=right valign=bottom><a href=http://www.res99.com/nexres/cars/search.cgi?src=10004159 target=_blank><img src=http://www.polhotels.com/cities_gfx/car.gif width=125 height=26 border=0></a><img src=b.gif width=5 height=1>\r\n');
	document.write('<a href=http://www.res99.com/nexres/start-pages/frame.cgi?src=10004159&product=AIR target=_blank><img src=http://www.polhotels.com/cities_gfx/air.gif width=125 height=26 border=0></a><img src=b.gif width=5 height=1><a href=mailto:ontravel@pol.pl><img src=http://www.polhotels.com/cities_gfx/contact.gif width=126 height=25 border=0></a></td></tr>\r\n');
	document.write('<tr><td colspan=2><img src=b.gif width=1 height=4></td></tr>\r\n');
	document.write('<tr><td bgcolor=#333366 colspan=2><img src=b.gif width=1 height=1></td></tr></table><img src=b.gif width=1 height=7><br>\r\n');
	document.write('<b>Welcome to Milan, Italy!</b>\r\n');
	document.write(" We present one of the most comprehensive selections of hotels in Milan available through the web, with detailed information on the hotels  facilities, photos, maps, and secure reservation forms.<Br> Whether you\'re on a budget or looking for luxury accommodations in Milan, our Milan hotels directory offers a wide range of possibilities for your stay, from cheap hotels, inns, motels, to deluxe hotels. Some of the hotels presented in this directory offer <u>prices lower than the hotel rack rates</u>. These kind of offers are exclusive for <a class=hotel href=http://www.hotelsitalyonline.com>hotelsitalyonline.com</a> and are available only when booked through our secure reservation forms.<br><img src=b.gif width=1 height=10><br></TD></TR>\r\n");
	document.write('<TR><TD width=50% valign=top class=light><TABLE name=ALLHOTELS width=100% cellspacing=0 cellpadding=0 border=0>\r\n');
	document.write('<tr><td colspan=4 align=left height=28 valign=top class=title><table cellspacing=0 cellpadding=0 width=100% border=0><tr height=28>\r\n');
	document.write('<td class=title align=left valign=top><img src=http://www.polhotels.com/cities_gfx/r1.gif width=14 height=9></td>\r\n');
	document.write('<td class=title> All Milan hotels</td><td align=right class=title><font class=a3>Currently <b>'+hotels.length+' hotels</b> available</font></td>\r\n');
	document.write('<td class=title align=right valign=top><img src=http://www.polhotels.com/cities_gfx/r2.gif width=14 height=9></td></table></td></tr>\r\n');
	document.write('<tr><td colspan=4 bgcolor=#333366><form name=theForm>\r\n');
	document.write('<table name=marginsearchbox cellspacing=0 cellpadding=0 class=title border=0 width=100%><tr><td><img src=b.gif width=1 height=1></td><td><table width=100% cellspacing=0 cellpadding=2 border=0 class=normal style="font-size:8pt">\r\n');
	document.write('<tr class=old><td colspan=4><img src=b.gif width=1 height=1></td></tr>\r\n');
	document.write('<tr class=old><td><img src=b.gif width=3 height=1></td>\r\n');
	document.write('<td><img src=arrow.gif width=4 height=7>   Category</td>\r\n');
	document.write('<td align=center><select onchange="listHotels()" style="width:80px;" name=category>\r\n');
	document.write('<option value="all">all</option><option value="5" '+selCategory[5]+'>5 stars</option><option value="4" '+selCategory[4]+'>4 stars</option><option value="3" '+selCategory[3]+'>3 stars</option><option value="2" '+selCategory[2]+'>2 stars</option>\r\n');
	document.write('<option value="1" '+selCategory[1]+'>other</option></select></td><td><img src=b.gif width=10 height=1><img src=arrow.gif width=4 height=7>   Location \r\n');
	document.write('<select style="width:180px;" name=location onchange="listHotels()">\r\n');
	document.write('<option value="0">all</option><option value="1" '+selLocation[1]+'>city center</option><option value="2" '+selLocation[2]+'>suburbs</option><option value="3" '+selLocation[3]+'>out of city</option><option value="4" '+selLocation[4]+'>airport</option></select></td>\r\n');
	document.write('</select></td>\r\n');
	document.write('</select></td></tr>\r\n');
	document.write('<tr class=old><td><img src=b.gif width=3 height=1></td>\r\n');
	document.write('<td><img src=http://www.polhotels.com/cities_gfx/arrow.gif width=4 height=7>   <nobr>Prices from</nobr></td>\r\n');
	document.write('<td align=center><select style="width:80px;" name=priceRange onchange="listHotels()">\r\n');
	document.write('<option value="all">all</option><option value="0" '+selPrice[0]+'>< € 50</option><option value="50" '+selPrice[50]+'>€ 50 - € 100</option><option value="100" '+selPrice[100]+'>€ 100 - € 150</option>\r\n');
	document.write('<option value="150" '+selPrice[150]+'>€ 150 - € 200</option><option value="200" '+selPrice[200]+'>> € 200</option></select></td>\r\n');
	document.write('<td><table cellspacing=0 cellpadding=0 border=0 width=100% class=normal style="font-size:8pt">\r\n');
	document.write('<tr class=old><td width=50%><img src=b.gif width=10 height=1><img src=arrow.gif width=4 height=7>   Fitness<img src=b.gif width=5 height=1><input type=checkbox name=fitness onclick="listHotels()" '+selFitness+'></td><td width=50%><img src=b.gif width=10 height=1><img src=arrow.gif width=4 height=7>   Business<img src=b.gif width=5 height=1><input type=checkbox name=business onclick="listHotels()" '+selBusiness+'> </td></tr>\r\n');
	document.write('</table></td></tr>\r\n');

//	document.write('<option value="all">all</option><option value="1" '+selLocation[1]+'>city center</option><option value="2" '+selLocation[2]+'>suburbs</option><option value="3" '+selLocation[3]+'>out of city</option></select></td>');
//	document.write('<td><img src=b.gif width=10 height=1><img src=http://www.polhotels.com/cities_gfx/arrow.gif width=4 height=7>   Fitness<img src=b.gif width=5 height=1><input type=checkbox name=fitness onclick="listHotels()" '+selFitness+'><img src=b.gif width=10 height=1><img src=http://www.polhotels.com/cities_gfx/arrow.gif width=4 height=7>   Business<img src=b.gif width=5 height=1><input type=checkbox name=business onclick="listHotels()" '+selBusiness+'> </td></tr>');

	document.write('<tr class=old><td colspan=4><img src=b.gif width=1 height=1></td></tr>\r\n');
	document.write('</form></table name=searchbox></td><td><img src=b.gif width=1 height=1></td></tr><tr><td colspan=3><img src=b.gif width=1 height=1></td></table name=marginsearchbox></td></tr>\r\n');
	document.write('</table name=allhotels></td><td width=5></td>\r\n');
	document.write('<td width=50% valign=top><img src=b.gif width=1 height=7><br><img src=http://www.polhotels.com/cities_gfx/cen2.gif width=13 height=13 align=middle> - city center <br><img src=http://www.polhotels.com/cities_gfx/fit2.gif width=13 height=13 align=middle> - fitness facilities: swimming pool / gym / tennis courts <br><img src=http://www.polhotels.com/cities_gfx/bus2.gif width=13 height=13 align=middle> - business facilities: business center / PC available to guests<br><img src=http://www.polhotels.com/cities_gfx/ins.gif width=13 height=13 align=middle> - instant availability check and reservations<br><font><b>Recommended hotels are marked with this color.</b></font></td></tr>\r\n');
// Koniec elementow statycznych

// test zmiennych:
// document.write('cat: ' + category + ' loc: ' +locationSearch + ' price: ' + priceRange +' fit: ' + fitness + ' bus: ' + business);

// test sortowanie:

	document.write('<tr><td colspan=3 class=light><table name=marginesy cellspacing=0 cellpadding=0 width=100%><tr><td><img src=b.gif width=3 height=0></td><td><table name="wyniki" cellspacing=0 cellpadding=1 border=0 width=100%>\r\n');
	sortPrice();
	sortCategory();
	var lastIndex = 99999;
	var resCount = 0;
	
	for (k=0; k<hotels.length; k++) //glowna petla
	{
// Okreslenie price range

		skok = 50;
		for (r=0; r<5; r++)
		{
			if (hotels[k].price<200)
			{
				if (hotels[k].price>=r*skok&&hotels[k].price<(r*skok+skok)) hotelPriceRange = r*skok;
			}
			else hotelPriceRange = 200;
		}

// warunki

		if ( (hotels[k].dist.charAt(locationSearch)=="1") && 
			 (hotels[k].fit=="1" || !fitness) && 
			 (hotels[k].bus=="1" || !business) && 
			 (hotelPriceRange==priceRange || priceRange=="all") && 
			 (hotels[k].cat==category || category=="all") ) 
			{
				resCount++;

//zmienne obrazkow

				var imgFit, imgBus, imgCen, imgIns
				if (hotels[k].fit==1) imgFit = "<img src=http://www.polhotels.com/cities_gfx/fit2.gif width=13 height=13>"; else imgFit ="";
				if (hotels[k].bus==1) imgBus = "<img src=http://www.polhotels.com/cities_gfx/bus2.gif width=13 height=13>"; else imgBus ="";
				if (hotels[k].dist.charAt(1)=="1") imgCen = "<img src=http://www.polhotels.com/cities_gfx/cen2.gif width=13 height=13>"; else imgCen ="";
				if (hotels[k].instant==1) imgIns = "<img src=http://www.polhotels.com/cities_gfx/ins.gif width=13 height=13>"; else imgIns ="";

// okreslenie czy to pierwszy hotel w swej kat.

			 	if (lastIndex==99999) isFirst="yes";
				else 
					if(hotels[k].cat!=hotels[lastIndex].cat) {isFirst="yes";} 
	 				else isFirst="no";

				lastIndex0 = lastIndex; // kontrola
			 	lastIndex=k;

				if (isFirst=="yes") 
				{
					if (lastIndex0!=99999) document.write('<tr><td colspan=9><hr></td></tr>\r\n');
					else document.write('<tr><td width=27%></td><td></td><td></td><td width=5%><td><img src=b.gif width=10 height=4></td><td width=27%></td><td></td><td></td><td width=5%></td></tr>\r\n');
					document.write('<tr><td colspan=9 align=left ><b class=h3>'+hotels[k].cat+'-star Milan hotels</b class=h3></td></tr><tr><td colspan=9><hr></td></tr>\r\n');
				}

// wypis hotelu		

/* AP */		if (isFirst=="yes")	resCount=1;

				if (resCount%2!=0) 
				{

//document.write('<br>Hotel:' + hotels[k].name + ' Cat: ' + hotels[k].cat + ' Price: ' + hotels[k].price +' Dist: ' + hotels[k].dist + ' Fit: ' + hotels[k].fit + ' Bus: ' +hotels[k].bus + ' Town: ' + hotels[k].town + ' PriceRange: ' + hotelPriceRange + ' last index: ' + lastIndex0 + imgFit + imgBus + imgCen + imgIns + '1st column' );

					document.write('<tr><td width=27% valign=middle><a href="'+hotels[k].dir+'" class=hotel>'+hotels[k].name+'</a></td><td valign=middle> '+imgCen+ ' ' +imgFit + ' '+ imgBus + ' '+imgIns+ ' </td><td align=right valign=middle>from</td><td align=right valign=middle width=5%><b>€ '+hotels[k].price+'</b></td><td><img src=b.gif width=15 height=1></td>\r\n');
				}
				else 
				{

//document.write('<br>Hotel:' + hotels[k].name + ' Cat: ' + hotels[k].cat + ' Price: ' + hotels[k].price +' Dist: ' + hotels[k].dist + ' Fit: ' + hotels[k].fit + ' Bus: ' +hotels[k].bus + ' Town: ' + hotels[k].town + ' PriceRange: ' + hotelPriceRange + ' last index: ' + lastIndex0 + imgFit + imgBus + imgCen + imgIns + '2 nd column');

					document.write('<td width=27% valign=middle><a href="'+hotels[k].dir+'" class=hotel>'+hotels[k].name+'</a></td><td valign=middle> '+imgCen+ ' ' +imgFit + ' '+ imgBus + ' '+imgIns+ ' </td><td align=right valign=middle>from</td><td align=right valign=middle width=5% ><b>€ '+hotels[k].price+'</b></td></tr>\r\n');
				}
			}
		}	// koniec glownej petli

	if (resCount==0) document.write("<img src=b.gif width=1 height=5><br><b><i>No hotels matched your criteria. Please try again.</i></b><br><img src=b.gif width=1 height=5>\r\n");
	document.write('</table name=wyniki><img src=b.gif width=1 height=5></td><td><img src=b.gif width=3 height=1></td></tr></table name=marginesy></td></tr>\r\n');

//legenda

	document.write('</TABLE name=LAYOUT>\r\n');
	document.write('<img src=b.gif width=1 height=5><br><div align=center style="font:8pt;">© 2004 Milan hotels</i></div>\r\n');
	document.write('</td></tr></table></td><td><img src=b.gif width=1 height=1></td></tr><tr><td><img src=b.gif width=1 height=1></td></tr></table name=linksmargins></td></tr></table name=LAYOUT>\r\n');
	document.write('</body></html>\r\n');
}


