    $(document).ready(function() {

            $("a[rel='zoomFotos']").colorbox();

            separator = ''; // To separate paginator's items
            paginatorPosition = 'bottom'; // where you want the paginator to be. Accepted values are 'top','bottom','both'
            paginatorStyle = 3; // To define which style of paginator you need.
            enablePageOfOption = false; // it shows on which are you currently, i.e. Page 3 of 6 , if turned true
            enableGoToPage = false; // shows a drop down of all pages for go/jump to any page user want to go, if turned true. Useful incase there are large no. of pages
            enableSelectNoItems = false; // if you want to change items per page on the fly.
            itemsPerPage = 8;
            $("#clipping, #projetos, #release").pagination();

           $(".getRelease").click(function() {
                var cod = $(this).attr('id');
                 $.fn.colorbox({iframe: true, width:"700px", height:"550px", href:"getRelease.php?cod="+cod});
                return false;
           });

            $(".subLista").hide();
            $("a.listaCategoria").click( function () {
                var href = $(this).attr("href");
                $(".subLista").each(function() {
                    if ($(this).css("display")=="block") {
                        $(this).slideUp(800).delay(400);
                    }
                });
                $("#categorias").slideUp(800);
                $(href).slideDown(800);
            });

            $("a.voltar").click( function () {
                $(".subLista").each(function() {
                    if ($(this).css("display")=="block") {
                        $(this).slideUp(300);
                    }
                });
                $("#categorias").slideDown(800);
            });
            

            $('.clienteTitulo, .getProjeto').each(function() {

                $(this).qtip({
                content: {
                   text: $(this).next(".clienteDesc").html(),
                   title: {text: $(this).html()}
                },
                  position: {
                     corner: {
                        target: 'topRight',
                        tooltip: 'bottomLeft'
                     }
                     , adjust: {screen: true}
                  },
                  style: {
                     name: 'green',
                     padding: '7px 13px',
                     width: {
                        max: 310,
                        min: 0
                     },
                     tip: true,
                     border: {
                         width: 3,
                         radius: 8
                      }
                  }
               }).attr('href', '#');
           });

           $('.openYoutube').each(function() {
              var videoID = $(this).attr('href').match(/watch\?v=(.+)+/);
              videoID = videoID[1];

              $(this).qtip({
                 content: '<div id="youtube-embed-'+videoID+'">You need Flash player 8+ to view this video.</div>',
                 position: {
                    corner: {
                       tooltip: 'bottomLeft', // ...and position it center of the screen
                       target: 'topRight' // ...and position it center of the screen
                    }
                    , adjust: {screen: true}
                 },
                 show: {
                    when: 'click', // Show it on click...
                    solo: true // ...and hide all others when its shown
                 },
                 hide: 'unfocus', // Hide it when inactive...
                 style: {
                    width: 432,
                    height: 264,
                    padding: 0,
                    tip: true,
                    name: 'green',
                    border: {
                         width: 3,
                         radius: 8
                      }
                 },
                 api: {
                    onRender: function()
                    {
                       // Setup video paramters
                       var params = {allowScriptAccess: 'always', allowfullScreen: 'false'};
                       var attrs = {id: 'youtube-video-'+videoID};

                       // Embed the youtube video using SWFObject script
                       swfobject.embedSWF('http://www.youtube.com/v/'+videoID+'&enablejsapi=1&playerapiid=youtube-api-'+videoID,
                                         'youtube-embed-'+videoID, '425', '264', '8', null, null, params, attrs);
                    },

                    onHide: function(){
                       // Pause the vide when hidden
                       var playerAPI = this.elements.content.find('#youtube-video-'+videoID).get(0);
                       if(playerAPI && playerAPI.pauseVideo) playerAPI.pauseVideo();
                    }
                 }
              }
              ).attr('href', '#');
           });
      });

    function imprimeErro(erro) {
        $("#alertObj").toggle();
        $("#alertObj").empty().html(erro);
        $("#alertObj").fadeIn();
    }

    $.fn.enviar = function(){

        var nome = $("#nome").val();
        var email = $("#email").val();
        var mensagem = $("#mensagem").val();
        var regmail = /^[\w!#$%&amp;'*+\/=?^`{|}~-]+(\.[\w!#$%&amp;'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;

        if (nome.length == 0) {
            $("#nome").focus();
            imprimeErro("Complete com seu nome.");
            return false;
        } else if(email == "" || (email != "" && !regmail.test(email))) {
            $("#email").focus();
            imprimeErro("Complete com seu e-mail.");
            return false;
        } else if (mensagem == "") {
            $("#mensagem").focus();
            imprimeErro("Complete com sua mensagem.");
            return false;
        } else {
            $.post('contato_enviar.php', {
                    acao: "enviar",
                    nome: nome,
                    email: email,
                    mensagem: mensagem
                }, function(data){
                    imprimeErro(data);
                    document.frmContato.reset();
           });
        }
    };
