

var scrolldelay;
var ScrollMenge = 0;

function stopScroll() 
{
    	ScrollMenge = 0;
    	clearTimeout(scrolldelay);
}



function pageScroll(Menge) 
{
    	window.scrollBy(0,10); // horizontal and vertical scroll increments
    	
    	if (Menge==ScrollMenge)
    	{
    		stopScroll();
    	}
    	else
    	{
    		scrolldelay = setTimeout('pageScroll(' + Menge + ')',10); 
    	}
    	ScrollMenge = ScrollMenge + 10;
}

function SubmitDahinE(actione,extravalue) {

		document.eingabe.sort.value = extravalue;
		document.eingabe.action = actione;
		document.eingabe.submit();
	}	


function SubmitDahin(actione) {
		document.eingabe.action = actione;
		document.eingabe.submit();
	}	
function SubmitDahinPage(actione,page) {
		document.eingabe.von.value = page;
		document.eingabe.action = actione;
		document.eingabe.submit();
	}		
	
function SubmitDahinPOST(actione) {
		
		document.eingabe.action = actione;
		document.eingabe.method = 'POST';
		document.eingabe.submit();
	}	
function ChangeColorProject(id,fcolor,bcolor,nummer){
	if (Lock[nummer]==0) {
		for (i=1,n=8;i<n;i++){
		if(document.getElementById('T' + i + id)){
			var TRr = document.getElementById('trsong' + id);
			var FarbeTR = document.getElementById('T' + i + id);

			FarbeTR.style.color = fcolor;
			TRr.style.backgroundColor = bcolor;

			}
			if (bcolor =='#FFFFFF'){
				change('M'+id,'art/icon_project.gif');
			}else{
				change('M'+id,'art/icon_project_an.gif');
			}
		}
	}
}
function ChangeColor(id,fcolor,bcolor,nummer){
	if (Lock[nummer]==0) {
		for (i=1,n=8;i<n;i++){
		if(document.getElementById('T' + i + id)){
			var TRr = document.getElementById('trsong' + id);
			var FarbeTR = document.getElementById('T' + i + id);

			FarbeTR.style.color = fcolor;
			TRr.style.backgroundColor = bcolor;

			}
			if (bcolor =='#FFFFFF'){
				change('M'+id,'art/music.gif');
			}else{
				change('M'+id,'art/music_on.gif');
			}
		}
	}
}
function ChangeColor1(id,fcolor,bcolor,nummer){
	if (Lock[nummer]==0) {
		for (i=1,n=8;i<n;i++){
		if(document.getElementById('T' + i + id)){
			var TRr = document.getElementById('trsong' + id);
			var FarbeTR = document.getElementById('T' + i + id);

			FarbeTR.style.color = fcolor;
			TRr.style.backgroundColor = bcolor;

			}
		}
	}
}
function openPopup(dahin,PSize){
	win2=window.open(dahin,'inhalt',PSize + ',status=no,scrollbars=no,resizable=no')
	win2.creator=self
}
function openPopupSong(dahin,PSize){
	win2=window.open(dahin,'addSong',PSize + ',status=no,scrollbars=no,resizable=no')
	win2.creator=self
}
function openPopupRequest(dahin,PSize){
	win2=window.open(dahin,'request',PSize + ',status=no,scrollbars=no,resizable=no')
	win2.creator=self
}

var ok=0;if ((parseInt(navigator.appVersion) > 3) || ((parseInt(navigator.appVersion) == 3) && (navigator.appName=='Netscape'))){ok=1;}
function change(name, newpic){
	if (ok==1){
		this.document[name].src=newpic;
		return true;
	}
}


function getWindowHeight() {
     var wh = (typeof(window.innerHeight)=='number')?window.innerHeight:(document.documentElement && document.documentElement.clientHeight)?document.documentElement.clientHeight:(document.body && document.body.clientHeight)?document.body.clientHeight:0;
     var ww = (typeof(window.innerWidth)=='number')?window.innerWidth:(document.documentElement && document.documentElement.clientWidth)?document.documentElement.clientWidth:(document.body && document.body.clientWidth)?document.body.clientWidth:0;
     return {h:wh, w:ww};
}


function setMain() {
	var windowHeight = getWindowHeight();
	
	if (windowHeight.h > 0) {
		var cE = document.getElementById('Ccontent');
		if (!document.getElementById('Ccontent')){
			var cE = document.getElementById('Ccontent2');
		}
		cE.style.left = ((windowHeight.w-840)/2) + 'px';
		
		var clogo = document.getElementById('logo');
		clogo.style.left = ((windowHeight.w-790)/2) - 26 + 'px';
		
		var cmenu = document.getElementById('menu');
		cmenu.style.left = ((windowHeight.w-520)/2) -20 + 'px';

		if (document.getElementById('headline')){
			var cheadline = document.getElementById('headline');
			cheadline.style.left = ((windowHeight.w-520)/2) -10 + 'px';
		}
		
		if (document.getElementById('myProjekts')){
			var cmyProjekts = document.getElementById('myProjekts');
			cmyProjekts.style.left =((windowHeight.w-520)/2) +365 + 'px';
		}		
		
		if (document.getElementById('machina')){
				var cheadline = document.getElementById('machina');
				cheadline.style.left = ((windowHeight.w-520)/2) -65 + 'px';
				cheadline.style.visibility = 'visible';
		}		
		if (document.getElementById('subheadline')){
			var csubheadline = document.getElementById('subheadline');
				csubheadline.style.left = ((windowHeight.w-300)/2) +180 + 'px';
				csubheadline.style.visibility = 'visible';
		}	
		cE.style.visibility = 'visible';
		clogo.style.visibility = 'visible';
		cmenu.style.visibility = 'visible';
		cheadline.style.visibility = 'visible';
		
		
		
		
	}

}

function openPopup(dahin,PSize){
	win2=window.open(dahin,'inhalt',PSize + ',status=no,scrollbars=no,resizable=no')
	win2.creator=self
}

window.onload = window.onresize = function(){setMain();}
