$(document).ready(function(){

	//Home Slideshow
	$('#slideshow').cycle({ 
	    fx:      'fade',
		pause:    1, 
	    speed:    1200, 
	    timeout:  8000 
	});
	
	//Stripe Pricing Table
	$('.pricing td:odd').not('.heading, .benefit').addClass('alt');

	//FAQs
	$('dl.faq dd').hide().prepend('<strong>A:</strong> ');
	$('dl.faq dt').wrapInner('<a href="#" onclick="return false;"></a>').prepend('<strong>Q:</strong> ');
	$('dl.faq dt').click(function () {
		$(this).next('dd').slideToggle("fast", "easeInOutQuad");
	});
	
	//Calendar Tooltip
	$(".cal-cell a").jHelperTip({
		ttC: "#cal-tip",
		trigger: "hover",
		source: "ajax",
		type: "GET",
		loadingImg: '/images/site/ajax-loader.gif',
		autoClose: true,
		attrName: "rel"
	});
	
	//FORMS
	
	//Hide other options divs
	$('#other-type, #form-errors, #other').hide();
		
	$('#event_group_type').change(function(){
		var selected = $(this).find('option:selected').attr('value');
		if( selected == 'other' ){
			$('#other-type').show(500);
		}
		else{
			$('#other-type').hide(500);
		}
		return false;
	});
	
	// book-it validation
	$("#book-it").RSV({
		displayType: "display-html",
		errorTextIntro: "<h3>Please fix the following errors.</h3>",
		errorFieldClass: "error",
		errorHTMLItemBullet: "&ordm; ",
		errorTargetElementId: "form-errors",
		rules: [
			"required,name,Please enter your first and last name.",
			"required,email,Please enter your email address.",
			"required,phone,Please enter a phone number.",
			"valid_email,email,Please enter a valid email address."
		]
  	});

	//EFT other field...probably could be combined w/other one...function?
	$('#eft_why_cancel').change(function(){
		var selected = $(this).find('option:selected').attr('value');
		if( selected == 'Other' ){
			$('#other').show(500);
		}
		else{
			$('#other').hide(500);
		}
		return false;
	});
	
	// EFT cancelatioon validation
	$("#cancel-eft").RSV({
		displayType: "display-html",
		errorTextIntro: "<h3>Please fix the following errors.</h3>",
		errorFieldClass: "error",
		errorHTMLItemBullet: "&ordm; ",
		errorTargetElementId: "form-errors",
		rules: [
			"required,name,Please enter your first and last name.",
			"required,email,Please enter your email address.",
			"valid_email,email,Please enter a valid email address."
		]
  	});
	
	//Clear Form Fields
	$('#enews-signup :text').focus(function() {
		// See if the input field is the default
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
		}
	})
	.blur(function() {
		if ($(this).val() == '') {
			$(this).val($(this).attr('title'));
		}
	});
	
});//end document.ready