function windowOpener(url, name, args) {
  if (typeof(popupWin) != "object"){
    popupWin = window.open(url,name,args);
  } else {
    if (!popupWin.closed){
      popupWin.location.href = url;
    } else {
      popupWin = window.open(url, name,args);
    }
  }
  popupWin.focus();
}

function CSearch(SearchValue) {
  var SearchValue = document.forms.sform.SearchValue.value;
  window.location.href = "index.php?C=search|0|0|0|0|0|0|0|"+SearchValue+"|0|0|0|0|0|0|0";
}

function GuestBookEntry() {
  var n = document.forms.gform.name.value;
  var s = document.forms.gform.subject.value;
  var e = document.forms.gform.email.value;
  var t = document.forms.gform.text.value;

  document.gform.C.value = "interaktiv|0|0|0|0|0|0|0|0|0|"+n+"|0|InsertGuestbookEntry|"+s+"|"+e+"|"+t;
  return true;
}

function SetLogin() {
  var u = document.forms.lform.Username.value;
  var p = document.forms.lform.Password.value;

  document.lform.C.value = "search|0|0|0|0|"+p+"|"+u+"|0|0|0|0|0|0|0|0|0";
  return true;
}

// KinoPopup
function ShowPop(addi,br,ho,fenster,tools,scr) {
  if (!fenster) fenster = "pop";
  if (!tools && tools != 0) tools = 1;
  if (!scr && scr != 0) scr = 1;
  if (window.pop && !(window.pop.closed)) {
    window.pop.focus();
    window.pop.location = addi;
  } else {
    pop = window.open(addi, fenster, "width=" + br + ",height=" + ho + ",toolbar=" + tools + ",scrollbars=" + scr + ",status=0,menubar=0,resizable=1");
  }
}


function showPic(imgDocID, imgObjName, comment) {
  //document.images[imgDocID].src = eval(imgObjName + ".src");
  document.images[imgDocID].src = imgObjName;
  window.status = comment;
  return true;
}

function findObj(n, d) {
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) {
    x=d.all[n];
  }
  for (i=0;!x&&i<d.forms.length;i++) {
    x=d.forms[i][n];
  }
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) {
    x=findObj(n,d.layers[i].document);
  }
  if(!x && document.getElementById) {
    x=document.getElementById(n);
  }
  return x;
}

function showLayer() {
  var i,p,v,obj,args=showLayer.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ((obj=findObj(args[i]))!=null) {
      v=args[i+2];
      if (obj.style) {
        obj=obj.style;
        if(obj.visibility =='hidden' && v =='show') { v = 'visible'; }
        if(obj.visibility =='visible' && v =='show') { v = 'hidden'; }
        if(obj.visibility =='visible' && v =='hide') { v = 'hidden'; }
      }
      obj.visibility=v;
    }
  }
}

