jQuery(document).ready(function(){
	

	/*$('#home #slider') 
		.before('<div id="container-paginacao"><div id="nav-slider">') 
		.cycle({ 
			fx:     'fade', 
			speed:  'fast', 
			timeout: 5000, 
			pager:  '#nav-slider',
			cleartype:  true,
			cleartypeNoBg:  true
		});*/
		
		
		 
		
	
	
	$('.right #slider')
	
	.cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: 3000, 
		//pager:  '.right #nav-slider',
		
		pager:  '.right #nav-slider',
		cleartype:  true,
		cleartypeNoBg:  true,
		
		pagerAnchorBuilder: function(index, el) {
        return '<a href="#">'+(index+1)+'</a>'; // whatever markup you want
    }
		
		
		
	});
	
	
	
	
	$('#slider-seta').cycle({ 
		fx:     'scrollHorz', 
		speed:   500, 
		timeout: 0, 
		next:   '#nav-seta #next', 
		prev:   '#nav-seta #prev',
		cleartype:  true,
		cleartypeNoBg:  true
	});
	
	
	
	
	$('#slider-novidades') .cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: '', 
		pager:  '#nav-slider',
		cleartype:  true,
		cleartypeNoBg:  true,
		pagerAnchorBuilder: function(index, el) {
        return '<a href="#">'+(index+1)+'</a>'; // whatever markup you want
    }
	});
	
	$('#slider-receitas') .cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: '', 
		pager:  '#nav-slider',
		cleartype:  true,
		cleartypeNoBg:  true,
		pagerAnchorBuilder: function(index, el) {
        return '<a href="#">'+(index+1)+'</a>'; // whatever markup you want
    }
	});
	
	$('#slider-receitas-salada') .cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: '', 
		pager:  '#nav-slider-salada',
		cleartype:  true,
		cleartypeNoBg:  true,
		pagerAnchorBuilder: function(index, el) {
        return '<a href="#">'+(index+1)+'</a>'; // whatever markup you want
    }
	});
	
	jQuery('.autoclear').autoclear();
	
	
	
	/*jQuery.each(jQuery.browser, function(i, val) {
		
	   if(($.browser.msie == true && Number(jQuery.browser.version.substr(0,1)) < 9) || ($.browser.mozilla == true && Number(jQuery.browser.version.substr(0,1)) < 2)){
	   		$(".round").each(function(i){
				$(this).wrap("<div id='bri"+i+"' class='bri'>").before("<span class='ctl'></span><span class='ctr'></span><span class='cbl'></span><span class='cbr'></span>");
				$('#bri'+i).css({position:'relative', width:$(this).attr('width'), height:$(this).attr('height')});
			});
	   }
	 });*/
	
	
	jQuery('#slider-galeria').cycle({ 
		fx:     'scrollHorz', 
		speed:   500, 
		timeout: 0, 
		next:   '#bt-next', 
		prev:   '#bt-prev',
		cleartype:  true,
		cleartypeNoBg:  true
	});
	
	
	
	
	//$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000, allowresize: false, theme:'light_rounded'});
	
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
			animation_speed: 'fast', /* fast/slow/normal */
			slideshow: 10000, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: true, /* true/false */
			allow_resize: false, /* Resize the photos bigger than viewport. true/false */
			default_width: 640,
			default_height: 480,
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false, /* If set to true, only the close button will close the window */
			overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
			keyboard_shortcuts: true
		});


	
	sliderLojas();
});


function sliderLojas(){
	$('#slider-lojas').cycle('destroy');
	$('#slider-lojas') .cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: '', 
		pager:  '#nav-slider',
		cleartype:  true,
		cleartypeNoBg:  true,
		pagerAnchorBuilder: function(index, el) {
        	return '<a href="#">'+(index+1)+'</a>'; // whatever markup you want
		}
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000, theme:'light_rounded'});
}


function setMenu(){
	
	$('#menu a').click(function() {
		var target		 = $(this).attr('href');
		
		marcaMenu('#menu', this);
		
		$('html,body').animate({scrollTop: $(target).offset().top}, 1500);
		return false;
	});
}


function marcaMenu(div, id){

	$(div + ' a').removeClass('selected');
	$(id).addClass('selected');
}


function setMenuServicos(){
	
	$('#menu-servicos a').click(function(){
		var target = $(this).attr('href');
		var n	   = Number($(this).attr('rel'));

		marcaMenu('#menu-servicos', this);	
				
		$('#servicos #slider').cycle(n); 
		return false; 
	});
	
	
}



function displayItem(id){
	
	var status = jQuery(id).css("display");

	if(status == 'none'){
		jQuery(id).show("fast");
	}else{
		jQuery(id).hide("fast");
	}
}

