function f(n_title, n_url, n_date, n_time, n_descr) {
	this.title = n_title;
	this.url = n_url;
	this.date = n_date;
	this.time = n_time;
	this.descr = n_descr;
}
function compareTime(a,b) {
	if(a.date == b.date) {
		if (a.time < b.time) return 1;
		if (a.time > b.time) return -1;
		// a must be equal to b
		return 0;
	}
	if (a.date < b.date) return 1;
	if (a.date > b.date) return -1;
	return 0;
}

$(function() {
	$(document.body).append('<div style="display: none" id="inf_hmn_pl"></div>');
	$.ajax({
		type:	"GET",
		url:	"http://informer.hmn.ru/types/info.js?value=27612&type=1_1&is=1",
		dataType:	"script",
		scriptCharset:	"windows-1251",
		success:	function(){
						$("#weather .day_t").text($("#inf_hmn_pl font.mhmb11pn:eq(0) b").text());
						$("#weather .night_t").text($("#inf_hmn_pl font.mhmb11pn:eq(1) b").text());
						$("#weather a").attr("href", "http://hmn.ru/");
						$("#weather").css("background-image", "url("+$("#inf_hmn_pl img:eq(1)").attr("src")+")").show();
					}
	});

	$.ajax({
		type:	"GET",
		url:	"http://news.yandex.ru/politics.js",
		dataType:	"script",
		scriptCharset:	"windows-1251",
		success:	function(){
				if(typeof m_politics != "undefined") {
					m_politics.sort(compareTime);
					$.each(m_politics, function(n) {
						if(n > 6) return false;
						$("#news-items ul")
							.append("<li><span class=\"time\"></span>&nbsp;<a href=\"#\" target=\"_blank\"></a></li>")
							.find("li:last")
								.find(".time").text(this.time).end()
								.find("a").text(this.title).attr("href", this.url).end();
					});
					$("#news-title").show();
					$("#news-items").show();
				}
			}
	});
});
