function banner() {

    $('#super_banner_inner').cycle({

	       fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...

	       timeout: '6000',

	       delay:   -2000,

		   pager:  '#banner_nav',

		   slideExpr: '.super_banner_cycle',

		   activePagerClass: 'activeBN'

	       //before: sliderResizer

       });

	};

	function pageimg() {		

		$("div.page_img").cycle();

	}

	function depoimentos() {

    $('#depoimentos').cycle({

	       fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...

	       timeout: '6000',

	       delay:   -2000,

		   slideExpr: '.depoimento'

	       //before: sliderResizer

       });

	};

	function imgSlider() {

    $('#slider').cycle({

	       fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...

	       timeout: '6000',

	       //delay:   -2000,

		   slideExpr: '.slide'

	       //before: sliderResizer

       });

	};

	function slider(){

	   $('#prod_slider').css({'height': '280px', 'overflow': 'hidden'});

           //var bar_height = $('#search_bar').height();

           var slider_height = $('#pro_slider_conteiner').height();

           //var total_height = slider_height + bar_height;

           var open_img = "url(imagens/more_btn.png) no-repeat top center";

           var close_img = "url(imagens/more_btn.png) no-repeat center -110px";

           $('#more_btn').toggle(

           function() {

		   $('#prod_slider').animate({height: slider_height,'padding-bottom': '15px' }, 300);

		   $('#more_btn').css({'background': close_img});

		   $('#more_btn span').text('menos..');  

           }, function() {

		   $('#prod_slider').animate({'height':'280px', 'padding-bottom': '0px'}, 300);

		   $('#more_btn').css({'background': open_img});

           $('#more_btn span').text('mais..');

       });

	 

	};

	function scrollbar(){

		$('div#slider_bloco').jScrollPane();

	}

	

$(document).ready(function(){

	var loading = $('#loading').html('<span><img src="imagens/loader.gif"/></span>');

	// Expand Panel

	$("a[rel*='popup']").click(function(event){

		event.preventDefault();

		$('div#slider_content').remove();

		loading.show();

		//var html = $(this).html();

		var href = $(this).attr('href');

		

		$("div#slider_bg").append('<div id="slider_content"></div>');

		$('#slider_content').css('display','none');

		var height = '';

		var heightVal2 = '';

		$('div#slider_content').load(href, function(){

				    heightVal2 = $(this).height();

				var minHeight = 450;

				//alert(heightVal2 + ',' + minHeight);

				

				if( minHeight >= heightVal2 ) {

					height = minHeight + 'px'; 

				} else {

					height = heightVal2;

				}

				$("div#slider_bg").animate({

			       'height': height

		         },400, function(){

					    $('div#slider_content').fadeIn(1000, function(){

				                loading.fadeOut(500);

			             });

					 

				 });

			

			

		});

	});

	// Collapse Panel

	$("div#slider_bg").click(function(event){

		event.preventDefault();	

		

		$('div#slider_content').animate({

			  'height': '0px',

			  'display': 'none'

		},300, function(){

			$('#slider_bg').css('height','0');

		     $('div#slider_content').remove();	

		});

		

	});

	

	/*$('.prod_tabs_nav li a').click(function(){

	    var tabHeight = $('#prod_tabs').height();

		var imgHeight = $('.tabimg').css('height');

		alert(tabHeight + ' , ' + imgHeight);

		if( imgHeight < tabHeight + 'px' ){	

			imgHeight = tabHeight + 50 + 'px';

		} else {

			imgHeight = 300;

		}

		

	});*/

	

});


