(function(){
var i=true,j=null,p=false;function $t(a){return typeof $t_data=="object"?a in $t_data?$t_data[a]:a:a}if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,b){if(b==j)b=0;else if(b<0)b=Math.max(0,this.length+b);for(var c=b,d=this.length;c<d;c++)if(this[c]===a)return c;return-1};
var s=function(a){function b(m,o){var k=$("#ac_results").empty().width(q.width());h=m.length;e=-1;if(h===0)f();else if(h>0){o=$.trim(q.val());o=o.toLowerCase();if(o.length>0){var t=q.position();k.css({top:t.top+24,left:t.left});for(t=0;t<h;++t)k.append($("<p></p>").attr("id","ac_opt_"+t).attr("class","ac_inactive").html(unescape(m[t].replace(o,"<b>"+o+"</b>"))).bind("mouseover",function(){$(".ac_active").attr("class","ac_inactive");$(this).attr("class","ac_active")}).bind("mouseout",function(){$(this).attr("class",
"ac_inactive")}).bind("click",function(){d($(this),2)}));k.append($("<a></a>").attr({href:"#","class":"ac_close"}).text($t("Close")).bind("click",function(){c();return p}));k.css("display","block")}else f()}}function c(){l=p;f();q.attr("autocomplete","on");return this}function d(m,o){if(m.html()!=j){var k=m.html().replace(/<B>|<\/B>/gi,"");if(o==undefined||o==2)q.val(k);if(o!=undefined){f();k=$("#ac_form");if(k.length)k=q.parent();k.length&&k.submit()}}}function f(){e=-1;$("#ac_results").css("display",
"none")}function g(m,o){$.trim(q.val().toLowerCase())===m.toLowerCase()&&$.ajax({dataType:"jsonp",url:ac_server+"/"+encodeURIComponent(m)+"?callback=?&t="+o,success:function(k){var t=parseInt(k.t);if(t>=n){n=t;r[m]=k.r;++y;b(k.r,m)}}})}var e=-1,h=0,l=i,n=0,r=[],y=0,q;return{bind:function(){q=$(a);if(typeof ac_server==="undefined")return c();q.attr("autocomplete","off");q.bind("keyup",function(m){var o=(new Date).getTime(),k=$.trim($(this).val());k=k.toLowerCase();if(!([40,38,13,27].indexOf(m.keyCode)!=
-1||!l))if(k.length>0)r[k]!==undefined?b(r[k],k):setTimeout(function(){g(k,o)},0);else f()});$(document).bind("keyup",function(m){if(m.keyCode===27)f();else if(m.keyCode!=undefined){$(".ac_active").attr("class","ac_inactive");switch(m.keyCode){case 40:if(e==-1)e=0;else if(++e>=h)e=0;$("#ac_opt_"+e).attr("class","ac_active");d($("#ac_opt_"+e));break;case 38:if(e==-1)e=h-1;else if(--e<0)e=h-1;$("#ac_opt_"+e).attr("class","ac_active");d($("#ac_opt_"+e));break;case 13:if(e!=-1){m=$("#ac_opt_"+e);m.length&&
d(m,1)}else f();break;case 37:case 39:case 8:e=-1}}});$("body").bind("click.autocompleter",function(){$(this).attr("id").indexOf("ac_")===-1&&f()});return this},ia:c}}("#ac_q");
(function(a){a.fn.X=function(b){var c=this;b=a.extend({B:"tactive",q:"tnactive",da:".toptions",C:0,A:"href"},b||{});a(this).each(function(){var d=a(this).find(b.da).children(),f;d.each(function(g){a(this).addClass(b.q);a(this).click(function(e){e.preventDefault();a(this).addClass(b.q);e=c.find(a(this).attr(b.A));if(e.length===0)throw"Could not find matching tab content for id: "+a(this).attr(b.A);f.removeClass(b.B).addClass(b.q);a(f.attr(b.A)).hide();a(this).removeClass(b.q).addClass(b.B);e.show();
f=a(this)});if(g===b.C||g===0&&d.length-1<b.C){f=a(this);a(this).trigger("click")}})})}})(jQuery);function u(){v("FFhide",1,365,"/");$("#addFFExtension").css("display","none")}function w(a){cookie=z(a);return cookie==j?p:i}function z(a){var b=document.cookie.indexOf(a+"="),c=b+a.length+1;if(!b&&a!=document.cookie.substring(0,a.length))return j;if(b==-1)return j;a=document.cookie.indexOf(";",c);if(a==-1)a=document.cookie.length;return unescape(document.cookie.substring(c,a))}
function v(a,b,c,d){var f=new Date,g=new Date;if(c==j)c=1;g.setTime(f.getTime()+864E5*c);cookieStr="";cookieStr=a+"="+escape(b);if(c>0)cookieStr+=";expires="+g.toGMTString();cookieStr+=";path="+d+";domain="+cookie_domain;document.cookie=cookieStr}
function A(a){a!=undefined&&a!=""&&$.ajax({url:global_path+"ajax_add_to_downloads_history.html",timeout:1E4,type:"post",data:{file_id:a},success:function(b){if(b.match(/not logged/))window.location=global_path+"account/login.html?continue="+window.location;if(b.match(/empty fid/)||b.match(/incorect fid/))alert($t("Something went terribly wrong ..."));b.match(/file not exist/)&&alert($t("Unfortunately this file doesn't exist in our database anymore ..."));b.match(/file already in history/)&&alert($t("This file is already in your history ..."));
b.match(/ok/)&&$("#add_to_history_span").empty().append($("<a></a>").attr("href",global_path+"account/history.html").css("cursor","pointer").text($t("Go to your downloads history")))}})}
var B=function(){function a(f){$(f).bind("mousemove.stars",function(g){g=g.pageX-$(this).offset().left;for(var e=d.length-1;e>=0;e--)if(d[e]<g){c=e+1;break}$(this).attr("class","star"+c)});$(f).bind("mouseout.stars",function(){c=b;$(this).attr("class","star"+c)});$(f).bind("click.stars",function(){var g=$(f).parent();g.empty().append($("<img>").attr("src",static_path+"images/ajax-loader.gif"));$.ajax({url:global_path+"ajax_link_rate.html?link_id="+$(this).attr("id")+"&rate="+c,success:function(e){e=
e.split("-");var h=parseFloat(e[0]);g.empty().append($("<div>").css({margin:"0px 10px 0 0","float":"left","line-height":"22px"}).text($t("Thanks for your rate"))).append($("<div>").attr("class","star"+Math.round(h)).css({"float":"left","line-height":"22px"})).append($("<div>").addClass("votes_info").text("("+e[1]+" "+$t("votes")+", "+$t("average")+": "+h+" "+$t("out of")+" 5)"))}})})}var b,c,d=[0,17,33,49,66];return{bind:function(f,g){b=c=parseInt(g.replace("star",""));a(f)}}}();
function C(a,b){this.f=a;this.O=b;this.timeout=3E3;this.i={};this.p={};this.J=35;this.replaceWith="..."}C.prototype.R=function(a){if(a.length==0)return p;for(var b=p,c="",d=0;d<a.length;d++)c+=a[d].key+",";c=c.substring(0,c.length-1);var f=setTimeout(function(){b=i},this.timeout);$.ajax({dataType:"jsonp",url:this.f+"/check/"+c,success:function(g){clearTimeout(f);if(!b)for(var e in g.result)parseInt(g.result[e],10)>0&&$("#"+e).show()}})};
C.prototype.Y=function(a,b){var c=p,d=this,f=$("#alternatives_"+a);if(!(a in d.p))if(a in d.i){f[d.i[a]===p?"show":"hide"]();$("#"+a).html(d.i[a]===p?'<img src="'+global_path+'pub/images/alt_minus.gif" /> '+$t("Hide other source links"):'<img src="'+global_path+'pub/images/alt_plus.gif" /> '+$t("Show other source links"));d.i[a]=!d.i[a]}else{d.p[a]=i;f.empty().show().attr("class","alt_div_list2 check-spinner");var g=function(){c=i;f.attr("class","alt_div_list2").text($t("An error occured. Please try again later"));
setTimeout(function(){f.fadeOut(100)},3E3)},e=setTimeout(function(){g();delete d.p[a]},d.timeout);$.ajax({dataType:"jsonp",url:d.f+"/get/"+a+"/"+b,success:function(h){clearTimeout(e);if(!c){var l='<div class="alt_div_list">',n;for(n in h.result){current=h.result[n];l+='<a href="'+global_path+current.t+'/go.html" title="'+current.n+'" target="_blank">'+(current.n.length>d.J?current.n.substring(0,d.J-d.replaceWith.length)+d.replaceWith:current.n)+"</a> <span>"+current.h+"</span><br />"}l+="</div>";
container=$("#alternatives_"+a).html(l).attr("class","alt_div_list2");$("#"+a).html('<img src="'+global_path+'pub/images/alt_minus.gif" />'+$t("Hide other source links"));d.i[a]=i;delete d.p[a]}},error:function(){g();delete d.p[a]}})}};
function D(a,b,c){function d(){$("#broken_alternatives .spinner").hide();$("#broken_alternatives .notfound").fadeIn("slow");f=i;setTimeout(function(){$("#broken_alternatives").slideUp("slow")},3E3)}$("#broken_alternatives").show();$("#broken_alternatives .spinner").show();var f=p,g=setTimeout(d,1E4);$.ajax({url:a.f+"/getb/"+b+"/"+c,type:"GET",dataType:"jsonp",timeout:1E4,success:function(e){clearTimeout(g);if(!f){$("#broken_alternatives .spinner").hide();if(e.success&&e.result.length>0)for(var h in e.result){var l=
$("#broken_alternatives div tr:eq(0)").clone().appendTo("#broken_alternatives div").show();l=$(l).find("td");var n=e.result[h],r="";r=n.k==2?global_path+n.t+",g/"+n.n.replace(/ /g,"_")+".html":global_path+n.t+"/"+n.n.replace(/ /g,"_")+".html";$(l[0]).html('<a href="'+r+'">'+n.n+"</a>");$(l[1]).html(n.h);$(l[2]).html(n.s);$(l[3]).find("a").attr("href",r)}else d()}},error:function(){clearTimeout(g);d()}})}function E(a,b){this.f=a;this.timeout=b;this.a=[]}E.prototype.N=function(a){this.a.push(a)};
E.prototype.Q=function(){for(x in this.a)F(this,this.a[x].t,this.a[x].ct)};function F(a,b,c){G(a,b);var d=d||a;$.ajax({url:"http://"+a.f,dataType:"jsonp",data:{checker_token:c,"_=_":Math.random().toString()},success:function(f){if(f.error!="0")d.error(b);else f.broken!="0"?H(d,b):I(d,b)},error:function(){d.error(b)}});setTimeout(function(){$("#checkstatus_"+b).attr("class")==="check-spinner"&&d.error(b,c)},a.timeout)}
E.prototype.U=function(a){for(var b in this.a)G(this,this.a[b].t);var c=c||this,d=c.a,f=this;$.ajax({url:"http://"+f.f,dataType:"jsonp",data:{checker_group_token:a},success:function(g){if(g.error!="0")for(var e in d)f.error(d[e].t);if("broken_tokens"in g&&g.broken_tokens instanceof Array)for(var h in d){broken=p;for(e in g.broken_tokens)if(g.broken_tokens[e]===d[h].t){broken=i;break}broken?H(c,d[h].t):I(c,d[h].t)}},error:function(){for(var g in f.a)c.error(f.a[g].t)}});for(b in f.a)(function(g){setTimeout(function(){$("#checkstatus_"+
g).attr("class")==="check-spinner"&&c.error(g)},f.timeout)})(f.a[b].t)};function G(a,b){$("#checkstatus_"+b).css("display","block").attr("class","check-spinner")}function I(a,b){$("#checkstatus_"+b).attr({"class":"check-ok",title:$t("Link is OK")})}function H(a,b){$("#checkstatus_"+b).attr({"class":"check-broken",title:$t("Link is broken")})}E.prototype.error=function(a){$("#checkstatus_"+a).attr({"class":"check-error",title:$t("Error checking file. Please try again later.")})};
var J=function(){var a={url:global_path+"getwatchherecontent.html"};return function(b,c){function d(){for(var e in f){var h=parseInt(e);$(f[e]).hide();$("a[id='quick_embed_button_%d']".replace("%d",h+1)).show();$("a[id='hide_embed_button_%d']".replace("%d",h+1)).hide()}}$.extend({},a,c||{});var f=[],g=[];return{bind:function(){$(b).find(".videoresult").each(function(e){var h=this,l=e+1,n="#quick_embed_%d".replace("%d",l);f.push(n);$(this).find("a[id='quick_embed_button_%d']".replace("%d",l)).bind("click.embed",
function(r){r.preventDefault();var y=$(this).attr("id");d();$(n).show();$("a[id='quick_embed_button_%d']".replace("%d",l)).hide();$("a[id='hide_embed_button_%d']".replace("%d",l)).show();g.indexOf($(this).attr("id"))===-1&&$.ajax({type:"post",url:global_path+"getwatchherecontent.html",data:{v_t:$(h).attr("id")},success:function(q){$(n).html(q);g.push(y)}})});$(this).find("a[id='hide_embed_button_%d']".replace("%d",l)).bind("click.embed",function(r){r.preventDefault();d()})})}}}}();
trendsCalendar={elements:j,o:j,g:j,b:j,L:j,G:j,l:10,page:1,z:0,w:1,v:2,c:0,W:"cal_t",V:"cal_b",ga:"cal_tn",fa:"cal_bn",init:function(a){this.o=20;this.elements=parseInt(a);$("#trends_calendar_container").css("height",this.P());this.b=Math.ceil(this.elements/this.l);this.L=$("#buttonup");this.G=$("#buttondown");a=z("trends_calendar_page");if(typeof a=="undefined"||a==j)this.b>1&&this.e(i);else this.Z(a>this.b?this.b:a)},P:function(){this.g=$("#trends_calendar_content");return this.o*this.l+"px"},buttonUp:function(){if(!this.K()){this.ca();
this.e(i);v("trends_calendar_page",this.page,1,"/");this.K()&&this.j(p)}},buttonDown:function(){if(!this.F()){this.ba();this.j(i);v("trends_calendar_page",this.page,1,"/");this.F()&&this.e(p)}},ca:function(){this.g.css("top",parseInt(this.g.css("top"))+this.o*this.l+"px");--this.page;this.c=this.page==1?this.z:this.w},ba:function(){this.g.css("top",parseInt(this.g.css("top"))-this.o*this.l+"px");++this.page;this.c=this.page==this.b?this.v:this.w},Z:function(a){if(!(a>this.b)){this.g.css("top",-(this.o*
this.l*(a-1))+"px");this.page=parseInt(a);if(this.b==1){this.j(p);this.e(p)}else switch(this.page){case 1:this.c=this.z;this.j(p);this.e(i);break;case this.b:this.c=this.v;this.e(p);this.j(i);break;default:this.c=this.w;this.j(i);this.e(i)}}},K:function(){return this.b==1?i:this.c==this.z?i:p},F:function(){return this.b==1?i:this.c==this.v?i:p},j:function(a){this.L.toggleClass(this.W,a)},e:function(a){this.G.toggleClass(this.V,a)}};
var K=function(){var a={theme:"white",ha:{ja:$t("Type the two words")}};return{bind:function(){$("#commentSubmit").bind("click",K.submit);$("#commentRecaptcha").each(function(){K.I(this)});$("#commentsPagination .page").live("click",function(){$("#commentsLoader").show();$("#commentsContainer").load(global_path+"file/comment/get.json",{token:$("#commentsContainer").prev("input[name=token]").val(),page:this.className.match(/page_(\d+)/)[1]},function(){$("#commentsLoader").hide()});return p})},submit:function(){$.ajax({url:global_path+
"file/comment/submit.json",type:"POST",data:$("#fileCommentForm").serialize(),dataType:"json",beforeSend:function(){$("#submitCommentInfo").empty().append($("<span></span>").html("Submitting ...")).append($("<img />").addClass("commentsLoader").attr("src",static_path+"images/ajax-loader.gif")).show()},success:function(b){if(b.success){$("#submitCommentInfo").empty().hide();$("#commentAuthor,#commentText").val("");$("#commentsContainer").load(global_path+"file/comment/get.json",{token:$("#commentsContainer").prev("input[name=token]").val(),
page:1});K.I($("#commentRecaptcha").get(0))}else $("#submitCommentInfo").empty().append($("<span></span>").html("Error : "+b.message))}})},I:function(b){Recaptcha.create(recaptcha_public_key,b,a)}}}();
$(document).ready(function(){s.bind();J(".other_adv").bind();$(".trends").X();$("body").bind("click",function(){$("#languagemenu, #shortcutmenu").hide()});$(".openx_ad").each(function(){var a=this.id.match(/openx_ad_(\d+)/);$(this).attr("src","http://ads.carocean.co.uk/delivery/afr.php?zoneid="+a[1])});typeof alternatives!="undefined"&&alternatives.O=="js"&&alternate_files.length>0&&D(alternatives,alternate_files[0].key,alternate_files[0].token);K.bind()});
window.showShortcutLinks=function(){var a=$("#shortcutmenu");if(a.is(":visible"))a.hide();else{var b=$("#shortcut_link").position(),c=$("#shortcut_link").outerHeight();a.css({top:b.top+c+10,left:b.left}).show()}};window.showHideRecentSearches=function(){var a=$("#recent");if(a.length!==0){a.toggle();v("DISPLAY_RECENT_SEARCHES",a.is(":visible")===i?1:0,365,"/")}};window.cloakRecentSearches=function(){var a=$("#recent");a.length!==0&&a.hide()};
window.display_mini_msg=function(){$.ajax({url:global_path+"messages/getcount",method:"post",dataType:"json",success:function(a){a.status.match(/error/);if(a.status.match(/ok/)){var b="("+a['newmsg']+"/"+a['allmsg']+")";if(parseInt(a['newmsg'])>0)b+=' <img class="imgfix" src="'+static_path+'images/newmsg.gif" title="'+$t("New messages")+'" />';$("#new_messages_count").html(b)}a.status.match(/db_exception/)}})};
window.feedbackForm=function(){window.open(global_path+"feedback.html","_blank","width=670,height=490,left="+((window.screenX||window.screenLeft)+50)+",top="+((window.screenY||window.screenTop)+50)+",resizable=falsechannelmode=0,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=0,toolbar=0,titlebar=0")};
window.translationForm=function(){window.open(global_path+"translation/main.html","_blank","width=700,height=650,left="+((window.screenX||window.screenLeft)+50)+",top="+((window.screenY||window.screenTop)+50)+",resizable=falsechannelmode=0,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,toolbar=0,titlebar=0")};window.showLanguageMenu=function(){var a=$("#languagemenu");if(a.css("display")=="none"){var b=$("#language_link"),c=b.offset();c.left-=28;c.top+=b.height();a.css({top:c.top,left:c.left})}a.toggle()};
window.changeLanguage=function(a){window.location=global_path+"account/change_language/"+a};window.Autocompleter=s;window.showFFExtension=function(){typeof window.sidebar=="object"&&typeof window.sidebar.D=="function"&&!w("FFhide")&&$("#addFFExtension").css("display","inline")};window.hideFFExtension=u;
window.addEngine=function(){if(typeof window.sidebar=="object"&&typeof window.sidebar.D=="function"){window.sidebar.D("http://www.filestube.com/pub/images/filestube.xml","http://www.filestube.com/pub/images/filestube.png","FilesTube.com",$t("FilesTube.com - Every search is a direct hit"));u()}else confirm($t("Search extensions are supported with Firefox"))&&window.open("http://firefox.com")};window.checkFFCookie=w;window.getCookie=z;window.SetCookie=v;
window.resultsLeftShowSwitch=function(){var a=$("#results_left"),b=$("#results"),c=$("#results_box"),d=$("#toggle");if(a.is(":visible")){a.hide();b.css("width","651px");c.css("width","986px");d.text($t("Show options")).css("background-position","left 1px");v("DISPLAY_RESULTS_LEFT","0",365,"/")}else{a.show();b.css("width","505px");c.css("width","840px");d.text($t("Hide options")).css("background-position","left -17px");v("DISPLAY_RESULTS_LEFT","1",365,"/")}};
window.switchMoreHostingFilters=function(a){$("#moreHostingFilters").css("display",a==0?"none":"inline");$("#moreHostingFiltersLink").html($t(a==0?"more":"less")+"...").attr("href","javascript:switchMoreHostingFilters("+!a+");")};
window.applyHostingFilters=function(){var a=[],b=0;$("input[type='checkbox'][class='hosting_checkbox']").each(function(){var d=$(this);b++;d.attr("checked")&&a.push(d.attr("id").substring(17))});var c=window.location.href.replace(/hosting=[^\/&]+/i,a.length>0&&a.length<b?"hosting="+a.join(","):"");window.location.replace(c)};window.toogleHostingFilter=function(a){checkbox=$("#hosting_checkbox_"+a);checkbox.length>0&&checkbox.attr("checked",!checkbox.attr("checked"))};
window.invertHostingFilters=function(){$("input[type='checkbox'][class='hosting_checkbox']").each(function(){$(this).attr("checked",!$(this).attr("checked"))})};window.clearHostingFilters=function(){$("input[type='checkbox'][class='hosting_checkbox']").each(function(){$(this).attr("checked",p)})};window.showSizeFilter=function(){$("#size_filter_custom").show()};
window.applySizeFilter=function(){var a=Math.pow(2,21),b=$("#size_filter_from"),c=$("#size_filter_to"),d=$("#size_filter_from_error").hide(),f=$("#size_filter_to_error").hide();error=p;if(/[^\d]+/.test(b.val())||parseInt(b.val())>a){d.text($t("Enter correct size")).show();error=i}if(/[^\d]+/.test(c.val())||parseInt(c.val())>a||parseInt(c.val())==0){f.text($t("Enter correct size")).show();error=i}if(!error&&parseInt(b.val())>parseInt(c.val())){f.text($t("Invalid range")).show();error=i}if(!error){a=
window.location.href;a=a.replace(/#.+/,"");if(/sizefrom=[^\/&]+/i.test(a))a=a.replace(/sizefrom=[^\/&]+/i,"sizefrom="+b.val());else a+="&sizefrom="+b.val();if(/sizeto=[^\/&]+/i.test(a))a=a.replace(/sizeto=[^\/&]+/i,"sizeto="+c.val());else a+="&sizeto="+c.val();window.location.replace(a)}};
window.checkDYM=function(a){a=sp_server+"/"+encodeURIComponent(a)+"?callback=?";if(sp_params!=undefined&&sp_params!="")a+="&"+sp_params;$.ajax({url:a,dataType:"jsonp",success:function(b){if(b.corrected!=""){var c=$("#DYMfield");$("#corrected_addr").empty().append($("<a>").css("font-weight","bold").attr("href",global_path+"search.html?q"+b.corrected.replace(/\s+/g,"+")).text(b.corrected));c.show()}}})};window.add_to_downloads_history=A;window.history_autosave=function(a,b,c){a==1&&!b&&A(c)};
window.jumpto_groupfile=function(a){window.location=global_path+a.options[a.selectedIndex].value+"/go.html"};window.report_broken_link=function(a){var b=$("#broken_div_"+a);b.empty().append($("<img>").attr("src",static_path+"images/ajax-loader.gif"));$.ajax({url:global_path+"ajax_report_broken_link.html?link_id="+a,timeout:1E4,success:function(c){if(c.match(/ok/)||c.match(/error/))b.empty().append($("<span></span>").css({color:"green","font-weight":"normal","margin-bottom":"5px"}).text($t("Thanks for reporting")))}})};
window.report_passworded_file=function(a,b){var c;c=b==undefined?$("#passworded_div_"+a):$("#fileInfo_password");c.empty().append($("<img>").attr("src",static_path+"images/ajax-loader.gif"));$.ajax({url:global_path+"ajax_report_passworded_file.html?link_id="+a,timeout:1E4,success:function(d){d.match(/ok/)&&c.empty().append($("<span>").css({color:"green","font-weight":"normal","margin-bottom":"5px"}).text($t("Thanks for reporting")))}})};window.Stars=B;
window.initCopyToClipboard=function(){var a=new ZeroClipboard.Client;a.setHandCursor(i);a.setCSSEffects(i);a.addEventListener("mouseDown",function(){a.setText($("#copy_paste_links").html());$("#d_clip_msg_copied").show();setTimeout(function(){$("#d_clip_msg_copied").hide()},2E3)});a.glue("d_clip_button","d_clip_container")};window.Alternatives=C;C.prototype.checkFilesAternativesExists=C.prototype.R;C.prototype.getAlternatives=C.prototype.Y;window.clearSearchField=function(a,b){$(a).val()==b&&$(a).val("")};
window.Checker=E;E.prototype.addToken=E.prototype.N;E.prototype.checkGroup=E.prototype.U;E.prototype.checkAllFiles=E.prototype.Q;window.Embeds=J;window.toggleDescription=function(a,b){$("#desc_short_"+a)[b===1?"hide":"show"]();$("#desc_full_"+a)[b===1?"show":"hide"]()};
window.clear_downloads_history=function(a){$("#ajax_confirmation").hide();$("#timezone_confirmation").hide();if(confirm($t("Do you really want to clear your downloads history?"))){$("#settings_indicator").css("display","inline");$.ajax({url:global_path+"account/ajax_clear_downloads_history.html",type:"post",data:{uid:a},success:function(b){if(b=="not logged")window.location=global_path+"account/login.html?continue="+window.location;else if(b=="error")alert($t("Error - your downloads history hasn't been cleared"));
else if(b=="db_error")alert($t("Database error - your downloads history hasn't been cleared"));else if(b=="ok"){$("#ajax_confirmation").text($t("Your downloads history has been cleared")).show();$("#settings_indicator").hide()}}})}};window.confirmAvatarRemove=function(a){if(confirm($t("Removing avatar. Are you sure?")))window.location=a;return p};
window.showMessageForm=function(){var a=$("#messageform");a.css("display","block").css({left:($(window).width()-a.width())/2+$(window).scrollLeft(),top:($(window).height()-a.height())/2+$(window).scrollTop(),visibility:"visible"});$("#messageform_content").show();$("#messageform_error").hide();$("#messageform_sendbutton").attr("disabled",p);$("#messageform_title").val("");$("#messageform_body").val("")};window.closeMessageForm=function(){$("#messageform").css({visibility:"hidden",display:"none"})};
window.sendUserMessage=function(){var a=$("#messageform_username").val(),b=$("#messageform_error"),c=$("#messageform_sendbutton").attr("disabled",i),d=$("#messageform_title").val(),f=$("#messageform_body").val();b.css({display:"block",visibility:"visible"}).empty().append($("<img>").attr("src",static_path+"images/ajax-loader.gif"));$.ajax({type:"post",url:global_path+"user/message/"+a+".plain",data:{subject:d,content:f},success:function(g){if(g=="ok")b.css({display:"block",visibility:"visible"}).empty().append($("<span>").css("color",
"green").text($t("Your message has been sent.")));else{c.attr("disabled",p);b.css({display:"block",visibility:"visible"}).empty().append($("<span>").css("color","red").text($t("Do not leave the message subject and/or message body empty. Subject length is limited to 100 characters, body length is limited to 1000 characters.")))}},error:function(){c.attr("disabled",p);b.css({display:"block",visibility:"visible"}).empty().append($("<span>").css("color","red").text($t("There was an error while trying to send the message.")))}})};
window.trendsCalendar=trendsCalendar;
window.ReportsChecker=function(){function a(g){$.ajax({url:c+g,dataType:"jsonp",success:function(e){if(e.success){e.count>d&&$("#js_files_list").prepend($("<tr></tr>").append($('<td colspan="4"></td>').addClass("harmWarning").text($t("Warning - These files may harm your computer."))));var h=$("<div>").addClass("harmButton");e.voted===0&&$("#d_clip_container").prepend(h.text($t("Report harmful files")).click(function(){h.unbind("click");$.ajax({url:f,dataType:"jsonp",data:{token:g},success:function(l){if(l.voted===
1){h.removeClass("harmButton");h.addClass("harmButtonOff");h.css("color","green").text($t("Thank you for reporting"))}else{h.removeClass("harmButton");h.addClass("harmButtonOff");h.text($t("An error occured, please try again later"))}}})}))}}})}var b=FT.Options.reportsChecker.enabled,c=FT.Options.reportsChecker.server,d=FT.Options.reportsChecker.limit,f=FT.Options.reportsChecker.votes_server;return{check:function(g){b&&a(g)}}};window.FT=FT;
window.toggleSourceTitle=function(a,b){if(b==1){$("#sti_"+a).attr("src",static_path+"images/alt_minus.gif");$("#sta_"+a).attr("href","javascript:toggleSourceTitle('"+a+"',0)")}else{$("#sti_"+a).attr("src",static_path+"images/alt_plus.gif");$("#sta_"+a).attr("href","javascript:toggleSourceTitle('"+a+"',1)")}$("#st_"+a).slideToggle(200)};window.Comments=K;
})()
