$(function() {

/* --- EQUAL HEIGH COLUMNS --------------------------------------------- */

	var lCol = $('#left_content');
	var rCol = $('#right_content');
	var lColHeight = lCol.height();
	var rColHeight = rCol.height();

	if(lColHeight > rColHeight) {
		rCol.css('height',lColHeight);
	} else if(lColHeight < rColHeight) {
		lCol.css('height',rColHeight);
	}


/* --- LIGHTBOX OVERLAY ------------------------------------------------ */

	$("a[rel^=prettyPhoto]").prettyPhoto({theme:'facebook'});

/* --- IMAGE GALLERY --------------------------------------------------- */



/*
//Create the scrollable gallery
$(".gallery_wrapper").scrollable({
	items: '.slide_container',
	next: '#next',
	prev: '#prev',
	circular: true,
	keyboard: 'static'
})
.autoscroll({interval: 3000});

//Vertically center images if they're taller than the available space
$('.gallery_wrapper .slide img').each(function(){
	var imgHeight = $(this).height();
	var parentHeight = $(this).parent().height();
	if(imgHeight > parentHeight){
		$(this).css('top', (parentHeight - $(this).height())/2);
	}
});

//Handle Next/Prev button states
$('#prev, #next').fadeTo('slow','0');
	
$('#prev')
	.bind('mouseenter', function(){
		$(this).fadeTo('fast','1')
	})
	.bind('mouseleave', function(){
		$(this).fadeTo('fast','0')
	});
	
$('#next')
	.bind('mouseenter', function(){
		$(this).fadeTo('fast','1')
	})
	.bind('mouseleave', function(){
		$(this).fadeTo('fast','0')
	});
*/


/* --- ANIMATE LINKS --------------------------------------------------- */
	
	$('.link a').each(function() {
		
		var icon = $(this).children('.icon');
		var text = $(this).children('.text');
				
		$(this).hover(
		  function () {
		    icon.animate({'margin-left' : '5px'}, 'fast','linear' );
		    text.animate({'margin-left' : '5px'}, 'fast','linear' );
		  }, 
		  function () {
		    icon.animate({'margin-left' : '0px'}, 'fast','linear' );
		    text.animate({'margin-left' : '0px'}, 'fast','linear' );
		  }
		);
		
	});

/* --- ANIMATE FRIENDS ------------------------------------------------ */
	
	$('.friend').each(function() {
		
		var pic = $(this);
		
		$(this).hover(
			function () {
				pic.fadeTo('fast','0.5');
			}, 
			function () {
				pic.fadeTo('fast','1');
			}
		);
		
	});
	
/* --- ANIMATE PROFILE PIC/ANIMATE FRIENDS ----------------------------- */

	$('.profile_pic, .friend').each(function() {
		
		var pic = $(this);
		
		$(this).hover(
			function () {
				pic.fadeTo('fast','0.5');
			}, 
			function () {
				pic.fadeTo('fast','1');
			}
		);
		
	});


/* --------------------------------------------------------------------- */

});

$(document).ready(function(e){

	if (console && console.log) console.log('setting up nivo slider', $('#slider'));
	$('#slider').nivoSlider({effect:'fade', controlNav:false});

});
	
