/*
 * JavaScript: 
 * Produced by
 * Heike Gruber
 * Mai 2003
 */
 
/*
 * function change( whichImg, hi, msg )
 *
 * Rollover Function
 * whichImg = Name of <img>
 * hi = 1 = over
 */

function change( whichImg, hi ){
  if (document.images){
    document.images[whichImg].src = (hi == 1 ) ? eval(whichImg+"_h.src") : eval(whichImg+".src");
  }
}


function MM_preloadimages() 
{ 
  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) 
{
   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); 
   return x;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) 
  {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) 
    {
      img.MM_init = true; 
      img.MM_up = args[3]; 
      img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) 
        nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) 
         if ((img = MM_findObj(args[i])) != null) 
         {
            if (!img.MM_up) 
               img.MM_up = img.src;
            img.src = img.MM_dn = args[i+1];
            nbArr[nbArr.length] = img;
      } 
    }
  } 
  else if (event == "over") 
  {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) 
      if ((img = MM_findObj(args[i])) != null) 
      {
        if (!img.MM_up) 
          img.MM_up = img.src;
        img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
        nbArr[nbArr.length] = img;
      }
  } 
  else if (event == "out" ) 
  {
    for (i=0; i < document.MM_nbOver.length; i++) 
    {
      img = document.MM_nbOver[i]; 
      img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; 
    }
  } 
  else if (event == "down") 
  {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) 
      { 
        img=nbArr[i]; 
        img.src = img.MM_up; 
        img.MM_dn = 0; 
      }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) 
      if ((img = MM_findObj(args[i])) != null) 
      {
        if (!img.MM_up)
           img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
      } 
  }
}


/*
 * function openNonResizableWin(URL, window_name, left, top, width, height)
 * 
 */

function openNonResizableWin(URL, window_name, left, top, width, height) {
   params = "status=no,locationbar=no,menubar=no,resizable=no,left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;
   wStandorte=window.open(URL, window_name, params);
   wStandorte.focus();
}

/*
 * function openResizableWin(URL, window_name, width, height)
 * 
 */

function openResizableWin(URL, window_name, width, height) {
   params = "status=no,locationbar=no,menubar=no,resizable=yes,scrollbars=yes,width=" + width + ",height=" + height;
   wStandorte=window.open(URL, window_name, params);
   wStandorte.focus();
}



/*
 * function AlterAnzeigen(id,GebJahr, GebMonat, GebTag)
 * 
 */

function AlterAnzeigen(id,GebJahr, GebMonat, GebTag) 
{ 
   var Jetzt = new Date(); 
   var Tag = Jetzt.getDate();
   var Monat = Jetzt.getMonth() + 1;
   var Jahr = Jetzt.getYear();
    
   Jahr = Jahr - GebJahr
   if (Monat < GebMonat) {
     Jahr = Jahr - 1; 
   } 
   if (Monat == GebMonat) {
     if (GebTag > Tag)
       Jahr = Jahr - 1;      
   } 
   var Age = Jahr
   
   if(document.all)     
     document.all.tags("div")[id].innerText = Age;
   else if(document.layers)
   {
     document.NetscapeDate.document.open();
     Age = '<span class="Age")>' + Age + '</span>';
     document.NetscapeDate.document.write(Age);
     document.NetscapeDate.document.close();
   } 
}


/*
 * function updateAge(anz)
 * 
 */
 
function updateAge(form,pos,anz) { 
   var pos;
   var Jahr, Monat, Tag;   
   for (i=0; i < anz; i++) {
      var GebTag = document.forms[form].elements[i].value;         
      p = GebTag.indexOf(".");
      Tag = GebTag.substring(0,p);
      GebTag = GebTag.substring(p+1);
      p = GebTag.indexOf(".");
      Monat = GebTag.substring(0,p); 
      Jahr = GebTag.substring(p+1);  
      AlterAnzeigen(i+pos,Jahr,Monat,Tag);
   } 
}

/*  
 * Funktionen für die Dia-Show  
 * ---------------------------
 */

 /*  function play()  */
 function play() {     
   aktiv = window.setInterval('playShow()',2000);        
 }  

 /*  function stop()  */  
 function stop() {
   window.clearInterval(aktiv);
 }  
  
 /*  function playShow()  */
 function playShow() {            
   if (pos < anz) {
     pos = pos + 1;
     if(document.all)     
       document.all.pos.innerHTML = pos;
     showImage(pos);        
   }
   else {  
     window.clearInterval(aktiv); 
     pos = 1;
     showImage(pos);        
   }           
 }    
 
 /*  function first()  */
 function first() {
   pos = 1;  
   showImage(pos);
 }
 
 /*  function next()  */
 function next() {
   if (pos < anz) {
     pos = pos + 1;
   }  
   showImage(pos);
 }
  
 /*  function back()  */
 function back() {
   if (pos > 1) {
     pos = pos - 1;
   }  
   showImage(pos);
 }
 
 /*  function last()  */
 function last() {
   pos = anz;   
   showImage(pos);
 }

 /*  function showImage(pos)  */
 function showImage(pos) {   
   if(document.all) 
     document.all.pos.innerHTML = pos; 	
   var newImg = "images/skater/skaterlauf/ImgS" + pos + ".jpg"
   if (document.images){
     document.images["dia"].src = newImg;
   } 
 }

/*  
 * Funktionen für die Dia-Show der Volleyball-Index-Seite  
 * ------------------------------------------------------
 */

 /*  function play_vb()  */
 function play_vb() {     
   aktiv = window.setInterval('playShow2()',5000);        
 }  

 
 /*  function playShow2()  */
 function playShow2() {            
   if (pos < anz) {
     pos = pos + 1;
     showImage2(pos);        
   }
   else {  
     pos = 1;
     showImage2(pos);        
   }           
 }    
 

 /*  function showImage2(pos)  */
 function showImage2(pos) {   
   var newImg = "images/volleyball/images_index/ImgS" + pos + ".jpg"
   if (document.images){
     document.images["dia"].src = newImg;
   } 
 }
 

 
 
