$(document).ready(function() {
	
	//MAIN NAV
	$('.nav_services, .nav_services_selected').hover(function() {
		$(this).children('a').css('background-position', 'bottom');
		$(this).find('.dropdown1').fadeIn('400').css('z-index', '500');
	}, function() {
		$(this).children('a').css('background-position', 'top');
		$(this).find('.dropdown1').hide();
	});
	
	$('.nav_inside, .nav_inside_selected').hover(function() {
		$(this).children('a').css('background-position', 'bottom');
		$(this).find('.dropdown2').fadeIn('400').css('z-index', '500');
	}, function() {
		$(this).children('a').css('background-position', 'top');
		$(this).find('.dropdown2').hide();
	});
	
	
	jQuery(".home-tabs").sliderkit({
		auto:false,
		autospeed: 10000,
		tabs:true,
		panelfx:"none",
		freeheight:true,
		circular:true
	});
	
	
	$(".client_row li:last, .client_row_int li:last").css( "border-right","none" );
	$(".snippet:last").css( "border-bottom","none" );
	$(".case:last").css( "border-bottom","none" );
	$(".home_people_l li:last").css( "background-image","none" );
	$(".dropdown1 li:last, .dropdown2 li:last").css( "border-bottom","none" );
	$(".active").css({ opacity: 0.2 });
	$(".sliderkit-nav-clip li:last").css("margin-right","0").css("width","212");
	
	
	
	$(".h_quotes").innerfade({
		animationtype: 'fade',
		speed: 2000,
		timeout: 8000,
		type: 'random', //'sequence', 'random' or 'random_start'
		containerheight: '336px'
	});
	
	$(".block_content").equalHeights();
	
	
	//HIDE CONTENT ON FOCUS
	$('.seer_news input').each( function () {
    $(this).val($(this).attr('defaultVal'));
      });
	
	$('.seer_news input').focus(function(){
    if ( $(this).val() == $(this).attr('defaultVal') ){
      $(this).val('');
      $(this).css('color', '#666666');
    }
    });
    
  	$('.seer_news input').blur(function(){
    if ( $(this).val() == '' ){
      $(this).val($(this).attr('defaultVal'));
      $(this).css('color', '#c5c5c5');
    }
    });
    
    $('.side_news input').each( function () {
    $(this).val($(this).attr('defaultVal'));
      });
	
	$('.side_news input').focus(function(){
    if ( $(this).val() == $(this).attr('defaultVal') ){
      $(this).val('');
      $(this).css('color', '#666666');
    }
    });
    
  	$('.side_news input').blur(function(){
    if ( $(this).val() == '' ){
      $(this).val($(this).attr('defaultVal'));
      $(this).css('color', '#666666');
    }
    });
    
    
    //SEER SLIDER
	$(".main_image .desc").show(); //Show Banner
	$(".main_image .block").animate({ opacity: 0.85 }, 1 ); //Set Opacity

	//Click and Hover events for thumbnail list
	$(".image_thumb ul li:first").addClass('active'); 
	$(".image_thumb ul li").click(function(){ 
		//Set Variables
		var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
		var imgDesc = $(this).find('.block').html(); 	//Get HTML of block
		var imgDescHeight = $(".main_image").find('.block').height();	//Calculate height of block	
		
		if ($(this).is(".active")) {  //If it's already active, then...
			return false; // Don't click through
		} else {
			//Animate the Teaser		
			$(".main_image img").animate({ opacity: 0}, 250 );
			$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
				$(".main_image .block").html(imgDesc).animate({ opacity: 0.85,	marginBottom: "0" }, 250 );
				$(".main_image img").attr({ src: imgTitle , alt: imgAlt}).animate({ opacity: 1}, 250 );
			});
		}
		
		$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
		$(this).addClass('active');  //add class of 'active' on this list only
		return false;
		
	}) .hover(function(){
		$(this).addClass('hover');
		}, function() {
		$(this).removeClass('hover');
	});
			
	//Toggle Teaser
	$("a.collapse").click(function(){
		$(".main_image .block").slideToggle();
		$("a.collapse").toggleClass("show");
	});
	
	$("a.vol_pop").fancybox({
		'titlePosition'	: 'over',
		'transitionIn'	: 'fade',
		'transitionOut'	: 'fade',
		'overlayOpacity' : '.7',
		'overlayColor'  : '#000000'
	});

	
});

	

