$(document).ready(function() {
	Cufon.replace('p.digits', { fontFamily: 'GothamBook' });
	Cufon.replace('p.digits strong', { fontFamily: 'GothamBold' });
	Cufon.replace('h2', { fontFamily: 'GothamBlack' });
	Cufon.replace('h3', { fontFamily: 'GothamBlack' });

	$('h1.logo').click(function(){
		$('li.active').fadeOut('slow', function(){$('li.active').removeClass('active');
			$('li.welcome').addClass('active');
		});
		return false;
	});

	$('button.getStarted').click(function(){
		$('li.active').fadeOut('slow', function(){$('li.active').removeClass('active');
			$('li.signup').addClass('active');

			// carousel must be initialized here or it breaks
			$(".carousel").jCarouselLite({
				visible: 1,
				circular: false,
				speed: 600,
				btnNext: ".next",
				btnPrev: ".prev"
			});
		});
		return false;
	});

	$('a.btnLiveChat').click(function(){
		return false;
	});

	$('a.btnHowItWorks').click(function(){
		$('li.active').fadeOut('slow', function(){$('li.active').removeClass('active');
			$('li.howItWorks').addClass('active');
		});
		return false;
	});

	$('a.btnContactus').click(function(){
		$('li.active').fadeOut('slow', function(){$('li.active').removeClass('active');
			$('li.contactUs').addClass('active');
		});
		return false;
	});

	$('a.btnPartnerLogin').click(function(){
		/*
		$('li.active').fadeOut('slow', function(){$('li.active').removeClass('active');
			$('li.partnerLogin').addClass('active');
		});
		*/
		return false;
	});


	var opt_createAccount = {
		url: "createAccount.php",
		type: "POST",
		success: function(){alert("Thank you!\n\nYour information has been received. A Davinci Tel representative will contact you soon.")}
	};
	$("#createAccount").ajaxForm(opt_createAccount);

	var opt_contactForm = {
		url: "contactForm.php",
		type: "POST",
		success: function(){alert("Thank you!\n\nYour message has been received. A Davinci Tel representative will contact you soon.")}
	};
	$("#contactForm").ajaxForm(opt_contactForm);

	var opt_login = {
		url: "login.php",
		type: "POST",
		success: function(){alert("success!")}
	};
	$("#login").ajaxForm(opt_login);
});

