$(document).ready(function(){

	/** autoload ao vivo */
	if (navigator.userAgent.indexOf("Chrome") == -1) { // !Chorme
	    $('a#AudioVideoAoVivo').click();
	}


    $('body').css({
        'background': '#c1c1c1 url(../../_recursos/imagens/img-default/bg.png) left top repeat-x',
        'color'     : '#363636',
        'height'    : 'auto'
    });

    $('.jornalismo').wrapAll('<div class="box">');
    
    /** ajustes da galeria e mural de fotos*/
    $('ul.galeria-fotos li').equalHeight();
    $('ul.galeria-fotos li:nth-child(3n)').css('margin','0 0 21px 0');
    $('ul.mural-fotos li').equalHeight();
    $('ul.mural-fotos li:nth-child(5n)').css('margin','0 0 19px 0');
    
    
    /** ajuste form busca */
    $('.submit-lupa').click(function(e){
        
        if($('.fldBusca').attr('value')== 'Buscar na TUPI')
        {
            alert('Informe o termo que deseja buscar');
            $('.fldBusca')
                .css('border','solid 2px #99080D')
                .css('background-color','#F4C1C1')
                .focus();
            e.preventDefault;
            return false;
        }
    });
    
    $('.fldBusca').focus(function()
    {
        var $this = $(this);
        if($this.val() == 'Buscar na TUPI')
        {
            $this.val('');
        }
    });
    
    $('.fldBusca').blur(function()
    {
        var $this = $(this); 
        if($this.val() == '') 
        {
            $this.val('Buscar na TUPI')
            $this.css('border','solid 1px #999999')
            $this.css('background-color','#ffffff');
        }
    });
    
    $('.fldBusca').keypress(function()
    {
        var $this = $(this); 
        if($this.val() != 'Buscar na TUPI')
        {
            $this.css('border','solid 1px #999999')
            $this.css('background-color','#ffffff'); 
        }
    });
        
  
}); // end $(function)



