
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var traildiv=["bilddiv", 1, 1] //div name, plus width and height of maximum image
var offsetfrommouse=[0,0] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0 //duration in seconds image should remain visible. 0 for always.

// TOMMY's Erweiterung    Anfang
function getscrollpos(startmargin) {
  var browser;
  browser=navigator.appName;
  if (browser == "Microsoft Internet Explorer") {
    return (document.body.scrollTop + startmargin);
  }
  else {
    return (window.pageYOffset + startmargin);
  }
}
// TOMMY's Erweiterung    Ende

if (document.getElementById || document.all)
document.write('<div id="bilddiv" style="position:absolute;visibility:hidden;display:none;width:1px;height:1px;margin-top:30;margin-left:10;"></div>')

function gettraildiv(){
 if (document.getElementById)
  return document.getElementById("bilddiv")
 else if (document.all)
  return document.all.bilddiv
}

function gettraildivstyle(){
 return gettraildiv().style
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail(){
gettraildivstyle().visibility="hidden"
document.onmousemove=""

}

function followmouse(e){
 var xcoord=offsetfrommouse[0]
 var ycoord=offsetfrommouse[1]
 if (typeof e != "undefined"){
  xcoord+=e.pageX
  ycoord+=e.pageY
 }
 else if (typeof window.event !="undefined"){
  xcoord+=truebody().scrollLeft+event.clientX
  ycoord+=truebody().scrollTop+event.clientY
 }

 var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
 var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
 if (xcoord+traildiv[1]+3>docwidth || ycoord+traildiv[2]> docheight)
  gettraildivstyle().display="none"
 else 
  gettraildivstyle().display=""
 gettraildivstyle().left=xcoord+"px"
 gettraildivstyle().top=ycoord+"px"
}


if (displayduration>0)
setTimeout("hidetrail()", displayduration*1000)


function showImage(imageName) {

	if ( gettraildivstyle().visibility == 'hidden' ) {
   gettraildiv().innerHTML = '<table cellpadding="0" cellspacing="0" style="border-collapse:collapse;cursor:pointer;" onClick="hideImage()";><tr><td><img src="'+imageName+'" style="border:1px solid black;border-collapse:collapse;"></td></tr><tr><td bgcolor="#FFFFFF" style="cursor:pointer;border-bottom:1px solid black;" align="center" class="fliesstext"><b>Schließen</td></tr></table>';

   var ypos;
   ypos=getscrollpos(-100);
   gettraildivstyle().zIndex=1000;		// TOMMY's Erweiterung                     
   gettraildivstyle().marginTop=ypos;    // TOMMY's Erweiterung   

   gettraildivstyle().visibility="visible";
   gettraildivstyle().display="block";


   
   //   alert(ypos);
//   gettraildivstyle().margin-top=59;    // TOMMY's Erweiterung   
   	//document.getElementById("bilddiv").style.marginTop=ypos;
// gettraildivstyle().z-index="1000";                  // TOMMY's Erweiterung   
   //   alert(ypos);
//   gettraildivstyle().margin-top=getscrollpos(30);    // TOMMY's Erweiterung

 }
}

function hideImage() {
 gettraildiv().innerHTML = '';
 gettraildivstyle().visibility="hidden";
 gettraildivstyle().display="none";
}
 

