// ************************************
// FAncybox nomes per a videos	
// ************************************
jQuery(document).ready(function() {
	jQuery("a.video_porta").click(function() {
		jQuery.fancybox({
		 'overlayShow'		   : true,
         'padding'             : 0,
         'autoScale'   		   : false,
         'transitionIn'        : 'none',
         'transitionOut'       : 'none',
         'title'               : this.title,
         'width'               : 680,
         'height'              : 495,
         'href'                : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
         'type'                : 'swf',
         'swf'                 : {'allowfullscreen':'true'}
         });
        return false;
   });
  jQuery("a.img_napi").fancybox();


//		PEr fer els destacat en forma de caixxa
    function smartColumns() {
    	jQuery("ul.column").css({ 'width' : "100%"});
      var colWrap = jQuery("ul.column").width();
      var colNum = Math.floor(colWrap / 200);
      var colFixed = Math.floor(colWrap / colNum);
      jQuery("ul.column").css({ 'width' : colWrap});
      jQuery("ul.column li").css({ 'width' : colFixed});
    }

    smartColumns();

    jQuery(window).resize(function () {
      smartColumns();
    });
//		    PEr fer els destacat efecte hover a home mapas
    jQuery("div.block a img").hover(
    		
    function() {
    	jQuery(this).stop().animate({"opacity": "1"}, "fast");
    },
    function() {
    	jQuery(this).stop().animate({"opacity": "0.6"}, "slow");
    });
    
//		    PEr fer els destacat efecte hover a home
    jQuery("div.block_home a img").hover(
    		
    function() {
    	jQuery(this).stop().animate({"opacity": "1"}, "fast");
    },
    function() {
    	jQuery(this).stop().animate({"opacity": "0.6"}, "slow");
    });
//		    PEr a que aparegui titol al buscador
    jQuery("#searcher_header p.info").hover(
		    
    function() {
    	jQuery(this).stop().animate({"opacity": "1"}, "slow");

    });
    
//    PEr fer pujar la pagina cap al header   
	jQuery('#backToToper').click(function() {
		
		var _opt = {
				
				duration: 800,
				easing: "easeInOutExpo"
			};
			
			
		jQuery('html, body').animate({

				scrollTop:0	
			},
				_opt
			);
			
		return false;
	});    
  });
