$(function() {
	// BACKGROUND PAGINA
	if(!$('body').hasClass('inicio')){
		var op = '.4';
	}else{
		var op = '1';
	}
	$("body").ezBgResize({
		img : url_site+'images/bg.jpg', // Relative path example. You could also use an absolute url (http://...).
	    opacity : op, // Opacity. 1 = 100%. This is optional.
		center : true
		
	});
	$('.ipad #intop').remove('object').html('<img src="'+url_site+'images/logomarca.png"/>');

 	
 	//EFEITO MENU
 	$('#menu .current').find('span').animate({
		left:'160px',
		opacity:1
 	})
 	$('#menu').hover(function(){},
 		function(){
 			$('.current').stop(true,true).find('span').animate({
	  			left:'160px',
	 			opacity:1				
 			}) 	
 		
 	}
 	);
 	$('#menu a').hover(
 		
 		function(){
 			if(!$(this).hasClass('current')){
	 			
	 			$(this).find('span').animate({
		 			left:'160px',
		 			opacity:1
	 			});
	 			$('.current').find('span').animate({
		  			left:'10px',
		 			opacity:0				
	 			})
 			}
 		},
 		function(){
 			if(!$(this).hasClass('current')){
	 			$(this).find('span').animate({
		 			left:'10px',
		 			opacity:0
	 			});		
 			}
 		}
 	);
 	   
    // NEWSLETTER
	$('#news-email').inputFocus('E-mail','#6c6d08','#6c6d08');
	$('#newsletter').submit(function(){
		var form = $(this).serialize();
		$.ajax({
			url : url_site+'newsletter.php',
			dataType : 'html',
			data : form,
			type : 'POST',
			success : function(data){
				if(data == 'no'){
					$('#resposta').html('<span>Email Inválido</span>').fadeIn().delay(3000).fadeOut();
				}else{
				$('#resposta').html('<span>E-mail Cadastrado com Sucesso</span>').fadeIn().delay(3000).fadeOut();
					}
			}
		});
		return false;
	});
	//newsletter

		//prettyPhoto
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed:'slow',
		theme:'facebook',
		slideshow:3000,
		overlay_gallery: false,
		autoplay_slideshow: false
	});
	//prettyPhoto	
	$("#mapC").gMap({
		zoom:17,
		markers:[{
			latitude: '-26.9250284',
			longitude: '-48.6746232',
			icon:{
				image:url_site+'images/seta_google_map.png',
				shadow: false,
				iconsize: [64, 64],
				shadowsize: false,
				iconanchor: [9, 34],
				infowindowanchor: [9, 2]
			}
		}]
	});	
	//mapa
	$('#map a.hover').fadeTo('slow',0.4);
	$('#map a.hover').hover(function(){
		$(this).fadeTo('slow',1);
	},function(){
		$(this).fadeTo('slow',0.4);
	});


	
});
