// JavaScript Document

$(document).ready(function() {

// News reader

	$('#n_res').rssfeed('http://www.mirc2050.com/blog/category/residenziale/feed', { limit: 2});
	$('#n_amm').rssfeed('http://www.mirc2050.com/blog/category/pubblica-amministrazione/feed', { limit: 2});
	$('#n_mon').rssfeed('http://www.mirc2050.com/blog/category/mondo-energia/feed', { limit: 1});

// Slideshow

$('#slide').crossSlide({
  speed: 20,
  fade: 2
}, [
  { src: '_slideshows/1.jpg', dir: 'left'   },
  { src: '_slideshows/2.jpg',   dir: 'right' },
  { src: '_slideshows/3.jpg',  dir: 'left'   }, 
  { src: '_slideshows/6.jpg', dir: 'right' }
]);

// Youtube RSS

$(window).load(function() {
	$('#you_box').youTubeChannel({ 
		userName: 'Mirc2050',
		channel: 'uploads',
		linksInNewWindow: true
	});
});

// YouTube FancyBox

$(".videolink").click(function() {
  $.fancybox({
	  'padding'			: 10,
	  'autoScale'		: true,
	  'transitionIn'	: 'linear',
	  'transitionOut'	: 'linear',
	  'title'			: this.title,
	  'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
	  'type'			: 'swf',
	  'swf'			: {
		'wmode'				: 'transparent',
		'allowfullscreen'	: 'true'
	  }
  });

		return false;
});

});
