Cufon.replace('#content h1, .info h2, .management th b', { fontFamily: 'DistrictThin' });
Cufon.replace('#menu a', { fontFamily: 'Bell Gothic Std', fontSize: '17px' });


$(function(){
	
	$("#menu li").not(".selected").hoverIntent(
		function(){
			$(this).find('img').animate({
				top: 0 
			}, 900, 'easeOutElastic')
			.parent().find('a').css('color','white');
			Cufon.refresh();
		},
		function(){
			$(this).find('img').animate({
				top: '-69'
			}, 200)
			.parent().find('a').css('color','black');
			Cufon.refresh();
		}
	).click(function(){
		var href = $(this).find('a').attr('href');
		window.location = href;
	});
	
	$(".submenu li").not(".selected").hover(
		function(){
			$(this).find('img').show().parent().find('a').css('color','white');
		},
		function(){
			$(this).find('img').hide().parent().find('a').css('color','black');;
		}
	);
	
	$("a.fancybox").fancybox({
		transitionIn: 'elastic'
	});
	
	$(".accordion").accordion({
		collapsible: true,
		active: false
	});
	
	$("#applications button.viewmore").button({
		icons: {
			primary: "ui-icon-triangle-1-e"
		},
		text: false,
		label: "View More Info"
	}).click(function(){
		$("#applications .hidden").toggle('slide');
		$(this).toggleClass('clicked');
		if ($(this).hasClass('clicked')) {
			$(this).button( "option", "icons", {primary:'ui-icon-triangle-1-w'} );
			$(this).button( "option", "label", "View Less Info" );
		} else {
			$(this).button( "option", "icons", {primary:'ui-icon-triangle-1-e'} );
			$(this).button( "option", "label", "View More Info" );
		}
	});
	
	$("#products button.viewmore").button({
		icons: {
			primary: "ui-icon-triangle-1-s"
		},
		text: false,
		label: "View More"
	}).click(function(){
		$("#products .hidden").toggle('blind');
		$(this).toggleClass('clicked');
		if ($(this).hasClass('clicked')) {
			$(this).button( "option", "icons", {primary:'ui-icon-triangle-1-n'} );
			$(this).button( "option", "label", "View Less" );
		} else {
			$(this).button( "option", "icons", {primary:'ui-icon-triangle-1-s'} );
			$(this).button( "option", "label", "View More" );
		}
	});
	
	$("input:submit").button();
	
	$("a.youtube").fancybox({
		'padding'		: 0,
		'transitionIn'	: 'elastic',
		'type'			: 'iframe',
		'title'			: this.title,
		'width'			: 800,
		'height'		: 480
	});
	
	$("#signupForm").validate({
		submitHandler: function(form){
			$(form).ajaxSubmit({
				target: "#result"
			});
		}
	});
	
	$("#resendForm").ajaxForm({
		target: "#result"
	});
	
});

