var J = jQuery.noConflict();
	J(function($) {
		
		$('#Navigation').addClass('js').children(':not(.current,.section)').hover(function() {
			$(this).children().stop().animate({
				marginTop: '6px',
				backgroundColor: '#a10202'
			});
		}, function() {
			$(this).children(':not(.clicked)').stop().animate({
				marginTop: 0,
				backgroundColor: '#c63'
			});
		}).click(function() {
			var $this = $(this);
			$this.children().addClass('clicked').stop().animate({
				marginTop: '6px',
				backgroundColor: '#a10202'
			}).parent().siblings().children('.clicked').animate({
				marginTop: 0,
				backgroundColor: '#c63'
			}).removeClass('clicked');
			$('#Navigation .current,#Navigation .section').children().animate({
				marginTop: 0,
				backgroundColor: '#c63'
			}).removeClass('current').removeClass('section');
			window.location = $this.children('a').attr('href');
		});
		
		if ($('#HomePage').length) {
			
			$('#Logo').pngFix();
			
			$('#Photos').galleryView({
				panel_width: 960,
				panel_height: 300,
				transition_speed: 1500,
				transition_interval: 5000,
				nav_theme: 'dark',
				border: 'none',
				pause_on_hover: true,
				show_filmstrip: false
			});
			
			$('#NextRetreats ul').addClass('js').children().each(function(index) {
				if ($.browser.msie && $.browser.version == '6.0') {
					//index counts from 0
					if (index > 3) {
						$(this).remove();
					}
				}
				else {
					return false;
				}
			}).hover(function() {
				$(this).children('.location').stop().animate({
					backgroundColor: '#a10202'
				});
			},
			function() {
				$(this).children('.location').stop().animate({
					backgroundColor: '#c63'
				});
			}).click(function() {
				document.location = $(this).children('a').attr('href');
			});
			
		}
		
		if ($('#RetreatListing').length) {
			
			$('#Retreats').addClass('js').children().hover(function() {
				$(this).children('.location').stop().animate({
					backgroundColor: '#a10202'
				});
			},
			function() {
				$(this).children('.location').stop().animate({
					backgroundColor: '#c63'
				})
			}).click(function() {
				window.location = $(this).children('a:first').attr('href');
			});
			
		}
		
		if ($('#RetreatPage').length) {
			$('.retreatGallery a').prettyPhoto({
				theme: 'facebook'
			});
		}
		
	});