$.fn.pwdInputSwap=function(_1){
var _2=$.extend({},$.fn.pwdInputSwap.defaults,_1);
var _3=$(this);
var _4=$(_2.inputTemp);
var _5=$(_2.inputPass);
_4.removeClass("hidden");
_5.addClass("hidden");
_4.focus(function(){
var _6=$(this);
_6.addClass("hidden");
_5.removeClass("hidden").addClass("userInput").focus();
});
_5.blur(function(){
var _7=$(this);
if(_7.val().length==0){
_7.addClass("hidden");
_4.removeClass("hidden");
}
});
};
$.fn.pwdInputSwap.defaults={inputTemp:"#switchfoo",inputPass:"#passwordfoo"};
$.fn.labelToValue=function(_8){
var _9=$.extend({},$.fn.labelToValue.defaults,_8);
var _a=$(this);
var _b=_a.prev("label").html();
_a.attr("value",_b).prev("label");
var _c=function(){
var _d=$(this);
if(_d.val()==_b){
_d.addClass(_9.focusClass).val("");
}
};
_a.one(_9.clearTextOn,_c);
_a.blur(function(){
var _e=$(this);
if(_e.val().length==0){
_e.removeClass(_9.focusClass).attr("value",_b).prev("label");
}
});
};
$.fn.labelToValue.defaults={focusClass:"userInput",clearTextOn:"focus"};
$.fn.pseudoHover=function(_f){
var _10=$.extend({},$.fn.pseudoHover.defaults,_f);
var _11=$(this);
var t;
_11.hover(function(){
clearTimeout(t);
_11.addClass("hover");
},function(){
t=setTimeout(function(){
_11.removeClass("hover");
},210);
});
};
$.fn.pseudoHover.defaults={addClass:"hover"};
$.fn.listHighLight=function(_13){
var _14=$.extend({},$.fn.listHighLight.defaults,_13);
var _15=$(this);
var _16=_15.find(".controls");
_15.hover(function(){
$(this).find("ul.controls").css("visibility","visible").animate({opacity:1},_14.fadeIn,function(){
$(this).parents("li:0").addClass("hilight");
});
},function(){
var _17=0;
if($(this).find("ul.controls").hasClass("noFade")){
_17=1;
}
if($(this).find("div.reportThis").hasClass("open")){
$(this).find("ul.nested").slideUp(50);
$(this).find("div.reportThis").removeClass("open");
}
$(this).find("ul.controls").animate({opacity:_17},_14.fadeOut,function(){
$(this).parents("li:0").removeClass("hilight");
});
});
};
$.fn.listHighLight.defaults={fadeIn:0,fadeOut:0};
$.fn.clickListener=function(_18){
var _19=$.extend({},$.fn.clickListener.defaults,_18);
var _1a=$(this);
_1a.click(function(e){
var _1c=$(e.target);
var _1d=function(_1e,_1f,_20){
var _21=_1e;
var url="/ajax/edit/comment";
var _23={review:"",tags:"",title:"",keep_date:false,sticky_post:false,commentid:0,publicid:"",syndicate_tw:"",syndicate_fb:"",token:""};
var _24=_21.find("textarea").val();
_23.review=_24.replace(/^\s+|\s+$/g,"");
if(_21.find("input[name='title']").length){
_23.title=_21.find("input[name='title']").val();
}
if(_21.find("input[name='tags']").length){
_23.tags=_21.find("input[name='tags']").val();
}
if(_21.find("input[name='keep_date']").length){
_23.keep_date=_21.find("input[name='keep_date']").attr("checked");
}
if(_21.find("input[name='sticky_post']").length){
_23.sticky_post=_21.find("input[name='sticky_post']").attr("checked");
}
if(_21.find("input[name='syndicate_tw']").attr("checked")){
_23.syndicate_tw=_21.find("input[name='syndicate_tw']").val();
}
if(_21.find("input[name='syndicate_fb']").attr("checked")){
_23.syndicate_fb=_21.find("input[name='syndicate_fb']").val();
}
var _25=_1c.parents("li:0");
if(_25.children("var").length){
_23.commentid=_25.children("var").attr("id");
_23.publicid=_25.children("var").attr("class");
}
_23.token=$("#wrapperContent").attr("class");
_23.keep_date=+_23.keep_date;
_23.sticky_post=+_23.sticky_post;
if(_1f){
for(var i in _1f){
_23[i]=_1f[i];
}
}
var _27=function(_28){
if(_28.success==true){
if(_21.parents(".text").find(".review").length!=0){
_21.parents(".text").find(".review").html(_28.review);
}else{
var _29="<p class=\"review\">"+_28.review+"</p>";
_21.parents(".text").find(".showThumbUp").after(_29);
}
closeAll();
}
};
if(_20){
var _2a=_20;
}else{
var _2a=_27;
}
if((_23.review.length>0||_23.commentid>0)||_23.tags.length>0){
$.post(url,_23,_2a,"json");
}else{
alert("Please write a review, or choose some tags for this url.");
return false;
}
};
function closeAll(){
var _2b=$(".listStumble .active");
_2b.each(function(){
$(".open").slideUp(200,function(){
setTimeout(function(){
_2b.removeClass("active");
},300);
});
});
$("#inflator.open").slideUp(200).removeClass("open");
$("#addContent.open").slideUp(200).removeClass("open");
}
if(_1c.is(".filter a.controlPanel")){
}
if(_1c.is(".controls a.edit")){
var _2c=_1c.parents("li:0");
var _2d=_2c.children("var").attr("id");
if(_2d==""){
_2d=0;
}
var _2e=_2c.children("var").attr("class");
var _2f=$("#wrapperContent").attr("class");
var _30=_2c.find("div.editReview");
var _31,_32;
if(_1c.hasClass("active")){
_1c.removeClass("active");
_2c.removeClass("active");
_30.slideUp(200).removeClass("open").unbind();
}else{
closeAll();
_1c.addClass("active");
_2c.addClass("active");
_30.slideDown(300).addClass("open");
_31=_30.find("textarea").val();
_32=_30.find("input[name='tags']").attr("value");
}
_30.unbind("click").click(function(e){
var _34=$(e.target);
if(_34.is("a.cancel")){
var _35=_34.parents("fieldset:0");
_30.find("textarea").val(_31);
_30.find("input[name='tags']").attr("value",_32);
closeAll();
return false;
}
if(_34.is("input[type='submit']")){
var _35=_34.parents("fieldset:0");
var _36=false;
if(_35.find("input[name='newUrlReview']").length){
_36=function(_37){
window.location.reload();
};
}
_1d(_35,false,_36);
}
});
}
if(_1c.is(".controls a.helpfulYes")||_1c.is(".controls a.helpfulNo")){
var _2c=_1c.parents("li:0");
var url="/ajax/flag/comment";
var _2f=$("#wrapperContent").attr("class");
var _39=_2c.children("var").attr("id");
var _3a={action:"helpful",helpful:0,commentid:_39,token:_2f};
var _3b={yes:_2c.find("div a.helpfulYes"),no:_2c.find("div a.helpfulNo")};
if(_1c.is("a.helpfulYes")){
_3a.helpful=1;
}
_3b.yes.css("font-weight","normal");
_3b.no.css("font-weight","normal");
if(_3a.helpful){
_3b.yes.css("font-weight","bold");
}else{
_3b.no.css("font-weight","bold");
}
$.post(url,_3a,function(_3c){
},"json");
}
if(_1c.is(".controls a.share")){
var _2c=_1c.parents("li:0");
var _3d=$("#wrapperPanel");
var _3e=$("#wrapperPanel iframe");
var _3f=$("#inflator");
if(_1c.hasClass("active")){
_3f.removeClass("open").slideUp(300,function(){
_2c.removeClass("active");
_1c.removeClass("active").unbind();
});
return false;
}else{
closeAll();
_2c.addClass("active");
_1c.addClass("active");
_3e.load(function(){
_3f.slideDown(400).addClass("open");
return false;
});
}
var _2e=_2c.children("var").attr("class");
_3e.attr("src","/share/"+_2e+"/");
_3e.css("height",500);
}
if(_1c.is(".controls a.delete")){
var _2c=_1c.parents("li:0");
var url="/ajax/delete/favorite";
var _2e=_2c.children("var").attr("class");
var _2f=$("#wrapperContent").attr("class");
var _2d=_2c.children("var").attr("id");
if(_2d==""){
_2d=0;
}
var _40=_2c.find(".deleteThis");
function closeThis(){
_1c.parent().removeClass("active");
_40.animate({"width":"hide"},0).removeClass("open");
}
function openThis(){
_1c.parent().addClass("active");
_40.animate({"width":"show"},200).addClass("open");
}
_1c.closest("li.listLi").hover(function(){
clearTimeout(t);
},function(){
t=setTimeout(function(){
closeThis();
},10);
});
if(_1c.parent().hasClass("active")){
$.post(url,{commentid:_2d,publicid:_2e,token:_2f},function(_41){
if(_41.success==true){
_2c.fadeOut(900,function(){
$(this).remove();
});
}
},"json");
}else{
closeAll();
openThis();
}
}
if(_1c.is(".headerControls a.addSite")){
var _42=$("#addContent");
_42.click(function(e){
var _44=$(e.target);
if(_44.is("a.cancel")){
_42.children("form").clearForm();
_42.removeClass("open").slideUp(200);
_42.unbind();
return false;
}
if(_44.is(".blogMode")){
var _45=_44.parents("fieldset:0");
var _46=_44.attr("checked");
if(_46){
_45.find("label[for='url']").html("Title");
_45.find("a.submit").html("Add a blog");
_45.find("#syndicatePost").hide();
}else{
_45.find("label[for='url']").html("URL");
_45.find("a.submit").html("Add a site");
_45.find("#syndicatePost").show();
}
}
if(_44.is("a.submit")){
var _45=_44.parents("fieldset:0");
var _47="";
var _48=_45.find("input[name='url']").val();
var _49=_45.find("input[name='blog_mode']").attr("checked");
var _4a=0;
var _4b=1;
if(_49){
_47=_48;
_48="";
_4a=1;
}
var _4c={title:_47,url:_48,new_post:_4b,blog_post:_4a};
var _4d=function(_4e,_4f){
if(_4e.go_to){
window.location=_4e.go_to;
}else{
window.location="/favorites/";
}
};
_1d(_45,_4c,_4d);
}
});
if(_42.hasClass("open")){
_42.removeClass("open").slideUp(200);
_42.unbind();
return false;
}else{
closeAll();
_42.slideDown(300).addClass("open");
return false;
}
}
if(_1c.is("#stats .seeMore")){
_1c.next("dl").slideToggle(250);
}
if(_1c.is(".tags.seeMore")){
_1c.next("dl").slideToggle(250);
}
if(_1c.is(".userSubscribe")){
var _2f=$("#wrapperContent").attr("class");
$.post("/ajax/user/subscribe",{act:"subscribe",id:_1c.attr("href").substr(1),fauth:_2f},function(){
},"json");
_1c.fadeOut();
}
if(_1c.is(".userSubscribeAndDS")){
var _2f=$("#wrapperContent").attr("class");
if(_1c.html()=="Subscribe"){
$.post("/ajax/user/subscribe",{act:"subscribe_and_ds",id:_1c.attr("href").substr(1),fauth:_2f},function(){
_1c.html("Subscribed");
},"json");
}else{
$.post("/ajax/user/subscribe",{act:"unsubscribe",id:_1c.attr("href").substr(1),fauth:_2f},function(){
_1c.html("Subscribe");
},"json");
}
}
if(_1c.is(".searchlink")){
_1c.hover(function(){
_1c.find("ul").fadeIn(100);
},function(){
_1c.find("ul").fadeOut(200);
});
}
});
};
$.fn.clickListener.defaults={};
$.fn.swapThis=function(_50){
var _51=$.extend({},$.fn.swapThis.defaults,_50);
var _52=$(this);
if(_51.event=="click"){
_52.click(function(){
$(_51.swapThis).addClass("hidden");
$(_51.forThat).removeClass("hidden");
return false;
});
}
};
$.fn.swapThis.defaults={swapThis:".this",forThat:".that",event:"click"};
$.fn.focusElement=function(_53){
var _54=$.extend({},$.fn.focusElement.defaults,_53);
var _55=$(this);
if(_54.event=="click"){
_55.click(function(){
$(_54.element).focus().select();
});
}
};
$.fn.focusElement.defaults={element:false,event:"click"};
$.fn.clearForm=function(){
return this.each(function(){
var _56=this.type,tag=this.tagName.toLowerCase();
if(tag=="form"){
return $(":input",this).clearForm();
}
if(_56=="text"||_56=="password"||tag=="textarea"){
this.value="";
}else{
if(_56=="checkbox"||_56=="radio"){
this.checked=false;
}else{
if(tag=="select"){
this.selectedIndex=-1;
}
}
}
});
};
$.fn.stumbleInfoPopup=function(_58){
var _59="userid="+_58.userid;
jQuery.ajax({type:"POST",url:"/ajax/user/info",data:_59,error:function(){
},success:function(){
}});
};
$.fn.imageMaxWidth=function(_5a){
var _5b=$.extend({},$.fn.imageMaxWidth.defaults,_5a);
$(this).each(function(){
var _5c=$(this);
if(_5c.attr("width")>=_5b.width){
_5c.removeAttr("height").removeAttr("width");
var _5d=_5c.width();
var _5e=_5c.height();
if(_5d>=_5b.width){
var _5f=(_5e/_5d);
var _60=_5b.width;
var _61=(_60*_5f);
_5c.height(_61).width(_5b.width);
}
}
});
};
$.fn.imageMaxWidth.defaults={width:700};
$.fn.installAddon=function(_62){
var _63=$.extend({},$.fn.installAddon.defaults,_62);
var btn=$(this);
if(jQuery.browser.msie){
btn.attr("href",_63.ie_download_url);
}else{
if(jQuery.browser.mozilla){
btn.attr("href",_63.ff_download_url);
btn.click(function(){
$("#fadeout",top.document).show();
$("#ff-install-helper",top.document).show();
});
$("#close-button",top.document).click(function(){
$("#ff-install-helper",top.document).hide();
$("#fadeout",top.document).hide();
});
}else{
btn.hide();
}
}
};
$.fn.installAddon.defaults={ff_download_url:"#",ie_download_url:"#"};

