// SL COLECT

//jQuery Cycle Plugin:
$(function() {
    $('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        pager:  '#nav',
		timeout:       9000,
		pause:  'true',
        pagerAnchorBuilder: function(idx, slide) {
return '<a href="#">'+ $(slide).attr('title') +'</a>';
}

    });
	
    $('#content-lojas').cycle({
        fx:     'fade',
        speed:  'slow',
        pager:  '#nav',
		width:  false,
        pagerAnchorBuilder: function(idx, slide) {
return '<a href="#">'+ $(slide).attr('title') +'</a>';
}

    });
    
});


//jQuery Fancybox Plugin:
$(document).ready(function() {
	$("#receitashowcontact, #receitashowcontact2").fancybox({
		'width'				: 340,
		'height'			: 540,
		'type'				: 'iframe'
	});
		
	$(".trabalhe-conosco").fancybox({
		'width'				: 340,
		'height'			: 280,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$(".institucional").fancybox({
		'width'				: 540,
		'height'			: 300,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$(".sac").fancybox({
		'width'				: 600,
		'height'			: 370,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$(".fale-conosco").fancybox({
		'width'				: 340,
		'height'			: 350,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
});

//Input Clear

    $(function(){
        $('#searchform').each(function(){
            var vGeral = $(this).children('input[type="text"], textarea').val();
            $(this).children('input[type="text"], textarea').focus(function(){
                var thisValue = $(this).val();
                if (vGeral == thisValue){
                    $(this).val('');
                }
            }).blur(function(){
                var thisValue = $(this).val();
                if (thisValue == ''){
                    $(this).val(vGeral);
                }
            });
 
        });
    });

//Input Mask

$(document).ready(function() {

	$('input[name="campo_cep"]').setMask('cep');
	//CNPJ
	$('input[name="cf7_field_4"]').setMask('cnpj');
	
	//INSCRICAO ESTADUAL
	$('input[name="cf7_field_5"]').setMask('999.999.999.999');
	
	
	//NUMERO
	$('input[name="cf7_field_7"]').setMask('99999');
	$('input[name="cf7_field_17"]').setMask('99999');
	
	
	//CEP
	$('input[name="cf7_field_11"]').setMask('cep');
	$('input[name="cf7_field_21"]').setMask('cep');
	
	
	//TELEFONE
	$('input[id="telefone"]').setMask('phone');
	$('input[name="cf7_field_25"]').setMask('phone');
	$('input[name="cf7_field_30"]').setMask('phone');
	
});
