function Compress(){this.ajaxURL="/compress.php";this.ajaxLoaderImage="/images/ajax-loader.gif";this.mode="compress";this.isCompressing=false;this.origLength=0;this.newLength=0;this.img=null;this.send=function(){if (!this.isCompressing&&$("#code").val()!=""){var code_container=$("#code");var code=code_container.val();var dotoc=$("#dotoc").val();var dotov=$("#dotov").val();this.isCompressing=true;this.origLength=code.length;code_container.attr("disabled",true);this.img=$(document.createElement("img"));this.img.attr("src",this.ajaxLoaderImage);this.img.css({position:"absolute",left:(code_container.offset().left+Math.round(parseInt(code_container.css("width"))/ 2) - 17) + "px",top:(code_container.offset().top+Math.round(parseInt(code_container.css("height"))/ 2) - 17) + "px","z-index":"20000"});$("body").append(this.img);$.post(this.ajaxURL,{code:code,mode:this.mode,dotoc:dotoc,dotov:dotov},function(data){$("#code").attr("disabled",false);Compress.img.remove();Compress.isCompressing=false;Compress.newLength=data.length;$("#result").slideDown(800);$("#result").children("textarea").val(data);$("#stats").html("("+Compress.newLength+"/"+Compress.origLength+") - Ratio Compressed: "+(Math.round((Compress.newLength/Compress.origLength)*10000)/100)+"%");if (Compress.mode=="compress"){if (dotoc=="delete"){pageTracker._trackEvent("Compressed","JS Compressed");}else if (dotoc=="compress"){pageTracker._trackEvent("Compressed","JS Compressed - Comments Compressed");}else {pageTracker._trackEvent("Compressed","JS Compressed - Comments Left Alone");}}else {pageTracker._trackEvent("Uncompressed","JS Uncompressed");}});}};this.changeMode=function(newMode){this.mode=newMode;if (this.mode=="compress"){$("#comments_compress").show();$("#comments_uncompress").hide();}else {$("#comments_compress").hide();$("#comments_uncompress").show();}};};var Compress=new Compress();