function YandexUpdatesInit(){
	document.getElementById('yandex-updates-block').innerHTML='<div style="border:1px solid #888; width: 86px; _width: 88px; height:29px; _height:31px; font: normal 9px Tahoma, Sans-Serif; color: black; background-color: white; text-align:center;"><div style="margin:3px 0"><div><a href="http://maulnet.ru/yandex-updates/" target="_blank" style="color:black !important; font-weight: bold !important; white-space:nowrap; font-size:9px !important; font-family:Tahoma, Sans-Serif !important; text-decoration:none !important; line-height: 12px">&#1040;&#1087;&#1076;&#1077;&#1081;&#1090; <span style="color:red !important">&#1071;</span>&#1085;&#1076;&#1077;&#1082;&#1089;&#1072;</a></div><div id="yandex-updates-data" style="line-height: 11px"></div></div></div>';
}

function YandexUpdates(obj){
	var update = new Date();
	update.setTime(obj.UpdateDate*1000);
	var mskoffset = update.getTimezoneOffset()*60 + obj.UpdateMSKoffset*1;
	var mskupdate = new Date();
	mskupdate.setTime(obj.UpdateDate*1000 + mskoffset*1000);
	document.getElementById('yandex-updates-block').title = update.toLocaleString();
	if (mskoffset!=0)
	{
		document.getElementById('yandex-updates-block').title += ' (local) ' + "\n" + mskupdate.toLocaleString() + ' (MSK)';
	}
	update.setHours(0,0,0,0);
	var today = new Date();
	today.setHours(0,0,0,0);
	var diff = Math.round(Math.round(today - update)/86400000);
	var result='';
	if (diff<0) result='&#1087;&#1086;&#1087;&#1088;&#1072;&#1074;&#1100; &#1095;&#1072;&#1089;&#1099;!';
	else if (diff==0) result='<b style="color:red">&#1057;&#1045;&#1043;&#1054;&#1044;&#1053;&#1071;!</b>';
	else if (diff==1) result='&#1073;&#1099;&#1083; <b>&#1074;&#1095;&#1077;&#1088;&#1072;</b>';
	else if (diff==2) result='&#1073;&#1099;&#1083; <b>&#1087;&#1086;&#1079;&#1072;&#1074;&#1095;&#1077;&#1088;&#1072;</b>';
	else if (diff<5) result= '<b>' + diff + '</b> &#1076;&#1085;&#1103; &#1085;&#1072;&#1079;&#1072;&#1076;';
	else if (diff<21) result= '<b>' + diff + '</b> &#1076;&#1085;&#1077;&#1081; &#1085;&#1072;&#1079;&#1072;&#1076;';
	else result='&#1089;&#1083;&#1086;&#1084;&#1072;&#1083;&#1086;&#1089;&#1100; 8(';
	document.getElementById('yandex-updates-data').innerHTML=result;
}

function YandexUpdatesShow(){
document.write('<sc'+'ript type="text/javascript" src="http://maulnet.ru/yandex-updates/json.php"><\/sc'+'ript>');
}

YandexUpdatesInit();
YandexUpdatesShow();
