/* ------------------------------------------- /
	Funções Principais
	Sgobin Studio
	
	Autor: Richard Sgobin
	
	Use esse arquivo para apreender, mas não copie
	e se copiar cite a fonte.

	(CC)
/ ------------------------------------------- */


//Anima Submenu da Nav
function mainmenu(){

$("ul#nav li ul").addClass("escondido");

$(" ul#nav li ").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(150);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
});
// Prepara o Modal
$("#caixaModalTalents").dialog({
    modal: true,
    autoOpen: false,
    width: 650,
    buttons: {
        Fechar: function () {
            $(this).dialog("close");
        }
    }
});

// Abre modal no click
$('#butModalTalents').click(function () {
    $("#caixaModalTalents").dialog('open');
});

// Prepara o Modal
$("#caixaModalPartners").dialog({
    modal: true,
    autoOpen: false,
    width: 650,
    buttons: {
        Fechar: function () {
            $(this).dialog("close");
        }
    }
});

// Abre modal no click
$('#butModalPartners').click(function () {
    $("#caixaModalPartners").dialog('open');
});		

};


//Anima texto dos cards
function keycards(){

$("div.text-card").css({top: 250});

$("div.key-card").hover(
  function () {
/*   	$('div.key-card').not(this).stop().animate({opacity: 0.3}, 300); */
    $(this).find('div:first').stop().animate({top: 200}, 150);
  },
  function () {
     $(this).find('div:first').stop().animate({top: 250}, 300);
/*      $('div.key-card').animate({opacity: 1}, 100); */
  }
);

};


// Altera cor do link na pagina atual
function paginaAtual() {
	var loc = window.location.toString().split("/")
	loc = loc[loc.length - 1]
	$("#sidebar ul li a[href=\""+loc+"\"]").addClass("selected");
};


//Rola CV
function rolaCV() {
	$(".cv-content").css({visibility: "visible",display: "none"})
	$(".accordion h3").click(function () {
      $(this).next().toggle("blind", {}, 300);
      // scroll the page
      $('html, body').animate({scrollTop: $(this).offset().top}, 700);
    });
};

//BG on Focus Forms
function bgFocus() {
	$(".form-contato input").focus(function() {
		$(this).parent().addClass("bg-on-focus")
	});
	$(".form-contato input").blur(function() {
		$(this).parent().removeClass("bg-on-focus")
	});
	
/*
	$("form#form-contato textarea").focus(function() {
		$(this).parent().addClass("bg-on-focus")
	});
	$("form#form-contato textarea").blur(function() {
		$(this).parent().removeClass("bg-on-focus")
	});
*/
};

//Google Maps
function initialize() {
    var latlng = new google.maps.LatLng(-22.888730, -47.051150);
    var myOptions = {
      zoom: 17,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
    };
    
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
    var icone = 'imagens/icone-mapa.png';
    var marker = new google.maps.Marker({
      position: latlng, 
      map: map,
      icon: icone, 
      title:"Master Minds Capital"
  });
   
};


// Hover News Itens
function hoverNewsItens() {
	var caixas = $("ul#news-list li");
	
	caixas
	
	.hover(function() {
		   $(this)
				.addClass("box-hover")
		}, function() {
		   $(this)
				.removeClass("box-hover")
		})
		
	.click(function() {
			window.location = $(this).find("a").attr("href");
		});
};


//Anima Formulário Empreendedor
function formularioEmpreendedor() {
	$("#passo1").addClass("escondido");
	$("#passosLegenda1").removeClass("ativo");
	$("#passo2").removeClass("escondido");
	$("#passosLegenda2").addClass("ativo");
};
