startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot .childNodes.length; i++) {
  node = navRoot.childNodes[i];
  if (node.nodeName=="LI") {
  node.onmouseover=function() {
  this.className+=" over";
    }
  node.onmouseout=function() {
  this.className=this.className.replace
      (" over", "");
   }
   }
  }
 }

if (document.all && document.getElementById) {
  navRoot = document.getElementById("nav_block");
  navLink = document.getElementById("blockon");
  navPoint = document.getElementById("pointeron");

  navRoot.onmouseover=function() {
  navLink.className+=" offon";
  navPoint.className+=" offon";
    }
  navRoot.onmouseout=function() {
  navLink.className=navLink.className.replace
      (" offon", "");
  navPoint.className=navPoint.className.replace
      (" offon", "");
   }

  }
}
window.onload=startList;

function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

function season(i, c){


document.body.id = i;

setCookie("season", i, "Mon, 01-Jan-2020 00:00:00 GMT", "/");

/*t = document.getElementById("top");
f = document.getElementById("footer");
b = document.getElementById("container");

t.style.background = "transparent url(/img/bg_top_"+i+".jpg) no-repeat 0px 0px";
t.style.backgroundPosition = "center top";
f.style.background = "url(/img/bg_bot_"+i+".jpg) no-repeat center bottom";
//sb.style.background = "url(/img/leto_bg_top.jpg) no-repeat center top";
b.style.background = c;

z = (i=='zima') ? '-23px' : '0';
v = (i=='vesna') ? '-23px' : '0';
l = (i=='leto') ? '-23px' : '0';
o = (i=='osen') ? '-23px' : '0';

document.getElementById("zima").style.backgroundPosition = "-0px "+z;
document.getElementById("vesna").style.backgroundPosition = "-24px "+v;
document.getElementById("leto").style.backgroundPosition = "-47px "+l;
document.getElementById("osen").style.backgroundPosition = "-70px "+o;
*/

}


function cs()
{

var s = getCookie("season");

if(s){
document.body.id = s;
}else{

var now = new Date();
var int=now.getMonth()+1;

if ( int == 1 || int == 2 || int == 12 )
   {document.body.id = 'zima';}
else
if ( 3 <= int && int <= 5 )
   {document.body.id = 'vesna';}
else
if ( 6 <= int && int <= 8 )
   {document.body.id = 'leto';}
else
if ( 9 <= int && int <= 11 )
   {document.body.id = 'osen';}
else
   {document.body.id = 'leto';}

}
   
}


