function changetitle() {
	if (document.title == "Новое сообщение!") {
		document.title = "Внимание!";
	} else {
		document.title = "Новое сообщение!";
	}
	blink();
}

function blink() {
	setTimeout(changetitle, 1000);
}

function messages_drop() {
	drop = '';
	for (i=1; i<=document.all('mess_num').value; i++) {
		if (document.all('mess'+i).checked) {
			drop += ',' + document.all('mess'+i).value;
		}
	}
	document.all('mess_drop').value = drop;
}

function messages_dropall() {
	drop = '';
	if (document.all('mess0').checked) {
		for (i=1; i<=document.all('mess_num').value; i++) {
			drop += ',' + document.all('mess'+i).value;
			document.all('mess'+i).checked = true;
		}
	} else {
		for (i=1; i<=document.all('mess_num').value; i++) {
			document.all('mess'+i).checked = false;
		}
	}
	document.all('mess_drop').value = drop;
}

function update_message(html) {
	alert('update');
	//document.all('new_message').innerHTML = html;
}

function timedRefresh() {
	setTimeout("location.reload(true);",5000);
}

function sethp(obj) {
	obj.style.behavior='url(#default#homepage)'; 
	obj.setHomePage('http://www.mirika.ru/'); 
	return false;
}

function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 
function bookmark(a){
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE' && 7 > b.version && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return false;
}
