// DOM READY
document.observe("dom:loaded", function() {
	picInit();
});
// Global
setDisplayAllWithClass=function(class_name,display){
	$$('.'+class_name).each(function(obj){
		obj.style.display=display;
	});
}
// Bilderscripts
picNum=0;
zIndex=0;
swapPictures = function(anzahl){
	$('pic_'+picNum).fade({ duration: 0, delay:3.5 });
	picNum++;
	if(picNum>anzahl-1){
		picNum = 0;
	}
	$('pic_'+picNum).style.zIndex=zIndex;
	zIndex++;
	$('pic_'+picNum).appear({ duration:3.5 });
} 

picInit = function(){
	$$('#image_container_top>*').each(function(obj,i){
		if(i!=0){
			obj.style.display = 'none';
		}
	});
	if($$('#image_container_top>*').length > 1 ){
		window.setInterval('swapPictures('+$$('#image_container_top>*').length+')',8000);
	}
}

changeMap=function(num){
	$$('.map img').each(function(obj){
		obj.style.display='none';
	});
	$$('.map img')[num].style.display='inline';
}

// Formular
toggleFormPartCheckbox=function(checkbox,class_name){
	if(checkbox.checked==true){
		display="";
	}else{
		display="none";
	}
	setDisplayAllWithClass(class_name,display);
}
