function loadFlights(dest, count)
{
	url = 'http://92.51.133.219/dani/lauda-air/templates/at/crawler.php';
	if (dest!=0||count!=0) url = url+'?';
	if (dest!=0) url = url+ 'dest='+dest;
	if (dest!=0&&count!=0) url = url+'&';
	if (count!=0) url = url+ 'count='+count;
	$.ajax({ 
		url: url, 
		success: function(csv)
		{
			
			rows = csv.split('\n');
			rows.pop();
			html = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="flightplan">';
			for (i in rows) html = html + buildSnippet(rows[i], i%2);
			html = html + '</table>';
			$('#container2').html(html);
		}
	});
}

function buildSnippet(row, evenRow)
{
	data = row.split('|');
	html = '<tr';
	if (evenRow==0) html = html + ' class="trung"';
	html = html + '>';
	for (i in data) html = html + '<td>' + data[i] + '</td>';
	html = html + '</tr>';
	return html;
}
