// JavaScript Document

$(document).ready(function() {
	
	$("a[rel='modal']").colorbox();
	$( ".filter_btn" ).button();
	
    $("#commentForm").validate();
	
	
	$("#tabs").tabs();
	$( "#accordion" ).accordion({
		autoHeight: false,
		navigation: true,
		active: false,
		collapsible: true

		});
	$('.slideshow').cycle({
		random: 0,
		timeout: 10000,
		fx: 'scrollHorz',
		next: '.next', 
    	prev: '.prev',
		after: onAfter
		});
});

function onAfter(curr, next, opts) {
    var index = opts.currSlide;
    $('.prev')[index == 0 ? 'hide' : 'show']();
    $('.next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}

