$(document).ready(function(){

$('#nav li').hide();
$('#nav .menu').show();
$('.menu, .endBit').show().css('border-bottom','none');
$('.menu').hover(function(){
				  	 $('#nav li').show();
				  	 $(this).hide();
				  	 },
				  	 function(){
});

$('#nav').hover(function(){},
		function(){			
			$('#nav .navLi').hide();
			$('.menu, .endBit').show();
});

//load image
$(".enlarge").click(function(){			
			var source = $(this).attr("alt");
			var caption = $(this).attr("title");
			
			$('#caption').hide();
			$('#caption').text(caption).fadeIn('fast');
			$('#caption').fadeIn('slow');
			
			$('#imgBanner iframe').hide();
			$(".enlarge,.map").removeClass('clicked');
			$(this).addClass('clicked');
		  	//$('.banner').replaceWith("<img class='banner' src='image/"+ source +".jpg' alt='St Ives Apartments' alt=''/>");
		  	$('#gallery').addClass('loading').html("<img class='banner' src='image/"+ source +".jpg' alt='St Ives Apartments' alt=''/>");
		  	//imageLoader();
		  	return false;

});

$('.map').click(function(){
		var caption = $(this).attr("title");
		
		$('#caption').hide();
		$('#caption').text(caption).fadeIn('fast');
		$('#caption').fadeIn('slow');
			
		$(".enlarge").removeClass('clicked');
		$(this).addClass('clicked');
		$('#gallery').html('<iframe width="878" height="375" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.au/maps?f=q&amp;hl=en&amp;geocode=&amp;q=3+Sturt+Place,+ST.+IVES,+NSW+2075.&amp;sll=-33.756818,150.782451&amp;sspn=0.04146,0.077248&amp;g=3+Sturt+Place,+ST.+IVES,+NSW+2075.&amp;ie=UTF8&amp;s=AARTsJqftwhAJyVQrDeTKXfIVgZYBe_NNQ&amp;ll=-33.72384,151.166124&amp;spn=0.026771,0.075359&amp;z=14&amp;iwloc=addr&amp;output=embed"></iframe>');
});

//imageLoader();

});

//image loader
/*function imageLoader(){
		  	$('.banner').load(function () {
		      $(this).hide();
		      $('#imgBanner').removeClass('loading').append(this);
		      $(this).fadeIn();
		    });// end load
}*/

