/*
* @ FireBugger jQuery funcions file.
* @ FireBugger 2010
*/
$(document).ready(function(){function j(){$("#firebugger").submit(function(){var c=$("#firebugger").serialize();$.ajax({type:"GET",url:"fbg.php",data:$.URLDecode(c),dataType:"json",beforeSend:function(){$(".error").remove();$(".success").remove();$("#working").remove();$("#downloading").remove();$("#er").fadeIn();$('<span id="working"><img src="images/ajax-loader.gif" /> Working..</span>').appendTo($("#er")).insertAfter(".imgl")},success:function(a){if(a.valid==true)$.ajax({url:"firebug-lite-min.js", beforeSend:function(){$(".error").remove();$("#working").fadeOut();$('<span id="downloading"><span>0%</span> Downloading Components..</span>').appendTo($("#er")).insertAfter(".imgl");$("#downloading span").everyTime(2500,function(d){$(this).html(d*25+"%")},4)},complete:function(){$("#downloading").remove();var d=$("#check input[type=checkbox]:checked").attr("name");d=typeof d=="undefined"?"":"&"+d;$('<span class="success"><span></span>Redirecting..</span>').appendTo($("#er")).insertAfter(".imgl"); $(".success").fadeIn();window.location="fbg.php?getSite="+a.site+d}});else{$("#working").fadeOut();$('<span class="error"><span></span>'+a.error+"</span>").appendTo($("#er")).insertAfter(".imgl")}$("#er").mouseover(function(){$("#working").remove();$(this).fadeOut("slow")})},timeout:1E4,error:function(a){$("#working").remove();$('<span class="error">Error '+a.status+", try again later</span>").appendTo($("#er")).insertAfter("#er img:first");$("#er").fadeIn("slow")}});return false})}function k(){$("#check input[type=checkbox]").each(function(){$(this).is(":checked")? $(this).next("label").css("background-position","71% 31%"):$(this).next("label").css("background-position","95% 31%")});$(".firstlabel").toggle(function(){$(this).css("background-position","71% 31%");$(this).prev("input").attr("checked",true)},function(){$(this).css("background-position","95% 31%");$(this).prev("input").removeAttr("checked")});$(".secondlabel").toggle(function(){$(this).prev("label").css("background-position","71% 31%");$(this).prev("label").prev("input").attr("checked",true)},function(){$(this).prev("label").css("background-position", "95% 31%");$(this).prev("label").prev("input").removeAttr("checked")})}function o(){var c=p("token");$.ajax({url:"listFiles.php",data:{token:c,deleteSession:c},complete:function(){window.location="/direct-input/"},error:function(a){if(a.status!="404")window.location=window.location.href}})}function p(c,a){if(a==null)a="";c=c.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var d=RegExp("[\\?&]"+c+"=([^&#]*)").exec(window.location.href);return d==null?a:d[1]}j();$("#contact_form").submit(function(){var c= $("#contact_form").serialize();$.ajax({type:"POST",url:"contact.php",data:c,dataType:"json",beforeSend:function(){$("#contact_form").append('<img src="images/ajax-loader.gif" />');$(".error").remove()},success:function(a){var d=[a.er_subject,a.er_name,a.er_email,a.er_msg];if(d[0]=="valid"&&d[1]=="valid"&&d[2]=="valid"&&d[3]=="valid")$("#contact").html('<span class="submitted"> '+a.submitted+" </span>");else{for(a=0;a<=3;a++)$(d[a]=="valid"?"":'<span class="error"><span></span>'+d[a]+"</span>").appendTo("#contact").insertAfter(".inputtext:eq("+ a+")").fadeIn("slow").css("display","block");$(".error").mouseover(function(){$(this).fadeOut("slow")})}},complete:function(){$("#contact_form img").fadeOut()}});return false});$("#tabs a").not(".stop").click(function(){function c(){$("#conwrap").load(a,function(){j();k()})}setTimeout(function(){$("#adsense").hide();$("#ads_menu").hide();$("#ads_top").hide();$("h1").css("margin-top","30px")},100);setTimeout(function(){$("#ads_menu").show();$("#ads_top").show();$("h1").css("margin-top","0")},1200); $("li").removeAttr("id","active");$(this).parent().attr("id","active");var a=$(this).attr("href")+" #content";$("#conwrap").animate({height:"toggle","min-height":"toggle"},{duration:500,complete:function(){$("#conwrap").animate({height:"toggle","min-height":"toggle"},{duration:500,complete:c()})}()});window.location.hash=$(this).attr("href").substr(0,$(this).attr("href").length-4);return false});$("#tabs a:first").click(function(){setTimeout(function(){$("#adsense").show();$("h1").css("margin-top", "0")},1200)});k();$("a[rel='bookmark']").mouseenter(function(){$('<div id="facebook"><img id="fb-loader" src="images/fb-loader.gif" /></div>').appendTo(this);$("#facebook").load("getFB.php",function(){$("#fb-loader").fadeOut()})});$("a[rel='bookmark']").mouseleave(function(){$("#facebook").remove()});if($("#ads_top").length>0){var g=Math.round($("#ads_top").position().top),h=Math.round($("#ads_top").position().left);$("#ads_menu").css("top",g+"px").css("left",h+"px");$(window).resize(function(){var c= Math.round($("#ads_top").position().top),a=Math.round($("#ads_top").position().left);$("#ads_menu").css("top",c+"px").css("left",a+"px")})}else $("#ads_menu").remove();if(typeof $(".adsenseLocation")!=null)if($(".adsenseLocation").length>0){g=Math.round($(".adsenseLocation").position().top);h=Math.round($(".adsenseLocation").position().left);$("#adsense").css("top",g+"px").css("left",h+"px");$("#adssquare").css("top",g+"px").css("left",h+"px");$(window).resize(function(){var c=Math.round($(".adsenseLocation").position().top), a=Math.round($(".adsenseLocation").position().left);$("#adsense").css("top",c+"px").css("left",a+"px")})}else $("#adsense").remove();if($.browser.msie&&$.browser.version<7){$("#search .inputsubmit").hover(function(){$(this).css("background",'url("images/search_button_hover.jpg") top left no-repeat')},function(){$(this).css("background",'url("images/search_button.jpg") top left no-repeat')});$.getScript("DD_belatedPNG_0.0.8a-min.js",function(){DD_belatedPNG.fix("#tabs a, #tabs li, li#active a, #tabs a:hover, .inputsubmit, .inputsubmit:hover, .submitted, .error span, .success span, .imgl, .imgr, .twit, .face, .firstlabel")})}var q= $("#browse");$("#browse_fake");$("input[type=file]").each(function(){var c=$(this).attr("title");$(this).wrap('<div class="fileinputs"></div>');$(this).addClass("file").css("opacity",0);$(this).parent().append($('<div class="fakefile" />').append($('<input id="browse_fake" type="text" value="'+c+'" />').attr("class","inputtext")).append('<input type="button" class="button_button" />'));$(".upload").appendTo(".fakefile");$(this).bind("change",function(){$("#browse_fake").val($(this).val());$("#browse_fake").css("font-style", "normal");$("#browse_fake").removeClass("nofile")})});setTimeout(function(){$("#uploadform").css("visibility","visible")},500);recap=$("#recaptcha_response_field");$("#uploadform").submit(function(){var c=$("#browse_fake");if(q.val().replace("/^s|s$/g","")){if(typeof recap.val()!="undefined")if(!recap.val().replace("/^s|s$/g","")){recap.addClass("nofile");recap.val("Enter the captcha.");return false}}else{c.addClass("nofile");c.val("Please select a file");return false}});typeof recap!="undefined"&& recap.click(function(){if($(this).val()=="Enter the captcha."){$(this).removeClass("nofile");$(this).val("")}});$("#deleteSession").click(function(){$("#confirm").appendTo("#direct");$("#confirm").fadeIn()});$("#confirm a:first").click(function(){o()});$("#confirm a:last").click(function(){$("#confirm").fadeOut()});$.extend({URLDecode:function(c){c=c;for(var a,d=/(%[^%]{2})/;(m=d.exec(c))!=null&&m.length>1&&m[1]!="";){b=parseInt(m[1].substr(1),16);a=String.fromCharCode(b);c=c.replace(m[1],a)}return c}}); jQuery.fn.extend({everyTime:function(c,a,d,e,f){return this.each(function(){jQuery.timer.add(this,c,a,d,e,f)})},oneTime:function(c,a,d){return this.each(function(){jQuery.timer.add(this,c,a,d,1)})},stopTime:function(c,a){return this.each(function(){jQuery.timer.remove(this,c,a)})}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1E3,das:1E4,hs:1E5,ks:1E6},timeParse:function(c){if(c==undefined||c==null)return null;var a=this.regex.exec(jQuery.trim(c.toString())); return a[2]?parseInt(a[1],10)*(this.powers[a[2]]||1):c},add:function(c,a,d,e,f,i){var l=0;if(jQuery.isFunction(d)){f||(f=e);e=d;d=a}a=jQuery.timer.timeParse(a);if(!(typeof a!="number"||isNaN(a)||a<=0)){if(f&&f.constructor!=Number){i=!!f;f=0}f=f||0;i=i||false;if(!c.$timers)c.$timers={};c.$timers[d]||(c.$timers[d]={});e.$timerID=e.$timerID||this.guid++;var n=function(){if(!(i&&this.inProgress)){this.inProgress=true;if(++l>f&&f!==0||e.call(c,l)===false)jQuery.timer.remove(c,d,e);this.inProgress=false}}; n.$timerID=e.$timerID;c.$timers[d][e.$timerID]||(c.$timers[d][e.$timerID]=window.setInterval(n,a));this.global[d]||(this.global[d]=[]);this.global[d].push(c)}},remove:function(c,a,d){var e=c.$timers,f;if(e){if(a){if(e[a]){if(d){if(d.$timerID){window.clearInterval(e[a][d.$timerID]);delete e[a][d.$timerID]}}else for(d in e[a]){window.clearInterval(e[a][d]);delete e[a][d]}for(f in e[a])break;if(!f){f=null;delete e[a]}}}else for(a in e)this.remove(c,a,d);for(f in e)break;if(!f)c.$timers=null}}}});jQuery.browser.msie&& jQuery(window).one("unload",function(){var c=jQuery.timer.global,a;for(a in c)for(var d=c[a],e=d.length;--e;)jQuery.timer.remove(d[e],a)})});



