$(document).ready(function(){

    // 
	// Form elements focus/blur ***************************** 
	$('input[type=text], textarea, input[type=password]').focus(function(){
		if(this.value==this.defaultValue)this.value='';
        $(this).css("color","#fff");
	});
	$('input[type=text], textarea, input[type=password]').blur(function(){
		if(this.value=='')this.value=this.defaultValue;
        $(this).css("color","#fff");
	});
	
	//
	// Custom file upload field  ***************************** 
	$('input[type=file]').change(function(e){
	  $in=$(this);
	  $in.prev().html($in.val());
	});
	
	// 
	// Homepage image slider ***************************** 
	$('.homeHeader').cycle({
		fx:    'fade',
		speed:  3000
	});
	
	//
	// Client Login Trigger  ***************************** 
	$('a.clientLoginTrigger').click(function(){
		$(this).next().toggle();
		return false
		}
	);
	
	// 
	// Project List Effects  ***************************** 
	$('ul.projectsList li a').hover(
		function() {
			$(this).children('span').animate({
				bottom: '-60px'
			  }, 300);
			$(this).children('img').css('top','0');
		},
		function() {
			$(this).children('span').animate({
				bottom: '0'
			  }, 300);
			$(this).children('img').css('top','-243px');
		}
	);
	
	// 
	// About List Hovers  ***************************** 
	$('#aboutWrap ul li a').hover(
		function() {
			$('#aboutWrap ul li a').animate({
				opacity: 0.3
			  }, 300);
			$(this).addClass('selectedImage');
			$(this).next('div').fadeIn('fast');
		},
		function() {
			$(this).removeClass('selectedImage');
			$(this).next('div').fadeOut('fast');
		}
	);
	$('#aboutWrap ul').mouseleave(function() {
		$('#aboutWrap ul li a').animate({
			opacity: 1.0
		  }, 300);
		}
	);
	
    
});

// Cufon replacement selectors  ***************************** 
Cufon.replace('#topSection ul li a span, .footerTop ul li a, .footerBottom ul li h3, ul.projectsList li a span b, #content h2, #content h3, a.backButton', {
	hover: true
});

