<!--
//******** Funkcija za Textsizer - povecaj / pomanjsaj **********//
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}


function textUp() {
	if (textSize < 1) { 
		textSize = textSize + 1;
		replaceCSS(textSize);
	}
}

function textDown() {
	if (textSize > -1) { 
		textSize = textSize - 1;
		replaceCSS(textSize);
	}
}

function replaceCSS(textSize) {
	var i, a;
	for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") != -1 && a.getAttribute("title")) {
			a.disabled = true;
			if (textSize == -1 && a.getAttribute("title") == "small") a.disabled = false; 
			else if (textSize == 1 && a.getAttribute("title") == "large") a.disabled = false; 
		}
	}
}

// ko zapustimo stran, se zapiše v cookie izbrana velikost - ce je razlicna od default
window.onunload = function(e) {
	if (textSize != 0) createCookie("textSize", textSize, 365);
	else createCookie("textSize","",-1);
}

// preberemo cookie ko se stran louda in ce ni default velikost, zamenamo stylesheet
if (document.cookie.indexOf("textSize") != -1) { // preverimo, ce obstaja cookie
	textSize = parseInt(readCookie("textSize"));
	replaceCSS(textSize);
} else {
	var textSize = 0;
}


//******** Funkcija, ki odpre v novem oknu slikco, okno se resajzat na velikost slike **********//
var okno3 = null;
function povecaj(url) {
	url = "image.php?pic="+url;
	okno3=window.open(url,'large','toolbar=no,width=200,height=200,directories=no,status=no,scrollbars=no,resize=no,menubar=no,location=no,copyhistory=no');
}




//********* popup funkcija - natisni **********//
var okno = null;
var okno2 = null;
function natisni(doc, w, h)
{
  	if (w == null) w = 470;
  	if (h == null) h = 550;
	if (okno==null || okno.closed) {
		okno=window.open(doc,"natisni",'toolbar=no,width='+ w +',height='+ h +',resizable=yes,scrollbars=yes,directories=no,status=no,menubar=no,location=no');
		okno.creator = self;      
	}
	else {
		okno.location = doc;
		okno.focus();
	}
	
}


//********* popup funkcija - e-novice **********//
var okno = null;
var okno2 = null;
function enovice(doc, w, h)
{
  	if (w == null) w = 450;
  	if (h == null) h = 300;
	if (okno==null || okno.closed) {
		okno=window.open(doc,"enovice",'toolbar=no,width='+ w +',height='+ h +',resizable=yes,scrollbars=no,directories=no,status=no,menubar=no,location=no');
		okno.creator = self;      
	}
	else {
		okno.location = doc;
		okno.focus();
	}
	
}