// JavaScript Document

if (!window.bubble && typeof(window.bubble) != 'function') {

  function bubble(display, xpos, ypos, fName, fSize, fLink) {
  	
	document.getElementById('DlItem').style.display = display;
	
	if( fName != '' || fSize != '' || fLink != '' ) {
		document.getElementById('DlItemTxt').innerHTML = '<a href="' + fLink + '" target="_blank">' + fName + '<br>PDF-Datei, ' + fSize + '</a>';
	}
	
	if( xpos != 0 && ypos != 0 ) {
		document.getElementById('DlItem').style.top  = (ypos+25)+'px';
		document.getElementById('DlItem').style.left = (xpos+44)+'px';
	}
  }
}


if (!window.displaynone && typeof(window.displaynone) != 'function') {
	function displaynone( object_id ) {
		document.getElementById(object_id).style.display = 'none';
		return false;
	}	
}






/* Listbox-Height */
var client = {

	getPage: function() { 
		
		// Default-Values for 1024x768
		var pageWidth = 720;
		var pageHeight = 576;
		
		var scrollArr = this.getScroll();
		var winArr = this.getWindow();
		pageWidth = winArr.width + scrollArr.left;
		pageHeight = winArr.height + scrollArr.top;
	
		return { scrollX: scrollArr.left, scrollY: scrollArr.top, winW: winArr.width, winH: winArr.height, pageW: pageWidth, pageY: pageHeight };
	}, 
	
	getScroll: function() { 
		return { left: this.scrollLeft(), top: this.scrollTop() };
	}, 
	
	getWindow: function() { 
		return { width: this.windowWidth(), height: this.windowHeight() };
	},
	
	scrollLeft: function() {
		var xScroll = 0;
		if (self.pageXOffset)
			xScroll = self.pageXOffset;
		else if (document.documentElement && document.documentElement.scrollLeft) 
			xScroll = document.documentElement.scrollLeft;
		else if (document.body)
			xScroll = document.body.scrollLeft;
			
		return xScroll;
	},
	
	scrollTop: function() {
		var yScroll = 0;
		if (self.pageYOffset)
			yScroll = self.pageYOffset;
		else if (document.documentElement && document.documentElement.scrollTop)
			yScroll = document.documentElement.scrollTop;
		else if (document.body)
			yScroll = document.body.scrollTop;
			
		return yScroll;
	},
	
	windowWidth: function() {
		var xWin = 720;
		if (self.innerHeight)
			xWin = self.innerWidth; 
		else if (document.documentElement && document.documentElement.clientWidth) 
			xWin = document.documentElement.clientWidth; 
		else if (document.body) 
			xWin = document.body.clientWidth;
			
		return xWin; 
	},
	
	windowHeight: function() { 
		var yWin = 576;
		if (self.innerHeight)
			yWin = self.innerHeight;
		else if (document.documentElement && document.documentElement.clientHeight)
			yWin = document.documentElement.clientHeight;
		else if (document.body)
			yWin = document.body.clientHeight;
			
		return yWin; 
	}
};



var updateShowBox;
var lastShowBox;

function showBox( id, type )
{
	var yScroll = client.scrollTop()
	$j(id).css('top', yScroll );
	
	
	if( type == 0 ) {
		lastShowBox = id;
		// $j('#overFrameInner').html(showBoxContent[id]['text']);
		
		$j(id).fadeIn(1000, function(){ 
			$j(id+' .shadow_box_player').css('display', 'block');
			showBox(id, 2); 
		});
	}
	else if( type == 1 ) {
		lastShowBox = '';
		$j(id+' .shadow_box_player').css('display', 'none');
		$j(id).fadeOut(2000);
	}
	else if( lastShowBox == id ) {
		updateShowBox = setTimeout('showBox("' + id + '", 2)', 500);
	}
}

