function hasHashMarburg()
{										
    if(window.location.href.indexOf("#zcr") != -1) {
    $("#navBar").tabs( 'select' , 3 )
}
}

function hasHashGiessen()
{										
    if(window.location.href.indexOf("#zcr") != -1) {
    $("#navBar").tabs( 'select' , 4 )
}
}


$(document).ready(function() {

// Tell jQuery that our div is to be a dialog  
$('#imprint').dialog({ autoOpen:false, draggable:false, modal:true });  
  
$('#imprint_link').click(function() {  
$('#imprint').dialog('open');
return false;  
});  



// Set Hover Class for Submit
$('.submitWrap').hover(function() {
  $(this).addClass('active');
}, function() {
  $(this).removeClass('active');
});

//Body Classes
	$("a#nav_angebot, a#nav_events, a#nav_kontakt_marburg, a#nav_kontakt_giessen").click(function(){
		$('body').removeClass();
		$('body').addClass('siteBook');
    });
	$("a#nav_galerie").click(function(){
		$('body').removeClass();
		$('body').addClass('siteBookFotos');
    });


//Hover Transition Effect
	$(".titlePic, .contentPic").fadeTo("slow", 0.6);

	$(".titlePic, .contentPic").hover(function(){
		$(this).fadeTo("fast", 1.0);
	},function(){
   		$(this).fadeTo("fast", 0.5);
	});

//Save the context in a var
	var $main = $(".titlePic");
	//If the container exists
	if($main.length){
		//Loop through each image, including the index of the object(i)
		$($main).each(function(i){
			//Since 0 based add one, for every 3rd object remainder will equal 0
			$(":first-child").removeClass("hidden");
		});
	}
	

//Save the context in a var
	var $main = $(".container");
	//If the container exists
	if($(".titlePic, .contentPic").length){
		//Loop through each image, including the index of the object(i)
		$(".titlePic, .contentPic", $main).each(function(i){
			//Since 0 based add one, for every 3rd object remainder will equal 0
			var remainder = (i + 1) % 3;
			//Add a class of last when the remainder is 0
			if(remainder === 0){
				$(this).addClass("last");
			}
		});
	}
});
