
function galerijaSlika(a,b) {
	if (!document.getElementById || !document.getElementsByTagName) return;
	if (!document.getElementById(a) || !document.getElementById(b)) return;
	var container=document.getElementById(a).getElementsByTagName("img")[0];
	var ostaleContainer=document.getElementById(b);
	var ostale=document.getElementById(b).getElementsByTagName("a");
	for (var i=0; i<ostale.length; i++) {
		ostale[i].onclick=function() {
			return prikaziSliku(this);	
		}
	}
}

function prikaziSliku(a) {
	if (!document.getElementById("slika")) return true;
	var source=a.getAttribute("href");
	var container=document.getElementById("slika").getElementsByTagName("img")[0];
	container.setAttribute("src",source);
	var opis=a.getAttribute("title");
	var descr=document.getElementById("slika").getElementsByTagName("p")[0];
	descr.firstChild.nodeValue=opis;
	return false;
}
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("navigacija");
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", "");
   }
   }
  }
 }
}

window.onload=function() {
	galerijaSlika("slika","ostale-slike");
	startList();
}
