function openPic(imageName,imageWidth,imageHeight) {
	var alt = "";
 	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,menubar=yes,left="+(Math.floor((screen.availWidth-imageWidth-10)/2))+",top="+(Math.floor((screen.availHeight-imageHeight-15)/2)));
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' title=\"'+alt+'\" alt=\"'+alt+'\" galleryimg=\"no\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function showPerson(userName) {
      var win = window.open("http://www.kirchenserver.net/bwo/opencms/sites/bistum/vk/personen/anzeige.html?f_action=show_user&f_user_name=" + userName,"preview_stelle_person", "toolbar=no, location=no, directories=no, status=no, menubar=0, scrollbars=yes, "+ "resizable=yes, top=10, left=" + ((screen.width-625) / 2) + ", width=525, height=600");
      if (win != null) {
            win.opener = self;
            win.focus();
			}
	  return false;
}

function showDiv(targetId) {
	if (window.actId==undefined) { 
		if ($(document.body).attr('class')=='ansatz') window.actId = 'grundlagen';
	}
	var n = $('#'+targetId);
	var t = $('#c_'+targetId);
	var i = $('#i_'+targetId);
	$('#'+window.actId).removeClass('selected');	
	$('#c_'+window.actId).css('visibility','hidden');	
	$('#i_'+window.actId).fadeOut(3000);	
	i.fadeIn(3000);
	n.addClass('selected');
	t.css('visibility','visible');	
	window.actId = targetId;
}

function showNav(targetId) {
	var c = $('#'+targetId);
	//c.addClass('selected');
	slideTriggered = false;
	if (window.actId && window.actId!=targetId) {
		window.oldActId = window.actId;
		$('#subnav_'+window.actId).slideUp('slow',function(){$('#subnav_'+targetId).slideDown('slow');$('#'+window.oldActId).removeClass('selected');}); 
		slideTriggered = true;
	}
	if (slideTriggered===false && window.actId==undefined) { $('#subnav_'+targetId).slideDown('slow'); }
	window.actId = targetId;
}

function gotoTop() {
	window.scrollTo(0,0);
}

$(document).ready(function() { 
    $('.subnav').parent().children('a').attr('href','javascript:;');
	$('.subnav').parent().children('a').click(function(){
		showNav($(this).parent().attr('id'));
	});
});

