/* googgle analytics */

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-27295194-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);
  })();

/* googgle analytics */

$(document).ready(function(){
  
  $("a.fancybox").fancybox({
      'transitionIn'		: 'none',
      'transitionOut'		: 'none',
      'centerOnScroll'          : true,
      'titlePosition' 	        : 'over'
  });
  
  $("a.iframe").fancybox({
      'type'			: 'iframe',
      'width'			: 600,
      'height'			: 550,
      'hideOnContentClick': false,
      'transitionIn'		: 'none',
      'transitionOut'		: 'none',
      'centerOnScroll'       	: true,
      'titlePosition' 		: 'over',
      'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
				      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
      }
  });

 $("#land").click();

  

  $('#mybook').booklet({
    name	: 'Revista Saboreie', // name of the booklet to display in the document title bar
    width	: 825,  // container width
    height	: 550,  // container height
    pageNumbers	: false,
    arrows	: true,
    closed	: true
  });

  $('input[type=submit]').click(function(){
    return true;
  });

  $('a[rel="blank"]').click(function(){
    window.open($(this).attr('href'));
    return false;
  });

  $("input[type=text]").focus(function(){
    if (this.value == this.defaultValue){
      this.value = "";
    }
    if (this.value != this.defaultValue) {
      this.select();
    }

  });
  
    $('a[rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
    
    $("a[rel='toTop']").click(function(){
		$("html,body").animate({scrollTop:0}, "slow");
    });
    
    $(".opacity").mouseover(function() {
        $(this).stop().animate({'opacity':0.6}, 300);
    }),
    $(".opacity").mouseout(function() {
        $(this).stop().animate({'opacity':1.0}, 300);
    }); 

    $("#logo").mouseover(function() {
        $(this).stop().animate({'opacity':0.6}, 300);
    }),
    $("#logo").mouseout(function() {
        $(this).stop().animate({'opacity':1.0}, 300);
    });

    $(".gsw").mouseover(function() {
        $(this).stop().animate({'opacity':0.4}, 300);
    }),
    $(".gsw").mouseout(function() {
        $(this).stop().animate({'opacity':1.0}, 300);
    });

    $("input[type=submit]").mouseover(function() {
		$(this).stop().animate({'opacity':0.6}, 300);
    }),
    $("input[type=submit]").mouseout(function() {
        $(this).stop().animate({'opacity':1.0}, 300);
    }); 
    $(".buttons").mouseover(function() {
        $(this).stop().animate({'opacity':0.6}, 300);
    }),
    $(".buttons").mouseout(function() {
        $(this).stop().animate({'opacity':1.0}, 300);
    });
  

});

