/* -----------------------------------------------
BASE
----------------------------------------------- */
function init() {
	document.body.className += " loading js";
	Cufon.replace('#Header p, #Navigation li, #Intro p, h1, .h1, h2, .h2, h3, .h3, div#Footer div.item-1 li', {hover: true
	});
};

var Body = null;
$(function() {
	Body = $(document.body);
	Setup.init();
	Search.init()
});

/*	Setup
----------------------------------------------- */

var Setup = {	
	Body: null,
	init: function() {
		var cc = this;
		Body.addClass('jsReady');
		Body.removeClass('loading');
		
		// equal cols
		$('div.equal, div#Footer div.cols').each(function() {
			var items = $(this).find('div.item');
			equalHeight(items);
		});
		
		// utility classes
		$("ul li:first-child").addClass("first");
		$("ul li:last-child").addClass("last");
	}
};

var Search = {
	Input: null,
	Default: null,
	init: function() {
		var cc = this;
		cc.Input = $('#keywords');
		cc.Default = cc.Input.val();
		cc.Input.focus(function(){
			if($(this).val()==cc.Default) {
				$(this).val('');
			}
		});
		cc.Input.blur(function(){
			if($(this).val()=="") {
				$(this).val(cc.Default);
			}
		});
	}
}

/*	Sections
----------------------------------------------- */


/*	Functions
----------------------------------------------- */

function equalHeight(group) {
	tallest = 0;
    group.each(function() {
        thisHeight = $(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}

