jQuery(document).ready(
	function($)
	{
		//$(".torr_sl").hide();
		//$(".taltlink_sl").hide();
		//$(".post_sl").hide();
		//$(".scr_sl").hide();
		//$(".info_sl").hide();
		//$(".opt_sl").hide();
		//$(".vote_sl").hide();

		$(".ats_cl").hover(function () {
			$(".ts_cont").html($(".ats_sl").html());
			$(".ts_cont").slideDown("fast");
			return false;
		});
		$(".yts_cl").hover(function () {
			$(".ts_cont").html($(".yts_sl").html());
			$(".ts_cont").slideDown("fast");
			return false;
		});
		$(".acs_cl").hover(function () {
			$(".ts_cont").html($(".acs_sl").html());
			$(".ts_cont").slideDown("fast");
			return false;
		});
		$(".ycs_cl").hover(function () {
			$(".ts_cont").html($(".ycs_sl").html());
			$(".ts_cont").slideDown("fast");
			return false;
		});

		/*$(".ts_cont").hover(
			function(){
			$(".ts_cont").slideDown("fast");
			},
			function(){
			$(".ts_cont").slideUp("fast");
			}
		);*/


		$(".torr_cl").click(function () {
			var isVisible = $('.torr_sl').is(':visible');
			if(isVisible)
			{
				$(".torr_sl").hide();
			}
			else
			{
				$(".torr_sl").show();
			}
			return false;
		});
		$(".taltlink_cl").click(function () {
			var isVisible = $('.taltlink_sl').is(':visible');
			if(isVisible)
			{
				$(".taltlink_sl").hide();
			}
			else
			{
				$(".taltlink_sl").show();
			}
			return false;
		});
		$(".post_cl").click(function () {
			var isVisible = $('.post_sl').is(':visible');
			if(isVisible)
			{
				$(".post_sl").hide();
			}
			else
			{
				$(".post_sl").show();
			}
			return false;
		});
		$(".scr_cl").click(function () {
			var isVisible = $('.scr_sl').is(':visible');
			if(isVisible)
			{
				$(".scr_sl").hide();
			}
			else
			{
				$(".scr_sl").show();
			}
			return false;
		});
		$(".info_cl").click(function () {
			var isVisible = $('.info_sl').is(':visible');
			if(isVisible)
			{
				$(".info_sl").hide();
			}
			else
			{
				$(".info_sl").show();
			}
			return false;
		});
		$(".opt_cl").click(function () {
			var isVisible = $('.opt_sl').is(':visible');
			if(isVisible)
			{
				$(".opt_sl").hide();
			}
			else
			{
				$(".opt_sl").show();
			}
			return false;
		});
		$(".vote_cl").click(function () {
			var isVisible = $('.vote_sl').is(':visible');
			if(isVisible)
			{
				$(".vote_sl").hide();
			}
			else
			{
				$(".vote_sl").show();
			}
			return false;
		});

		$(".torrhide").click(function () {
			var isVisible = $('.torrblock').is(':visible');
			if(isVisible)
			{
				$(".torrblock").fadeOut('slow');
				$(".messblock").css("width","100%");
				$(".torrhide").html('<div style="margin-top:1px;width:18px;height:19px;background-position:0% 50%;background-image:url(./images/tracker/toggle.gif);float:right;"></div>');
			}
			else
			{
				$(".torrblock").fadeIn('slow');
				$(".messblock").css("width","100%");
				$(".torrhide").html('<div style="margin-top:1px;width:18px;height:19px;background-position:100% 50%;background-image:url(./images/tracker/toggle.gif);float:right;"></div>');
			}
			return false;
		});
		//a[title], img[title], input[title], select[title], li[title], span[title]
		$('a').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});
		$('img').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});
		$('input').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});
		$('select').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});
		$('li').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});
		$('span').tooltip({
			track: true,
			delay: 0,
			showURL: false,
			showBody: " - ",
			fade: 250
		});

		$("a.fancybox").fancybox({
			'modal': false,
			'titleShow': true,
			'titlePosition': 'inside',
			'autoScale': true,
			'autoDimensions': true,
			'scrolling': 'auto',
			'hideOnContentClick': true,
			'titleFormat': function(title, currentArray, currentIndex, currentOpts)
			{
				return '<div style="width:100%;white-space:pre-wrap;background-color:#FFFFFF;overflow:auto"><a href="' + $(this).attr('href') + '" target="_blank">' +  $(this).attr('href') + '</a></div>';
			}
		});
	}
);

function toggle_block(id)
{
	var el = document.getElementById(id);
	el.style.display = (el.style.display == 'none') ? '' : 'none';
}
