/* author: Dominik Cabos */
/* Creation date: 2004-01-15 */

/* Modified: Artur Pakuszewski */

// 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('1100000000', 5, 0, 1, 150, 0, 'EUR', '/LunaBaglioni', 'Luna Baglioni', 'Venice');
hotels[i++] = new hotel('1001010000', 5, 0, 0, 181, 0, 'EUR', '/BoscoloDeiDogi', 'Boscolo Dei Dogi', 'Venice');
hotels[i++] = new hotel('1110000000', 5, 1, 1, 187, 0, 'EUR', '/WestinEuropa', 'Westin Europa', 'Venice');
hotels[i++] = new hotel('1100000000', 5, 1, 0, 192, 0, 'EUR', '/DesBains', 'Des Bains', 'Venice');
hotels[i++] = new hotel('1100000000', 5, 0, 1, 230, 0, 'EUR', '/Danieli', 'Danieli', 'Venice');
hotels[i++] = new hotel('1100001000', 5, 0, 0, 230, 0, 'EUR', '/ExcelsiorVenice', 'Excelsior Hotel Venice', 'Venice');
hotels[i++] = new hotel('1010000000', 5, 0, 0, 360, 0, 'EUR', '/GrittiPalace', 'Gritti Palace', 'Venice');
hotels[i++] = new hotel('1111000000', 5, 1, 0, 493, 0, 'EUR', '/Bauer', 'Bauer', 'Venice');
hotels[i++] = new hotel('1000001000', 5, 1, 0, 853, 0, 'EUR', '/Cipriani', 'Cipriani', 'Venice');
hotels[i++] = new hotel('1000000100', 4, 0, 0, 83, 0, 'EUR', '/Alexander', 'Alexander', 'Venice');
hotels[i++] = new hotel('1111000000', 4, 0, 0, 88, 0, 'EUR', '/CarltonExecutive', 'Carlton & Grand Canal', 'Venice');
hotels[i++] = new hotel('1000001000', 4, 0, 0, 88, 0, 'EUR', '/Bologna', 'Bologna', 'Venice');
hotels[i++] = new hotel('1000001000', 4, 1, 0, 93, 0, 'EUR', '/Biasutti', 'Biasutti', 'Venice');
hotels[i++] = new hotel('1000000100', 4, 0, 0, 99, 0, 'EUR', '/LagunaPalace', 'Laguna Palace', 'Venice');
hotels[i++] = new hotel('1000000100', 4, 0, 0, 105, 0, 'EUR', '/Ramada', 'Ramada', 'Venice');
hotels[i++] = new hotel('1000010000', 4, 0, 0, 107, 0, 'EUR', '/Amadeus', 'Amadeus', 'Venice');
hotels[i++] = new hotel('1000000100', 4, 1, 0, 109, 0, 'EUR', '/Ambasciatori', 'Ambasciatori', 'Venice');
hotels[i++] = new hotel('1000000100', 4, 1, 0, 110, 0, 'EUR', '/Marghera', 'Marghera', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 1, 1, 118, 0, 'EUR', '/Saturnia', 'Saturnia', 'Venice');
hotels[i++] = new hotel('1101000000', 4, 0, 0, 132, 1, 'EUR', '/PalaceBonvecchiati', '<font>Palace Bonvecchiati</font>', 'Venice');
hotels[i++] = new hotel('1000001000', 4, 1, 1, 133, 0, 'EUR', '/VillaMabapa', 'Villa Mabapa', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 140, 0, 'EUR', '/Cavaletto', 'Cavaletto', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 145, 0, 'EUR', '/Savoia-Jolanda', 'Savoia - Jolanda', 'Venice');
hotels[i++] = new hotel('1101000000', 4, 0, 1, 158, 0, 'EUR', '/Bonvecchiati', '<font>Bonvecchiati</font>', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 171, 0, 'EUR', '/Concordia', 'Concordia', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 190, 0, 'EUR', '/Monaco', 'Monaco', 'Venice');
hotels[i++] = new hotel('1000001000', 4, 1, 0, 195, 0, 'EUR', '/QuattroFontane', 'Quattro Fontane', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 200, 0, 'EUR', '/SanMarcoPalace', '<font>San Marco Palace</font>', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 218, 0, 'EUR', '/LocandaVivaldi', '<font>Locanda Vivaldi</font>', 'Venice');
hotels[i++] = new hotel('1010010000', 4, 0, 0, 237, 0, 'EUR', '/Bellini', 'Bellini', 'Venice');
hotels[i++] = new hotel('1111000000', 4, 0, 0, 250, 0, 'EUR', '/StarSplendidSuisse', 'Starhotel Splendid Suisse', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 265, 0, 'EUR', '/LondraPalace', 'Londra Palace', 'Venice');
hotels[i++] = new hotel('1100000000', 4, 0, 0, 180, 1, 'EUR', '/mariaadele', '<font>Ca Maria Adele</font>', 'Venice');
hotels[i++] = new hotel('1100000000', 3, 0, 0, 45, 1, 'EUR', '/villadellepalme', '<font>Villa delle Palme</font>', 'Venice');
hotels[i++] = new hotel('1000000100', 3, 0, 0, 55, 1, 'EUR', '/Centrale', '<font>Centrale</font>', 'Venice');
hotels[i++] = new hotel('1000001000', 3, 0, 0, 65, 0, 'EUR', '/Helvetia', 'Helvetia', 'Venice');
hotels[i++] = new hotel('1000000100', 3, 0, 0, 49, 1, 'EUR', '/Ariston', '<font>Ariston</font>', 'Venice');
hotels[i++] = new hotel('1011000000', 3, 0, 0, 79, 0, 'EUR', '/AlSolePalace', 'Al Sole Palace', 'Venice');
hotels[i++] = new hotel('1110000000', 3, 0, 0, 95, 0, 'EUR', '/RoyalSanMarco', '<font>Royal San Marco</font>', 'Venice');
hotels[i++] = new hotel('1100000000', 3, 0, 0, 84, 0, 'EUR', '/AmbassadorTreRose', '<font>Ambassador Tre Rose</font>', 'Venice');
hotels[i++] = new hotel('1100000000', 3, 0, 1, 98, 0, 'EUR', '/Panada', 'Panada', 'Venice');
hotels[i++] = new hotel('1100000000', 3, 0, 1, 99, 0, 'EUR', '/Montecarlo', 'Montecarlo', 'Venice');
hotels[i++] = new hotel('1100000000', 3, 0, 0, 99, 0, 'EUR', '/AlbergoSanMarco', '<font>Albergo San Marco</font>', 'Venice');
hotels[i++] = new hotel('1000000110', 3, 0, 1, 103, 0, 'EUR', '/Ducale', 'Ducale', 'Venice');
hotels[i++] = new hotel('1010000000', 3, 0, 0, 162, 0, 'EUR', '/Continental', 'Continental', 'Venice');
hotels[i++] = new hotel('1001000000', 3, 0, 0, 171, 0, 'EUR', '/Rialto', 'Rialto', 'Venice');
hotels[i++] = new hotel('1010100000', 3, 0, 0, 240, 0, 'EUR', '/BelleArti', 'Belle Arti', 'Venice');
hotels[i++] = new hotel('1010101000', 1, 0, 0, 30, 1, 'EUR', '/villaveneta', '<font>Villa Veneta</font>', 'Venice');
hotels[i++] = new hotel('1000000001', 1, 0, 0, 50, 1, 'EUR', '/piave', '<font>Piave</font>', 'Mestre');

/*hotels[i++] = new hotel('1100', 5, 0, 1, 150, 1, 'EUR', '/LunaBaglioni', 'Luna Baglioni', 'Venice');
hotels[i++] = new hotel('1100', 5, 0, 0, 181, 0, 'EUR', '/BoscoloDeiDogi', 'Boscolo Dei Dogi', 'Venice');
hotels[i++] = new hotel('1100', 5, 1, 1, 187, 1, 'EUR', '/WestinEuropa', 'Westin Europa', 'Venice');
hotels[i++] = new hotel('1100', 5, 1, 0, 192, 1, 'EUR', '/DesBains', 'Des Bains', 'Venice');
hotels[i++] = new hotel('1100', 5, 0, 1, 230, 1, 'EUR', '/Danieli', 'Danieli', 'Venice');
hotels[i++] = new hotel('1100', 5, 0, 0, 230, 1, 'EUR', '/ExcelsiorVenice', 'Excelsior Hotel Venice', 'Venice');
hotels[i++] = new hotel('1100', 5, 0, 0, 360, 1, 'EUR', '/GrittiPalace', 'Gritti Palace', 'Venice');
hotels[i++] = new hotel('1100', 5, 1, 0, 493, 1, 'EUR', '/Bauer', 'Bauer', 'Venice');
hotels[i++] = new hotel('1010', 5, 1, 0, 853, 1, 'EUR', '/Cipriani', 'Cipriani', 'Venice');
hotels[i++] = new hotel('1010', 4, 0, 0, 83, 0, 'EUR', '/Alexander', 'Alexander', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 88, 1, 'EUR', '/CarltonExecutive', 'Carlton Executive', 'Venice');
hotels[i++] = new hotel('1010', 4, 0, 0, 88, 0, 'EUR', '/Bologna', 'Bologna', 'Venice');
hotels[i++] = new hotel('1010', 4, 1, 0, 93, 0, 'EUR', '/Biasutti', 'Biasutti', 'Venice');
hotels[i++] = new hotel('1010', 4, 0, 0, 99, 1, 'EUR', '/LagunaPalace', 'Laguna Palace', 'Venice');
hotels[i++] = new hotel('1010', 4, 0, 0, 105, 0, 'EUR', '/Ramada', 'Ramada', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 107, 1, 'EUR', '/Amadeus', 'Amadeus', 'Venice');
hotels[i++] = new hotel('1010', 4, 1, 0, 109, 1, 'EUR', '/Ambasciatori', 'Ambasciatori', 'Venice');
hotels[i++] = new hotel('1010', 4, 1, 0, 110, 1, 'EUR', '/Marghera', 'Marghera', 'Venice');
hotels[i++] = new hotel('1100', 4, 1, 1, 118, 1, 'EUR', '/Saturnia', 'Saturnia', 'Venice');
hotels[i++] = new hotel('1010', 4, 1, 1, 133, 0, 'EUR', '/VillaMabapa', 'Villa Mabapa', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 140, 0, 'EUR', '/Cavaletto', 'Cavaletto', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 145, 0, 'EUR', '/Savoia-Jolanda', 'Savoia - Jolanda', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 1, 150, 0, 'EUR', '/Bonvecchiati', '<font>Bonvecchiati</font>', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 171, 1, 'EUR', '/Concordia', 'Concordia', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 190, 1, 'EUR', '/Monaco', 'Monaco', 'Venice');
hotels[i++] = new hotel('1010', 4, 1, 0, 195, 1, 'EUR', '/QuattroFontane', 'Quattro Fontane', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 200, 0, 'EUR', '/SanMarcoPalace', '<font>San Marco Palace</font>', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 218, 0, 'EUR', '/LocandaVivaldi', '<font>Locanda Vivaldi</font>', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 237, 1, 'EUR', '/Bellini', 'Bellini', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 250, 1, 'EUR', '/StarSplendidSuisse', 'Starhotel Splendid Suisse', 'Venice');
hotels[i++] = new hotel('1100', 4, 0, 0, 265, 1, 'EUR', '/LondraPalace', 'Londra Palace', 'Venice');
hotels[i++] = new hotel('1010', 3, 0, 0, 60, 0, 'EUR', '/Centrale', 'Centrale', 'Venice');
hotels[i++] = new hotel('1010', 3, 0, 0, 65, 0, 'EUR', '/Helvetia', 'Helvetia', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 72, 0, 'EUR', '/Ariston', 'Ariston', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 79, 1, 'EUR', '/AlSolePalace', 'Al Sole Palace', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 84, 0, 'EUR', '/RoyalSanMarco', '<font>Royal San Marco</font>', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 84, 0, 'EUR', '/AmbassadorTreRose', '<font>Ambassador Tre Rose</font>', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 1, 98, 1, 'EUR', '/Panada', 'Panada', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 1, 99, 1, 'EUR', '/Montecarlo', 'Montecarlo', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 99, 0, 'EUR', '/AlbergoSanMarco', '<font>Albergo San Marco</font>', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 1, 103, 0, 'EUR', '/Ducale', 'Ducale', 'Venice');
hotels[i++] = new hotel('1010', 3, 0, 0, 162, 1, 'EUR', '/Continental', 'Continental', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 171, 1, 'EUR', '/Rialto', 'Rialto', 'Venice');
hotels[i++] = new hotel('1100', 3, 0, 0, 240, 0, 'EUR', '/BelleArti', 'Belle Arti', 'Venice');
*/

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<9; 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>Venice Hotels - Search Results</title>\r\n<link rel=stylesheet type=text/css href=cityStyles.css>\r\n');
	document.write('<script language=javascript src=venice.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><img src=b.gif width=740 height=10> <table cellspacing=0 cellpadding=0 border=0 width=100%>');
	document.write('<tr><td><img src=venicehotels.gif alt=\"Venice Hotels\"><span style="position: relative; left: -119px; top: -2px; font-size: 22px;"><nobr>Venice 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=car.gif width=125 height=26 border=0></a><img src=b.gif width=5 height=1>');
	document.write('<a href=http://www.res99.com/nexres/start-pages/frame.cgi?src=10004159&product=AIR target=_blank><img src=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=contact.gif width=126 height=25 border=0></a></td></tr>');
	document.write('<tr><td colspan=2><img src=b.gif width=1 height=4></td></tr>');
	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>');
	document.write('<b>Welcome to Venice, Italy!</b>');
	document.write(" We present one of the most comprehensive selections of hotels in Venice 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 Venice, our Venice 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 of <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>");
	document.write('<TR><TD width=50% valign=top class=light><TABLE name=ALLHOTELS width=100% cellspacing=0 cellpadding=0 border=0>');
	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>');
	document.write('<td class=title align=left valign=top><img src=r1.gif width=14 height=9></td>');
	document.write('<td class=title> All Venice hotels</td><td align=right class=title><font class=a3>Currently <b>'+hotels.length+' hotels</b> available</font></td>');
	document.write('<td class=title align=right valign=top><img src=r2.gif width=14 height=9></td></table></td></tr>');
	document.write('<tr><td colspan=4 bgcolor=#333366><form name=theForm>');
	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">');
	document.write('<tr class=old><td colspan=4><img src=b.gif width=1 height=1></td></tr>');
	document.write('<tr class=old><td><img src=b.gif width=3 height=1></td>');
	document.write('<td><img src=arrow.gif width=4 height=7>   Category</td>');
	document.write('<td align=center><select onchange="listHotels()" style="width:80px;" name=category>');
	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>');
	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 ');
	document.write('<select style="width:130px;" name=location onchange="listHotels()">');
	document.write('<option value="0">all</option><option value="1" '+selLocation[1]+'>San Marco Square</option><option value="2" '+selLocation[2]+'>Grand Canal</option><option value="3" '+selLocation[3]+'>Rialto Bridge</option><option value="4" '+selLocation[4]+'>Accademia Gallery</option><option value="5" '+selLocation[5]+'>St Lucia Railway Station</option><option value="6" '+selLocation[6]+'>Lido Island</option><option value="7" '+selLocation[7]+'>Venice Mainland</option> <option value="8" '+selLocation[8]+'>Airport</option> <option value="9" '+selLocation[9]+'>Mestre</option></select></td>');
	document.write('</select></td></tr>');
	document.write('<tr class=old><td><img src=b.gif width=3 height=1></td>');
	document.write('<td><img src=arrow.gif width=4 height=7>   <nobr>Prices from</nobr></td>');
	document.write('<td align=center><select style="width:80px;" name=priceRange onchange="listHotels()">');
	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>');
	document.write('<option value="150" '+selPrice[150]+'>€ 150 - € 200</option><option value="200" '+selPrice[200]+'>> € 200</option></select></td>');
	document.write('<td><table cellspacing=0 cellpadding=0 border=0 width=100% class=normal style="font-size:8pt">');
	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>');
	document.write('</table></td></tr>');

/*
1 -> San Marco Square
2 -> Grand Canal
3 -> Rialto Bridge
4 -> Accademia Gallery
5 -> St Lucia Railway Station
6 -> Lido Island
7 -> Venice Mainland
8 -> Airport
9 -> Mestre
*/

//	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=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=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>');
	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>');
	document.write('</table name=allhotels></td><td><img src=b.gif width=10></td>');
	document.write('<td width=50% valign=top><img src=b.gif width=1 height=7><br><img src=fit2.gif width=13 height=13 align=middle> - fitness facilities: swimming pool / gym / tennis courts <br><img src=bus2.gif width=13 height=13 align=middle> - business facilities: business center / PC available to guests<br><img src=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>');
// 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%>');
	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=fit2.gif width=13 height=13>"; else imgFit ="";
				if (hotels[k].bus==1) imgBus = "<img src=bus2.gif width=13 height=13>"; else imgBus ="";
//				if (hotels[k].dist.charAt(1)=="1") imgCen = "<img src=cen2.gif width=13 height=13>"; else imgCen ="";
				if (hotels[k].instant==1) imgIns = "<img src=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>');
					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 Venice 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=top><a  href="'+hotels[k].dir+'" class=hotel>'+hotels[k].name+'</a></td><td valign=top> '+imgCen+ ' ' +imgFit + ' '+ imgBus + ' '+imgIns+ '  </td><td align=right valign=top>from</td><td align=right valign=top width=5%><b>€ '+hotels[k].price+'</b></td><td><img src=b.gif width=15 height=1></td>');
				}
				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=top><a  href="'+hotels[k].dir+'" class=hotel>'+hotels[k].name+'</a></td><td valign=top>  '+imgCen+ ' ' +imgFit + ' '+ imgBus + ' '+imgIns+ '  </td><td align=right valign=top>from</td><td align=right valign=top 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>");
	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>');

//legenda

	document.write('</TABLE name=LAYOUT>');
	document.write('<img src=b.gif width=1 height=5><br><div align=center style="font:8pt;">© 2003 Venice hotels</i></div>');
	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>');
	document.write('</body></html>');
}

/*

Tulip Inn Mirage - 1 km
Starhotel Monginevro - 2,5 km
Nord - 2,7 km
Golden Tulip Vivahotel Alexander - 2,8 km
Leopolda - 4 km
Raffaello - 4,5 km

Grand Hotel Florence - 6 km
Westin Excelsior - 11 km
Savoy Florence - 8 km
Hotel Helvetia & Bristol - 7 km
Grand Hotel Villa Medici - 6 km
Grand Hotel Villa Cora - 9 km
Grand Hotel Minerva - 7 km
Berchielli - 7 km
Best Western Grand Hotel Adriatico - 6 km
Hotel De La Ville - 7 km
Best Western Hotel Rivoli - 6 km
Golden Tulip Hotel Kraft - 6 km
Sheraton - 15 km
Croce di Malta - 6 km
Londra - 6 km
Jolly Hotel Firenze - 7 km
Villa Gabriele D`Annunzio - 11 km
Astoria - 7 km
Atlantic Palace - 7 km
Bernini - 10 km
Brunelleschi - 9 km 
Carolus - 8 km
Holiday Inn Florence North - 2 km
Fenice Palace - 8 km
Grand Hotel Majestic - 7 km
Best Western Hotel Laurus - 7 km
Sofitel Firenze - 6 km
Plaza Lucchesi - 8 km
Relais Certosa - 15 km
Roma - 7 km
Starhotel Michelangelo - 6 km
Demidoff - 8 km
Starhotel Vespucci - 5 km
Grand Hotel Regina - 6 km
Golden Tulip Grand Hotel Baglioni - 5 km
Alamanni Hotel - 5 km
Martelli Hotel - 5 km
Montebello Splendid - 6 km
Florence Residence Hotel - 9 km
Grifone - 8 km
Paris - 7 km
Balestri - 6 km
Ambasciatori - 6 km
Castri - 5 km
Cellai - 6 km
Le Due Fontane - 6 km
San Giorgio - 5 km
Machiavelli Palace - 6 km
Grand Hotel Cavour - 6 km
Palazzo Ricasoli - 6 km
Pitti Palace - 6 km
Best Western Hotel Capitol - 7 km
Lombardi Hotel - 5 km

via del termine, Peretola

*/
