(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'
		
		W=Math.floor((Width/100)*(Percentage));
		H=Math.floor((Height/100)*(Percentage));
		W2=Math.floor((Width/100)*(Percentage+10));
		H2=Math.floor((Height/100)*(Percentage+10));
		
		if(XPos=='left')img.style.left='1px';
		else if(XPos=='center')img.style.left=Math.floor(TargetWidth/2 - W/2)+'px';
		else if(XPos=='right')img.style.right='1px';
		else img.style.left=XPos+'px';
		
		if(YPos=='top')img.style.top='1px';
		else if(YPos=='center')img.style.top=Math.floor(TargetHeight/2 - H/2)+'px';
		else if(YPos=='bottom')img.style.bottom='1px';
		else img.style.top=YPos+'px';
		
		$(this).addClass('pr dib')
		$(this).append(img)
		
		
		
		$('img:last', this).css({opacity:MinAlpha, width:W, height:W})
		$(this).hover(
			function(){$('img:last', this).stop(true,true).animate({opacity:MaxAlpha,width:W2,height:H2},500)},
			function(){$('img:last', this).animate({opacity:MinAlpha,width:W,height:H},500)}
		)
	}
})(jQuery);
