$(document).ready(function(){

initSlider();
    //efeitinho na pagina contato
     $('form.contato input:not(#botao), form.contato textarea').css({'border':'1px #2070A0 solid'}).stop()
        .focus(function() {
            $(this).animate({backgroundColor:'#dfebf2'}, '50');
            $(this).css({borderColor: "#7fb5ff" });
        });
     $('form.contato input:not(#botao), form.contato textarea')
        .stop().blur(function(){
         $(this).animate({backgroundColor:'#fff'}, 'slow');
            $(this).css({borderColor: "#2070A0" });
     });

		 //efeito background na li noticias ()
    $('.noticias li:not(".primeira")').hover(function(){
       $(this).stop().animate({backgroundColor:'#dfebf2'}, '50', 'swing');
    }, function(){
        $(this).stop().animate({backgroundColor:'#ffffff'}, '50', 'swing');
    });

    //efeito drop down do menulateral
		$('.menuLateral ul ul').css({display: 'none'});
    $('.menuLateral ul li').click(function(){
       $(this).children('ul:not(:animated)').slideToggle();
    });

		$('.menuLateral li[rel='+itemMenu+']').addClass('selected');
		$('.menuLateral li[rel='+itemMenu+']').parents('ul').css({display: 'block'});
		$('.menuLateral li[rel='+itemMenu+']').parents('li').addClass('selected');

    //animação hover, la no menu_topo :)
    $('.menuTopo a').hover(function(){
         $(this).stop().animate({color:'#ffffff'}, 'fast','swing' );
    }, function(){
         $(this).stop().animate({color:'#003d65'}, 'fast','swing' );
    });

    // o zé ja ta colocando scroll
    $('#scroll li').mouseover(function(){
		if($(this).attr('class') != 'primeira')
			clearTimeout(timeout);
		});

	$('#scroll li').mouseout(function(){
		if($(this).attr('class') != 'primeira')
			initSlider();
	});

    //mascara nos campos
    //$('#fone').mask('(99) 9999-9999');

});


hs.graphicsDir = 'highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.dimmingOpacity = 0.75;
// define the restraining box
hs.useBox = true;
hs.width = 800;
hs.height = 600;
// Add the controlbar
hs.addSlideshow({
    //slideshowGroup: 'group1',
    interval: 5000,
    repeat: false,
    useControls: true,
    fixedControls: 'fit',
    overlayOptions: {
        opacity: 1,
        position: 'bottom center',
        hideOnMouseOut: true
    }
});

function initSlider(){
		timeout = setInterval(function(){
		var altList = ($('#scroll li:first').outerHeight()+10) * -1;
		var topo = parseInt($('#scroll').css('top'))-1;
		if(topo <= altList){
			$('#scroll li:first').appendTo('#scroll');
			topo = topo-altList;
		}
		$('#scroll').css({top: topo+'px'});
		//alert(topo)

	}, 30);


}
