<!--
$(document).ready(function(){		
	// Aplica fonte personalizada
	Cufon.set('fontFamily', 'Hand Of Sean');
	Cufon.replace("h1.title, .render");
	Cufon.replace("#mn-header li", { hover: true });
	
	// Atribuição do OverlayBox ao menu
	$("#mn-header a").click(function(evt){
		evt.preventDefault();
		obj = $(this);
		ref = obj.attr("href");		
		boxSize = obj.attr("rel").split(',');		
		overlayBox(ref, boxSize[0], boxSize[1]);
		//$("a").removeClass("sel");
		//obj.addClass("sel");
	});

////// Desabilita o click direito do mouse
//$(document).bind("contextmenu",function(e){
														
	$("body").prepend("<div id='infoBox'></div>");
	$("#infoBox").hide();											
														
	$(".objectHome, .objectHomeMd").bind("mouseenter", function(evt){
		evt.preventDefault();
		obj = $(this);		
		$("#infoBox").html(obj.html()).prepend("<span id='marcador-lt'></span><span id='marcador-rt'></span>").show();
		Cufon.replace("#infoBox span");
	});
	
	$(".objectHome, .objectHomeMd").bind("mouseleave", function(evt){
		evt.preventDefault();
		$("#infoBox").hide();		
		//clearTimeout(timer);
		//timer = window.setTimeout(function() {
		//	$("#infoBox").fadeOut();
		//},3000);		
	});
	
	$(".objectHome").bind("click", function(evt){														
		evt.preventDefault();
		obj = $(this);
		ref = obj.attr("href");
		//alert(ref);
		if(!ref == "" || ref == "undefined"){
			boxSize = obj.attr("rel").split(',');		
			overlayBox(ref, boxSize[0], boxSize[1]);
		}
	});
	
	//setInterval(infoBoxMove, 20);	
	//function infoBoxMove(){
	
	$(document).bind("mousemove", function(e){
				
		var pageCoords = "( " + e.pageX + ", " + e.pageY + " )";
		var clientCoords = "( " + e.clientX + ", " + e.clientY + " )";
		//$("span:first").text("( e.pageX, e.pageY ) - " + pageCoords);
		// $("span:last").text("( e.clientX, e.clientY ) - " + clientCoords);
		
		if(e.pageX > $(document).width()/2 + 40){			
			var widthObj = $("#infoBox").width();
			posX =parseInt(  e.pageX - widthObj - 40 );			
			$("#infoBox #marcador-lt").hide();
			$("#infoBox #marcador-rt").show();
			
		} else {
			posX = parseInt( e.pageX + 30 ),
			$("#infoBox #marcador-lt").show();
			$("#infoBox #marcador-rt").hide();
		}
		
		$("#infoBox").css({
			left: posX,
			top: e.pageY - 10
		});
	});	
	
	
	
	/*
	var divName = 'infoBox'; // div that is to follow the mouse
	// (must be position:absolute)
	var offX = 5;  // X offset from mouse position
	var offY = 5;  // Y offset from mouse position
	function mouseX(evt) {if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;}
	function mouseY(evt) {if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;}
	 
	function follow(evt) {if (document.getElementById) {
		var obj = document.getElementById(divName).style; obj.visibility = 'visible';
		
		
		if(mouseX > $(document).width()/2){			
			//var widthObj = $("#infoBox").width();
			//posX =  mouseX - widthObj - 50;			
			$("#infoBox #marcador-lt").hide();
			$("#infoBox #marcador-rt").show();			
		} else {
			//posX = mouseY + 40,
			$("#infoBox #marcador-lt").show();
			$("#infoBox #marcador-rt").hide();
		}
		
		obj.left = (parseInt(mouseX(evt))+offX) + 'px';
		obj.top = (parseInt(mouseY(evt))+offY) + 'px';
		}
	}
	
	document.onmousemove = follow;
	*/
	
});


// Formulário
function ValidaFormulario () {	
		if (document.contato.nome.value==""){
		alert("Digite o seu Nome");
		document.contato.nome.focus();
		document.getElementById('nome').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('nome').style.border='1px solid #046';
		}

		if (document.contato.email.value==""){
		alert("Digite seu e-mail para contato");
		document.contato.email.focus();
		document.getElementById('email').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('email').style.border='1px solid #046';
		}

		//validar email(verificao de endereco eletrônico)
    	parte1 = document.contato.email.value.indexOf("@");
        parte2 = document.contato.email.value.indexOf(".");
        parte3 = document.contato.email.value.length;
        //if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
        if (!(parte1 >= 3 && parte2 >= 1 && parte3 >= 9)) {
            alert ("O campo E-mail deve conter um endereco eletronico!");
            document.contato.email.focus();
      		document.getElementById('email').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('email').style.border='1px solid #046';
		}



		if (document.contato.telefone.value==""){
		alert("Digite seu telefone de contato");
		document.contato.telefone.focus();
		document.getElementById('telefone').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('telefone').style.border='1px solid #046';
		}

		if (document.contato.cidade.value==""){
		alert("Cidade é um campo necessário.");
		document.contato.cidade.focus();
		document.getElementById('cidade').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('cidade').style.border='1px solid #046';
		}

		if (document.contato.uf.value==""){
		alert("UF é um campo necessário");
		document.contato.uf.focus();
		document.getElementById('uf').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('uf').style.border='1px solid #046';
		}

		if (document.contato.mensagem.value==""){
		alert("Digite sua mensagem");
		document.contato.mensagem.focus();
		document.getElementById('mensagem').style.border='1px solid red';
		return false;
		}else{
			document.getElementById('mensagem').style.border='1px solid #046';
		}
	return true;
}

// PopUp
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// text area count
function max(txarea)
{
	if (txarea.value.length - txarea.value.lastIndexOf(' ') > 30)
	{
		txarea.value = txarea.value.substring(0, (txarea.value.length - 1));
		return;
	}

	total = 200;
	tam = txarea.value.length;
	str="";
	str=str+tam;
	Digitado.innerHTML = str;
	Restante.innerHTML = total - str;

	if (tam > total)
	{
		aux = txarea.value;
		txarea.value = aux.substring(0,total);
		Digitado.innerHTML = total
		Restante.innerHTML = 0
	}
}
-->
