// JavaScript Document

$().ready(function(){
//	levelize(new Array("col_center","col_right"));
	sidenav_fx();
});

function sidenav_fx(){
	$("#sidenav a").each(function(){
		var o_width = $(this).width();
		$(this).mouseover(function(){
			//alert(o_width);
			$(this).stop().animate({width:'105px'},{queue:false, duration:600})
		});	
		$(this).mouseout(function(){
			$(this).stop().animate({width: o_width+'px'},{queue:false, duration:600})
		});						   
	});	
}

function levelize(array){
	var max_height = 0;
	//first get the highest box
	for(i = 0; i < array.length; i++){
		var el_height = $("#"+array[i]).height();
		if(el_height > max_height){
			max_height = el_height;	
		}
	}
	//then apply the highest height to all the boxes
	for(i = 0; i < array.length; i++){
		var el_height = $("#"+array[i]).height();
		if(el_height != max_height){
			var padding_top = $("#"+array[i]).css("padding-top");
			padding_top = padding_top.replace("px","");
			var padding_bottom = $("#"+array[i]).css("padding-bottom");
			alert(padding_bottom);
			padding_bottom = padding_bottom.replace("px","");
			var new_height = max_height - padding_top;		
			new_height -= padding_bottom;
			$("#"+array[i]).css("min-height",new_height);
			$("#"+array[i]).css("height",new_height);
		}
	}
}