jQuery(document).ready(function () {

	var Style = document.createElement('style');
	jQuery(Style).attr("id", "yaslider-styles");
	Style.type = 'text/css';
	Style.innerHTML = '\
		\n\
		.yaslider-slide {\n\
		\n\
			float:left;\n\
			position:absolute;\n\
			width:100%;\n\
			height:100%;\n\
			z-index:1;\n\
		\n\
		}\n\
		\n\
		.yaslider-controls {\n\
		\n\
			width:100%;\n\
			position:absolute;\n\
			bottom:0;\n\
			height:0px;\n\
			z-index:3;\n\
			-webkit-transition: height 300ms ease, opacity 300ms ease;\n\
			-moz-transition: height 300ms ease, opacity 300ms ease;\n\
			-ms-transition: height 300ms ease, opacity 300ms ease;\n\
			-o-transition: height 300ms ease, opacity 300ms ease;\n\
			transition: height 300ms ease, opacity 300ms ease;\n\
		\n\
		}\n\
		\n\
		.yaslider-controls:hover {\n\
		\n\
			opacity:1;\n\
		\n\
		}\n\
		\n\
		.banner:hover .yaslider-controls {\n\
		\n\
			height:15px;\n\
			overflow:hidden;\n\
		\n\
		}\n\
		\n\
		.yaslider-controls-prev,\n\
		.yaslider-controls-next,\n\
		.yaslider-controls-center {\n\
		\n\
			float:left;\n\
			height:15px;\n\
		\n\
		}\n\
		\n\
		.yaslider-controls-prev,\n\
		.yaslider-controls-next {\n\
		\n\
			width:15px;\n\
			cursor:pointer;\n\
			position:absolute;\n\
		\n\
		}\n\
		\n\
		.yaslider-controls-next {\n\
		\n\
			right:0px;\n\
		\n\
		}\n\
		\n\
		\n\
		.yaslider-controls-center {\n\
		\n\
			right:15px;\n\
			left:15px;\n\
			position:absolute;\n\
		\n\
		}\n\
	';
	
	
	jQuery("head").first().append(Style);
	
});


jQuery.fn.extend({

	yaSlider: function() {

		return this.each(function() {
		

		
			jQuery(this).css("overflow", "hidden");
			jQuery(this).css("position", "relative");
			jQuery(this).css("display", "block");

			jQuery(this).children(".yaslider-slide").each(function () {
			
				if (!jQuery(this).is(jQuery(this).parent().children(".yaslider-slide").first())){
					
					jQuery(this).hide();
				
				}
			
			});	

			var This = jQuery(this);
			
			var Rest_Duration = 2000;
			var Fade_Speed = 500;
			
			var Auto_Changing = true;
			var Controls_Locked = false;
			
			if (This.data("rest-duration") != undefined) {
			
				Rest_Duration = This.data("rest-duration");
			
			}
		
			if (This.data("fade-speed") != undefined) {
			
				Fade_Speed = This.data("fade-speed");
			
			}
		
			function Interval () {		

				if (!Auto_Changing){
					
					return;
				
				}
				
				Go_To_Next_Slide(This);
			
			}	

			var Controls_Center = jQuery(document.createElement("div"));
			var Controls_Lower = jQuery(document.createElement("div"));	

			Controls_Center.addClass("yaslider-controls-text");
			Controls_Lower.addClass("yaslider-controls");	
			
			Controls_Lower.append(Controls_Center);
			
			if (This.data("has-controls") != "no"){
			
				This.append(Controls_Lower);
				
			}
			
			
			
			jQuery("#yaslider-styles").ready(function () {
				
				Fill_Blurb(This);
				
				
				if (This.children(".yaslider-slide").length > 1) {
				
					Controls_Center.addClass("yaslider-controls-center");

					var Controls_Prev = jQuery(document.createElement("div"));
					var Controls_Next = jQuery(document.createElement("div"));
						
					Controls_Next.click(function () {
					
						if (Controls_Locked){
						
							return;
						
						}
					
						Auto_Changing = false;
					
						Go_To_Next_Slide(This);
					
					});

					Controls_Prev.click(function () {
					
						if (Controls_Locked){
						
							return;
						
						}
						
						Auto_Changing = false;
					
						Go_To_Previous_Slide(This);
					
					});			
					
					Controls_Lower.prepend(Controls_Prev);
					Controls_Lower.append(Controls_Next);			
					
					Controls_Prev.addClass("yaslider-controls-prev");		
					Controls_Next.addClass("yaslider-controls-next");			
				
					setTimeout(Interval, Rest_Duration);
				
				}
				
			});
			
			
			function Fill_Blurb (Slider) {
			
				var Blurb_Value = Slider.children(".yaslider-slide:visible").first().data("blurb");
	
				if (Blurb_Value == undefined){
				
					Blurb_Value = "";
					
				}
		
				Slider.find(".yaslider-controls-text").html(Blurb_Value);
			
			}
			
			function Go_To_Next_Slide(Slider) {
			
				Controls_Locked = true;
			
				var Current_Slide = Slider.children(".yaslider-slide:visible");
				var Next_Slide;
				
				if (Current_Slide.next().is(".yaslider-slide")){
					
					Next_Slide = Current_Slide.next();
				
				} else {
					
					Next_Slide = Slider.children(".yaslider-slide").first();
				
				}

				Replace_Slide(Current_Slide, Next_Slide);		

			}
			
			function Go_To_Previous_Slide(Slider) {
			
				Controls_Locked = true;		
			
				var Current_Slide = Slider.children(".yaslider-slide:visible");
				var Previous_Slide;
				
				if (Current_Slide.is(Slider.children(".yaslider-slide").first())){
					
					Previous_Slide = Slider.children(".yaslider-slide").last();
				
				} else {
				
					Previous_Slide = Current_Slide.prev(".yaslider-slide");
				
				}

				Replace_Slide(Current_Slide, Previous_Slide);

			}
			
			function Replace_Slide (First_Slide, Second_Slide) {
				
				First_Slide.css("z-index", "2");
				Second_Slide.css("z-index", "1");
				Second_Slide.show();				
			
				First_Slide.fadeOut(Fade_Speed, function () {
				
						First_Slide.hide();
						Fill_Blurb(Second_Slide.parent());
						
						Controls_Locked = false;
						
						setTimeout(Interval, Rest_Duration);

				
				});
			
			}		

		});
		
	}

});
jQuery(document).ready(function () {


	jQuery("#left-banner").yaSlider();
	jQuery("#center-banner").yaSlider();
	jQuery("#right-banner").yaSlider();

	jQuery("#menu-toggle").click(function () {
	
		if (jQuery("#primary-navigation").hasClass("nav-mobile-hidden")){
		
			jQuery("#primary-navigation").switchClass("nav-mobile-hidden", "nav-mobile-visible", 500);
			
		} else {
		
			jQuery("#primary-navigation").switchClass("nav-mobile-visible", "nav-mobile-hidden", 500);
		
		}
	
	});

});!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAADFBMVEW8vLzAwMDCwsLExMQ9oncCAAAAoklEQVR42u3NMRHDABAEsU2OP+cQSOFKhedFQP2zh3rqlltuueWWW2555/IVy8QysUwsE8vEMrFMLBPLxDKxTCwTy8QysUwsE8vEMrFMLANLA0sDSwNLA0sDSwNLA0sDSwNLA0sDSwNLA0sDSwNLA0sDSwNLH7AklsSSWBJLYkksiSWxJJbEklgSS2JJLIklsSSWxJJYEku33HLLLbfccoteft6oN6LIdwxjAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);

jQuery(document).ready(function () {

	jQuery("img.lazy").lazyload({
	
		effect : "fadeIn"
		
	});

});


jQuery(document).ready(function () {

	jQuery("blockquote.transcript").hide();

	jQuery("div.transcript-box button").click(function () {
	
		jQuery("blockquote.transcript").toggle();
		
		if (jQuery(this).html() == "Show"){
		
			jQuery(this).html("Hide");
			
		} else {
		
			jQuery(this).html("Show");
		
		}
	
	});
	
});jQuery(function ($) {

    var $bgs = $('.book-extratoggle');
    jQuery('.book-extra').click(function () {
        var $target = $($(this).data('target')).stop(true).slideToggle();
        $bgs.not($target).filter(':visible').stop(true, true).slideUp();
    });
	
});

jQuery(document).ready(function () {

	jQuery(".toggle-div-button").click(function () {
	
		Load_Fragment(jQuery(this).attr("href"));
	
	});

	Load_Fragment('undefined');	
	
	function Load_Fragment (Href) {
		
		Hash = window.location.hash;
	
		if (Href != 'undefined') {
		
			Hash = Href;
		
		}
		
	
		jQuery(".toggle-div").hide();
	
		if (Hash != "undefined") {
		
			jQuery(Hash).toggle();
			
		
		}
	
	}

});