// JavaScript Document
// 1. Funktion fuer den Zugriff aufs Dokument
    
function DivObjDocument(div_id) 
{
    if (!div_id || div_id.length==0) {
       div_obj = document;
    }
    else {
       if (document.getElementById) {
          div_obj = document; // W3C
       }   
       else if (document.layers) {
          div_obj = eval("document."+div_id+".document");
       }
       else if (document.all) {
          div_obj = eval("document.all."+div_id+".document");
       }   
    }   
    return div_obj;
}     

// 2. Funktion fuer den Zugriff aufs Style Sheet

function DivObjStyle(div_id)
{
    if (!div_id || div_id.length==0)
    {
       if (document.getElementById) {
           div_obj = document.style;
       }    
       else if (document.layers) {
           div_obj = document;
       }
       else if (document.all) {
           div_obj = document.all.style;
       }
    }
    else {   
       if (document.getElementById) {
          div_obj = document.getElementById(div_id).style;
       }    
       else if (document.layers) {
          div_obj = eval("document."+div_id);
       }
       else if (document.all) {
          div_obj = eval("document.all."+div_id+".style");
       }
    }   
    return div_obj;
}

/*Beispiel:
DivObjDocument("Test1").images[2].src = "img/other.gif";
DivObjStyle("Test1").visibility = "visible";

Auch wenn keine Layers verwendet werden,
können diese Funktionen verwendet werden, 
indem einfach als Layer-Name nichts mitgegeben wird, 
z.B. DivObjDocument().images[2].src
 
*/

var btnImg=new Array();
var btnImgOver=new Array();
var image=new Array();
var which=1;
var klicknum = 1;

/*Change the below variables to reference your own images. You may have as many images in the slider as you wish*/
btnImg[0]="";
btnImgOver[0]="";
image[0]="";

btnImg[1]="intf/bild1.jpg";
btnImgOver[1]="intf/bild1_f2.jpg";
image[1]="img/"+dat_name+"/"+dat_name+"1.jpg";

btnImg[2]="intf/bild2.jpg";
btnImgOver[2]="intf/bild2_f2.jpg";
image[2]="img/"+dat_name+"/"+dat_name+"2.jpg";

btnImg[3]="intf/bild3.jpg";
btnImgOver[3]="intf/bild3_f2.jpg";
image[3]="img/"+dat_name+"/"+dat_name+"3.jpg";

btnImg[4]="intf/bild4.jpg";
btnImgOver[4]="intf/bild4_f2.jpg";
image[4]="img/"+dat_name+"/"+dat_name+"4.jpg";


function restore(){
		if (DivObjDocument().images.bild1) {DivObjDocument().images.bild1.src=btnImg[1];DivObjStyle("legend1").display = "none";}
		if (DivObjDocument().images.bild2) {DivObjDocument().images.bild2.src=btnImg[2];DivObjStyle("legend2").display = "none";}
		if (DivObjDocument().images.bild3) {DivObjDocument().images.bild3.src=btnImg[3];DivObjStyle("legend3").display = "none";}
		if (DivObjDocument().images.bild4) {DivObjDocument().images.bild4.src=btnImg[4];DivObjStyle("legend4").display = "none";}
}

function klick(which){
		restore();
		DivObjDocument().images["bild"+which].src=btnImgOver[which];
		DivObjDocument().images.tauschbild.src=image[which];
		DivObjStyle("legend"+which).display = "inline";
		var klicknum = which;
}

function up(which){
		DivObjDocument().images["bild"+which].src=btnImgOver[which];
}

function out(which){
		DivObjDocument().images["bild"+which].src=btnImg[which];
}

