function fadeheader() {
	$('#header').hide();
	    // Set the timer
		var dTimer = {};
	    dTimer = $.timer(250,function(){
		    // Actions to perform when the timer goes off
			$('#header').fadeIn(1000);
		 
	    });	
}

function loadproject(tar, delay) {

	    // Set the timer
		var dTimer = {};
	    dTimer = $.timer(delay,function(){
		    // Actions to perform when the timer goes off
			$('#projects .'+tar+' a').show("slide", { direction: "up" }, 500);
		 
	    });	
}

function loadpicture(tar, delay) {
	    // Set the timer
		var pTimer = {};
	    pTimer = $.timer((delay+500),function(){
		    // Actions to perform when the timer goes off
			$('#project .'+tar).fadeIn(2000);
		 
	    });	
}

function pnavslide() {

	// Set the timer
	var dTimer = {};
    dTimer = $.timer(500,function(){
	    // Animate
		$('#p-navbar').show().animate({width: "71px"}, 500);
	 
    });
    
}


$(document).ready(function() {
	// Fade in Header
	fadeheader();
	if ($.browser.msie) {
		$('.p-images .tt').hide();
		$('.p-details .tt').hide();
		$('.p-view .tt').hide();
	}
	
	$('.navfade').hide();
	$('#p-navbar').css('width', '0').hide();
	pnavslide();
	$('ul#navbar li.navlink a').hoverIntent(function() {
		// Stuff to do when the mouse enters the element;
		if (!$.browser.msie) {
			$(this).css('color', '#676767');
			$(this).parent().children('.navfade').show();
		}
	}, function() {
		// Stuff to do when the mouse leaves the element;
		if (!$.browser.msie) {
			$(this).parent().children('.navfade').fadeOut(300);
			$(this).animate({color:"#454545"}, 300);
		}
	});
	$('ul#subnavbar li.sublink a').hoverIntent(function() {
		// Stuff to do when the mouse enters the element;
		if (!$.browser.msie) {
			$(this).css('color', '#676767');
			$(this).parent().children('.navfade').show();
		}
	}, function() {
		// Stuff to do when the mouse leaves the element;
		if (!$.browser.msie) {		
			$(this).parent().children('.navfade').fadeOut(300);
			$(this).animate({color:"#454545"}, 300);
		}
	});
	
	// Hide Projects for Sliding Animation
	$('#projects a').hide();
	
	//Project Nav Functions
	if (!$.browser.msie) {
		$('.p-images a').mouseover(function() {
			$('.p-images .tt').fadeIn(500);
		});
		$('.p-images a').mouseout(function() {
			$('.p-images .tt').fadeOut(1000);
		});
		$('.p-details a').mouseover(function() {
			$('.p-details .tt').fadeIn(500);
		});
		$('.p-details a').mouseout(function() {
			$('.p-details .tt').fadeOut(1000);
		});
		$('.p-view a').mouseover(function() {
			$('.p-view .tt').fadeIn(500);
		});
		$('.p-view a').mouseout(function() {
			$('.p-view .tt').fadeOut(1000);
		});
	} else {
		$('.p-images a').mouseover(function() {
			$('.p-images .tt').show();
		});
		$('.p-images a').mouseout(function() {
			$('.p-images .tt').hide();
		});
		$('.p-details a').mouseover(function() {
			$('.p-details .tt').show();
		});
		$('.p-details a').mouseout(function() {
			$('.p-details .tt').hide();
		});
		$('.p-view a').mouseover(function() {
			$('.p-view .tt').show();
		});
		$('.p-view a').mouseout(function() {
			$('.p-view .tt').hide();
		});
	}
	
	// Field Elements
	
	//Name
	
	$('#ff_contact #name').attr('value', 'Name');
	$('#ff_contact #name').focus(function() {
		// Act on the event
		if ($('#ff_contact #name').attr('value')=='Name') {
			$('#ff_contact #name').addClass('f-content');
			$('#ff_contact #name').attr('value', '');
		};
	});
	$('#ff_contact #name').blur(function() {
		// Act on the event
		if ($('#ff_contact #name').attr('value')=='') {
			$('#ff_contact #name').removeClass('f-content');
			$('#ff_contact #name').attr('value', 'Name');
		};
	});
	
	// Email
	
	$('#ff_contact #email').attr('value', 'Email');
	$('#ff_contact #email').focus(function() {
		// Act on the event
		if ($('#ff_contact #email').attr('value')=='Email') {
			$('#ff_contact #email').addClass('f-content');
			$('#ff_contact #email').attr('value', '');
		};
	});
	$('#ff_contact #email').blur(function() {
		// Act on the event
		if ($('#ff_contact #email').attr('value')=='') {
			$('#ff_contact #email').removeClass('f-content');
			$('#ff_contact #email').attr('value', 'Email');
		};
	});
	
	// Message
	
	$('#ff_contact #comments').attr('value', 'Message');

	$('#ff_contact #comments').focus(function() {
		// Act on the event
		if ($('#ff_contact #comments').attr('value')=='Message') {
			$('#ff_contact #comments').addClass('f-content');
			$('#ff_contact #comments').attr('value', '');
		};
	});
	$('#ff_contact #comments').blur(function() {
		// Act on the event
		if ($('#ff_contact #comments').attr('value')=='') {
			$('#ff_contact #comments').removeClass('f-content');
			$('#ff_contact #comments').attr('value', 'Message');
		};
	});
	
	// Form Button(s)
	
	$('form#ff_contact #submit').hover(function() {
		// Stuff to do when the mouse enters the element
		$(this).addClass('over');
	}, function() {
		// Stuff to do when the mouse leaves the element;
		$(this).removeClass('over');
	});

	
});
