function confirmLink(theLink,text){
	var is_confirmed = confirm(text);
	if (is_confirmed) {
  	theLink.href += '&is_confirmed=1';
  }
	
	return is_confirmed;
}
// Ermittelt die Scrollposition
function getScrollPosition(){

	if (self.pageYOffset) {
		return self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		return document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		return document.body.scrollTop;
	} else {
		return false;
	}
}

// Ermittelt die Fenster und Seitengröße
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

// Bringt die Farben einer Pos Liste wieder in die richtige Reihenfolge
function poslist_color_refresh(list) {
	var color;
	var poslist = document.getElementById(list);
	
	for(i=0;i<poslist.getElementsByTagName('div').length;i++) {
		color = (i+1)%2==0 ? '#F1F1F1':'#FFFFFF';
		poslist.getElementsByTagName('div')[i].style.backgroundColor = color;
	}
}

// Fügt ein onload Event hinzu
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
			window.onload = func;
	} else {
		window.onload = function(){
			oldonload();
			func();
		}
	}
}


var tt,x,y;
function updateTT(e){
	var scrTop = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
	var scrLeft = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
	x = (document.all) ? window.event.x + scrLeft : e.pageX;
	y = (document.all) ? window.event.y + scrTop : e.pageY;
	if (tt != null) {
		tt.style.left = (x - 140) + "px";
		tt.style.top = (y - 380) + "px";
	}
}
function show_spielerfoto(obj){
	tt = obj.getElementsByTagName("img")[0];
	tt.style.display = "block";
	document.onmousemove = updateTT;
}
function hide_spielerfoto(){
	tt.style.display = "none";
	tt = null;
}