<!--

function openwin(URL, name, width, height) {
	var w = window.open(URL, name, 'width='+width+',height='+height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, resizable=no,copyhistory=no');
	w.focus;
}

function go_nav(url) {
	window.location.href = url;	
}	

function change_nav_bg(id,colorcode) {
	if (colorcode == "white") {
		document.getElementById(id).style.background = "white";		
		return;
	}
	
	if (colorcode == "gruen") {
		document.getElementById(id).style.background = "#E5F2CB";
	} else if (colorcode == "rot") {
		document.getElementById(id).style.background = "#FFE3DA";
	} else if (colorcode == "gelb") {
		document.getElementById(id).style.background = "#FCF1C5";
	} else if (colorcode == "tuerkis") {
		document.getElementById(id).style.background = "#DAEBEB";
	} else if (colorcode == "orange") {
		document.getElementById(id).style.background = "#FDE3C6";
	} else if (colorcode == "blau") {
		document.getElementById(id).style.background = "#D4E2EF";
	} else if (colorcode == "ocker") {
		document.getElementById(id).style.background = "#F5EBC2";
	} else if (colorcode == "braun") {
		document.getElementById(id).style.background = "#F1DFCB";
	}				
}	


function toggleOptions(type) {
	$(type).toggle();
	$(type+'On').toggle();
	$(type+'Off').toggle();
}

function togglePerformance (elem) {
	if (elem.checked) {
		$('performanceOptions').style.display = "block";
		$('performanceOptionsOn').style.display = "none";
		$('performanceOptionsOff').style.display = "block";
	} else {
		$('performanceOptions').style.display = "none";
		$('performanceOptionsOn').style.display = "block";
		$('performanceOptionsOff').style.display = "none";		
	}
}

function toggleDetails(type, onoff) {
	$(type+'On').toggle();
	$(type+'Off').toggle();
	
	if (onoff == 'on') {
		$('priceOptions').style.display='block';
		$('priceOptionsOn').style.display='none';
		$('priceOptionsOff').style.display='block';
		$('performanceOptions').style.display='block';	
		$('performanceOptionsOn').style.display='none';
		$('performanceOptionsOff').style.display='block';		
	} else {
		$('priceOptions').style.display='none';
		$('priceOptionsOn').style.display='block';
		$('priceOptionsOff').style.display='none';				
		$('performanceOptions').style.display='none';
		$('performanceOptionsOn').style.display='block';
		$('performanceOptionsOff').style.display='none';				
	}
}

function checkFormular(form) {
	$('minusBalanceError').style.display = "none";
	$('plusBalanceError').style.display = "none";
	ok = 1; 
	if ( $('minusBalance').checked==1 && $('minusBalanceSum').value=="") {
		$('minusBalanceError').style.display = "block";
		ok=0;	
	}
	if ( $('plusBalance').checked==1 && $('plusBalanceSum').value=="") {
		$('plusBalanceError').style.display = "block";
		ok=0;	
	}			 
	if (ok) $('maincompass').submit();
}

function uncheckAll(str) {
	var checkboxes = [];
	checkboxes = $$('input').each(function(e){ if(e.type == 'checkbox') checkboxes.push(e)  });
	checkboxes.each(function(e){
		if ( e.id.match(str) ) { 
			e.checked = 0;
		} 
	});
}


function toggleBalance(element, id) {
	if( element.checked!=1 ) {
		$(id).value='';
		$(id).removeClassName('active');
		$(id).addClassName('inactive'); 
	} else {
		$(id).addClassName('active'); 
		$(id).removeClassName('inactive'); 	
	}
}

//-->
