/* GENERAL FUNCTIONS
-----------------------------------------------------*/
(function($) {	
	function _setupNewsletterSignup() {		
		var oInput = $('.foot-column #subscribe-form').find('input');
		var sTitle = "Enter Your E-mail Address";
		if(!oInput) return;
		
		$(oInput).focus(function() { if(this.value == sTitle) this.value=""; $(this).select(); });
		$(oInput).blur(function() {	if (!this.value.length) { this.value = sTitle; } }); 
	};
	
	function _setupBoxHovers() {
		$(".boxes").not(".no-rollover").find(".box").each(function() {
			$(this).css({ overflow:"hidden" }).hover(_boxOverHandler, _boxOutHandler);
			$("<div class='viewOverlay'></div>").appendTo(this).css({ top:165, opacity:1 }).show();
		});
	};
	
	function _boxOverHandler() {
		$(this).addClass("hover").find(".viewOverlay").stop().animate({ top:0 }, 300);
	};
	
	function _boxOutHandler() {
		$(this).removeClass("hover").find(".viewOverlay").stop().animate({ top:165 }, 300);
	};
 	
	$(document).ready(function() {
		_setupNewsletterSignup();
		_setupBoxHovers();
	
		$("a[href^='http://'],a[href$='.doc'],a[href$='.pdf']").attr("target", "_blank");	// EXTERNAL LINKS IN NEW WINDOW
		$("ul.nav").find("li").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); });		
	});
})(jQuery);
