﻿// Functions specific to a site.

(function($) {
	$(document).ready(function() {
		// Place document manipulation code here
		Cufon.replace('h1, h2, .ctas-header');
		
		if ($('#form-calculator').length != 0) {
			$('#form-calculator').jqTransform({});
		}
		
		// Accordion
		var closedHeight = '35px';
		$('ul#accordion > li').css( 'height', closedHeight).addClass('closed');
		$('ul#accordion > li:last-child').addClass('last-child');
		$('#accordion h3').click( function() {
			if($(this).parent().hasClass('open')) {
				$(this).parent().animate({'height': closedHeight}, 200).removeClass('open').addClass('closed');
			} else if ($(this).parent().hasClass('closed')) {
				//$('.open').animate({height: '22px'}, 200).removeClass('open');
				$(this).parent().css('height', 'auto');
				var accHeight = $(this).parent().css('height');
				$(this).parent().css('height', closedHeight);
				$(this).parent().addClass('open').animate({ height: accHeight}, 200).removeClass('closed');
			}
		});
		
//	Superfish drop-down menus
//		$('.main-nav ul.L1').superfish({
//			delay: 500, // one second delay on mouseout
//			animation: { opacity: 'show' }, // fade-in and slide-down animation
//			speed: 'fast', // faster animation speed
//			autoArrows: false,
//			dropShadows: false
//		}); 		
	}); 
})(jQuery);
