// JavaScript Document

$(document).ready(function() {
	$('.topo').click(function(){
     target = $('#header').offset().top;
     $('html, body').animate({scrollTop:target}, 1000);
      return false; 
	});
	
	
	$("ul#topnav li").hover(function() { //Hover over event on list item
		$(this).find("span").show(); //Show the subnav
	} , function() { //on hover out...
		$(this).css({ 'background' : 'none'}); //Ditch the background
		$(this).find("span").hide(); //Hide the subnav
	});
	
	
	$("div.cases-sucesso").hover(function() { //Hover over event on list item
		$("div.cases").addClass('cases_02'); //Show the subnav
	} , function() { //on hover out...
		$("div.cases").removeClass('cases_02'); //Ditch the background
	});
	
	

	$(".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
		}
		
		$(".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');
	});
	/*
	var tabContainers = $('div#posts > div');
	tabContainers.hide().filter(':first').show();
	
	$('div#posts ul.tabNavigation a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div#posts ul.tabNavigation a').removeClass('selected');
			$(this).addClass('selected');
			return false;
		}).filter(':first').click();
		
	*/
});
