$('#slider').anythingSlider({
  buildArrows         : true,       // If true, builds the forwards and backwards buttons
  forwardText         : "&rsaquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
  backText            : "&lsaquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
  buildNavigation     : false,      // If true, builds a list of anchor links to link to each panel
  enableNavigation    : false,      // if false, navigation links will still be visible, but not clickable.
  delay               : 9000,       // How long between slideshow transitions in AutoPlay mode (in milliseconds)
  resumeDelay         : 10000,      // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
  animationTime       : 900         // How long the slideshow transition takes (in milliseconds)
});
/*.anythingSliderFx({
  '.panel' : [ 'fade', 2000, 'easeOutCirc' ] // target the entire panel and fade will take 1000ms
 });
*/

$("#accordion")
	.find('.accordion-wrap > h3')
	.click(function() {    
		$('div.accordion-wrap').find('div').slideUp('slow');    
		$(this).next().stop().slideToggle('slow');    
		return false;  
	})
	.next()
	.hide();  
	

if ( !$('body').hasClass('home') ) {
	
$('#menu-main-nav a').each(function(i) {
	var $this    = $(this);
	var rel      = $this.attr('rel');
	var $subPage = $('#left-sidebar .current_page_item a');
	var isFound  = new Array();
	
	
	isFound[i]    = $subPage.attr('href').search(rel)

		
	if ( isFound[i] != -1 ) {
		$(this).parent().addClass('eci_current');
	}
	
});

}


var eci_more_less = function(elem) {
	
	$('.'+elem).each(function() {
		
		var $this = $(this);
		
		$('&nbsp;<a class="more-button" href>more &darr;</a>').appendTo($this.prev());
		$this.hide();
		
	});
	
	$('.more-button').click(function() {
		
		var $this = $(this),
		    $text = $(this).parent().next('.more-block');
		
		if ( !$text.is(':visible') ) {
			$text.slideDown('slow', function() {
				$this.html('less &uarr;');
			}); 
		} else {	
			$text.slideUp('slow', function() {
				$this.html('more &darr;')
			});
		}
		
		return false;
		
	});
	
}
eci_more_less('more-block');




$('.cal-accordion').click(function() {

	var $this = $(this);
	var $next = $(this).parent().next('div');
	
	if ( $next.is(':visible') ) {
		$next.slideUp('slow');
	} else {
		$next.slideDown('slow');
	}

});













