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

var traildiv2=["sachendiv", 500, 300] //div name, plus width and height of maximum sachen-image
var offsetfrommouse2=[-250,10] //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration2=0 //duration in seconds image should remain visible. 0 for always.

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

function gettraildiv2(){
 if (document.getElementById)
  return document.getElementById("sachendiv")
 else if (document.all)
  return document.all.sachendiv
}

function gettraildiv2style(){
 return gettraildiv2().style
}

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

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

}

function followmouse(e){
 var xcoord=offsetfrommouse2[0]
 var ycoord=offsetfrommouse2[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+traildiv2[1]+3>docwidth || ycoord+traildiv2[2]> docheight)
  gettraildiv2style().display="none"
 else 
  gettraildiv2style().display=""
 gettraildiv2style().left=xcoord+"px"
 gettraildiv2style().top=ycoord+"px"
}

document.onmousemove=followmouse

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

function showSachenImage(text) {
 if ( gettraildiv2style().visibility == 'hidden' ) {
   gettraildiv2().innerHTML = '<table width=500><tr><td align=center><table bgcolor=#ffffff cellpadding=10 ><tr><td class=fliesstext style=\"border:1px solid black;\">'+text+'</td></tr></table></td></tr></table>';
   gettraildiv2style().visibility="visible";
   gettraildiv2style().display="block";
 }
}

function hideSachenImage() {
 gettraildiv2().innerHTML = '';
 gettraildiv2style().visibility="hidden";
 gettraildiv2style().display="none";
}
 

