
//PRODUTOS FOTOS
$(document).ready(function() {
	
		$("img#m_foto1").ready(function () {
			$("div#foto1").fadeIn("fast");
			$("div#foto2").hide();
			$("div#foto3").hide();
			$("div#foto4").hide();
		});
	
	
		$("img#m_foto1").mouseover(function() {
			$("div#foto1").fadeIn("fast");
			$("div#foto2").hide();
			$("div#foto3").hide();
			$("div#foto4").hide();
		});
		$("img#m_foto2").mouseover(function() {
			$("div#foto1").hide();
			$("div#foto2").fadeIn("fast");
			$("div#foto3").hide();
			$("div#foto4").hide();
		});
		$("img#m_foto3").mouseover(function() {
			$("div#foto1").hide();
			$("div#foto2").hide();
			$("div#foto3").fadeIn("fast");
			$("div#foto4").hide();
		});
		$("img#m_foto4").mouseover(function() {
			$("div#foto1").hide();
			$("div#foto2").hide();
			$("div#foto3").hide();
			$("div#foto4").fadeIn("fast");
		});
	});


//BUSCA RAPIDA QUADRO
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	function lookup(inputString) {
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("http://www.lapin.com.br/busca-rapida.php", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	
//BUSCA RAPIDA POSICAO
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	if (document.all){}
else document.captureEvents(Event.CLICK);
document.onclick=mouse;

function mouse(e) {
        if (navigator.appName == 'Netscape'){
                xcurs = e.pageX;
                ycurs = e.pageY;  
        } else {
                xcurs = event.clientX;
                ycurs = event.clientY;
        }
}



// CEP
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function getEndereco() {
			if($.trim($("#cep2").val()) != ""){
				$.getScript("http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep="+$("#cep1").val()+$("#cep2").val(), function(){
			  		if(resultadoCEP["resultado"]){
						$("#endereco").val(unescape(resultadoCEP["tipo_logradouro"])+" "+unescape(resultadoCEP["logradouro"]));
						$("#bairro").val(unescape(resultadoCEP["bairro"]));
						$("#cidade").val(unescape(resultadoCEP["cidade"]));
						$("#estado").val(unescape(resultadoCEP["uf"]));
					}else{
						alert("Endereço não encontrado");
					}
				});				
			}			
	}
	
	function pulacep() {
		if (document.getElementById("cep1").value.length == 5) {
			document.getElementById("cep2").focus();
		}
	}	



//MENU
/////////////////////////////////////////////////////////////
$(function(){
	$('#menu a')
		.css( {backgroundPosition: "-20px 35px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-20px 94px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(40px 35px)"}, {duration:200, complete:function(){
				$(this).css({backgroundPosition: "-20px 35px"})
			}})
		})
});


//
$(function(){
	$('div.bredondo').corner();
	$('a.d').corner("5px");
	$('a.m').corner("5px");
	//$('a.m').css("color","#ffffff");
});    


