$(document).ready(function() {
	
		$('.portfolio li img').hide();
		$('#accordion').hide();
	
				
		$('#wrapper').fadeIn(50, function(){
			
			// FRONT PAGE SLIDER
			$('#placeholder').delay(700).slideDown(700); 
			$('#placeholder p').delay(1400).fadeIn(400);
			$('#accordion').delay(1400).fadeIn(400);
			$('.yourhere').delay(2500).fadeIn(400);
			// INNER PAGE SLIDER
			$('#placeholderinner').delay(700).slideDown(700); 
			$('#placeholderinner p').delay(1400).fadeIn(400);
			
			 
		});
		
		$('#header h1').click(function(){
  			
			window.location = window.location = 'http://www.thewebsitedesigner.net';
		
		});
	
		
		// ****************************** //
		// ****************************** //
		// *** BLINK CURSOR IN HEADER *** //
		// ****************************** //
		// ****************************** //
		
		function blink(selector){
			
			$(selector).fadeOut(400, function(){
			
				$(this).fadeIn(400, function(){
				
					blink(this);
			
				});
		
			});
	
		}

		blink('.blink');

		// ****************************** //
		// ****************************** //
		// **** FORM INPUT STYLING ***** //
		// ****************************** //
		// ****************************** //
		
		$("p.cont").find('input').focus(function() {
			
			$(this).css('border-color', '#87c43f');
			
		});
		
		$("p.cont").find('input').blur(function() {
			
			$(this).css('border-color', '#efefef');
			
		});
		
		$("p.cont").find('textarea').focus(function() {
			
			$(this).css('border-color', '#87c43f');
			
		});
		
		$("p.cont").find('textarea').blur(function() {
			
			$(this).css('border-color', '#efefef');
			
		});
		
		// ************************** //
		// ************************** //
		// **** FORM VALIDATION ***** //
		// ************************** //
		// ************************** //		
		
		$("#quoteForm").validate();
		$("#contactForm").validate();
		
		
		
		

			
	});

	$(window).load(function() {
		
		// POST COUNT
		$('.posts:nth-child(3n)').addClass('lasts');
		
		// *************************** //
		// *************************** //
		// **** PORFOLIO LOADING ***** //
		// *************************** //
		// *************************** //

		$(".portfolio li").hover(function() {
			$(this).find('div').slideDown('fast');
		
		}, function() {
			$(this).find('div').slideUp('fast');
		});
    
		$(".portfolio li img").each(function(i) {
		   $(this).delay((i + 1) * 400).fadeIn();
		});
		
		$("#accordion").accordion({
			//event: 'mouseover',
			animated: 'easeslide'
		
		});
		
		
		
});

		// *************************** //
		// *************************** //
		// **** GOOGLE ANALYTICS ***** //
		// *************************** //
		// *************************** //

	var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-554302-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

