
$(document).ready(function() {
	$('.detail').fadeOut('fast', function() {});						   
		var gal=true;				   
						   
						   
/////menu-content
	//Hide (Collapse) the toggle containers on load
	$(".about").hide(); 
	$(".contact").hide(); 
	$(".network").hide(); 	
	
	//$(".detail").hide();
	//fill details






	//go to post when url#param
	var params=document.URL.split("#")[1];
	if(typeof params != 'undefined' && params != ""){
		
	var locator="content/"+params+"/"+params+".html";
	
	//fill details
		$('#contentloader').load(locator, function() {
		
			//get and remember heights
			galheight= $('.innerslide').height();
			detheight= $('.detail').height();
		
		$('.slider').slideUp('slow', function() {
				$('.detail').fadeIn(1200, function() {});	
			});		
												   });
		gal=false;
		}


$('.menu a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('div')) && (checkElement.is(':visible'))) {
        checkElement.slideUp('normal');
        }
      if((checkElement.is('div')) && (!checkElement.is(':visible'))) {
        $('.menu div:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );						   

$('.caption').fadeTo('fast',0.7);

$(".entry").hover(function(){
$(this).children('.caption').fadeTo('fast',1);
						   },
				
				function () {
$(this).children('.caption').fadeTo('fast',0.7);
						   
});



$('.entry').click(
    function() {	
	
if(gal == true){
	var currentid = $(this).attr('id');
	currentid = currentid.substring(0,currentid.length-1);
	var locator="content/"+currentid+"/"+currentid+".html";
	
	//fill details
		$('#contentloader').load(locator, function() {
		
			//get and remember heights
			galheight= $('.innerslide').height();
			detheight= $('.detail').height();
		
		
		$('.slider').slideUp(
			 'slow', function() { 
			$('.detail').fadeIn(1200, function() {});	
			});	
			gal=false;
												   });
		

}
		});

			$('#back').click(
			function() {			
			if(gal == false){					

		$('.slider').slideDown(
			 'slow', function() { 
			$('.detail').fadeOut('slow', function() {});	
			});
		gal=true;
			}
			});						
		

});

