var actVisible;
var actVisible2;

function hidenav() {
	if (actVisible && actVisible2) {
		document.getElementById(actVisible).style.visibility='hidden'

		document.getElementById(actVisible2).style.background='url(../images/navipfeil.gif) no-repeat 210px 20px';
		document.getElementById(actVisible2).style.color='#000000';

		var elements = document.getElementById("navidiv").getElementsByTagName("a");

		for(i=0; i<elements.length; ++i)
		{
			elements[i].style.opacity='1';
			elements[i].style.filter='alpha(opacity=100)';
		}
		
		document.getElementById('headerpicture').style.opacity = '1';

		actVisible = '';
		actVisible2 = '';
	}

}

function nav(mod,sit,subdiv) {
	if (mod == "visible") {

		hidenav();
		document.getElementById(subdiv).style.visibility=mod;

		actVisible = subdiv;
		actVisible2 = sit;

		var elements = document.getElementById("navidiv").getElementsByTagName("a");

		for(i=0; i<elements.length; ++i)
		{
			elements[i].style.opacity='0.5';
			elements[i].style.filter='alpha(opacity=50)';
		}
		
		$('#uberfoto').stop().animate({opacity: '0.5'},"slow");



		document.getElementById(sit).style.background='#ffffff url(../images/navipfeil_aktiv.gif) no-repeat 210px 20px';
		document.getElementById(sit).style.color='#cc0000';
		document.getElementById(sit).style.opacity='1.0';
		document.getElementById(sit).style.filter='alpha(opacity=100)';

	} else {
		document.getElementById(subdiv).style.visibility=mod;

		actVisible = '';
		actVisible2 = '';

		var elements = document.getElementById("navidiv").getElementsByTagName("a");

		for(i=0; i<elements.length; ++i)
		{
			elements[i].style.opacity='1';
			elements[i].style.filter='alpha(opacity=100)';
		}
		
		$('#uberfoto').stop().animate({opacity: '1'},"slow");


		document.getElementById(sit).style.background='url(../images/navipfeil.gif) no-repeat 210px 20px';
		document.getElementById(sit).style.color='#000000';
	}

}



function nav2(mod,subdiv) {
	document.getElementById(subdiv).style.visibility=mod;
	}

/* car configurator aufruf 
function configureCar(marketId) {
	var newMarketId = "";
	switch (marketId) {
		case "usa": newMarketId = "us"; break;
		case "germany": newMarketId = "de"; break;
		}
	gotoUrlNewWinSizeByName("http://cc.porsche.com/pva/ui/pva/index.jsp?sprache=" + marketId + "&modelrange=null", 960, 652, "PVA")
}

function gotoUrlNewWinSizeByName(s, sWidth, sHeight, sName) {
	sWidth += 20;
	sHeight += 25;
	newWin = window.open(s, sName, "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");
}*/

function datenschutz() {
	window.open('datenschutzerklaerung','Datenschutz','width=600,height=750,scrollbars=yes,menubar=no');
	}
	
function popupFullscreen(sUrl, bScroll) {
	var width = screen.width;
	var height = screen.height;
	var left = 0;
	var top = 0;
	
	if (screen.width > 1920)
	{
		width = 1920;
		height = 1200;
		left = Math.round((screen.width - width) / 2);
		top = Math.round((screen.height - height) / 2);
	}
	
    var scrollbars = 0;
    if (bScroll) scrollbars = 1;
    
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollbars + ",resizable=0,left=" + left + ",top=" + top + ",width=" + (width - 10) + ",height=" + (height - 55);	
	var site = window.open(sUrl,"porschemicrosite", sProps);
	site.focus();		
}

function popupWin(sUrl, bScroll, width, height) {
	var left = 0;
	var top = 0;
	
    var scrollbars = 0;
    if (bScroll) scrollbars = 1;
    
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollbars + ",resizable=0,left=" + left + ",top=" + top + ",width=" + (width - 10) + ",height=" + (height - 55);	
	var site = window.open(sUrl,"porschemicrosite", sProps);
	site.focus();		
}


