$(document).ready(function(){
	// Home Page Slide Show
	$('#slideshow').cycle({ timeout: 5000, fx: 'fade', pager: '#pager', pause: 0, pauseOnPagerHover: 0 });
	ddsmoothmenu.init({ mainmenuid: "nav", orientation: "h", classname: "ddsmoothmenu", contentsource: "markup" });
	// FAQs
	heightArray = new Array();
	$("dl.faqs dd").each(function(i) {
	  theHeight = $(this).height();
	  heightArray[i] = theHeight;
	});
	$("dl.faqs dd").hide();
	$("dl.faqs dt").live('click', function () {
		$(this).next("dd").css({height: heightArray[$("dl.faqs dt").index(this)]});
		$(this).next("dd").animate({height: 'toggle', opacity: 'toggle'}, "fast", "easein");
	});
	$('#options a.expand').live('click', function() {
		$('dl.faqs dd').slideDown({opacity: 1}, "fast");
		return false;
	});
	$('#options a.collapse').live('click', function() {
		$('dl.faqs dd').slideUp({opacity: 0}, "fast");
		return false;
	});
	// Lightbox Images
	$('.img_box a').lightBox();
	// Change Height of side bare
	if ($("#sidebar").height() < $("#inner_content").height()) $("#sidebar").height($("#inner_content").height());
	// Image Gallery
	$('#imageGallery').cycle({
			fx: 'scrollHorz',
			easing: 'backinout',
			timeout: 0,
			pager:  '.navImageGallery',
			cleartypeNoBg:  true,
			pagerAnchorBuilder: function(idx, slide) {
			return '.navImageGallery li:eq(' + (idx) + ') a';
		}
	});
$(".tablesorter").tablesorter({sortList:[[0,0]], widgets: ['zebra']});
	// Seek Attention
	$('.attention').seekAttention({ paddingTop: 0, paddingBottom: 0, paddingLeft: 10, paddingRight: 10 });
	// Form Functions
	$("form")
		.attr("autocomplete", "off")
		.submit(function() { return false; });
	$("input[type=text], input[type=password]")
		.focus(function() { $(this).parent().addClass("curFocus"); })
		.blur(function() { $(this).parent().removeClass("curFocus"); });
	$("textarea")
		.focus(function() { $(this).parent().addClass("curFocus"); })
		.blur(function() { $(this).parent().removeClass("curFocus"); });
	$("select")
		.focus(function() { $(this).parent().addClass("curFocus"); })
		.blur(function() { $(this).parent().removeClass("curFocus"); });
	$(".integer").keypress(function (e){
		if ( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)) {
			return false;
		}
	});
	$("#submitComments").live('click', function() { alert("Sorry, this form is unavailable at this time."); });
	$("#registration").live('click', function() {
		alert("Registrations have closed for 2010. Please contact the registrar for more information.");
		//return false;
	});
	$("#stopWeather").live('click', function() {
		var today = new Date();
		today.setTime( today.getTime() );
		var expires = 1000 * 60 * 60 * 24 ;
		var expires_date = new Date( today.getTime() + (expires) );
		document.cookie = 'noWeather=true,expires=' + expires_date.toGMTString();
		alert('The weather will not display in future.');
		return false;
	});
});