stopper = 0;

function opacity(id, opacStart, opacEnd, millisec) {
	if(stopper!=1) {
		//speed for each frame
		var speed = Math.round(millisec / 20);
		var timer = 0;

		//determine the direction for the blending, if start and end are the same nothing happens
		if(opacStart > opacEnd) {
			for(i = opacStart; i >= opacEnd; i = i-5) {
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		} else if(opacStart < opacEnd) {
			document.getElementById(id).style.visibility = 'visible';
			for(i = opacStart; i <= opacEnd; i = i+5)
				{
				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
				timer++;
			}
		}
    }
}

function changeOpac(opacity, id) {
	if(opacity>=100) {
		opacity = 99;
	}
	if(opacity < 0) {
		opacity = 0;
	}
	var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function toggleText(lang) {
	if(lang=='en') {
		document.getElementById('text-de').className='';
		document.getElementById('text-en').className='active';
		document.getElementById('tab-de').className='';
		document.getElementById('tab-en').className='active';}
	else {
		document.getElementById('text-en').className='';
		document.getElementById('text-de').className='active';
		document.getElementById('tab-en').className='';
		document.getElementById('tab-de').className='active';}
}

function padInt(integer) {
	if(integer < 10) {
		return '0'+integer;
	} else {
		return integer;
	}
}

