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_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_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_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 bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
function toggle( targetId ){
  if (document.getElementById){
    target = document.getElementById( targetId );
    if (target.style.display == "none"){
      target.style.display = "";
    } 
    else {
      target.style.display = "none";
    }
  }
}

function kbacheck(nr,formname)
{
	if (nr==1 && document[formname].Zwei.value.length==4) 
	{
		document[formname].SKtypNr.value=0;
		document[formname].Drei.focus();
		document[formname].Drei.select();
	}	
	if (nr==2 && document[formname].Drei.value.length==3){ 
		document[formname].SKtypNr.value=1;
		document[formname].submit();
	}
	if (nr==3 && document[formname].Drei.value.length==3){ 
		document[formname].SKtypNr.value=1;
		xajax_myFunction(document[formname].Zwei.value,document[formname].Drei.value,'','','','KBA','felgen&kba=mit');
	}
 	else document[formname].SKtypNr.value=0;	
}

var richtung = 1;
var pause = 3000;
var warte = 30;
var fraemes = 100;
var time = warte;
var aktiv;
var wert1 = 1/fraemes;
var wert2 = 1-wert1;
var name = navigator.appName;

function ueberblend()
{
  e = document.getElementById ('bild1');
  
  if (!e.filters) // Netscape, Opera, Safari
  {
	// Firefox
	document.getElementById('bild1').style.MozOpacity = wert2;
  	document.getElementById('bild2').style.MozOpacity = wert1;
	// Opera
	document.getElementById('bild1').style.opacity = wert2;
  	document.getElementById('bild2').style.opacity = wert1;
  }	
  else  // IE 
  {	
	document.getElementById('bild1').style.filter="alpha(opacity="+ Math.round(wert2*100) +")";
  	document.getElementById('bild2').style.filter="alpha(opacity="+ Math.round(wert1*100) +")";
  }	
  if(wert1 <= (1/fraemes) || wert1 > (1-1/fraemes))
  { 
	window.clearTimeout(aktiv);
	if(wert1 <= 0.1) 
	{	
		richtung = 1;
	}
	else
	{
		richtung = 0;
	}
	time= pause;
  }
  else 
  {
	time = warte;
  }		
  if(richtung==1) // plus
  {
	wert1 =  wert1 + ( 1/fraemes) ;
	wert2 = 1 - wert1;
   }
   else
   {
	wert1 =  wert1 - ( 1/fraemes);
	wert2 = 1 - wert1;
   }
   aktiv= setTimeout("ueberblend()",time);
}
var z=0; var win=""; var hoehe="250";
function bild(id,breite,hoehe,Anb) {
	winold=win; win="win"+z
	if(winold != ""){win="";  w.close()}
	w= window.open ("bild.php?{SID}&id=" + id +"&Anb=" + Anb, win,"width=" + (breite + 20) +",height=" + (hoehe + 20));
	z=z+1
}
function bilds(id,breite,hoehe,Anb) {
	winold=win; win="win"+z
	if(winold != ""){win="";  w.close()}
	w= window.open ("bilds.php?{SID}&id=" + id +"&Anb=" + Anb, win,"width=" + (breite + 20) +",height=" + (hoehe + 20));
	z=z+1
}





//document.getElementById('cnt').innerHTML='CC0000'  
// + neudiv;
//neudiv ='';
//neudiv= '<span style="font: bold 19px arial; color: #0e4097;">Noch </span><span id="c1" style="font: bold 19px arial; color: #0e4097;"></span><br />';
//neudiv += '<span id="c2" style="font: bold 23px arial; color: #ffffff; margin: 0px 0px 0px 0px;">;</span><br />';
//neudiv += 'bis zur TV total Autoball<br>Weltmeisterschaft ' + year;

//document.write(neudiv);



//neu= setTimeout( alert(), 1150);
var now = new Date();
var year = now.getYear();
if (year < 1900) {
	year += 1900;
}
var end = new Date("June 04, " + year + " 18:15:00 GMT");


function toSt2(n) {
  s = "";
  if (n < 10) s += "0";
  return (s + n).toString();
}
function toSt3(n) {
  s = "";
  if (n < 10) s += "00";
  else if (n < 100) s += "0";
  return (s + n).toString();
}


function countdown() 
{
  
  //neudiv ='';
  d = new Date();
  count = Math.floor(end.getTime() - d.getTime());
  if(count > 0) {
    miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
    seconds = toSt2(count%60); count = Math.floor(count/60);
    minutes = toSt2(count%60); count = Math.floor(count/60);
    hours = toSt2(count%24); count = Math.floor(count/24);
    days = count;
    document.getElementById('zaehler').innerHTML = '<div style="padding:68px 30px 20px 395px"><span style="font: bold 19px arial; color: #0e4097;">Noch '+ days + ' TAGE </span><br><span style="font: bold 23px arial; color: #ffffff; margin: 0px 0px 0px 0px;">' + hours + ':' + minutes + ':' + seconds + '.' + miliseconds +'</span><br /><span style="font: bold 14px arial; color: #000000; margin: 0px 0px 0px 0px;">bis zur TV total Autoball<br>Weltmeisterschaft  2010</span></DIV><img src="images/leer.gif" width="648" height="85">' ;
    setTimeout("countdown()", 150);
  }
}
function stzeit()
{
  countdown()
}