// show, hide layers

var previous = 0;

function show() {
		var actual = show.arguments[0];
		if (previous != 0) {
				clearTimeout(timer_id);
				document.getElementById(previous).style.display = 'none';
		}
		document.getElementById(actual).style.display = 'inline';
		previous = actual;
		return false;
} 

function close_timer() {
		timer_id = setTimeout('delay()', 300);
}

function delay() {
		if (previous != 0) {
				document.getElementById(previous).style.display = 'none';
				previous = 0;
		}
		return false;
}

function stop_timer() {
		clearTimeout(timer_id);
}

// Switch images

var panoramas = new Array (
				"../images/panorama_nacht.jpg",
				"../images/panorama_tag.jpg" );

var wellness_01 = new Array (
				"../images/ambiente_freibad_nacht.jpg",
				"../images/ambiente_freibad_tag.jpg" );

var wellness_02 = new Array (
				"../images/ambiente_freibad_hallenbad_nacht.jpg",
				"../images/ambiente_freibad_hallenbad_tag.jpg" );


var timeout = new Array (
				1500,3000);


var max_bild = 1;


var i_bild = 0;


function well_switch_01 (){

		document.getElementById ("well_switch_01").src = wellness_01 [i_bild];

		window.setTimeout ( "well_switch_01()", timeout [i_bild]);
		if ( i_bild < max_bild ){
				i_bild = i_bild + 1;
		}
		else {
				i_bild = 0;
		}
}

function well_switch_02 (){

		document.getElementById ("well_switch_02").src = wellness_02 [i_bild];

		window.setTimeout ( "well_switch_02()", timeout [i_bild]);
		if ( i_bild < max_bild ){
				i_bild = i_bild + 1;
		}
		else {
				i_bild = 0;
		}
}


function pan_switch (){

		document.getElementById ("pan_switch").src = panoramas [i_bild];

		window.setTimeout ( "pan_switch()", timeout [i_bild]);
		if ( i_bild < max_bild ){
				i_bild = i_bild + 1;
		}
		else {
				i_bild = 0;
		}
}

// window.setTimeout ( "pan_switch()", 0 );
