﻿$(document).ready(function() {
   // SERVICES SCROLL
   var api = $('.services-scroll').scrollable({
      items: '.services',
      size: 1,
      clickable: false
   }).navigator({api: true});
   if ( $('.services-scroll').length ){
      api.onBeforeSeek(function(e, i) {
         if (i) {
            $("#intro").hide();
         } else {
            $("#intro").fadeIn(1000);
         }
      });
   }
   // PORTFOLIO
   $('.portfolio-thumb').hover(
      function() { // roll-over
        $(this).animate({opacity:1}, 200);
        $('.cover', this).stop().animate({top:'65px'},{queue:false,duration:160});
      },
      function() { // roll-out
        $(this).animate({opacity:0.8}, 80);
        $('.cover', this).stop().animate({top:'95px'},{queue:false,duration:160});
      }
   );
   
   if ( $('.portfolio-image a').length ){
      $('.portfolio-image a').overlay({
         target: '#gallery',
         expose: {color: '#000',loadSpeed: 200,opacity: 0.7},
         close: '.close-it'
      }).gallery({
         speed: 800,
         template: '<div class="title">${title}</div><div class="desc">${desc}</div><div class="nav">Imagem ${index} de ${total}</div>'
      });
   }
   if ( $('.portfolio-pages').length ){
      $('.portfolio-pages').scrollable({vertical:false,clickable:false,size: 1});
   }
   if ( $('.confirmation-box').length ){
      $('.modal-box').html( $('.confirmation-box').html() );
      $('.modal-box').overlay({
         top:'30%',
         expose: {color: '#000',loadSpeed: 200,opacity: 0.7},
         closeOnClick: false,
         api: true
      }).load();
   }
   $('a.overlay-box').colorbox({width:600, height:400, iframe:true});
   /*
   if ($('#contact_test').length){
      $('#contact_test').click(function(){
         $.getJSON('caralho', function(data){
            alert('TESTE: '+data.var3);
         });
      });
   }
   */
});

