$(function(){

	if( $('body').hasClass('home') ){
		$('#slideshow').cycle({ 
			fx: 'fade',
			pager: '#slideshowNavi',
		  pagerAnchorBuilder: function(idx, slide) { 
		      // return selector string for existing anchor 
		      return '#slideshowNavi li:eq(' + idx + ') a'; 
		  }		
		});		
	}
	
	$('#submitNewsletter').bind('click', function(e){
		e.preventDefault();
		
		var $this = $(this);
		var text = $this.attr('data-text');
		var $checkbox = $('#newsletterCondition');
		
		$('#resultado').html();
		
		if( $checkbox.is(':checked') ){
			Inscribe();
		} else {
			$('#resultado').html(text);
		}
	});
	
	$('a[href$=.rtf]').addClass('pdfIcon');
	
	$('.panorama-view').panorama360();
	
	$('#panoramaNavi a').bind('click', function(e){
		e.preventDefault();
		$('#panoramaNavi').find('a').removeClass('active');
		
		var $this = $(this);
		var src = $this.attr('data-src');
		var width = $this.attr('data-width');
		var height = $this.attr('data-height');
		var $img = $('#panoramaWrap').find('img');
		
		$this.addClass('active');
		$img.attr('src', src);
		$img.attr('data-width', width);
		$img.attr('data-height', height);	
	});
	
	$('.facebookWraper').hover(
    function () {
      $(this).animate({left: '-0px'}, 500);
    }, 
    function () { 
      $(this).animate({left: '-304px'}, 500);
    }
  );	

});
