/*********************************************************************************************************************************/
/* DOCUMENT READY CALLS **********************************************************************************************************/
/*********************************************************************************************************************************/
$(document).ready(function(){
	
	/* EXTERNAL LINKS start ***********************************************************/
	$('a[rel="external"]').click(function(){
		this.target = "_blank";
	});
	/* EXTERNAL LINKS end *************************************************************/
	
	$('html').addClass('js');

	/* SLIDESHOW start ***************************************************************/
	
	var selector = '#slideshow li';
	var fade_speed = 1000;
	var slideshow = setInterval( "slideSwitch('"+selector+"',"+fade_speed+",'Next')", 5000 );
	
	/* SLIDESHOW end *****************************************************************/
	if($('#gallery').length){
		$('#gallery li a').lightBox();
	}
}); //close document.ready

/*********************************************************************************************************************************/
/* DOCUMENT READY FUNCTIONS ******************************************************************************************************/
/*********************************************************************************************************************************/
//if($('#internal').length){Cufon.replace('#page-title');}

/* SLIDESHOW function start *********************************************************/
function slideSwitch(s,o,d){var $a=$(s+'.active');if($a.length==0)$a=$(s+':first');if(d=='Next'||d==null){var $n=$a.next().length?$a.next():$(s+':first');}else if(d=='Previous'){var $n=$a.prev().length?$a.prev():$(s+':last');}$a.addClass('last-active');$n.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0},o,function(){$a.removeClass('active last-active');});}
/* SLIDESHOW function end ***********************************************************/
