function toggleDetails(targetId) {
	$target = $('#'+targetId+' .longInfo');
	var w = 'verbergen';
	if ($target.css('display')=='none') { 
		w = 'zeigen';
		$target.addClass('shown');
		$target.removeClass('hidden');
		$('#'+targetId).addClass('selected');		
	} else {
		$target.addClass('hidden');
		$target.removeClass('shown');
		$('#'+targetId).removeClass('selected');
	}
	$('#'+targetId+' h2 a').attr({ title: "ausführliche Informationen "+w });	
}

function showAll() {
	if (window.curState==undefined) { window.curState = 'hidden'; }
	$target = $('.longInfo');
	var v = 'zeigen';
	var w = 'verbergen';
	if (window.curState=='hidden') {
		$target.removeClass('hidden');
		$target.addClass('shown');
		window.curState = 'shown';
	} else { 
		$target.removeClass('shown');
		$target.addClass('hidden');
		w = 'zeigen';
		v = 'verbergen';
		window.curState = 'hidden';
	}
	$('h2 a').attr({ title: "ausführliche Informationen "+w });	
	var t = $('.showAll a').text();
	var r = new RegExp(v);
	t = t.replace(r,w);
	$('.showAll a').empty();
	$('.showAll a').append(t);
	$('.showAll').toggleClass('hideAll');
}

function showDiv(targetId) {
	if (window.actId==undefined) { 
		if ($(document.body).attr('class')=='philosophie') window.actId = 'naeherkommen';
		if ($(document.body).attr('class')=='philosophie raeume') window.actId = 'ueberblick';
		if ($(document.body).attr('class')=='philosophie raeume raeume2') window.actId = 'ueberblick';
		if ($(document.body).attr('class')=='haus aufenthalt') window.actId = 'betreuung';
		if ($(document.body).attr('class')=='menschen') window.actId = 'ueberblick';
		if ($(document.body).attr('class')=='home') window.actId = 'willkommen2';
		if ($(document.body).attr('class')=='anreise') window.actId = 'pkw';
	}
	var n = $('#'+targetId);
	var t = $('#c_'+targetId);
	var i = $('#i_'+targetId);
	$('#'+window.actId).removeClass('selected');	
	$('#i_'+window.actId).fadeOut('slow',function(){ i.fadeIn('slow'); });	
	$('#c_'+window.actId).hide();
	n.addClass('selected');
	t.show();
	window.actId = targetId;
}

function changePic(targetId) {
	if (window.actId==undefined) window.actId = 1;
	var n = $('#pic'+targetId);
	$('#pic'+window.actId).fadeOut('slow',function(){ n.fadeIn('slow'); });	
	window.actId = targetId;
}

function showElement(targetId) {
	var e = $('#'+targetId);
	if (e.css('display')=='none') e.slideDown('slow');
	
}


function accPopup(theURL,winName,features) {
		newwindow=window.open(theURL,winName,features);
		if (window.focus) {newwindow.focus()}
		return false;
}

function disableForm() {
		var s = document.getElementById('submitButton');
		s.disabled = 'disabled';
		s.value = 'Upload läuft, bitte einen Moment Geduld';
}

function enableForm() {
		var s = document.getElementById('submitButton');
		s.disabled = '';
		s.value = 'hochladen';
}

function showWaitMessage() {
	$('#waitMessage').fadeIn();
}

$(document).ready(function() {
	
});