$(function(){
	$('#propertyList>div,#mainLinks>div,#properties li').click(function() {
								  window.location = $(this).find('a').attr('href');
								  });
	
	
	
	$('ul.gallery').galleria(
											  {
												  onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
				
				// fade in the image & caption
				//if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
				//	image.css('display','none').fadeIn(300);
				//}
				//caption.css('display','none').fadeIn(300);
				
				var _html = thumb.attr('alt') || "";
				
				$(".image_caption").html(_html);
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// fade out inactive thumbnail
				_li.siblings().children('img.selected').fadeTo(500,1);
				
				// fade in active thumbnail
				thumb.fadeTo('fast',0.3).addClass('selected');
				
				// add a title for the clickable image
				image.attr('title','Next image >>');
			},
			insert: '#main_image',
			history: false,
			onThumb : function(thumb) { // thumbnail effects goes here
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// if thumbnail is active, fade all the way.
				var _fadeTo = _li.is('.active') ? '0.3' : '1';
				
				// fade in the thumbnail when finnished loading
				thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1000);
				
				// hover effects
				thumb.hover(
					function() { _li.not('.active').children('img').fadeTo('fast',0.8); },
					function() { _li.not('.active').children('img').fadeTo('fast',1); } // don't fade out if the parent is active
				)
			}
											  }
											  
											  
											  
											  );
});