$(document).ready(function() {

	$("#header ul li").hover(
	   function () {
	     $(this).addClass('hover');
	   }, 
	   function () {
	     $(this).removeClass('hover');
	   }
	);
		
	// scrollpanes
	$('div.scroll').jScrollPane({verticalGutter:10, horizontalGutter: 10});


	// accordian on events page
	// set active item
	var curEvent = $('li.selected');	
	$('#events').accordion({ header: 'a.header', active: false,  collapsible: true, autoHeight: false, active: $('#events li').index(curEvent)});

	// homepage slideshows
	if($('body').hasClass('home')) {
		$('#home-mixes').cycle({fx:'fade', timeout: 2500});
		$('#home-events').cycle({fx:'fade', timeout: 2500, delay:1250});			
		$('#feature div.pad').cycle({fx:'uncover', timeout: 5000, pager:  '#nav'});		
	}

	// search box default text
	$('#s').focus(function () {
		if ($(this).val() == $(this).attr("title")) {
			$(this).val("");
		}
	}).blur(function () {
		if ($(this).val() == "") {
			$(this).val($(this).attr("title"));
		}
	});
	
	// focus the form box on hover
	$('#header li.search').hover(
		function() {
	  		$('#s').focus();
		},
		function() {
	  		$('#s').blur();		
		}
	);	
	
	// ajax calendar
	$('a#next,a#prev').live('click', function() {		
  		$('#calendar_wrap').load($(this).attr('href') + ' #calendar_wrap', function() {
  			// complete
		});
		return false;
	});
	
	// corners for ie
	//$('div.small-corners').corner("bottom 10px");
	//$('ul.large li').corner("bottom 20px");	
	

	
});

