// remap jQuery to $
(function($){
		
	$(document).ready(function(){ 
		//http://www.onextrapixel.com/2010/02/23/how-to-use-jquery-to-make-slick-page-transitions/
		//$("#body").css('display', 'none');
		//$("#body").delay(800).fadeIn(1000);
	});
	
	
	// must use (window).load rather than (document).ready, conflict with fancybox
	$(window).load(function() {
	    $('#slideshow').cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			next: '#next',  // id of element to use as click trigger for next slide 
		    prev: '#prev'  // id of element to use as click trigger for previous slide
		});
	});
	
	//keyboard navigation
	//http://www.mail-archive.com/jquery-en@googlegroups.com/msg74442.html
	$(document).keydown(function(e){
		if(e.which == 37){ $('#prev').click();}
		else if(e.which == 39){ $('#next').click();}
		// 32 is spacebar
		// else if(e.which == 32){ $('#slideshow').cycle('pause');}
	});
	// uncomment either of these and use with .alt class in style.css
	// $('tr:odd').css({backgroundColor: '#f8f2e9'});	
	// $('tr:odd').addClass('alt');
	
	$("#employment_application").formToWizard({ submitButton: 'SaveAccount' });
	
	// $('a').each(function() {
	// 	   var a = new RegExp('/' + window.location.host + '/');
	// 	   if(!a.test(this.href)) {
	// 	       $(this).click(function(event) {
	// 	           event.preventDefault();
	// 	           event.stopPropagation();
	// 	           window.open(this.href, '_blank');
	// 	       });
	// 	   }
	// 	});
	
	$(window).load(function(){
		$("a[@href^='http']").attr('target','_blank');
	});
	

})(window.jQuery);
