// JavaScript Document
function print(){
	var i = 0
	var text = ''
	guesthouse.sort(function() {return 0.5 - Math.random()})
	for(i=0;i<=(guesthouse.length-1);i++){
		text += '\n<table class="bbborder" cellpadding="0" cellspacing="0">'
			+'\n  <tr>'
			+'\n    <td width="5" height="5"><img class="corner1" width="5" height="5" src="images/graphics/corner1.bmp" /></td>'
			+'\n    <td class="bbordertop" height="5"></td>'
			+'\n    <td width="5" height="5"><img class="corner2" width="5" height="5" src="images/graphics/corner2.bmp" /></td>'
			+'\n  </tr>'
			+'\n  <tr>'
			+'\n    <td class="bborderleft" ></td>'
			+'\n	<td>'
			+'\n		<table border="0" cellpadding="0" cellspacing="0" class="bb">\n'
			+'\n 			<tr valign="top">'
			+'\n				<td height="75" colspan="4"><p class="name"><a href="'+guesthouse[i][2]+'" target="_blank">'+guesthouse[i][0]+'</a></p>'

if (guesthouse[i][4] != ''){
				text +='\n				<p class="availability_link"><a href="'+guesthouse[i][4]+'" target="_blank">Availability</a></p></td>'
			}
			
	   text+='\n 			</tr>'
			+'\n 			<tr>'
			
			if (guesthouse[i][1] != ''){
				text +='\n  				<td height="195" colspan="4"><div align="center"><a href="'+guesthouse[i][2]+'" target="_blank"><img src="images/'+guesthouse[i][1]+'" width="285" height="190"></a></div></td>'
			}
			else {
				text +='\n  				<td height="195" colspan="4">&nbsp;</td>'
			}

			text+='\n  			</tr>'
			+'\n  			<tr>'

	for(j=0;j<=(guesthouse[i][3].length-1);j++){
			text+='\n				<td class="rating"><img src="images/rating/'+guesthouse[i][3][j]+'" height="100"></td>'
	}

		text+='\n			</tr>'
			+'\n			<tr>'		
			+'\n			</tr>'
			+'\n		</table>'
			+'\n	</td>'
			+'\n    <td class="bborderright"></td>'
			+'\n  </tr>'
			+'\n  <tr>'
			+'\n    <td width="5" height="5"><img class="corner3" width="5" height="5" src="images/graphics/corner4.bmp"></td>'
			+'\n    <td class="bborderbottom"></td>'
			+'\n    <td width="5" height="5"><img class="corner4" width="5" height="5" src="images/graphics/corner3.bmp"></td>'
			+'\n	</tr>'
			+'\n</table>'
		}
	document.getElementById('main_body').innerHTML = text
}