/************************************************
*						*
* splosnovizija					*
*						*
************************************************/
var isNN, isIE, isMac, isMoz;
var agent = navigator.userAgent;

var jsg_jezik_S = "si";

isMac = (agent.lastIndexOf('Mac') < 0);

if (document.all){
	isIE = true;
} else if (document.layers){
	isNN = true;
	document.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP | Event.RESIZE);
	window.onresize=umResizeFunction;
} else if (navigator.userAgent.indexOf('Gecko') != -1) {
	isMoz = true;
}

// netscapove neumnosti...
if (isNN){
   var ws = window.innerWidth;
   var hs = window.innerHeight;
}

function umResizeFunction(){
	if (isNN) {
		if ((window.innerWidth != ws) || (window.innerHeight != hs)){
			window.location.href = window.location.href;
		}
	}
}

// čisto nič
function donull () {}

function um_okno(url, w, h, opt) {
var win = null;
var i = 0;

	w = w || 300;
	h = h || 400;
	opt = opt || "width=" + w + ",height=" + h + ",toolbar=0,resize=0";

	win = window.open("/" + jsg_jezik_S + "/inc/okno/okno.asp?u=" + url, "krkaPomoznoOkno", opt);

	if (!win.opener) {
		win.opener = self;
	}

	if (window.focus) {
		win.focus()
	}

}

function um_print(w) {
	if (w.print) {
		w.print();
	} else {
		alert('Za tiskanje te strani izberite ustrezen ukaz v meniju ali gumb v orodjarni brskalnika!');
	}
	return true;
}


// za pridobit kodo menujev... :)
//var msgWindow=window.open("","displayWindow","menubar=yes")
function ustvari_debug(ime,w,h,x,y,z,vidno,vsebina,dodatnoNN,dodatnoIE) {
	if (isNN) {
		vidno ? vidno = 'show' : vidno = 'hide';
		msgWindow.document.write('<layer width='+w+' height='+h+' left='+x+' top='+y+' name="'+ime+'" z-index='+z+' visibility="'+vidno+'" '+dodatnoNN+'>'+vsebina+'</layer>');
	} else if (isIE || isMoz) {
		vidno ? vidno = 'visible' : vidno = 'hidden';
		msgWindow.document.write('<div id="'+ime+'" style="position:absolute;width:'+w+';height:'+h+';left:'+x+';top:'+y+';z-index:'+z+';visibility:'+vidno+';'+dodatnoIE+'" >'+vsebina+'</div>');
	}
}


// stvaritev layerja - crossbrowser
function ustvari(ime,w,h,x,y,z,vidno,vsebina,dodatnoNN,dodatnoIE) {
	if (isNN) {
		vidno ? vidno = 'show' : vidno = 'hide';
		document.write('<layer width='+w+' height='+h+' left='+x+' top='+y+' name="'+ime+'" z-index='+z+' visibility="'+vidno+'" '+dodatnoNN+'>'+vsebina+'</layer>');
	} else if (isIE || isMoz) {
		vidno ? vidno = 'visible' : vidno = 'hidden';
		document.write('<div id="'+ime+'" style="position:absolute;width:'+w+';height:'+h+';left:'+x+';top:'+y+';z-index:'+z+';visibility:'+vidno+';'+dodatnoIE+'" >'+vsebina+'</div>');
	}
}

// premikanje layerja - crossbrowser
function premakni(id,x,y){
	if (isNN){
		if (x != null) document.layers[id].left = x;
		if (y != null) document.layers[id].top = y;
	} else if(isIE){
		if (x != null) document.all[id].style.posLeft = x;
		if (y != null) document.all[id].style.posTop = y;
	} else if (isMoz) {
		if (x != null) document.getElementById(id).style.left = 200;
		if (y != null) document.getElementById(id).style.top = 200;
	}
}


// vidnost layerja - crossbrowser
function vidnost(id, vidno) {
	if (isNN) {
		vidno ? vidno = 'show' : vidno = 'hide';
		document.layers[id].visibility = vidno;
	} else if (isIE) {
		vidno ? vidno = 'visible' : vidno = 'hidden';
		document.all[id].style.visibility = vidno;
	} else if (isMoz) {
		vidno ? vidno = 'visible' : vidno = 'hidden';
		document.getElementById(id).style.visibility = vidno
	}
}

// premik & prikaz layerja - crossbrowser
function prikazxy(id, x, y, offsetx) {
	if (isNN) {
		if (x != null) document.layers[id].left = x + offsetx;
		if (y != null) document.layers[id].top = y;
		document.layers[id].visibility = 'show';
	} else if (isIE) {
		if (x != null) document.all[id].style.posLeft = x + offsetx;
		if (y != null) document.all[id].style.posTop = y;
		document.all[id].style.visibility = 'visible';
	} else if (isMoz) {
		if (x != null) document.getElementById(id).style.left = x + offsetx;
		if (y != null) document.getElementById(id).style.top = y;
		document.getElementById(id).style.visibility = 'visible';
	}
}

// menjava slike na layerju - crossbrowser
function menjajImg(kaj,novSrc,nnLayer){
	var layerInfo = "";
	if (isNN){
		layerInfo = nnLayer;
	}
	eval(layerInfo + "document.images['" + kaj + "'].src = '" + novSrc.src + "'");
}


// blinkovizija
function um_blink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}
function um_startblink() {
  // Make sure it is IE4, what about moz?
  if (document.all)
    setInterval("um_blink()",1000)
}



