document.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>');
function showTweets(elem, username, number) {
	var html = '<dl>';
	var tweetFeed = 'http://twitter.com/status/user_timeline/' + username + '.json?count=' + number + '&callback=?'
	$.getJSON(tweetFeed, function(d) {
		$.each(d, function(i,item) {
			html+="<dt>"+item.text+"</dt>";
			html+="<dd>"+item.created_at+"</dd>";
			//html+=getTimeDiff(item.created_at);
		})
		
		html+="</dl>";
		elem.append(html);
		
	})
}


$(function(){
	var time= (new Date());
	
	url = "souba.php?fromarea=1&yearmonth=" + time.getFullYear() + "," + (time.getMonth() + 2) + "&room_type=3&tyme=" + time.getTime();
	$("#soubacontent").data("file", url);
	$("#soubacontent").load($("#soubacontent").data("file")+" #content");
	
	showTweets($('#container'), '5454kun', 4);
});

function chengeSouba() {
	var time= (new Date());
	
	$("#soubacontent").html('<p class="loading"><img src="img/loading.gif" alt="" /></p>');
	fromarea = document.form1.fromarea.value;
	yearmonth = document.form1.yearmonth.value;
	room_type = document.form1.room_type.value;
	url = "souba.php?fromarea=" + fromarea + "&yearmonth=" + yearmonth + "&room_type=" + room_type + "&time=" + time.getTime();

	$("#soubacontent").data("file", url);
	$("#soubacontent").load($("#soubacontent").data("file")+" #content");
	return false;
}

