(function($) {
	$(document).ready( function() {		

//$("a.fancylink").fancybox({'transitionIn':'elastic','transitionOut':'elastic','speedIn':600,'speedOut':200,'overlayShow':true});
// Toggle function
$(".toggle_container").hide();
$("p.trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
});
$('a.external').click(function(){this.target = '_blank';});
$(".ic_container").capslide({
                    caption_color	: '#fff',
                    caption_bgcolor	: 'transparent',
                    overlay_bgcolor : '#832EA5',
                    border			: '',
                    showcaption	    : false
                });
	
// COMMON (ANYTHINGSLIDER)
	if($('#banner #slides aside.slide').length>0){
		$('#banner .dots ul').remove();	
		$('#banner #slides > aside.slide').show();
		$('#banner #slides').anythingSlider({
			width               : 1454,      //1454// Override the default CSS width
			height              : 400,      // Override the default CSS height
			expand              : false,     // If true, the entire slider will expand to fit the parent element
			resizeContents      : false,      // If true, solitary images/objects in the panel will expand to fit the viewport
			showMultiple        : false,     // Set this value to a number and it will show that many slides at once
			theme               : 'default', // Theme name - adds a class name to the base element "anythingSlider-{theme}" so the loaded theme will work.
			startPanel          : 1,         // This sets the initial panel
			changeBy            : 1,         // Amount to go forward or back when changing panels.
			hashTags            : false,      // Should links change the hashtag in the URL?
			infiniteSlides      : true,      // if false, the slider will not wrap
			enableKeyboard      : false,      // if false, keyboard arrow keys will not work for the current panel.
			buildArrows         : false,      // If true, builds the forwards and backwards buttons
			buildNavigation     : true,      // If true, builds a list of anchor links to link to each panel
			enableNavigation    : true,      // if false, navigation links will still be visible, but not clickable.
			toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
			appendControlsTo    : $('#banner .dots'),      // A HTML element (jQuery Object, selector or HTMLNode) to which the controls will be appended if not null
			enablePlay          : false,      // if false, the play/stop button will still be visible, but not clickable.
			autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
			autoPlayLocked      : false,     // If true, user changing slides will not stop the slideshow
			startStopped        : false,     // If autoPlay is on, this can force it to start stopped
			pauseOnHover        : true,      // If true & the slideshow is active, the slideshow will pause on hover
			stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page. This also stops the rewind effect when infiniteSlides is false.
			playRtl             : false,     // If true, the slideshow will move right-to-left
			delay               : 10000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
			resumeDelay         : 500,     // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
			animationTime       : 800,       // How long the slideshow transition takes (in milliseconds)
			//easing              : "easeOutExpo",   // Anything other than "linear" or "swing" requires the easing plugin
			maxOverallWidth     : 32766,     // Max width (in pixels) of combined sliders (side-to-side); set to 32766 to prevent problems with Opera
			cleartypeNoBg		: true
			//onSlideBegin        : function(event, slider){$('.slide img.cutepng').animate({top:'-300px'}, 1000, "easeOutExpo");}
		});
		$('#banner #slides').anythingSliderFx({
			inFx : {
				'aside.slide div.block_excerpt' : {  opacity: 1, top  : 0, duration: 1600 },
				'aside.slide div.featured_image' : {   right : '0px', duration: 500 }
			},
			outFx : {
				'aside.slide div.block_excerpt' : {  opacity: 0, top  : 0, duration: 500 },
				'aside.slide div.featured_image' : {  opacity: 1, right : '-1231px', duration: 500 }
			}
		});
		$(".previous").click(function(){
			$('#banner #slides').data('AnythingSlider').goBack(true);
			return false;
		});
		$("#banner .next").click(function(){
			$('#banner #slides').data('AnythingSlider').goForward(true);
			return false;
		});
	}
// COMMON (ANYTHINGSLIDER)	




	});
})(jQuery);


