/*********************************************************************************************************************************/
/* DOCUMENT READY CALLS **********************************************************************************************************/
/*********************************************************************************************************************************/

$(document).ready(function(){
	
	/* EXTERNAL LINKS start ***********************************************************/
	$('a[rel="external"]').click(function(){
		this.target = "_blank";
	});
	/* EXTERNAL LINKS end *************************************************************/
	
	$('html').addClass('js');
	
	$('#facebook').prepend('<fb:fan profile_id="139436232467" stream="1" connections="0" logobar="0" width="220" height="310"></fb:fan><script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US"></script><script type="text/javascript">FB.init("3de81a45bd2750bc1daf1b8226336e40");</script>');
	
	/*SEARCH start ********************************************************************/
	$('#search input[type="text"]').val('Search');
	$('#search input[type="text"]').focus(function(){ if(this.value=='Search') { $(this).val('');} });
	$('#search input[type="text"]').blur(function(){ if(this.value =='') { $(this).val('Search');} });
	/*SEARCH end **********************************************************************/	
	
	/* NAVIGATION start ***************************************************************/
	$('#nav ul > li,#nav-top ul > li').hover(function() { $('ul:first', this).show(); $('a:first',this).addClass('hover'); },function() {$('ul:first', this).hide(); $('a:first',this).removeClass('hover'); });
	
	/* SCROLLERS start*/
	if($("#home").length >0) { 
		$("#intro .c").jScrollPane({showArrows:true,scrollbarWidth : 25});
		//$("#events dl").jScrollPane({showArrows:true,scrollbarWidth : 25});
		$("#news-blog dl").jScrollPane({showArrows:true,scrollbarWidth : 25});
		
		
		$("#events .display").jCarouselLite({
			btnNext:'.next',
			btnPrev:'.prev',
			auto:true,
			vertical: true,
			speed:2500,
			circular:true,
			visible:2,
			scroll:1
		});
		
		var liftoffTime = new Date();
		liftoffTime = new Date(liftoffTime.getFullYear() + 1, 1-6,11,14,00,00,00);
		
		$('#countdown .display').countdown({until: liftoffTime, format: 'dHM', 
    										layout: '<dl>{d<}<dt class="m">{dl}</dt> <dd class="days">{dn}</dd>{d>} {h<}<dt class="m">{hl}</dt> <dd class="hours">{hn}</dd>{h>} {m<}<dt class="m">{ml}</dt> <dd class="minutes">{mn}</dd>{m>}</dl>'
		});		
	}
	/* SCROLLERS end*/
	
	if($("#internal").length >0) {
		Cufon.replace('#main > h1');
	}
		
}); //close document.ready

/*********************************************************************************************************************************/
/* DOCUMENT READY FUNCTIONS ******************************************************************************************************/
/*********************************************************************************************************************************/
