/* google analytics script */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6077200-1']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();  

/* end analytics */

function PopUp(url, w, h)
{
    if ( width != '' || height != ''){
        var width = x;
        var height = h;
    } else {    
        var width = 300;
        var height = 500;
    }

    window.open(url, 'PopUp_Window', 'width='+width+',height='+height+',resizable=no');

};

$(document).ready(function(){
/*
    $('input[type=submit]').click(function(){
        return true;
    });
*/
    $('a[rel="blank"]').click(function(){
        window.open($(this).attr('href'));
        return false;
    });

    $('#slides').nivoSlider({

        effect: 'sliceDown',
        slices: '8',
        captionOpacity: 0.8,
        controlNav: true

    
    });

    $("#phone").mask("(99) 9999-9999");
/*
   	$('#form_contact').submit(function(e){
		var name    = $('#name').val();
		var email   = $('#email').val();
		var phone   = $('#phone').val();
        var city    = $('#city').val();
        var subjt = $('#subjt').val(); 
		var message = $('#message').val();
		e.preventDefault();
		$.post('pages/interna-submit.php', { name: name, email: email, phone: phone, city: city, subjt: subjt, message: message }, function (data){
			$.jnotifica(data);			
			});
		}); 
   
    $('#form_denuncie').submit(function(e){
		var city     = $('#city').val();
        var state    = $('#state').val();
		var message  = $('#message').val();
		e.preventDefault();
		$.post('pages/interna-submit-denuncia.php', { city: city, state: state, message: message }, function (data){
			$.jnotifica(data);			
			});
		}); 
*/
       $('.Newsletter').submit(function(e){
		var name_n     = $('#name_n').val();
        var email_n    = $('#email_n').val();

		e.preventDefault();
		$.post('pages/interna-submit-newsletter.php', { name_n: name_n, email_n: email_n }, function (data){
			$.jnotifica(data);			
			});
		});  

    $("#slider").easySlider({
        prevId:'btnPrev',
        nextId:'btnNext',  
        prevText: "<img src='assets/img/arrowRight.png'' title='Anterior' border='0' />",
        nextText: "<img src='assets/img/arrowLeft.png' title='Próximo' border='0' />"
    

    });
       

    $("input[type=text]").focus(function(){
    if (this.value == this.defaultValue){
        this.value = "";
    }
    if (this.value != this.defaultValue) {
        this.select();
    }

    });
    


  /*  $(document).ready(function() {
		$("a#iframe").fancybox({
			'width'				: 800,
			'height'			: 440,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'autoScale'			: true,
			'type'				: 'iframe',
			'overlayColor'		: '#000',
			'overlayOpacity'	: 0.5
	    });
      }); */
        
    // Load theme
    Galleria.loadTheme('src/themes/classic/galleria.classic.js');
    
    // run galleria and add some options
    $('#galleria').galleria({
        image_crop: false, // crop all images to fit
        thumb_crop: false, // crop all thumbnails to fit
        transition_speed: 400, // slow down the crossfade
        data_config: function(img) {
            // will extract and return image captions from the source:
            return  {
                title: $(img).parent().next('strong').html(),
                description: $(img).parent().next('strong').next().html()
            };
        },
    });

       
        

});





