/**
 * lh.js
 * @author Lewis Howles
 *
 * Default Niceties.
 */

var lh = {
	
	/*
	 * Set default text for inputs (title attribute)
	 */
	setInputTexts : function(){
	   $("input[type=text], textarea").each(
		   function(){
			   if($(this).attr("value")==""){$(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.externalLinks();

	$('a.iframe').fancybox({
		'width' : '60%',
		'height' : '60%',
		'autoScale' : false,
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'type' : 'iframe'
	});
})
