(function($){
	$(document).ready(function(){ // document ready starts
		$('a[rel="showVideo"]').click(function() {
			$.fancybox({
				'autoScale'		: false,
				'scrolling'		: 'yes',
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'title'			: this.title,
				'width'			: 450,
				'height'		: 350,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
					 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
		
			return false;
		});
		
		
		$('a[rel*="showZoomImage"]').fancybox({
			'transitionIn'	: 'elastic',
			'transitionOut' : 'fade',
			//'autoDimensions': false,
			'autoScale'		: false,
			'scrolling'		: true,
			'titlePosition' : 'inside'
		});
		
	}) // document ready ends
	
	$.fn.addZoomIcon = function(){
		img=document.createElement('img')
		img.src=src;
		img.className='pa'
		img.style.right=0;
		img.style.bottom=0;
		$(this).addClass('pr')
		$(this).append(img)
		
		w=($('img:last', $(this)).width())?$('img:last', $(this)).width():50;
		h=($('img:last', $(this)).height())?$('img:last', $(this)).height():50;
		w2=Math.floor((w/100*90));
		h2=Math.floor((h/100*90));
		
		$('img:last', this).css({opacity:minAlpha, width:w2, height:h2})
		$(this).hover(
			function(){$('img:last', this).stop(true,true).animate({'opacity':maxAlpha,width:w,height:h},500)},
			function(){$('img:last', this).animate({opacity:minAlpha,width:w2,height:h2},500)}
		)
	}
})(jQuery);
