/* ------------------------------------------- /
	Fun¨›es Principais
	Sgobin Studio
	
	Autor: Richard Sgobin
	
	Use esse arquivo para apreender, mas n‹o copie
	e se copiar cite a fonte.

	(CC)
/ ------------------------------------------- */

// Func›es Globais
$(function () {
    animaMenu();
    modalMsg();
});

//Anima o menu
function animaMenu() {
	//Remove o fallback
	$('ul.menuFallBack').removeClass('menuFallBack');
	//Anima o Menu
	$('li.temSub').bind({
	  mouseenter: function() {
	    $(this).children(".submenu").slideDown(150);
	  },
	  mouseleave: function() {
	    $(this).children(".submenu").slideUp(50);
	  }
	});
}

//Anima Cards
function animaCards() {
	if ( !($.browser.msie) ) {
		$('.cards').children().hover(function() {
		    $(this).siblings().stop().fadeTo(300,0.5);
				}, function() {
			$(this).siblings().stop().fadeTo(300,1);
		});	
	}
}

//Inicia Galeria Imovel
function galeriaImovel() {
	$('#galeria').galleryView({
		panel_width: 658,
		panel_height: 418,
		frame_width: 140,
		frame_height: 90,
		transition_interval: 8000,
		frame_gap: 10,
		pause_on_hover: true,
		show_panel_nav: false,
		show_panels: true,
		show_overlays: true
	});
}

//Google Maps
function initialize(LAT, LON, NOME) {
    var latlng = new google.maps.LatLng(LAT, LON);
    var myOptions = {
      zoom: 17,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
    };
    
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
    var icone = 'imagens/icone-mapa.png';
    var marker = new google.maps.Marker({
      position: latlng, 
      map: map,
      icon: icone, 
      title:NOME
  });

}

function modalMsg() {
    $("#diagModal").dialog({
        autoOpen: false,
        modal: true,
        title: 'Vifran Construtora',
        buttons: {
            OK: function () {
                $(this).dialog('close');
            }
        }
    });
}
