// JavaScript Document//
Cufon.replace('span.homehead', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('#quickBlurb h2', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('#pithyList', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('h3', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('#theTweet', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('#contact label', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('#pithyComments li', {hover: true, fontFamily: 'Avenir LT Std' });
Cufon.replace('#errorNav li', {hover: true, fontFamily: 'Avenir LT Std' });

$('#homeslide').cycle({ 
	fx:     'scrollLeft', 
	speed:  700, 
	timeout: 8000,
	pager:  '#rotatingNavigation',
	before:	onBefore, 
    after:   onAfter 
});
$('#portfolio #pithyComments ul').cycle({
	height: '308px',
	width: '100%',
	fx: 'fade',
	speed: 1000,
	timeout: 7000
});
$('#portWrapper').cycle({ 
	height: '500px',
	width: '615px',
	fx:     'scrollUp', 
	speed:  1000, 
	timeout: 0,
	next: '#seeMoar'
});
function onBefore() {
	$('.clientTitleFade').fadeOut("slow");
}
function onAfter(){
	$('.clientTitleFade').fadeIn("slow");
	$('.clientTitleFade').html(this.title);
}
function MaxLength(input, limit, pithyInfo) {
	var length = input.value.length;
	if(length > limit) {
		$('#' + pithyInfo).html('Please, keep it pithy!');
		input.value = input.value.substr(0,limit);
    }
	else $('#' + pithyInfo).html('('+ (limit - length) +' ' + 'char remaining)');
} 