$(document).ready(function(){
//ID NOOB SCRIPTING XB

	// SMOOTHSCROLL TO #DIV
	$("a[href^=#][href!=#]").live('click',function(e){
		$('html,body').animate({'scrollTop': $($(this).attr('href')).offset().top+'px'}); 
		e.preventDefault();
	});
	
	
	/** 
	 * @projectDescription	Simple Equal Columns
	 * @author 	Matt Hobbs
	 * @version 	0.01 
	 */
	jQuery.fn.equalCols = function(){
		//Array Sorter
		var sortNumber = function(a,b){return b - a;};
		var heights = [];
		//Push each height into an array
		jQuery(this).each(function(){
			heights.push(jQuery(this).height());
		});
		heights.sort(sortNumber);
		var maxHeight = heights[0];
		return this.each(function(){
			//Set each column to the max height
			jQuery(this).css({'height': maxHeight});
		});
	};
	//Usage
	//Select the columns that need to be equal e.g
	jQuery('.equal').equalCols();
	
	
	
	
	     // declare a few constants:
	     var SMALL = 14; //small font size in pixels
	     var LARGE = 16; //larger size in pixels
	     var COOKIE_NAME = "Simple-Fontresizer"; //Maybe give this the name of your site.

	     //make it small by default
	     var fontsize = LARGE; 

	     // Only show text resizing links if JS is enabled
	     $(".fontresize").show();

	     // if cookie exists set font size to saved value, otherwise create cookie
	     if($.cookie(COOKIE_NAME)) {
		     fontsize = $.cookie(COOKIE_NAME);
		     //set initial font size for this page view:
		     $("body").css("font-size", fontsize + "px");
		     //set up appropriate class on font resize link:
		     if(fontsize == SMALL) { $("#small").addClass("current"); }
		     else { $("#large").addClass("current"); }
	     } else {
		     $("#small").addClass("current");
		     $.cookie(COOKIE_NAME, fontsize);
	     }

	     // large font-size link:
	     $("#large").bind("click", function() {
			     if(fontsize == SMALL) {
			     fontsize = LARGE;
			     $("body").css("font-size", fontsize + "px");
			     $("#large").toggleClass("current");
			     $("#small").toggleClass("current");
			     $.cookie(COOKIE_NAME, fontsize);
			     }
			     return false;	
			     });
	     
	     // small font-size link:
	     $("#small").bind("click", function() {
			     if(fontsize == LARGE) {
			     fontsize = SMALL;
			     $("body").css("font-size", fontsize + "px");
			     $("#large").toggleClass("current");
			     $("#small").toggleClass("current");
			     $.cookie(COOKIE_NAME, fontsize);
			     }
			     return false;	
			     });
	
	
	
	
});

