function isObj() {
  for (var i = 0; i < isObj.arguments.length; i++)
    if (eval( "typeof( " + isObj.arguments[ i ] + " );" ) == "undefined")
      return false;
  return true;
}  // function isObj

/* getSrcFromImg gibt das src-attribut des kompletten img-elements zur?ck, */
/* falls ein solches ?bergeben worden ist. wenn nicht, dann nicht. */
/* dies macht nur sinn, wenn unser liebes cms nps die links verwaltet */
function getSrcFromImg( url ) {
  /* sondern einfach das erste doppelt gequotete attribut: */
  return (url.indexOf( "<img" ) == 0) ? url.split( "\"" )[ 1 ] : url;
}

function div( divId ) {
  if (document.getElementById) {
    return (document.getElementById( divId )) ? document.getElementById( divId ) : false;
  }
  if (document.layers) {
    return (document.layers[ divId ]) ? document.layers[ divId ] : false;
  }
  if (document.all) {
    return (document.all[ divId ]) ? document.all[ divId ] : false;
  }
  return false;
}

function divStyle( divID ) {
  if (document.getElementById || document.all) {
    return (div( divID ).style) ? div( divID ).style : false;
  }
  if (document.layers) {
    return div( divID );
  }
  return false;
}

function divShow( ) {
  if (divShow.arguments.length >= 1) {
    divID = divShow.arguments[ 0 ];
  }
  sichtbarkeit = (document.layers) ? "show" : "visible";
  if (divShow.arguments.length >= 2) {
    sichtbarkeit = (document.layers) ? "hide" : "hidden";
  }
  if (divStyle( divID )) {
    divStyle( divID ).visibility = sichtbarkeit;
  }
}

function divHide( divID ) {
  divShow( divID, false );
}

function clickIt( url ) {
  window.location.href = url;
}


function divDisplay() {
//  if (isObj( "browser", "divDisplay" )) {
    //alert(divDisplay.arguments.length);
    if (divDisplay.arguments.length > 0) {
      /* der 1te parameter ist der name vom div */
      var divID = divDisplay.arguments[ 0 ];
      //alert(divID + " " + divStyle( divID ).display);
      /* der 2te parameter ist die display-angabe, ansonsten display it einfach mal: */
      var divThen = (divDisplay.arguments.length > 1) ? divDisplay.arguments[ 1 ] : "block";
      //alert( divID + " " + divThen );
      //if (browser.ie > 4 || browser.op > 4) {
        /* vb: mit divStyle( divID ).display kann ich hier nicht arbeiten, */
        /* weil der ie hier nicht auf document.getElementById sondern auf document.all anspricht, */
        /* ich sonst aber document.getElementById bevorzuge (weil browserunabh?ngiger) */
        //alert( "man glaubt es nicht" );
        //if (document.all[ divID ]) {
          //document.all[ divID ].style.display = divThen;
        //}
      //}
      /* alert( browser.op ); */
      //if ( (browser.ns > 4 || browser.op >= 5) && (document.getElementById( divID )) )  {
        //alert("yep");
        document.getElementById( divID ).style.display = divThen;
      //}
      /* vb: fixme: netscape4 (zumindest hidden), opera, conqueror? */
    }
//  } else {
//    window.status = "JavaScript-Error!";
//  }
}
function divDisplayHide( divID ) {
  divDisplay( divID, "none" );
}
function divDisplayToggle( divID ) {
  //alert(divID + " " + divStyle( divID ).display);
  divThen = (divStyle( divID ).display == "block") ? "none" : "block";
  //alert( divID + " " + divThen );
  divDisplay( divID, divThen );
}
