jQuery.event.add(window, "load", resizeFrame);
jQuery.event.add(window, "resize", resizeFrame);

function resizeFrame() 
{
    	var h = $(window).height();
		var galleriaHeight = h;
var stageHeight = h-58;


		$("#galleria").height(galleriaHeight);
		$(".galleria-container").height(galleriaHeight);
			
}
	
	$(document).ready(function(){
		$("#galleria").css('z-index', '300');
		$("#sidebar").css({'z-index': '800', 'position':'absolute'});
		
		/*$('#sidebar').fadeTo('slow', 0.1);
		
		$('#sidebar').hover(function(){
			$(this).stop().fadeTo('slow', 0.9);
		}, function(){
			$(this).stop().fadeTo('slow', 0.1);
		});*/
		$('h1').fadeTo('slow', 0.3);
		$('#nav_549355').fadeTo('slow', 0.1);
		
		$('#sidebar').hover(function(){
			$('h1').stop().fadeTo('slow', 0.9);
			$('#nav_549355').stop().fadeTo('slow', 0.9);
			$("<div class='overlay'></div>").appendTo('#sidebar');
		}, function(){
			$('h1').stop().fadeTo('slow', 0.1);
			$(".overlay").remove();
			$('#nav_549355').stop().fadeTo('slow', 0.1);


					 
		});
		

	 	 $(function () {
				 $.ajax({
					  type: "GET",
					  url: "/home-img/PhotoGallery.xml", // replace with absolute URL of your gallery's xml file
					  dataType: "xml",
					  success: function(xml) {
						  $(xml).find('img').each(function() {
							 var location = '/home-img/'; // replace with absolute path to the directory that holds your images
							 var url = $(this).attr('src');
							 var alt = $(this).attr('alt');
							  $('<img src="'+location+''+url+'" alt="'+alt+'"/>').appendTo('#galleria');
							  
						  });
						   $('#galleria').galleria({
								image_crop: false, // crop all images to fit
								thumb_crop: false, // crop all thumbnails to fit
								transition_speed: 700, // slow down the crossfade
								show_counter: false,
								transition: 'fade', // crossfade photos
								extend: function() {
					
									this.bind(Galleria.IMAGE, function(e) {
							
										$('.counter').html(this.$('counter').html());
							
									})
						
									this.bind(Galleria.IMAGE, function(e) {
							
										$('.caption').html(this.$('info-description').html());
							
									})
								}
					
							});
						  
					  }
	  
				  });
	
			  })
	
		
	});
	                   
	// Load theme
	Galleria.loadTheme('/js/src/themes/classic/galleria.classic.js');




