$(document).ready(function(){

	if(window.location.hash) {
		var placeholder = $('#ajax_placeholder');
		placeholder.load('/ajax_content.php?show=' + window.location.hash.substring(1));
		placeholder.fadeIn(1000);
	}

	$('.ajax').click( function(){ 
		var placeholder = $('#ajax_placeholder');
		placeholder.load($(this).attr('href'));
		placeholder.fadeIn(1000);
	});
	
	$('a.close').live('click', function(){ 
		var placeholder = $('#ajax_placeholder');
		placeholder.fadeOut(1000);
	});
	
	
	
	var img_sel = $("#content img");
	var img_ociety = $("#society img");
	$(img_ociety).animate({opacity: '0.4'}, "slow"); 
	
	
	$(img_sel).hover(
	  function () {
		$(this).animate({opacity: '1'}, "slow"); 
	  },
	  function () {
		$(this).animate({opacity: '0.4'}, "slow");
	  }
	);
	
	$(img_ociety).hover(
	  function () {
		$(this).animate({opacity: '1'}, "slow"); 
	  },
	  function () {
		$(this).animate({opacity: '0.4'}, "slow");
	  }
	);
	
	$(img_sel).each(function(i){
		$(img_sel).rand(1).animate({opacity: '1'}, "slow") .end();
		$(img_sel).rand(1).animate({opacity: '0.2'}, "slow") .end();
		$(img_sel).rand(1).animate({opacity: '1'}, "slow") .end();
		$(img_sel).rand(1).animate({opacity: '0.2'}, "slow") .end();
	});
		$(img_sel).animate({opacity: '0.2'}, "slow").delay(800);
	
});
