$(document).ready(function(){
	
    $('#animacao').cycle({ 
            fx:     'fade', // pode tentar também 'fade' que fica legal. Tem outros efeitos em http://malsup.com/jquery/cycle/begin.html
            timeout: 5000, // segundos x1000
            pause: true // true pra parar qdo o mouse ta em cima
    });

	$("#detalhes .painel ul a").mouseover(function(){
		title = $(this).attr("title");
		$("#detalhes .painel ul li.legenda").html("<p>"+title+"</p>");
	}).mouseout(function(){
		$("#detalhes .painel ul li.legenda").html("&nbsp;");
	});
	
	if ($("#fotos ul li a").length>0) {
		$("#fotos ul li a").lightBox();
	}
	
	if ($("#imediacoes #map").length>0) {
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map"));
			map.setCenter(new GLatLng(-30.050253,-51.215038), 15);
			var latlng = new GLatLng(-30.050253,-51.215038);
			map.addOverlay(new GMarker(latlng));
		}
	}
	
	if ($("#contato #map").length>0) {
		if (GBrowserIsCompatible()) {
			var map = new GMap2(document.getElementById("map"));
			map.setCenter(new GLatLng(-30.050253,-51.215038), 15);
			var latlng = new GLatLng(-30.050253,-51.215038);
			map.addOverlay(new GMarker(latlng));
		}
	}
	
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		$("#imovel-fale .enviar").attr("src","img/design/btn_enviar_8.png");
		$("#contato .submit").attr("src","img/design/btn_enviar_8.png");
		/*$("ul.dropdown li.dir").hover(function(){ //esta é a solução simples: só esconde os select
			$("#busca select").css("visibility","hidden");
		},function(){
			$("#busca select").css("visibility","visible");
		});*/
		$("ul.dropdown li.dir").hover(function(){ //esta é a solução LUCASMASTER. transforma os selects em divs com o mesmo tamanho e margem.
			$("#busca select").each(function(){
				$(this).css("display","none");
				w = $(this).css("width");
				h = $(this).css("height");
				m = $(this).css("margin-bottom");
				$(this).after('<div class="select2" style="background-color:#FFF;height:'+h+';width:'+w+';margin-bottom:'+m+';line=height:1px;"></div>');
			});
		},function(){
			$("#busca select").css("display","block");
			$("#busca .select2").remove();
		});
		
	}

});

