

$(document).ready(function(){
    $('#flash-proxxima').flash(
        { src: 'http://mmimg.meioemensagem.com.br/swf/index-cobertura.swf',
          width: 328,
          height: 332 },
        { version: 8 }
    );
});

function abrir(){	
	document.getElementById('abrir').style.display = 'block';
	document.getElementById('div1').style.display = 'block'
};



$(document).ready(function() { 
    $('ul.sf-menu').superfish(); 
});

function shareOpen(){
	$("ul#shareBox").fadeIn('slow');
	document.getElementById(this).style.display = 'block'
};


$(document).ready(function(){

	$("#slider").easySlider({
		auto: true, 
		continuous: true,
		numeric: true
	});

	$(".toolTip").easyTooltip();
	
    $(".toolTipAc").easyTooltip({
		tooltipId: "easyTooltip2"
	});
    
    $(".toolTip3").easyTooltip({
		tooltipId: "easyTooltip3"
	});

     
      $("#aumenta_fonte").click(function(){
  		if (fonte<17){
  			fonte = fonte+1;
  			lineHeight = lineHeight+1;
  			$("#aumentaBaixa").css({'font-size' : fonte+'px','line-height' : lineHeight+'px'});
  			$("#textoT").css({'font-size' : fonte+'px','line-height' : lineHeight+'px'});
  			$("#textoT p").css({'font-size' : fonte+'px','line-height' : lineHeight+'px'});
  			
  		}
      });
      
      $("#reduz_fonte").click(function(){
  		if (fonte>9){
  			fonte = fonte-1;
  			lineHeight = lineHeight-1;
  			$("#aumentaBaixa").css({'font-size' : fonte+'px','line-height' : lineHeight+'px'});
  			$("#textoT").css({'font-size' : fonte+'px','line-height' : lineHeight+'px'});
  			$("#textoT p").css({'font-size' : fonte+'px','line-height' : lineHeight+'px'});
  		}
      });
      
      

      $("#MsgCount").text("0").css({'font-weight' : 'bold'});

      $("#comentario").keyup(function (event) {
  
    	  $Comentario = $(this).val();

    	  var maxText = 300;

    	  var numChar = $Comentario.length;

    	  $("#MsgCount").text(numChar);

    	  if (numChar < maxText){
    		  
    		  $("#MsgCount");
    	  }
    	  else
    	  {
    		  if ( numChar > maxText)
    		  {
    			  if (event.keyCode != 8)
    			  {
  
    				  $("#MsgCount").text("Excedeu "+numChar).css({'font-weight' : 'bold', 'color' : '#ae1b50'});
    			  }
    		  }
    	  }
      });
      
      
      
      
	  	$(function() {
			$('ul.hover_block li').hover(function(){
				$(this).find('img').animate({left:'-140px'},{queue:false,duration:500});
			}, function(){
				$(this).find('img').animate({left:'0px'},{queue:false,duration:500});
			});
			
		});

      
      

});



function fn_refresh(div, url){	
	$(div).load(url + '&noAd=true');
	
}

function fn_refresh_div(div, url){	
	$(div).load(url + '&noAd=true' + ' ' + div);
}

//apagar e acender a luz

$(document).ready( function(){
    $("#shadow").css("height", $(document).height()).hide();
	var fn = function(){
		$("#shadow").toggle();
        if ($("#shadow").is(":hidden"))
        	$("#btApagar").removeClass("btnacende");
         else
        	$("#btApagar").addClass("btnacende");	
    }
    $("#btApagar").click(fn);
    $("#shadow").click(fn);
});
 

