function torrentShowInfo(){


if (!$(".boxTorrentInfo").is(":hidden")) {
$('.boxTorrentInfo').slideUp();
$('.showTorrentInfoLink').text("Pokaż szczegóły");
$.cookie('showTorrentInfo', 'none');
//location = '#torrentInfo';
}
else {
$('.boxTorrentInfo').slideDown();
$('.showTorrentInfoLink').text("Ukryj szczegóły");
$.cookie('showTorrentInfo', 'block');
//location = '#torrentInfo';
}

}

function torrentCancel(id) {
$('.jsTorrent').remove();
$('.boxTorrent .caption').show();
$('.boxTorrent .text').show();

}

function torrentThx(id) {
var data = {};
data['act'] = 'torrentThx';
data['id'] = id;

$.ajax({
type: "POST",
url: "/torrentJS.html",
data: data,
beforeSend: function(){ 
$('.torrentThx').html(Loading);
},
success: function(obj) {
$('#Loading').remove();
location.reload();
}
});

}

function torrentYtFetch(text) {

var data = {};
data['act'] = 'torrentYtFetch';
data['text'] = text;

$.ajax({
type: "POST",
url: "/torrentJS.html",
data: data,
beforeSend: function(){
$('.boxTorrentYt').html(Loading);
},
success: function(obj) {
$('#Loading').remove();
$('.boxTorrentYt').html(obj);
}
});

}

function torrentFiles(id) {

if ($('.jsFiles').text().length == 0) {

num = $('.boxTorrentInfo .files a').attr('title');

var data = {};
data['act'] = 'torrentFiles';
data['hash'] = id;

$.ajax({
type: "POST",
url: "/torrentJS.html",
data: data,
beforeSend: function(){ 
$('.boxTorrentInfo .files').after(Loading);
},
success: function(obj) {
$('#Loading').remove();
$('.boxTorrentInfo .files').after(obj);
}
});
$('.boxTorrentInfo .files a').text(num+' - Ukryj');
}
else {

if($('.boxTorrentInfo .files a').text() == num+' - Ukryj')
$('.boxTorrentInfo .files a').text(num+' - Pokaż');
else
$('.boxTorrentInfo .files a').text(num+' - Ukryj');

$('.jsFiles').toggle();
}

}

function torrentFetch(id,type) {

var data = {};
data['act'] = 'torrentFetch';
data['id'] = id;
data['type'] = type;

$.ajax({
type: "POST",
url: "/torrentJS.html",
data: data,
beforeSend: function(){ 
$('.boxTorrentWeryfikacja').after(Loading);
},
success: function(obj) {
$('#Loading').remove();
$('.boxTorrentWeryfikacja').html(obj);
}
});

}