function pokaziListu(kaj){
	var kajPokazati = kaj.getAttribute("id");
	var kakvoJeStanje = document.getElementById(kajPokazati+"l");
	var seVidi = kakvoJeStanje.style.display;
	if (seVidi != "block") {kakvoJeStanje.style.display = "block";}
	else {kakvoJeStanje.style.display = "none";}
	//leveler();
	return false;
}

function catalog(cat){
	var param = cat.value;
	var def_act = cat.parentNode.parentNode.getAttribute("action");
	var dLink = def_act+"?cat="+param;
	eval("location='"+dLink+"'");
}

function popup(topop) {
	var sl = topop.getAttribute("href");
	var ns = topop.getAttribute("title");
	var es = screen.availWidth;
	var ev = screen.availHeight;;
	var ps = 70;
	var pv = 70;
	var lp = (es - ps) / 2;
	var tp = (ev - pv) /2;
	var s = "";

  var features 	= "'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+ps+",height="+pv+",left="+lp+",top="+tp+"'";
  var winName	= "galery"
  var theURL	= "galery_popup.php?sl="+sl+"&ns="+ns;
  window.open(theURL,winName,features);
}

function overme(img){
	var gdi  = img.getAttribute("rel");
	var aimg_src = "/elements/images/thumbnails/"+gdi;
	var aimg = document.getElementById("aimage");
	var aimg_parent = aimg.parentNode;
	var kaj2  = img.getAttribute("href");
	var naslov  = img.getAttribute("title");
	aimg.setAttribute("src",aimg_src);
	aimg_parent.setAttribute("href",kaj2);
	aimg_parent.setAttribute("title",naslov);
}


// Script by Shaun Inman @ http://www.shauninman.com/plete/2004/05/clear-positioned-elements
// Modified by Hrvoje
// 25.08.2006.
function SI_clearAbsolutes() {
	var d = document;
	if(!d.getElementById) return;
	if(!d.getElementById('article_images')) return;
	if (!d.getElementsByTagName) return;
	divs = d.getElementsByTagName('div');
	for (i=divs.length-1;div=divs[i];i--) {
		if (div.className.indexOf('si-clear-absolutes')!=-1) {
			// Make an array of the rendered heights of the contained elements
			oh = []; for (j=0;j<div.childNodes.length;j++) {
				c = div.childNodes[j];
				if (c.nodeName=='UL') {
					oh[oh.length] = parseInt(c.offsetHeight);
					}
				}
			// Determine the max height
			//h = 0;
			h = parseInt(divs[i].offsetHeight)
			for (k=0;k<oh.length;k++) { 
				h = (oh[k]>h)?oh[k]:h;
			}
			// Extend shorter elements
			//for (j=0;j<div.childNodes.length;j++) { c = div.childNodes[j]; if (c.nodeName=='DIV') { c.style.height = h+'px'; }}
			// Set the height of the containing element
			div.style.height = h+'px';
			}
		}
	}
//window.onload = SI_clearAbsolutes;

// SLOGAN DROP SHADOW
function slogan_shadow(){
	var sloganE = document.getElementById('branding').getElementsByTagName('p')[0];
	var slogan = sloganE.childNodes[0].nodeValue;
	var sloganParent = sloganE.parentNode;
	var sloganShadow = document.createElement('p');
	var sloganShadowText = document.createTextNode(slogan);
	sloganShadow.appendChild(sloganShadowText);
	sloganShadow.setAttribute('id','shadow');
	sloganParent.appendChild(sloganShadow);
	//alert(sloganShadow);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(slogan_shadow);
addLoadEvent(SI_clearAbsolutes);
