// JavaScript - einige nützliche Funktionen: jsfunc.js
// $Id: jsfunc.js,v 1.5 2005/10/11 12:54:17 wwwuser Exp $
// ---------------------------------------------------------

VERSIONOK = 3.0;

browser = navigator.appName;
version = parseFloat(navigator.appVersion);
agent = navigator.userAgent;
i = agent.indexOf("MSIE");
if (i) {
  v = parseFloat(agent.substr(i + 5,3));
  if (v < 4.5) version -= 1;
}

//
// doopen(target,page):
// Öffnet die angegebene Seite "page" im Frame "Target" .
//
function doopen(target, page) {
  if (version >= VERSIONOK)
    parent.frames[target].location = page;
}

//
// Öffnet Popupfenster
// 
function open_popup(seite,name) {
  MeinFenster = window.open(seite, name, "width=400,height=240,resizeable=yes,dependent=yes,scrollbars=yes");
  MeinFenster.focus();
}

//
// Prüft, ob window in Frame aufgerufen wird,
// falls nicht, Rückfall auf ../index.php
//
function checkframe(url) {
  if (window.top == window.self) {
    newurl = "../../index.php" + url;
    window.location.replace(newurl);
  }
}

//
// Lädt das angegebene Fram neu:
//
function doreload(frame) {
  window.location.reload(frame);
}

//
// Selektiert Eingabefeld im Frame 'frame', Formular 'form', Feld 'field':
//
function setfocus(frame,form,field) {
  parent.frames[frame].document.forms[form].elements[field].select();
}

//
// Drucke Fensterinhalt:
function doprint() {
  window.print();
}

//
// Übernimmt der Wert aus WARENKORB.ZABD in das Feld BESTELLUNG.zabdtext:
// 
function savezabd () {
  zahlbd = document.BESTELLUNG.zabdtext.value;
  // IE braucht im Falle von options dieses:
  if (zahlbd == "") {
     index = document.BESTELLUNG.zabdtext.selectedIndex;
     zahlbd = document.BESTELLUNG.zabdtext.options[index].text;
  }
  document.WARENKORB.ZABD.value = zahlbd;
}

//
// Macht das angegebene Element "visible":
//
function makevisible (objekt) {
  if(document.getElementById) {
    document.getElementById(objekt).style.visibility = "visible";
  }
}


// ----------------------------------------------------------------------------

