function feldlaenge(feld,anz){
  var feld,anz;
    //alert("Feld="+feld+" Anzahl="+anz +" Zeichen="+document.getElementsByName("mail[Ihre Nachricht]")[0].value.length);
      if(eval(anz- document.getElementsByName(""+feld+"")[0].value.length) < 0){
		document.getElementsByName(""+feld+"")[0].value = document.getElementsByName(""+feld+"")[0].value.slice(0,anz);
		alert("Es können nicht mehr Zeichen in das Eingabefeld eingegeben werden.")
	}
}
//Weihnachtskalender
function OpenWindow(ShowFile,WindowWidth,WindowHeight,WindowName)
{
	WindowPosX = (screen.width-WindowWidth) /2; WindowPosY = (screen.height-WindowHeight) /2; WParam = 'menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no';
	WindowParam = 'width='+WindowWidth+',height='+WindowHeight+',top='+WindowPosY+',left='+WindowPosX+WParam;
	var CenterWindow = window.open(ShowFile,WindowName,WindowParam);
	CenterWindow.focus();
}

function findObj(theObj, theDoc)
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  return foundObj;
}

// * Dependencies *
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
//
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
//
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers()
{
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}


// Example:
// onMouseOver="toolTip('tool tip text here')";
// onMouseOut="toolTip()";
// -or-
// onMouseOver="toolTip('more good stuff', '#FFFF00', 'orange')";
// onMouseOut="toolTip()"; 
/*
MOVE this to the <body>:
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="JavaScript"><!-- initToolTips(); //--></script>
*/
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var tool_message="Für mehr Informationen klicken Sie..";
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(msg, fg, bg, cl, klm)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "";
    if(!bg) bg = "";
    if(!cl) cl = "";
    if(!klm) klm = "";
   
    var content =
    '<table border="1" bordercolor="#FFFFFF" class='+cl+' cellspacing="0" cellpadding="0" bgcolor="' + fg + '"><tr><td>' +
    '<table border="0" class='+cl+' cellspacing="0" cellpadding="0" bgcolor="' + bg + 
    '"><tr><td align="left"><font face="Arial, Helvetica, sans-serif" color="' + fg +
    '" size="-2">' + msg +
    '&nbsp\;</font></td></tr><tr><td><font face="Arial, Helvetica, sans-serif" color="' + fg +
    '" size="-2"><br>'
    if(klm==''){
    	content +=tool_message
    }
    content+='&nbsp\;</font></td></tr></table></td></tr></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


   function mOvr(src,clrOver){
         src.className = clrOver;
         //src.style.cursor = 'pointer';
  }
   function mOut(src,clrIn){
         //src.style.cursor = 'default';
         src.className = clrIn;
   }
   function mClk(src)
   {
   if(event.srcElement.tagName=='TD')
   {
   src.children.tags('A')[0].click();
   }
   }

function feldlaenge(feld,anz){
  var feld,anz;
    //alert("Feld="+feld+" Anzahl="+anz +" Zeichen="+document.getElementsByName("mail[Ihre Nachricht]")[0].value.length);
      if(eval(anz- document.getElementsByName(""+feld+"")[0].value.length) < 0){
		document.getElementsByName(""+feld+"")[0].value = document.getElementsByName(""+feld+"")[0].value.slice(0,anz);
		alert("Es können nicht mehr Zeichen in das Eingabefeld eingegeben werden.")
	}
}


function preischeck(URL)
{
	if (navigator.appName=="Netscape")
	{
		
		newscreen(URL);
		
	}
	else
	{
		
		
		if(document.location.pathname=="/presse/presse_preise.htm")	//Aufruf aus Presse Preise
		{		
			document.location.href=URL.substring(0,URL.lastIndexOf("/"))+"/preise.htm";	//Pfad rausholen und einbauen.
		}
		
		else
		{
			document.location.href="preise/preise.htm";		//Wenn nicht aus Presse, dann wie vorher, liegt automatisch im Preise Verzeichniss
			
		}
		
	}
	
	if (URL == "ausstattung/fabia_ausstattung.htm")
	{
		if (navigator.appName=="Netscape")
		{
			newscreen(URL);
		}
		else
		{
			document.location.href="ausstattung/ausstattung.htm";
		}
	}		
	
	
}



function GetXPosCentered(){
	var x;
	if(IE4xx()==true)
		x=window.screenLeft;
	else if(NN4xx()==true || NN6xx()==true)
		x=window.screenX;
	return x;
}
function GetYPosCentered(){
	var y;
	if(IE4xx()==true)
		y=window.screenTop;
	else if(NN4xx()==true || NN6xx()==true)
		y=window.sc
}
function NN4xx(){
	var NN4=((navigator.appName.indexOf("Netscape") !=-1) && (parseInt(navigator.appVersion)==4));
return NN4;
}
function NN6xx(){
	var NN6=((navigator.appName.indexOf("Netscape") !=-1) && (parseInt(navigator.appVersion)==5));
return NN6;
}
function NN7xx(){
	var NN7=((navigator.appName.indexOf("Netscape") !=-1) && (parseInt(navigator.appVersion)==5));
return NN7;
}
function IE4xx(){
	var IE4=((navigator.appName.indexOf("Microsoft") !=-1) && (parseInt(navigator.appVersion)==4));
return IE4;
}
function IE5xx(){
	var IE5=((navigator.appName.indexOf("Microsoft") !=-1) && (navigator.appVersion.indexOf("MSIE 5") !=-1));
return IE5;
}
function IE6xx(){
	var IE6=((navigator.appName.indexOf("Microsoft") !=-1) && (navigator.appVersion.indexOf("MSIE 6") !=-1));
return IE6;
}

function cc(oid,aid){
	var url;
	var param;
	
	if(isNaN(aid)==true){	//falls keine Ausstattung mit gegeben wurde
		aid=""
	}
	url = "http://carconfig.skoda-auto.de"; //dbserver2	
	var Config= window.open(url,"CarConfigurator","resizable=yes,scrollbars=yes,width=1024,height=810,toolbar=no,status=no,menubar=no,location=no")
	if(Config){
		Config.focus();
	}
	
}



// Diese Funktion ist fuer den Aufruf aus den Farben/Bezuegen-Unterverzeichnissen gedacht.
// Koennte auch in die normale preischeck-Routine eingebunden werden. -> Aber keine Zeit (Timo).

function preischeck_Bez(URL)
{
	if (navigator.appName=="Netscape")
	{
		
		newscreen(URL);
		
	}
	else
	{

		document.location.href="../preise/preise.htm";	
	}
}


function newscreen(URL)
		      {  		
		      var NeuWin = window.open(URL,"Technics","resizable=yes,scrollbars=yes,width=600,height=420,toolbar=no,status=no,menubar=no,location=no")
		      }
	


function newscreen_tech(URL)
		      {  		
		      var NeuWin = window.open(URL,"Technics","resizable=yes,scrollbars=yes,width=800,height=500,toolbar=no,status=no,menubar=no,location=no")
		      }
		    
function win(theURL) 
{
	//alert(theURL);
	window.open(theURL,'Farbgenerator',"resizable=no,scrollbars=no,width=500,height=500,toolbar=no,status=no,menubar=no,location=no");
}		     
		     
		     
function bilddb(modell,presse)
{
url = 'http://www.skoda-auto.de/bild_db/frontend.php3';

	if (modell)
	{
		url = url + "?modell="+modell;
	}
	
	if (presse)
	{
			url = url + "&presse="+presse;
	}
	
	window.open(url,'Bilddatenbank','width=720,height=480');
}


function techdb(modell)
{
url = 'http://www.skoda-auto.de/tech_db/presse.php3';

	if (modell)
	{
		url = url + "?modell="+modell;
	}
	
	window.open(url,'Presseinformationen','width=780,height=480');
}

var bookmarkurl="http://www.skoda-auto.de";
var bookmarktitle="Skoda Auto Deutschland GmbH";

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle);
}



	
	/*
	
	
	
	
	
	
	// Check ob, Document in Frame geladen ist , ansonsten redirect
	par= (parent.location);
	cur= (document.location);
	
	if (par==cur)
  	{
    	redir= "/index.php3?frame="+document.location.pathname;
    	document.location.href= redir;
  	}
  	*/