
var itemWidth = 250;
var offsetfrommouse=[15,15];
var displayduration=0;
var currentimageheight = 270;
var st;
var pub_div = 'vergroesserung';

function gettrailobj(){

	document.getElementById(pub_div).bgColor = '#FFFFFF';

	if (document.getElementById)
		return document.getElementById(pub_div).style
	else if (document.all)
		return document.all.pub_div.style
}

function gettrailobjnostyle(){

	if (document.getElementById)
		return document.getElementById(pub_div)
	else if (document.all)
		return document.all.pub_div
}


function truebody(){

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

function div_anzeigen(imagename,title,description,showthumb,height, newItemWidth){

	if (newItemWidth != false) {
		itemWidth = newItemWidth;
	}

	if (height > 0){
		currentimageheight = height;
	}

	document.onmousemove=maus_verfolgung;

	cameraHTML = '';

	newHTML = '<div>';

	if (showthumb > 0){
		newHTML = newHTML + '<div style="border: 1px solid #999;background-color:#FFF;padding:5px;" align="center"><img src="' + imagename + '" border="0"></div>';
	}

	newHTML = newHTML + '</div>';

	gettrailobjnostyle().innerHTML = newHTML;

	//gettrailobj().visibility="visible";
	st = window.setTimeout("bild_einblenden()", 800);

}

function bild_einblenden(){

		gettrailobj().visibility="visible";
}


function facts_anzeigen(div_id,title,description,showthumb,height, newItemWidth){

	//alert(screen.availHeight+"-"+screen.height);
	if (newItemWidth != false) {

		itemWidth = newItemWidth;
	}

	if (height > 0){

		currentimageheight = height;
	}

	document.onmousemove=maus_verfolgung;

	gettrailobjnostyle().innerHTML = document.getElementById(div_id).innerHTML;

	//gettrailobj().visibility="visible";
	st = window.setTimeout("bild_einblenden()", 800);

}


function showhtml(newHtml,height) {

	document.onmousemove=maus_verfolgung;
	newHtml = '<div style="border: 1px solid #000000;background-color:#FFFFFF;padding:5px" align="left">' + newHtml + '<div>';
	gettrailobjnostyle().innerHTML = newHtml;
	gettrailobj().visibility="visible";

}

function div_verstecken(){

	window.clearTimeout(st);
	gettrailobj().visibility="hidden"

	gettrailobj().backgroundColor = "#FFF";
	gettrailobj().border = "0";

	document.onmousemove=""
	gettrailobj().left="-1000px"

}



function maus_verfolgung(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < itemWidth + 50){
//			if (noPicture == "yes") {
//				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
//			} else {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
//			}
		} else {
			xcoord += e.pageX;
		}
		if ((docheight - e.pageY) < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		
		docwidth = (docwidth == undefined) ? 800 : docwidth;
		
		if (docwidth - event.clientX < itemWidth + 50){
			if (noPicture == "yes") {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			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(browser == 'IE') {
	ycoord-=200;
	xcoord-=320;
}
else if(browser == 'Netscape' && os == 'Windows') {
	if(screen.availHeight > 900 && screen.availHeight < 1000) {
		ycoord+=150;
		xcoord-=100;
	}
	else if(screen.availHeight > 600 && screen.availHeight < 900) {
		ycoord+=50;
		xcoord+=1;
	}
	else {
		ycoord+=400;
		xcoord-=250;
	}


}
else if(browser == 'Netscape' && os == 'Mac') {
	ycoord+=150;
	xcoord-=60;
}

else if(os == 'Mac') {
	ycoord-=200;
	xcoord-=200;
}
else {
	ycoord-=200;
	xcoord-=320;
}

	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"


}
