function chgVis(id,st) {
//  alert("chgVis: "+id+"/"+st);
  var contEl = getElement(id); if (! contEl) return ;
  if (! contEl.style) return ;
  if (st == "plus") { 
    pst = "block" ; psti = "inline" ; nst = "none" ;
  } else {
    pst = "none" ; psti = "none" ; nst = "inline" ;
  }
  contEl.style.display = pst ;
  contEl = getElement(id + "_minus") ;
  if (contEl) contEl.style.display = psti ;
  contEl = getElement(id + "_plus") ;
  if (contEl) contEl.style.display = nst ;
}

function fixParentLinks(f) {
  var atags = getTags("a",f);
  for (var i = 0; i < atags.length; i++) {
    if (atags[i].target == "_parent") { atags[i].target = ""; }
  }
}

function copyContent(id) {
  var e = getElement(id); if (!e) { alert("no element "+id); return; }
  var f = getIframeDocument(getElement(id+"_frame")); if (!f) { alert("cannot get child frame for "+id); return; }
  fixParentLinks(f);
  var d = getElementFromDocument("content",f); if (!d) { alert("cannot get child content for "+id); return; }
  var s = d.innerHTML; e.innerHTML = s;
}

function copyToParent(id) {
  if (window != parent) setTimeout("parent.copyContent('"+id+"');",10);
}

function dw(x) { document.write(x); }

function writeFloatMenu() {
  dw('<div style="float: right;" class="floatMenu">') ;
  dw('<p class="floatMenuText"><img src="/images/act_email.gif">&nbsp;<a href="javascript:window.sendMail()">Pošlji povezavo</a></p>');
  dw('</div>');
}

function clickPopupLink() {
  wo(this.href,500,500);
  return false;
}

function enablePopupLinks() {
  xGetElementsByClassName("popup",document,"a",function(e) { e.onclick = clickPopupLink; });
}

try { xAddEventListener(window,"load",enablePopupLinks); } catch(e) {}