var Timer;
var Timer2;
function showInfo(id){
	if (id == "de"){
		from = document.getElementById('europa');
		to = document.getElementById('deutschland'); 			
		switchOpacity(from, to);
		document.getElementById('europalink').style.display = 'block';
		
	} else if (id == "eu"){
		
		from = document.getElementById('deutschland');
		to = document.getElementById('europa'); 
		if (from.style.opacity >= 1){
			switchOpacity(from, to);
		}
		document.getElementById('europalink').style.display = 'none';
	} else {
		if (document.getElementById(id)) {
			div = document.getElementById('rightcontent_vertriebspartner');

			setOpacity(0, 'rightcontentinside');
			div.innerHTML = (document.getElementById(id).innerHTML.search(/.*<h2>.*<\/h2>$/i) == -1)  && (document.getElementById(id).innerHTML.search(/.*<h2>.*<\/h2>\n$/i) == -1) ? document.getElementById(id).innerHTML : document.getElementById(id).innerHTML + document.getElementById('none').innerHTML;
			if (Timer2)
				window.clearInterval(Timer2);

			counter = 0;
			Timer2 = window.setInterval(
				function change() {
				setOpacity(counter, 'rightcontentinside');
				counter += 10;
				if (counter >= 100)
					window.clearInterval (Timer2);
				}, 20);	
		}
		
	}
	
	// Fehlerbehandlung
	if (document.getElementById('deutschland').style.display == 'none' && document.getElementById('europa').style.display == 'none') {
		document.getElementById('europa').style.display == 'block';
		setMapOpacity('europa', 35);
	}
	
}

function switchOpacity(from, to){
	setMapOpacity (to, 0);
	i = 0;
	i2 = 35;
	if (Timer)
		window.clearInterval(Timer);
		
	to.style.display = 'block';
	
	from.style.display = 'none';
	
	Timer = window.setInterval(
		function change() {
			setMapOpacity(to, i);
			setMapOpacity(from, i2);
			i++;
			i2--;
			if (i == 35 && i2 == 0)
				window.clearInterval (Timer);
		}, 10);
}

function setMapOpacity(element, value){
	element.style.opacity = value/10;
	element.style.filter = 'alpha(opacity=' + value*10 + ')';	
}