var fotos = new Array();
var akbild = 0;  
 
function neu(url,url2, link)
{
    Neu = fotos.length;
    fotos[Neu] = new Array();
    fotos[Neu]["pic"]=new Image()
    fotos[Neu]["pic"].src=url;
    fotos[Neu]["pic_gross"]=new Image()
    fotos[Neu]["pic_gross"].src=url2;
    fotos[Neu]["link"]=link;  
}
// editiere hier das große bild
exakt=false;        //false = runterskalieren | true = die exakte angegebene größe
height=300;        //bei exakt=false sollte die width sehr hoch gesetzt werden!
width=900;

var preview=4;    //anzahl der thumbnails in der manual-navi-leiste
time=3500    //'slide'Zeit wie lange ein einzelnes Bild angezeigt wird in ms


thumb_height=height/preview;
thumb_width=100000;
thumb_exakt=false;


function thumb_table(offset)
{
    table="<table width=100%><tr>";    
    for(var x=offset; x<=offset+preview-1; x++)
    {
        if(fotos[x])
        {
             if( x == akbild)
            {
                table+="<th><img onmouseover=\"show('"+x+"',true)\" class='hover'  src='"+fotos[x]["pic"].src+"' id=bild_"+x+"  ></th>";
            }else{
                table+="<th><img onmouseover=\"show('"+x+"',true)\" class='thumb'  src='"+fotos[x]["pic"].src+"' id=bild_"+x+"  ></th>"; 
            }
        }
    }
    table+="</tr></table>";    
    
    if(document.images['pfeil_rechts'] != null && document.images['pfeil_links'] != null )
    {
        if(fotos.length == offset+preview)
        {
           document.images['pfeil_rechts'].src = "/image/pfeile/orange_gross_rg.gif";
           document.images['pfeil_links'].src = "/image/pfeile/orange_gross_l.gif";      
        }else{
           if(offset == 0){
            document.images['pfeil_links'].src = "/image/pfeile/orange_gross_lg.gif"; 
            document.images['pfeil_rechts'].src = "/image/pfeile/orange_gross_r.gif"; 
            
          }else{
           document.images['pfeil_rechts'].src = "/image/pfeile/orange_gross_r.gif";          
           document.images['pfeil_links'].src = "/image/pfeile/orange_gross_l.gif"; 
          
          }
        }
    }
    return(table);
}

var nav=0;
function navi(v)
{
    v=Number(v);
    if(nav+v>fotos.length-preview)
    {
            V=fotos.length-preview;
    }else
    {
        if(nav+v<0)
        {
            V=0;
        }else
        {
            V=nav+v;
        }
    }
    nav=V;
    
    document.getElementById("thumbs").innerHTML=thumb_table(V);
 }
NAV=-1;
function show(x,fs)
{
    x=Number(x);
    if(fotos[x])
    {
     
        document.images['inhalt'].src = fotos[x]["pic_gross"].src;
        document.getElementById("link").href = fotos[x]["link"]; 
        akbild= x;
        out(x);   
    }
    NAV=x
} 
function out(h)
{
    for(var x=0; x< fotos.length ; x++)
    {
        if(x == h)
        {
          document.getElementById("bild_"+x).className ="hover"; 
        }else{
          if(document.getElementById("bild_"+x) != null)
          {
            document.getElementById("bild_"+x).className ="thumb"; 
          }
       }  
    }
}  
