$(document).ready(function(){
	$("head").prepend('<style>.rounded {position:relative;}.lt,.lb,.rt,.rb {position:absolute;z-index:100;display:block;text-indent:-9999px;height:7px;width:7px;background-repeat:no-repeat}.lt {left:0;top:0;background-position:left top}.lb {left:0;bottom:0;background-position:left bottom}.rt {right:0;top:0;background-position:right top}.rb {right:0;bottom:0;background-position:right bottom}.top, .bottom {position:absolute;display:block;left:0;z-index:100;text-indent:-9999px;height:10px;width:100%;background-repeat:no-repeat;}.top {top:0;background-position:left top;}.bottom {bottom:0;background-position:left bottom;}</style>');
	$(".rounded").append('<span class="lt" /><span class="rt" /><span class="rb" /><span class="lb" />');
	$(".top-bottom").append('<span class="top" /><span class="bottom" />');	
	$("ul li:last-child").addClass("last");
	
	$("ul.menu li a").click( function () {
		//return false;
	});
	$("#note").click( function () {
		$("#fields").show();
		$(this).hide();
	});
	
	
	$("ul.portfolio li a").hover( function () {
		$(this).children("span.mask").fadeIn("fast");
	}, function () {
		$(this).children("span.mask").fadeOut("fast");
	});
	
	$(".campo").addClass("idleField");
	$(".campo").focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});

	$(".campo").blur(function() {
		$(this).removeClass("focusField").addClass("idleField");
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});

// Code for contact form on footer
// we will add our javascript code here
	$("#frmContato").submit(function(){
	var str = $(this).serialize();
		$.ajax({
			type: "POST",
			url: "contact.php",
			data: str,
			success: function(msg){
			$("#note").ajaxComplete(function(event, request, settings) {
				if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
				{
					result = "<div class='notification_ok'>Sua mensagem foi enviada!</div>";
					$("#fields").hide();
				}
				else
				{
					result = msg;
				}
	
				$(this).html(result);
			}); // fim de .ajaxComplete
		} // fim de .ajax
	 }); // fim de .submit
	return false;
	});

});




