//var GloOldonError=window.onError;
function lib_bwcheck(){
  this.ver=navigator.appVersion;
  this.agent=navigator.userAgent;
  this.dom=document.getElementById?1:0;

  this.opera5=this.agent.indexOf("Opera 5")>-1;
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
  this.ie4=(parent.document.all && !this.dom && !this.opera5)?1:0;

  this.ieVersion=this.ver.replace (/.*\bMSIE ([0-9,\.]*).*/, "$1");
  //alert(this.ieVersion+"\r"+this.ver);

  this.ie=this.ie4||this.ie5||this.ie6
  this.mac=this.agent.indexOf("Mac")>-1
  this.ns6=(this.dom && parseInt (this.ver) >= 5) ?1:0;

  this.ns4=((navigator.appName.indexOf("Netscape") >= 0 && parseFloat(this.ver)) >= 4 && !this.dom)?1:0;

  this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ie5_5 ||this.ns4 || this.ns6 || this.opera5)
  this.javascript=window.location.search!="?noJavaScript";
  return this
}

var bw=new lib_bwcheck()
if ( bw.javascript )
 //window.onerror=DoError;

function DoError()
{ window.location.href+="?noJavaScript";
  return true;
  if (GloOldonError) GloOldonError();
}

/*****************************************************************************
  Helpfunctions
*****************************************************************************/

function nvl(aTestValue, aNullValue)
{if (aTestValue) {return aTestValue} else {return aNullValue};}

var Wochentagname =  new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");

function getZeit() {
 var Jetzt = new Date();
 var result = new Array();
 var year = Jetzt.getYear();
 result["datum"] = Wochentagname[Jetzt.getDay()] + ", " +
                   String (Jetzt.getDate()).replace (/(\b[0-9]\b)/, "0$1")+"."+
                   String (Jetzt.getMonth() + 1).replace (/(\b[0-9]\b)/, "0$1")+"."+
                   String ((year<2000)?(year+1900):year).replace (/(\b[0-9]\b)/, "0$1");

  result["zeit"] = String (Jetzt.getHours()).replace (/(\b[0-9]\b)/, "0$1")+":"+
                   String (Jetzt.getMinutes()).replace (/(\b[0-9]\b)/, "0$1")+":"+
                   String (Jetzt.getSeconds()).replace (/(\b[0-9]\b)/, "0$1");
 return result;
}

function writeContainerClassID(aWidth, aHeight, aFaktorX, aFaktorY )
{ var tmpFaktorX =(aFaktorX>=0)?aFaktorX:0.5;
  var tmpFaktorY =(aFaktorY>=0)?aFaktorY:0.5;
  var tmpWidth   =(aWidth>=0)?aWidth:800;
  var tmpHeight  =(aHeight>=0)?aHeight:600;
  var aStr='#container {position:absolute;left:'+Math.max ((screen.availWidth-tmpWidth)*tmpFaktorX, 0)+'px;width:'+aWidth+'px;height:'+aHeight+'px'
  if (aFaktorY)
   aStr+=';top:'+Math.max ((screen.availHeight-tmpHeight)*tmpFaktorY, 0)+'px';
  aStr+='}'
  document.writeln ('<style type="text/css">');
  document.writeln ('<!--');
  document.writeln (aStr);
  document.writeln ('-->');
  document.writeln ('</style>');
}


var ImageIntervallHandle = null;

function wait_for_image (aImage)
{ if (!aImage.complete)
  this.IntervallHandle=setInterval(this.obj+'.do_animation_step()',10);
}



