﻿$(document).ready(function() {
 
	$("#formulario").submit(function() {
		var options = {
			target: "#resposta", 
			url: $('#formulario').attr('action'),
			type: "post", 
 
			success: function(resposta) {
				$("#resposta").text(resposta).show();
				$("#formulario")[0].reset();
			}
		}
 
		$(this).ajaxSubmit(options);
		return false;
	});
});


$('#colmenu a.titleperfil').click(function(e){
    e.stopPropagation();
    e.preventDefault();

    $('html,body').animate({scrollTop:document.body.scrollHeight},2500);

});




$('#hideHeader').click(function(e){
    e.stopPropagation();
    e.preventDefault();
    $('#header').slideToggle(300);
    $('#centercolapse a').toggleClass("fecharmenu").toggleClass("abrirmenu");
});


$('#sidebar input').focus(function() {
	if( this.value == this.defaultValue ) {
		this.value = "";
	}
});

$('#sidebar textarea').focus(function() {
	if( this.value == this.defaultValue ) {
		this.value = "";
	}
});