function makeBrowser(){ 
     this.ver=navigator.appVersion;
     this.dom=document.getElementById?1:0;
     this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
     this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
     this.ie4=(document.all && !this.dom)?1:0;
     this.ns6=(this.dom && !document.all)?1:0;
     this.ns5=(this.dom && parseInt(this.ver) >= 5 && !this.ver.indexOf("Netscape6")) ?1:0;
     this.ns4=(document.layers && !this.dom)?1:0;
     this.opera = (navigator.userAgent.indexOf("Opera") != -1);
     this.mac=(navigator.platform.indexOf("Mac")!= -1);
     if (this.ie6) this.ie5=true;
     this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ns6 || this.opera);
     return this;
}

bw=makeBrowser();

function roll(inNr,inState){
	var inId ="L"+inNr;
	var theBg = inId+"Bg";
	var theImg = inId+"BgImg";
	if(bw.ns4){
		 theElement = document.layers["LBg"].document.images[theImg];
	}else if(bw.ns6){
		theElement = document.images[theImg];
	}else{
		theElement=document.all[theImg];
	}
	theTextLayer =getTheLayerRef("LText"+inNr);
	getTheLayerRef("LText"+curTextLayer).visibility="hidden";
	theTextLayer.visibility="visible";
	curTextLayer=inNr;
	setLayerPos("LText"+curTextLayer,12);

	changeColor(theElement,inState);
}

function getTheLayerRef(inLayer){
	if (bw.ns4){
  		var theElement = (document.layers[inLayer]);
 	}else if(document.getElementById){
  		if (document.getElementById(inLayer))var theElement = document.getElementById(inLayer).style;
 	}else{
		var theElement=document.all[inLayer].style;
	}
	 return theElement;
}

function changeColor(inId,inState){
 	inId.src =(inState == "in") ? theProductLayerMenuHighLight :theProductLayerMenuBg;
}
function writeMenu(){
 	theStr='';
 	for(i=1;i<=3;i++){
	  theStr+='<tr><td width="10"><a href="#" onMouseOver ="roll(\'L'+i+'\',\'in\');" onMouseOut ="roll(\'L'+i+'\',\'out\');"><img src="../shared/pf_white7.gif" width="10" height="17" border="0" alt=""></a></td>';
	  theStr+='<td><a href="#" onMouseOver ="roll(\'L'+i+'\',\'in\');" onMouseOut ="roll(\'L'+i+'\',\'out\');"><span class="headlineinverse">2Car Entertainment und Navigation</span></a></td></tr>';
	  theStr+='<tr><td bgcolor="#2269B5"><img src="'+theTransparent+'" width="10" height="1" alt="" border="0"></td><td bgcolor="#2269B5"><img src="'+theTransparent+'" width="252" height="1" alt="" border="0"></td></tr>';
	  
 	}
 	return theStr;
}

function setLayerPos(inLayer,inOffset){
	 if (!inOffset)inOffset=0;
	 var theLayerRef=getTheLayerRef(inLayer);
	 if (!theLayerRef)return;
	 if (bw.ns4 || bw.ns6) {
	  	w=window.innerWidth-16;
	 } else if (bw.opera){
	  	w=window.innerWidth;
	 }else {
	  	w=document.body.clientWidth;
	 }
	 //if (w==oldw) return;
	 if (bw.ns6 && (window.innerHeight > document.height)) w = w+16;
	 theLeft =((w-720)/2);
	if (theLeft < 0){theLeft=0;}
	theLayerRef.left =theLeft + inOffset;
	theLayerRef.visibility="visible";
}

function setLayers(){
 	setLayerPos("Menu",60);
 	setLayerPos("LBg",60);
 	setLayerPos("LText"+curTextLayer,12);
	
	
}
function selfinstall()
{
 // store window size for Netscape 4.x resize fix
 if (bw.ns4){
  ns_origWidth = innerWidth;
  ns_origHeight = innerHeight;
  window.onresize = netscapeResizeFix;
  //theTime=setTimeout("netscapeResizeFix()", 1000);
 }else{
  window.onresize =setLayers;
 }
}

function netscapeResizeFix ()
{ 
 if (typeof (ns_origWidth) != "number" || typeof (ns_origHeight) != "number"){
  theTime=setTimeout("netscapeResizeFix()", 1000); return;
 }
 if (innerWidth != ns_origWidth || innerHeight != ns_origHeight){ 
  location.reload();
 }else{
  theTime=setTimeout("netscapeResizeFix()", 1000);
 }
}




    function writeTeaser(inNr,inArrow){
        theStr='<tr><td><a href="'+teaserLinkArray[inNr]+'" onclick="if(ie4)blur();"><img src="'+teaserImgArray[inNr]+'" width="173" height="54" border="0"></a></td>';
        theStr+='<td><img src="'+theTransparent+'" height="1" width="6"></td>';
        theStr+='<td valign="top"><a href="'+teaserLinkArray[inNr]+'" class="blueplaintext"><span class="blueplaintextbold">'+teaserHeadArray[inNr]+'</span><br>'+teaserTextArray[inNr]+'<img src="'+inArrow+'" width="12" height="7" border="0"></a></td>';
        theStr+='<td><img src="'+theTransparent+'" width="6" height="1"></td></tr>';
        document.write(theStr);   
    }

    function writeBigTeaser(){
        var theAdd="?";
       var theFlash=teaserFlashArray[1]+theAdd+"path=";
        var theFlashLink=teaserFlashLinkArray[1]; 
               if(theFlash.length >2){
            insertFlash(4,theFlash, 'flash', 342, 199,'FFFFFF', teaserFlashFbArray[1],theFlashLink,teaserFlashLinkArray[1]);
        }else{
            document.write('<a href="'+teaserFlashLinkArray[1]+'"><img src="'+teaserImgArray[1]+'" width="342" height="199" border="0"></a>');
        }

    }
    
