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

		//$(".qr_sl").hide();

		$(".qr_cl").click(function () {

			var isHidden = $(".qr_sl").is(":hidden");
			if(isHidden)
			{
				$(".qr_sl").slideDown("slow");
			}
			else
			{
				$(".qr_sl").slideUp("slow");
			}
			/*$(".qr_sl").css("height", "100%");*/
			return false;
		});

		$(".qr_cl2").hover(function () {
			$(".qr_sl").show();
			return false;
		});

		$(".torr_cl").click(function () {
			var isVisible = $('.torr_sl').is(':visible');
			if(isVisible)
			{
				$(".torr_sl").hide();
			}
			else
			{
				$(".torr_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();
	}
);

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