function ch_color(kolor, elem) {
	elem.style.background=kolor; return true;
}
function new_window(src,w,h) {
	window.open(src,"okno","toolbar=no,menubar=no,location=no,directories=no,top=100,left=100,status=no,scrollbars=no,resizable=yes,width="+w+",height="+h);
}
var expires=new Date();
expires.setTime(expires.getTime()+ (86400 * 90 * 1000));// 90 dni
var expiryDate=expires.toGMTString();
if(!(Cookieget('index_0'))){document.cookie='index_0=4; expires='+expiryDate}
if(Cookieget('index_0') < 0){document.cookie='index_0=0; expires='+expiryDate}
function Cookieget(name){
  var start = document.cookie.indexOf(name+"=");
  var len = start+name.length+1;
  if((!start) && (name != document.cookie.substring(0,name.length))) {
    return null;
  }
  if(start == -1){
    return null;
  }
  var end = document.cookie.indexOf(";",len);
  if(end == -1){
    end = document.cookie.length;
  }
  return unescape(document.cookie.substring(len,end));
}




// --- menu functions
function MenuColor(fontover, fontout, backover, backout) {
	this.fontover = fontover;
	this.fontout = fontout;
	this.backover = backover;
	this.backout = backout;
}

MenuColors = new Array();
MenuColors[0] = new MenuColor("#000000", "#000000", "#eeeeee", "#A0A0A0");
MenuColors[1] = new MenuColor("#000000", "#000000", "#006699", "#A0A0A0");
MenuColors[2] = new MenuColor("#000000", "#000000", "#eeeeee", "#A0A0A0");
MenuColors[3] = new MenuColor("#000000", "#000000", "#eeeeee", "#A0A0A0");
MenuColors[4] = new MenuColor("#000000", "#000000", "#eeeeee", "#00cc00");
MenuColors[5] = new MenuColor("#000000", "#000000", "#eeeeee", "#A0A0A0");
MenuColors[6] = new MenuColor("#000000", "#000000", "#eeeeee", "#A0A0A0");
MenuColors[7] = new MenuColor("#000000", "#000000", "#eeeeee", "#A0A0A0");


function setMenuColors() {
	if(document.all) {
		td_tags = document.all.tags("TD");
		for(var i=0; i<td_tags.length; i++)
			if(td_tags[i].className.match(/^menu\d$/) != null) {
				td_tags[i].onmouseover = td_over;
				td_tags[i].onmouseout = td_out;
				td_tags[i].onclick = td_click;
			}
		
		function td_over() {
			this.style.backgroundColor = MenuColors[this.className.substring(4)].backover;
			this.all.tags('A')[0].style.color=MenuColors[this.className.substring(4)].fontover;
			this.style.cursor = "hand";
		}
		function td_out() {
			this.style.backgroundColor = MenuColors[this.className.substring(4)].backout;
			this.all.tags('A')[0].style.color=MenuColors[this.className.substring(4)].fontout;
		}
		function td_click() {
			this.all.tags('A')[0].click();
		}
	}
}

