	
function openMemory() {
	var mem = window.open('/memory/','Memory','width=700,height=700,resizable=yes,scrollbars=yes')
	mem.focus;
}
	
function controlSl(){
	var c = $('slideshowControl').value;

	if(c == 'stoped') {
		$('slideshowControl').value = 'playing';
		$('toggleSlIcon').src = '/data/pause.png';

		new Effect.Opacity('contentleft',{duration:0.5,from:1.0,to:0.2});
		new Effect.Opacity('head',{duration:0.5,from:1.0,to:0.2});
		new Effect.Opacity('contentright',{duration:0.5,from:1.0,to:0.2});
	
	} else {
		$('slideshowControl').value = 'stoped';
		$('toggleSlIcon').src = '/data/play.png';
		new Effect.Opacity('contentleft',{duration:0.5,from:0.2,to:1.0});
		new Effect.Opacity('head',{duration:0.5,from:0.2,to:1.0});
		new Effect.Opacity('contentright',{duration:0.5,from:0.2,to:1.0});
	}
}
function playSl(){
	var c = $('slideshowControl').value;
	if(c == 'playing') {
		nextLarge();
	}
}
function showNav(navNode){
	if($('nav').style.opacity=='' || $('nav').style.opacity=='0'|| $('nav').style.opacity==undefined){
		$('navcontainer').style.zIndex=4;					
		new Effect.Opacity('nav',{duration:0.5,from:0.0,to:1.0});
		new Effect.Opacity('navigation',{duration:0.5,from:0.0,to:1.0});
	}
}
function hiddeNav(navNode){
	;/*if($('nav').style.opacity!='' && $('nav').style.opacity!='0'){
		$('navcontainer').style.zIndex=3;
		new Effect.Opacity(navNode,{duration:0.5,from:1.0,to:0.0});
	}*/
}
function showLoading(){
	//document.getElementsByTagName('body')[0].style.cursor="wait";
	document.getElementById('systemworking').style.display = 'inline';
}

function hideLoading (){
	document.getElementById('systemworking').style.display = 'none';
	//document.getElementsByTagName('body')[0].style.cursor='auto';

}

Ajax.Responders.register({
	onCreate : showLoading,
	onComplete : hideLoading
});
function change_medium(newsrc,bc){
	//document.getElementById('bildmedium').src='/bilder/original/'+newsrc;
	$('tempbc').value = bc;
	$('bild_' + bc).rel = 'visist';	
	$('bild_' + bc).style.opacity = 1;
	
	$('tempmedium').value=newsrc;

	if($('bildmedium') != null){
		new Effect.Opacity('bildmedium',{duration:0.5, from:1.0,to:0.0,afterFinish: loadmedium});
	}else{
		new Effect.Opacity('contentdesc',{duration:0.5, from:1.0,to:0.0,afterFinish: loadmedium});
	}
	var tempgalerie = window.location.search;
	tempgalerie = tempgalerie.replace(/\?galerie=/,'');
	
	
	new Ajax.Updater('bildbeschreibung', '/inc/info.php', {
		method:'get',
		parameters: { bild: newsrc,fromajax:true, galerie:tempgalerie },
		evalScripts : true
	});
}
function loadmedium(obj){
	var newsrc = $('tempmedium').value;

	new Ajax.Updater('contentmiddle', '/inc/medium.out.php', {
		method:'get',
		parameters: { bild: newsrc,fromajax:true },
		evalScripts : true
	});
	$('picNav').style.display='inline';
	
	
}
function loadLarge(bildName){
	bildName = $('tempmedium').value;

	if($('largePic').style.zIndex=='1' || $('largePic').style.zIndex=='') {
		$('imgLarge').src='/bilder/original/'+bildName;
		$('largePic').style.zIndex='99';
		new Effect.Opacity('largePic',{duration:0.5,from:0.0,to:1.0});
		new Effect.Opacity('mediumPic',{duration:0.5,from:1.0,to:0.0});
		$('zoomImgIcon').src = '/data/minimize.png';
	} else {
		$('largePic').style.zIndex='1';
		new Effect.Opacity('largePic',{duration:0.5,from:1.0,to:0.0,afterFinish: largePicTo1});
		new Effect.Opacity('mediumPic',{duration:0.5,from:0.0,to:1.0});
		$('zoomImgIcon').src = '/data/maximize.png';
	}
}

function nextLarge(event){

	var aktBc = $F('tempbc');

	if(aktBc == (Pictures.length - 1))
		aktBc = -1;
	var nextBc = (aktBc * 1) + 1;

	
	
	$('imgLarge').src = '/bilder/original/' + Pictures[nextBc];
	
	$('bildmedium').src = '/bilder/medium/' + Pictures[nextBc];
	
	$('tempbc').value = nextBc;
	$('tempmedium').value=Pictures[nextBc];
}

function prevLarge(event){
	var aktBc = $F('tempbc');


	if(aktBc == 0)
		aktBc = Pictures.length;
	var nextBc = (aktBc * 1) - 1;

	
	$('imgLarge').src = '/bilder/original/' + Pictures[nextBc];
	$('bildmedium').src = '/bilder/medium/' + Pictures[nextBc];
	$('tempbc').value = nextBc;
	$('tempmedium').value=Pictures[nextBc];
	
}

function largePicTo1(){
	$('largePic').style.zIndex='1';
	$('imgLarge').src='/data/pixel.gif';
}
function overthumb(bc){
	hiddeNav('nav');
	if($('largePic').style.zIndex=='99') {
		new Effect.Opacity('largePic',{duration:0.5,from:1.0,to:0.0,afterFinish: largePicTo1});
		new Effect.Opacity('mediumPic',{duration:0.5,from:0.0,to:1.0,afterFinish: largePicTo1});
		$('navZoom').innerHTML = '+';
	}
	if($('bild_' + bc).rel != 'visist')
		new Effect.Opacity('bild_'+bc,{duration:0.5,from:1.0,to:0.2});
}
function outthumb(bc){
	if($('bild_' + bc).rel != 'visist')
		new Effect.Opacity('bild_'+bc,{duration:0.5,from:0.2,to:1});

}

function saveInGalerie(){
	new Ajax.Updater('bildbeschreibung', '/inc/saveInGalerie.php', {
		method:'get',
		parameters: $('saveForm').serialize(true),
		evalScripts : true
	});

	return false;
}



