//window.onload = checkWidth;
//window.onresize = checkWidth;


var preload_img = new Array(2);
preload_img[0] = new Image;
preload_img[0].src = "/i/menu_ron.gif";
preload_img[1] = new Image;
preload_img[1].src = "/i/menu_lon.gif";

function checkWidth(){
	bodywdt = document.body.clientWidth;
	setActiveStyleSheet(800);
	if (bodywdt >= 900) {	
		setActiveStyleSheet(1024);
	} else {
		setActiveStyleSheet(800);
	}
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}


function on(a) {
	var li = a.parentNode;
	if (li.id=="menuon") return;
	li.style.backgroundImage='url(/i/menu_ron.gif)';
}

function off(a) {
	var li = a.parentNode;
	if (li.id=="menuon") return;
	li.style.backgroundImage='url(/i/menu_rnorm.gif)';
}

function vote(count) {
	window.open('','vote_win','top=30,left=30,personalbar=0,maximize=1,resizable=1,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=400,height='+(count*32+85));
}

function add2fav() {
	if (window.sidebar) {
		window.sidebar.addPanel(document.title, location.href, "");
	} else
	if (window.external) {
		window.external.AddFavorite(location.href, document.title);
	}
	else alert('Ваш браузер не поддерживает автоматическое добавление закладок.');

	return false;
}


