

$(document).ready(function(){	

	//$('.thumbs').dropShadow( {left: 0,top: 0,blur: 2,opacity: .4, color: "black", swap: false});
	// HOME FEATURED  /////////////////////////////////////////////////////////////////////////////////////
	
	//alert('testing');
	
	var counter = 1;
   
    $('#container').after('<div id="fnav" class="fnav">').cycle({
        fx:     'scrollDown',
        speed:  1000,
        timeout: 9000,
		easing: 'easeOutSine',
        pager:  '#fnav'
    });


	$('#fnav a').click(function(){
		$('#container').cycle('pause');
	});


	$('#fnav a').each(function() {
		//  alert(index);
  		$(this).addClass('nav'+counter);
		counter++;
	});

	
	// VALIDATE NEWSLETTER  /////////////////////////////////////////////////////////////////////////////////////
	$("#newsletter").validate();
	$("#commentform").validate();

	
	// KILL FIELDS VALUE ON CLICK
	jQuery(".wpcf7-form input").click(function() {
								   
		if(
		   	jQuery(this).attr('value') == 'search' 
			|| jQuery(this).attr('value') == 'Email Address' 
			|| jQuery(this).attr('value') == 'Name *' 
			|| jQuery(this).attr('value') == 'Email *'
			|| jQuery(this).attr('value') == 'Phone #' 
			|| jQuery(this).attr('value') == 'Company' 
		){
			focusValue = jQuery(this).attr('value');
			jQuery(this).removeAttr("value");
		};
    }) ;
	
	jQuery("textarea" ).click(function() {
		if(jQuery(this).attr('value') == 'Message *'){
			focusValue = jQuery(this).attr('value');
			jQuery(this).removeAttr("value");
		};
    }) ;
	
	// FILL IN FEILDS WHEN FOCUS IS LOST
	$("input").blur(function() {
		if (jQuery(this).attr('value') == ''){
			jQuery(this).attr('value',focusValue);
		}
	});

	$("textarea").blur(function() {
		if (jQuery(this).attr('value') == ''){
			jQuery(this).attr('value',focusValue);
		}
	});
	

	
	$("#nav ul li ul li:first-child").addClass('first');
	
	// Company - Chart /////////////////////////////////////////////////////////////////////////////////////
	$('#multi-buttons .stratigy').hover(
	  function () { $('#multi-copy #stratigy').fadeTo(150, 1); }, 
	  function () { $('#multi-copy #stratigy').fadeTo(150, 0); }
	);
	
	$('#multi-buttons .talent').hover(
	  function () { $('#multi-copy #talent').fadeTo(150, 1); }, 
	  function () { $('#multi-copy #talent').fadeTo(150, 0); }
	);
	
	$('#multi-buttons .client').hover(
	  function () { $('#multi-copy #client').fadeTo(150, 1); }, 
	  function () { $('#multi-copy #client').fadeTo(150, 0); }
	);
	
	$('#multi-buttons .bullet').hover(
	  function () { $('#multi-copy #bullet').fadeTo(150, 1); }, 
	  function () { $('#multi-copy #bullet').fadeTo(150, 0); }
	);
	
	// Company - Arrows /////////////////////////////////////////////////////////////////////////////////////
	/*
	
	$('.company .last').css( "display", "block" );
	$('.company .last').animate({ opacity: 0 }, { duration: 0 });
	
	jQuery(".company .first .arrow" ).click(function() {
		$('.company .first').animate({
			opacity: 0,
			left: '-=200'
  		});
		$('.company .last').animate({
			opacity: 1,
			left: '+=200'
  		});
		$('.company .last .arrow').css( "display", "block" );
		$('.company .first .arrow').css( "display", "none" );
    }) ;
	
	jQuery(".company .last .arrow" ).click(function() {
		$('.company .first').animate({
			opacity: 1,
			left: '+=200'
  		});
		$('.company .last').animate({
			opacity: 0,
			left: '-=200'
  		});
		$('.company .last .arrow').css( "display", "none" );
		$('.company .first .arrow').css( "display", "block" );
    }) ;
	
	*/
	
	var opener = "people";
	
	$('.cBtn').click(function() {
		if(opener == "up"){
			goPeople();
		} else {
			goPhilosphy();
		}
    });
	
	$('#up').animate({ opacity: 1, }, 0);
	$('#down').animate({ opacity: 0, }, 0);
	
		
	function goPeople(){
		$('.people').animate({ opacity: 1, top: '+=365' }, 1500, "swing");
		$('.philosophy').animate({ opacity: 0, top: '+=378' }, 1000, "swing");
		$('.aobutSlider').animate({ height: '360' });
		$('#up').animate({ opacity: 1, }, 1000);
		$('#down').animate({ opacity: 0, }, 1000);
		opener = "down"
	};
	
	function goPhilosphy(){
		$('.people').animate({ opacity: 0, top: '-=365' }, 1000);
		$('.philosophy').animate({ opacity: 1, top: '-=378' },1500);
		$('.aobutSlider').animate({ height: '310' });
		$('#up').animate({ opacity: 0, }, 1000);
		$('#down').animate({ opacity: 1, }, 1000);
		opener = "up"
	};
	
	
	
	
	// FLOATING WORK SIDEBAR /////////////////////////////////////////////////////////////////////////////////////
	/*var name = ".work-sidebar";  
	var pos = $(".work-sidebar").position();  
	var menuYloc = Math.round(pos.top);
	
	$(window).scroll(function () {  
		if(!$.browser.msie){
			checkSideBar(); 
		}
	});  
	
	function checkSideBar() {
		
		if($(document).scrollTop() > 266){
			var offset = $(document).scrollTop() - 270 + "px"; 
			$(name).animate({top:offset},{duration:500,queue:false}); 
		} else {
			var offset = 0+"px"; 
			$(name).animate({top:offset},{duration:500,queue:false}); 
		}
	}
	
	if(!$.browser.msie){
		checkSideBar(); 
	}
	*/
});


Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('.branded');
