function videosThumbnails(){
	
	$('.mainFileLinkActivate').click(function(){
		$(".mainFileLink").toggle();
	});
	
	$(".mainFileLinkActivate").tipTip({
		delay: 0,
		edgeOffset: 7,
		defaultPosition: "top"
	});
	
	$('.flash, .divx').click(function(){
		recordDownload($(this).attr('rel'));
		_gaq.push(['_trackPageview', "play", $(this).find('img').attr('alt')]);
	});
	
	$("#uploadLinkImg").tipTip({
		delay: 0,
		edgeOffset: 5,
		defaultPosition: "top"
	});
	
	flowplayer("a.flash", "swf/flowplayer-3.2.7.swf", {
		key: '#$e10283ac48be57f36b2',
		onFullscreen: function () {
			this.getClip().update({scaling: "fit"});
		},
		onFullscreenExit: function () {
			this.getClip().update({scaling: "scale"});
		},
		plugins:  {
			controls:  {
				volume: false,
				backgroundColor: "transparent",
				backgroundGradient: "none",
				sliderColor: '#FFFFFF',
				sliderBorder: '1.5px solid rgba(160,160,160,0.7)',
				volumeSliderColor: '#FFFFFF',
				volumeBorder: '1.5px solid rgba(160,160,160,0.7)',

				timeColor: '#ffffff',
				durationColor: '#535353',

				tooltipColor: 'rgba(255, 255, 255, 0.7)',
				tooltipTextColor: '#000000'
			}	
		},
		onBeforeClick: (function(){
			$(this.getParent()).next().hide();
		}),
		onBeforeStop: (function(){
			$(this.getParent()).next().delay(400).fadeIn();
		})
	});
	
	//console.log("config.toolTipEffect : " + config.toolTipEffect);
	
//	$(".thumbnailVideo").tooltip({
//		offset: [-195,-20],
//		effect: config.toolTipEffect,
//		tipClass: 'tool',
//		delay: 0
//	});
	
	$("#switchViewThumb2").tipTip({
		delay: 0,
		edgeOffset: 7,
		defaultPosition: "top"
	});
	
	
	
	/*if ($('.divx').size() > 0){
		
		// HIGHSLIDE
		
		hs.graphicsDir = 'images/highslideGraphics/';
		hs.align = 'center';
		hs.transitions = ['expand', 'crossfade'];
		hs.outlineType = 'rounded-white';
		hs.fadeInOut = true;
		hs.wrapperClassName = 'draggable-header';
		hs.captionEval = '';
		hs.dimmingOpacity = .3;
		hs.showCredits = false;
		
		if (hs.Expander.prototype.onAfterExpand == null){
			hs.Expander.prototype.onAfterExpand = function (sender) {
				var plugin;
				if(navigator.userAgent.indexOf('MSIE') != -1 || navigator.userAgent.indexOf('Safari') != -1)
				    plugin = document.getElementById('ie_plugin');
				else
				    plugin = document.getElementById('np_plugin');
			    if(plugin != null){
			    	//plugin.GoWindowed();
			        plugin.GoFullscreen();
			    }
			}
		}
		
		if (hs.Expander.prototype.onBeforeClose == null){
			hs.Expander.prototype.onBeforeClose = function (sender) {
				var plugin;
				if(navigator.userAgent.indexOf('MSIE') != -1 || navigator.userAgent.indexOf('Safari') != -1)
				    plugin = document.getElementById('ie_plugin');
				else
				    plugin = document.getElementById('np_plugin');
			    if(plugin != null){
			        plugin.Stop();
			    }
			}
		}
	}*/
	
	removeAjaxEvents = function(){
		$('.divx, .flash, .closebutton').unbind();
		$("#tiptip_holder").remove();
		$f("*").each(function() {
			this.unload();
		});
	};
}

// For videos not encoded yet
function videoThumbnail(containerId, playerId){
	
	$('#' + playerId).click(function(){
		recordDownload($(this).attr('rel'));
	});
	
	flowplayer(playerId, "swf/flowplayer-3.2.7.swf", {
		key: '#$e10283ac48be57f36b2',
		onFullscreen: function () {
			this.getClip().update({scaling: "fit"});
		},
		onFullscreenExit: function () {
			this.getClip().update({scaling: "scale"});
		},
		plugins:  {
			controls:  {
				volume: false,
				backgroundColor: "transparent",
				backgroundGradient: "none",
				sliderColor: '#FFFFFF',
				sliderBorder: '1.5px solid rgba(160,160,160,0.7)',
				volumeSliderColor: '#FFFFFF',
				volumeBorder: '1.5px solid rgba(160,160,160,0.7)',

				timeColor: '#ffffff',
				durationColor: '#535353',

				tooltipColor: 'rgba(255, 255, 255, 0.7)',
				tooltipTextColor: '#000000'
			}	
		},
		onBeforeClick: (function(){
			$(this.getParent()).next().hide();
		}),
		onBeforeStop: (function(){
			$(this.getParent()).next().delay(400).fadeIn();
		})
	});
	
	$("#" + containerId).tooltip({
		offset: [-195,-20],
		effect: config.toolTipEffect,
		tipClass: 'tool',
		delay: 0
	});
	
	removeAjaxEvents = function(){
		$('.divx, .flash, .closebutton').unbind();
		$f("*").each(function() {
			this.unload();
		});
	};
}
