/* site.js by Rob Martin, Rockstar Design */
// Added by Chris  sidebar videos using Fancybox
  $(document).ready(function() {

	$("a.beyond-gallery-img").fancybox({
			
				'titlePosition'		: 'inside',
				'type'		        : 'iframe',	
				'width'		        : 480,
				'height'	        : 700
                                
	
	});  

	$("a.vidfbx").click(function() {
			$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'overlayOpacity': 0.5,
				'overlayColor'	: '#000000',
				'title'			: this.title,
				'width'			: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
				'wmode'			: 'transparent',
				'allowfullscreen'	: 'true'
						}
			});
			return false;
		});
});

// End all additions

// Image preloader
(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)
