toolTip=function(divId){
var e;
this.inheritFrom=layer;
this.inheritFrom(divId);
this.tipShow=toolTipShow;
this.tipGo=toolTipGo;
this.setCont=function(h){this.setHtml(h);this.original=h}
this.flipTip=function(){this.toolTip=(this.toolTip-1)*-1;this.move=0} 
this.flipMove=function(){this.move=(this.toolTip)?(this.move-1)*-1:0} 
this.mkButton=poplayer_aTagReplace;
this.onFaded=fadeEnd;
this.place=putInPlace;
this.parseTip=txtParse;
event_addListener(this.obj,'mouseout',toolPopGo);
event_addListener(this.obj,'mouseover',toolPopShow);
this.fix=false;
this.offsetX=15;
this.offsetY=15;
this.posType=0;
this.sDel=0.7;
this.goDel=0.1;
this.hide();
this.move=0;
this.inWait=0;
this.toolTip=1;
this.setIn(0.5);
this.setOut(0.2);
this.original=this.getHtml();
this.pa="kein_pa";
e=this;
eval ("d.tTip"+(e.obj.id)+"=e");
if (!d.acTip) d.acTip=this;
}
toolTipShow=function(){
parms=toolTipShow.arguments;nummer=parms.length-2;rArray=(nummer<=-1)?0:new Array();for(j=0;j<=nummer;j++)rArray[j]=parms[j+1];
if(this.inWait!="show"){
clearInterval(this.cD||0);
this.inWait=0;
if (d.acTip.pa!=parms[0]){
if (d.acTip.pa!="kein_pa"){
clearInterval(d.acTip.cD||0);
d.acTip.inWait=0;
if (d.acTip==this){
this.setOut( Math.min((X=this.fOut),this.sDel*0.5));
this.hide();
this.setOut(X);
}
else{ d.acTip.hide();
}
}
if (d.acTip.getVis()&&d.acTip.inTrans!="hidden") alert("hier soll ein eingeschaltener Layer von seinem Platz verdraengt werden");
d.acTip=this;
dId="d.tTip"+this.obj.id;
X=( ! this.fix && (this.move || this.pa!=parms[0]))?dId+".place();":"";
this.pa=parms[0];
this.xx=parms[0];
this.inWait="show";
this.cD=setInterval(dId+".parseTip(rArray);"+X+dId+".show();d.acTip.pa=d.acTip.xx;clearInterval("+dId+".cD);"+dId+".inWait=0;",this.sDel*1000);
}else	if(this.inTrans=="hidden"){
this.show();
}
}
}
toolTipGo=function(X){
if (this.inWait!="go"){
clearInterval(this.cD||0);
this.inWait=0;
if(!this.getVis() || this.inTrans=="hidden")this.pa="kein_pa";
if (this.getVis() && this.inTrans!="hidden" && (this.autoClose||X) && (this.toolTip&&!this.autoClose||X||!l)){
dId="d.tTip"+this.obj.id;
this.inWait="go";
this.cD=setInterval(dId+".hide();clearInterval("+dId+".cD);"+dId+".inWait=0;",this.goDel*1000);
}
}
}
function toolPopShow(current){
eval ("with(d.tTip"+current.id+"){if(autoClose && !toolTip)tipShow(pa);}");
};
function toolPopGo(e){
if (!d.acTip.autoClose) return;
d.acTip.tipGo(1);
}
function txtParse(rArray){
original=this.original;
if (rArray){
for(i=0;i<rArray.length ;i++){
regexstr="/\\!\\+"+i+"\\-\\!/"
regex=eval(regexstr);
while (regex.exec(original)){
original=original.replace(eval(regexstr),rArray[i]);
}
}
}
regex=/\!\+([^\d\-]*)\-\!/
this.autoClose=1;
while (regex.exec(original)){
replace="<a href=\"javascript:d.tTip"+this.obj.id+".tipGo(1);\">"+RegExp.$1+"</a>"
original=original.replace(regex,replace);
this.autoClose=0;
this.move=0;
}
this.setHtml(original);
}
function putInPlace(){
this.offsetX=Math.abs(this.offsetX)*((this.toolTip)?1:-1);
this.offsetY=Math.abs(this.offsetY)*((this.toolTip)?1:-1);
rollX=(bw.ns4)?window.pageXOffset:(bw.ns6)?window.scrollX:(bw.ie)?d.body.scrollLeft:0;
rollY=(bw.ns4)?window.pageYOffset:(bw.ns6)?window.scrollY:(bw.ie)?d.body.scrollTop:0;
toX=mX+this.offsetX;
toY=mY+this.offsetY;
toX=(toX>(nX=d.scrW-this.getW()-2+rollX) && !this.posType)?toX-this.getW()-2*this.offsetX:toX;
toY=(toY>(nY=d.scrH-this.getH()-6+rollY) && !this.posType)?toY-this.getH()-2*this.offsetY:toY;
x=(toX>nX)?nX:toX;
y=(toY>nY)?nY:toY;
x=Math.max(rollX+2,x);
y=Math.max(rollY+2,y);
this.setX(x);
this.setY(y);
}
mX=0;mY=0;
function toolTipRepos(x,y){
mX=x; mY=y;
if(d.acTip)if(d.acTip.getVis() && d.acTip.move) d.acTip.place();
}
func_addSomething('mousemove','toolTipRepos');
function fadeEnd(ff){
if (!this.getVis())this.pa="kein_pa";
}
function poplayer_aTagReplace(layerObjectName) {
if (!bw.dom) return
if (!layerObjectName) alert("Du musst der funktion 'mkButton()' den Namen mitgeben,\n in welcher globalen Variablen das Objekt abgelegt wurde!");
addRunTagFunc('a','if (tag.title.toLowerCase()=="'+this.obj.id.toLowerCase()+'")aTagReplaceFunct(tag,'+layerObjectName+');')
}
function aTagReplaceFunct(tag, layer) {
var l=layer,tag,button,rex;
if(tag.className.toLowerCase()=="tooltipbut"&&l.butImg){
button=tag.appendChild(new Image());
button.src=l.butImg;
rex=/\/?([\w]+)\.[\w]*$/;
rex.exec(l.butImg);
button.border=0;button.align="absmiddle";button.className=RegExp.$1;
}else if (tag.childNodes.length==0){
tag.appendChild(document.createTextNode(tag.lang||"?"));
}
tag.myTip=l;
tag.replace=tag.name||"";
event_addListener(tag,'mouseover',function(e){eval("e.myTip.tipShow(e"+((e.replace)?","+e.replace:"")+")")});
event_addListener(tag,'mouseout',function(e){e.myTip.tipGo()});
if (!tag.href)event_addListener(tag,'click',event_prevent);
tag.name="";
tag.title="";
tag.lang="";
}
func_addSomething("load","measureScreen")
if(!bw.ns4) func_addSomething("resize","measureScreen")
function measureScreen() {
d.scrW= (bw.ie?document.body.clientWidth:innerWidth) - (bw.ns?16:0);
d.scrH= (bw.ie?document.body.clientHeight:innerHeight) - (bw.ns?8:0);
};

