/****** TIPSTER v1.1 by Angus Turnbull http://www.twinhelix.com ******/

// Please leave the above line in the source, and a link to my site in your page somewhere.
// After all, if you found these scripts useful, won't your visitors?
// Run the rest of this through my comment trimmer if you want before deploying.


// *** COMMON CROSS-BROWSER COMPATIBILITY CODE ***

var isDOM = document.getElementById?1:0;
var isIE = document.all?1:0;
var isNS4 = (navigator.appName=='Netscape' && !isDOM)?1:0;
var isIE4 = (isIE && !isDOM)?1:0;
var isWin = (navigator.platform.indexOf('Win') != -1)?1:0;
var isDyn = (isDOM||isIE4||isNS4);

function getRef(id, par)
{
 par = (!par ? document : (par.navigator ? par.document : par));
 return (isIE ? par.all[id] :
  (isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
  par.layers[id]));
}

function getSty(id, par)
{
 return (isNS4 ? getRef(id, par) : getRef(id, par).style)
}

if (!window.LayerObj) var LayerObj = new Function('id', 'par',
 'this.ref=getRef(id, par); this.sty=getSty(id, par); return this');
function getLyr(id, par) { return new LayerObj(id, par) }

function LyrFn(fn, fc)
{
 LayerObj.prototype[fn] = new Function('var a=arguments,p=a[0]; with (this) { '+fc+' }');
}
LyrFn('x','if (!isNaN(a[0])) sty.left=p; else return parseInt(sty.left)');
LyrFn('y','if (!isNaN(a[0])) sty.top=p; else return parseInt(sty.top)');
LyrFn('vis','sty.visibility=p');
LyrFn('write','if (isNS4) with (ref.document) {write(p);close()} else ref.innerHTML=p');
LyrFn('alpha','var f=ref.filters; if (f) {' +
 'if (sty.filter.indexOf("alpha")==-1) sty.filter+="alpha()"; ' +
 'if (f.alpha) f.alpha.opacity=p } else if (isDOM) sty.MozOpacity=(p/100)');





// *** TIP FUNCTIONS AND OBJECT ***

function tipTrack(evt) { with (this)
{
 if (followMouse && div)
 {
  // Scroll and mouse positions...
  sX = (isIE ? document.body.scrollLeft : window.pageXOffset);
  sY = (isIE ? document.body.scrollTop : window.pageYOffset);
  mX = (isIE ? event.clientX + sX : evt.pageX);
  mY = (isIE ? event.clientY + sY : evt.pageY);
  // ... that the position function uses.
  pos()
 }
}}

function tipPos() { with (this)
{
 if (lastTip)
 {
  // Pull the compulsory information out of the tip array.
  var t=tips[lastTip], tipX=t[0], tipY=t[1], tipW=t[2], tipH=t[3], adjX = 1;

  // Check if tip is inside window dimensions.
  var winW = (isIE ? document.body.clientWidth : window.innerWidth - 10);
  var winH = (isIE ? document.body.clientHeight : window.innerHeight - 10);
  
  if (mX + tipX + tipW + 5 > sX + winW) { mX = sX + winW - tipX - tipW - 5; adjX = 2 }
  if (mY + tipY + tipH + 5 > sY + winH) mY = sY + winH - tipY - (adjX*tipH) - 5;

  // Set its position to the mouse position plus calculated offset.
  div.x(mX + tipX);
  div.y(mY + tipY);
 }
}}

function tipShow(tipN) { with (this)
{
 if (!isDyn) return;

 // My layer object we use.
 if (!div) div = getLyr(myName + 'Layer');
 // Remember it's this that's visible, and set 'showTip' for the fade function.
 lastTip = tipN;
 showTip = true;
 // Stick it somewhere onscreen.
 if (followMouse) pos();

 // Go through and replace %0% with the array's 0 index, %1% with tips[tipN][1] etc...
 var str = content;
 for (var i=0; i<10; i++) str = str.replace('%'+i+'%', tips[tipN][i]);
 // Write the proper content... the last <br> weirdly helps IE5/Mac...?
 div.write(str + ((document.all && !isWin) ? '<small><br></small>' : ''));
 
 // ...and either fade in or display immediately.
 fade();
}}

function tipHide() { with (this)
{
 if (!isDyn) return;

 // Set the hide flag and call the fade function.
 showTip = false;
 fade();
}}

function tipFade() { with (this)
{
 // Clear to stop existing fades.
 clearTimeout(fadeTimer);

 // Show it and optionally increment alpha from 0 to 100.
 if (showTip)
 {
  div.vis('visible');
  if (doFades && alpha < 100)
  {
   alpha += fadeSpeed;
   if (alpha > 100) alpha = 100;
   div.alpha(alpha);
   // Call this function again shortly, fading tip in.
   fadeTimer = setTimeout(myName + '.fade()', 50);
   return;
  }
 }

 else
 {
  // Similar to before but counting down and hiding at the end.
  if (doFades && alpha > 0)
  {
   alpha -= fadeSpeed;
   if (alpha < 0) alpha = 0;
   div.alpha(alpha);
   fadeTimer = setTimeout(myName + '.fade()', 50);
   return;
  }
  div.vis('hidden');
 }
}}

function TipObj(myName)
{
 // Holds the properties the functions above use.
 this.myName = myName;
 this.tips = new Array();
 this.currTip = '';
 this.showTip = false;

 this.track = tipTrack;
 this.pos = tipPos;
 this.show = tipShow;
 this.hide = tipHide;
 this.fade = tipFade;
 
 this.div = null;

 // Set to false if you want a static tip (like a status bar).
 this.followMouse = true;
 this.sX = 0;
 this.sY = 0;
 this.mX = 0;
 this.mY = 0;

 // False will hide tips instantaneously. Fading only works under IE/Win and NS6+.
 this.doFades = false;
 this.fadeTimer = 0;
 // Increment alpha by fadeSpeed, higher means faster fades.
 this.fadeSpeed = 20;
 this.alpha = 0;
}







// *** START EDITING HERE ***

// First, create a new tip object, and pass it its own name so it can reference itself.
var docTips = new TipObj('docTips');
with (docTips)
{
 // Next, set its properties.
 
 // Set some tips to subarrays, tips.name = new Array(X, Y, width, height, text);
 // X and Y are measured from the mouse cursor if mouse following is active.

//Mitarbeiter
 tips.teufl = new Array(-60, -70, 120, 36, 'teufl.gif');
 tips.bacher = new Array(-57, -70, 114, 36, 'bacher.gif');
 tips.meinhart = new Array(-82, -70, 164, 36, 'meinhart.gif');
 tips.hauser = new Array(-80, -70, 160, 36, 'hauser.gif');
 tips.roidmayr = new Array(-67, -70, 134, 36, 'roidmayr.gif');
 tips.astegger = new Array(-74, -70, 148, 36, 'astegger.gif');
 tips.doetzlhofer = new Array(-61, -70, 121, 36, 'doetzlhofer.gif');
 tips.ascheibl = new Array(-59, -70, 118, 36, 'a_scheibl.gif');


 // 'content' is a string that contains the HTML template written to the tip layer.
 // Currently it's two nested tables (border and background). 
 // Include %n% where n is a number corresponding to the position in the tips.name arrays
 // set above, 0=X, 1=Y, 2=Width, 3=Height, 4 onwards can be whatever you want (e.g. content).
 // The script automatically replaces these with the values from the arrays set above.
 // This example sets the width and height of the table, and inserts some content.
 
 content = '<img src="images/gruppenfoto/%4%" width="%2%" height="%3%" border="0">'

 //content = '<table  bgcolor="#003366" cellpadding="1" cellspacing="0" width="%2%" border="0">' +
 // '<tr><td><table bgcolor="#FFFFFF" cellpadding="2" cellspacing="0" width="100%" border="0" >' +
 // '<tr><td align="center" height="%3%" class="docTips"%4%</td></tr></table></td></tr></table>';

 // Optionally, turn on or off mouse following or fading here.
}

// Capture the mousemove event so tips can follow the mouse.
if (isNS4) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = new Function('evt', 'docTips.track(evt)');
