<!--
	/******************** variables ********************/
	var timer;
	var content;
	var cl = true;
	var position = 0;

	/******************** functions ********************/
	function init()
	{
		// nur javascript ausführen, wenn dom unterstützt wird
		var dom = ( document.createElement && document.getElementsByTagName );
		if ( dom ) 
		{
			if( document.getElementById( 'scrollarea') )
				initScroller();	
		}
	}
	
	/******************** scroll function initialisieren ********************/
	function initScroller()
	{
		content = document.getElementById( 'content_beauty' );
		// variable löschen, falls keine sublinks existieren
		if( document.getElementById( 'noClassPage' ) )
			cl = false;
		// falls div (inhalt) grösser ist, als das fenster -> scroller anzeigen
		if( (content.clientHeight - document.getElementById( 'data' ).clientHeight) > 0 )
			createArrows();
			
		
	}
	
	/******************** scroll buttons erstellen ********************/
	function createArrows()
	{
		// scrollarea hintergrund
		var areaBg = document.createElement( 'div' );
		areaBg.className = 'area_bg';
		var area = document.getElementById( 'scrollarea' );
		area.appendChild( areaBg );
		if( !cl ) area.style.height = '370px';			// abstand der scrollpfeile anpassen, wenn keine kategorie vorhanden ist
		
		// scrollbuttons
		var btnUp = document.createElement( 'img' );
		btnUp.src = 'media/graphics/navigation/arrow_up.png';
		var btnDown = document.createElement( 'img' );
		btnDown.src = 'media/graphics/navigation/arrow_down.png';
		btnDown.className = 'btnDown';
		
		areaBg.appendChild( btnUp );
		areaBg.appendChild( btnDown );
		
		// mousehandlers
		// up
		btnUp.onmousedown = function()
		{
			scrollUp();
		}
		btnUp.onmouseup = function()
		{
			scrollStop();
		}
		btnUp.onmouseover = function()
		{
			this.src = 'media/graphics/navigation/arrow_up_hi.png';
			this.style.cursor = 'pointer';  
		}
		btnUp.onmouseout = function()
		{
			this.src = 'media/graphics/navigation/arrow_up.png';
			this.style.cursor = 'default';
			scrollStop();
		}
		
		// down
		btnDown.onmousedown = function()
		{
			scrollDown();
		}
		btnDown.onmouseup = function()
		{
			scrollStop();
		}
		btnDown.onmouseover = function()
		{
			this.src = 'media/graphics/navigation/arrow_down_hi.png';
			this.style.cursor = 'pointer'; 
		}
		btnDown.onmouseout = function()
		{
			this.src = 'media/graphics/navigation/arrow_down.png';
			this.style.cursor = 'default'; 
			scrollStop();
		}
	}
	
	
	/******************** div scrolling up and down ********************/
	function scrollUp()
	{
		if( position < 0 ) position += 7;
		content.style.top = position + 'px';
		timer = setTimeout( 'scrollUp();', 25 );
	}
	
	function scrollDown()
	{
		toScroll = content.clientHeight - document.getElementById( 'data' ).clientHeight;
		if( cl ) toScroll = toScroll + 30;				// bereich für die sublinks dazurechnen
		if( position > (0 - toScroll) ) position -= 7;
		content.style.top = position + 'px';
		timer = setTimeout( 'scrollDown();', 25 );
	}
	
	function scrollStop()
	{
		clearTimeout( timer );
	}
	
	/******************** javascript initialisieren ********************/ 
	window.onload = init;

-->

