$(document).ready(function(){
		
		/* 1º) mouse over banner curso futuro */
		$('.bot-banner', '.banner-curso-futuro').click(function(){
				var divform = $(this).next('.form-curso-futuro');
				divform.animate({top:0}, 800, 'swing');
				
				return false;
		});
		/* 2º) envia email para curso futuro */
		$('.bot-form', '.form-curso-futuro').click(function(){
				var divpai = $(this).parent().parent().parent().parent();
				var nomeCurso = $(this).prev().val();
				var email = $(this).prev().prev().val();
				var linkk = $(this);
				
				// valida e-mail
				var valid = is_email(email);
				if(valid == false){
					alert('O e-mail não é válido!');

				} else {
					// via AJAX salva submissão
					$.ajax({
						type: "POST",
						url: V['site_url']+"inicio/enviaEmailFuturo",
						data: "e="+email+"&c="+nomeCurso,
						dataType: ($.browser.msie) ? "text" : "html",
						
						beforeSend: function() {
							// msg de carregando				
							linkk.addClass('aguardando');
						},
						success: function(message)
						{						
							if (message.length == 1){							
								// recebe o retorno e processa	
								$('.form-futuro-resposta', divpai).animate({top:0}, 800, 'swing');	
								$('.form-curso-futuro', divpai).slideUp();
								
							} else {
								alert('erro ao receber dados');
							}	
						}
					});// end ajax
				}				
				
				return false;
		});
		// marca dágua campo email para curso futuro --------------------------------
		$('input[name=email_curso]', '.form-curso-futuro').focus(function(){
			if($(this).val() == 'seu e-mail')$(this).val('');
			return false;
		});
		$('input[name=email_curso]', '.form-curso-futuro').blur(function(){
			if($(this).val() == '')$(this).val('seu e-mail');
			return false;
		});
		
		// aba guarda conteúdo ------------------------------------------------------
		$('#aba-guarda #aba-content').hide();
		$('.bot-controle a', '#aba-guarda').click(function(){

			if($.browser.msie && $.browser.version.substr(0,1) < 8){$('#aba-guarda #aba-content').toggle();}
			else {$('#aba-guarda #aba-content').slideToggle();}
			
			return false;
		});
		
		// alert-box --------------------------
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		$('#mask').css({'width':maskWidth,'height':maskHeight});


		$('#mask').fadeTo(1000,0.8);
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		$("#alert-box").css('top',  winH/2 - $("#alert-box").height());
		$("#alert-box").css('left', winW/2 - $("#alert-box").width()/2);
	
		$("#alert-box").fadeIn(1000);
		
		$("#alert-box .close").click(function (e) {
			e.preventDefault();			
			$('#mask').hide();
			$("#alert-box").hide();
		});		
		
		$('#mask').click(function () {
			$(this).hide();
			$("#alert-box").hide();
		});
		
		
		
		
});
  hs.graphicsDir = V['base_url']+'site_itens/img/highslide/';
    hs.outlineType = 'rounded-white';
    hs.outlineWhileAnimating = true;
    hs.objectLoadTime = 'after';
    window.onload = function() {
        hs.preloadImages();
    }
