$(document).ready(function() {

	// Initializes Cycle.js for home features
	$('#home .features .slides').cycle({ 
	    fx:     'fade', 
	    speed:  500, 
	    timeout: 7000,
	    pager: '#home .features .pager'
	});
		
	$('#home .testimonials .slides').cycle({ 
	    fx:     'fade', 
	    speed:  500, 
	    timeout: 7000
	});

	// Sticky sidebar for secondary pages
	$(window).scroll(function() {
		var y = $(this).scrollTop();
		if (y > 240) {
			$('.page_navigation, .secondary_header, .page_content').addClass('fixed');
		} else if (y < 240) {
			$('.page_navigation, .secondary_header, .page_content').removeClass('fixed');
		}
	});
	
	// Initializes localScroll & scrollTo for secondary pages' sidebar
	$('.page_navigation, #site_navigation').localScroll({
		queue: false,
		duration: 500,
		offset: {top: -100}
	});
	
	// Zebra striping
	$('ul.dl_list').each(function() {
		$(this)
			.children('li:even')
			.addClass('even');
	});
	
	// Site Container Height Resizing
	$(function() {
	    $(window).bind('resize', function() {
			$('#site_container').css(($.browser.msie && $.browser.version < 7 ? '' : 'min-') + 'height', $(window).height() + 'px');
	    }).trigger('resize');
	});			
});
