$(function()
{
	if (typeof($.fancybox) != 'undefined')
	{
		$("a.t").fancybox({
			'hideOnContentClick' : true,
			'transitionIn'       :	'fade',
			'transitionOut'      :	'fade',
			'speedIn'            :	600,
			'speedOut'           :	200,
			'overlayShow'        :	false,
			'titlePosition'      :	'over',
			'titleFormat'        :	function(title, currentArray, currentIndex, currentOpts)
									{
										return '<span id="fancybox-title-over">SF4Tube Screen ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
									}
		});
	}
});

function get_cookie(cookieName)
{
	var re = new RegExp(cookieName + "=([^;]+)");
	var value = re.exec(document.cookie);
	return (value != null) ? unescape(value[1]) : null;
}

function set_cookie(cookieName, cookieValue, nMinutes)
{
	var today = new Date();
	var expire = new Date();

	if (!nMinutes) nMinutes = 60 * 24 * 7;
	expire.setTime(today.getTime() + 60000 * nMinutes);
	document.cookie = cookieName + "=" + escape(cookieValue) + "; domain=" + location.hostname.replace('www', '') + "; expires=" + expire.toGMTString();
}

