/**
 * lh.js
 * @author Lewis Howles
 *
 * Default Niceties.
 */

var lh = {
	
	/*
	 * Set default text for inputs (title attribute)
	 */
	setInputTexts : function(){
	   $("input[type=text], textarea").each(
		   function(){
			   $(this).val($(this).attr('title'));
		   }
	   );
	},
   
	/*
	 * Show / hide text from inputs
	 */
	inputText : function(){
		$("input, textarea").focus(function(event){
			if($(this).val() === $(this).attr('title'))
				$(this).val("");
		}).blur(function(event){
			if($(this).val() === "")
				$(this).val($(this).attr('title'));
		});
	},
   
	/*
	 * Set target blank on external links
	 */
	externalLinks : function(){
		$('a[rel="external"]')
			.attr('target', '_blank')
	}
}

$(function() {	
	lh.setInputTexts();
	lh.inputText();
	lh.externalLinks();
	
	if ($('h1').text() == "Search Results") {
		getValues();
	}
	
	$('#banner').innerfade({
		speed: 1000,
		timeout: 6000,
		containerheight: '208px'
	});
});
