/* PEGAR ALTURA TOTAL DA PAGINA */
$(document).ready(function(){
	var altura = $(document).height();
	$(".alturaTotal").height(altura);
});
/* PEGAR ALTURA TOTAL DA PAGINA */	

/* PLUGIN PARA PASSAR A PAGINA EM JQUERY */
$(function() {
    function slidePanel( newPanel, direction ) {
        // define the offset of the slider obj, vis a vis the document
        var offsetLeft = $slider.offset().left;

        // offset required to hide the content off to the left / right
        var hideLeft = -1 * ( offsetLeft + $slider.width() );
        var hideRight = $(window).width() - offsetLeft;

        // change the current / next positions based on the direction of the animation
        if ( direction == 'esquerda' ) {
            currPos = hideLeft;
            nextPos = hideRight;
        }
        else {
            currPos = hideRight;
            nextPos = hideLeft;
        }

        // slide out the current panel, then remove the active class
        $slider.children('.paginas-total.ativa').animate({
            left: currPos
        }, 10, function() {
            $(this).removeClass('ativa');
        });

        // slide in the next panel after adding the active class
        $( $sliderPanels[newPanel] ).css('esquerda', nextPos).addClass('ativa').animate({
            left: 0
        }, 10 );
    }

    var $slider = $('#fundo-total');
    var $sliderPanels = $slider.children('.paginas-total');

    var $navWrap = $('<div id="fundo-total-setas"></div>').appendTo( $slider );
    var $navLeft = $('<div id="fundo-total-setas-esquerda"></div>').appendTo( $navWrap );
    var $navRight = $('<div id="fundo-total-setas-direita"></div>').appendTo( $navWrap );

    var currPanel = 0;

    $navLeft.click(function() {
        currPanel--;

        // check if the new panel value is too small
        if ( currPanel < 0 ) currPanel = $sliderPanels.length - 1;

        slidePanel(currPanel, 'direita');
    });

    $navRight.click(function() {
        currPanel++;

        // check if the new panel value is too big
        if ( currPanel >= $sliderPanels.length ) currPanel = 0;

        slidePanel(currPanel, 'esquerda');
    });
});
/* PLUGIN PARA PASSAR A PAGINA EM JQUERY */


/* 	MASCARA PARA NUMEROS DE TELEFONES COM DDD */
function Telefone(objeto){ 
   if(objeto.value.length == 0)
     objeto.value = '(' + objeto.value;

   if(objeto.value.length == 3)
      objeto.value = objeto.value + ') ' +' ';

 if(objeto.value.length == 10)
     objeto.value = objeto.value + '-';
}
/* /MASCARA PARA NUMEROS DE TELEFONES COM DDD */


//-- Função para exibir calendarios nos campos data jquery do botao de gerar relatorio --//
$(function(){
	$("#campo_data").datepicker($.datepicker.regional['pt-BR']);
});
<!-- /Date picker -->

/*FANCYBOX*/
$(document).ready(function() {
	$(".various").fancybox({
		'width'				: '100%',
		'height'			: '100%',
		'autoScale'			: true,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'type'				: 'iframe'
	});
});
/*FANCYBOX*/


