$(document).ready(function(){ 
	
	// Un-hides items to be hidden unless javascript is enabled
	$('.nojs-hide').show();
	
	// Provides a smooth scroll to internal anchor links
	$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' +  this.hash.slice(1) + ']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
    }}});
	});
	
	
	// Enables accessibility mode if the user uses the keyboard tab key
  $("body, input, textarea").keypress(function(e){
		if((e.keyCode ? e.keyCode : e.which) == 9 && 
				!$('body').hasClass('accessibility')) { //Tab keycode
				
			$('body').addClass('accessibility'); }
  });

	// Disabled accessibility mode if the user switches to the mouse
	$("body, input, textarea").click(function(e){
		if($('body').hasClass('accessibility')) { $('body').removeClass('accessibility'); }
	});
	
	// Load the homepage image slider
	$('#slider').coinslider({ width:580, height:245, navigation:false, delay:7000 });
});