(function(A){A.fn.autoResize=function(B){var C=A.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},B);
this.filter("textarea").each(function(){var E=A(this).css({resize:"none","overflow-y":"hidden"}),G=E.height(),H=(function(){var I=["height","width","lineHeight","textDecoration","letterSpacing"],J={};
A.each(I,function(K,L){J[L]=E.css(L);
});
return E.clone().removeAttr("id").removeAttr("name").css({position:"absolute",top:0,left:-9999}).css(J).attr("tabIndex","-1").insertBefore(E);
})(),F=null,D=function(){H.height(0).val(A(this).val()).scrollTop(10000);
var J=Math.max(H.scrollTop(),G)+C.extraSpace,I=A(this).add(H);
if(F===J){return ;
}F=J;
if(J>=C.limit){A(this).css("overflow-y","");
return ;
}C.onResize.call(this);
C.animate&&E.css("display")==="block"?I.stop().animate({height:J},C.animateDuration,C.animateCallback):I.height(J);
};
E.unbind(".dynSiz").bind("keyup.dynSiz",D).bind("keydown.dynSiz",D).bind("change.dynSiz",D);
});
return this;
};
})(jQuery);

(function(D){var C=[];
D.tools=D.tools||{};
D.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(G,E,F){A[G]=[E,F];
}};
var A={toggle:[function(H){var G=this.getConf(),F=this.getTip(),E=G.opacity;
if(E<1){F.css({opacity:E});
}F.show();
H.call();
},function(E){this.getTip().hide();
E.call();
}],fade:[function(E){this.getTip().fadeIn(this.getConf().fadeInSpeed,E);
},function(E){this.getTip().fadeOut(this.getConf().fadeOutSpeed,E);
}]};
function B(O,N){var E=this,J=D(this);
O.data("tooltip",E);
var I=O.next();
if(N.tip){I=D(N.tip);
if(I.length>1){I=O.nextAll(N.tip).eq(0);
if(!I.length){I=O.parent().nextAll(N.tip).eq(0);
}}}function F(R){var S=N.relative?O.position().top:O.offset().top,T=N.relative?O.position().left:O.offset().left,Q=N.position[0];
S-=I.outerHeight()-N.offset[0];
T+=O.outerWidth()+N.offset[1];
var V=I.outerHeight()+O.outerHeight();
if(Q=="center"){S+=V/2;
}if(Q=="bottom"){S+=V;
}Q=N.position[1];
var U=I.outerWidth()+O.outerWidth();
if(Q=="center"){T-=U/2;
}if(Q=="left"){T-=U;
}return{top:S,left:T};
}var L=O.is(":input"),P=L&&O.is(":checkbox, :radio, select, :button"),M=O.attr("type"),G=N.events[M]||N.events[L?(P?"widget":"input"):"def"];
G=G.split(/,\s*/);
if(G.length!=2){throw"Tooltip: bad events configuration for "+M;
}O.bind(G[0],function(Q){if(N.oneInstance){D.each(C,function(){this.hide();
});
}var R=I.data("trigger");
if(R&&R[0]!=this){I.hide().stop(true,true);
}Q.target=this;
E.show(Q);
G=N.events.tooltip.split(/,\s*/);
I.bind(G[0],function(){E.show(Q);
});
if(G[1]){I.bind(G[1],function(){E.hide(Q);
});
}});
O.bind(G[1],function(Q){E.hide(Q);
});
if(!D.browser.msie&&!L&&!N.predelay){O.mousemove(function(){if(!E.isShown()){O.triggerHandler("mouseover");
}});
}if(N.opacity<1){I.css("opacity",N.opacity);
}var H=0,K=O.attr("title");
if(K&&N.cancelDefault){O.removeAttr("title");
O.data("title",K);
}D.extend(E,{show:function(Q){if(Q){O=D(Q.target);
}clearTimeout(I.data("timer"));
if(I.is(":animated")||I.is(":visible")){return E;
}function R(){I.data("trigger",O);
var S=F(Q);
if(N.tip&&K){I.html(O.data("title"));
}Q=Q||D.Event();
Q.type="onBeforeShow";
J.trigger(Q,[S]);
if(Q.isDefaultPrevented()){return E;
}S=F(Q);
I.css({position:"absolute",top:S.top,left:S.left});
var T=A[N.effect];
if(!T){throw'Nonexistent effect "'+N.effect+'"';
}T[0].call(E,function(){Q.type="onShow";
J.trigger(Q);
});
}if(N.predelay){clearTimeout(H);
H=setTimeout(R,N.predelay);
}else{R();
}return E;
},hide:function(Q){clearTimeout(I.data("timer"));
clearTimeout(H);
if(!I.is(":visible")){return ;
}function R(){Q=Q||D.Event();
Q.type="onBeforeHide";
J.trigger(Q);
if(Q.isDefaultPrevented()){return ;
}A[N.effect][1].call(E,function(){Q.type="onHide";
J.trigger(Q);
});
}if(N.delay&&Q){I.data("timer",setTimeout(R,N.delay));
}else{R();
}return E;
},isShown:function(){return I.is(":visible, :animated");
},getConf:function(){return N;
},getTip:function(){return I;
},getTrigger:function(){return O;
},bind:function(R,Q){J.bind(R,Q);
return E;
},onHide:function(Q){return this.bind("onHide",Q);
},onBeforeShow:function(Q){return this.bind("onBeforeShow",Q);
},onShow:function(Q){return this.bind("onShow",Q);
},onBeforeHide:function(Q){return this.bind("onBeforeHide",Q);
},unbind:function(Q){J.unbind(Q);
return E;
}});
D.each(N,function(R,Q){if(D.isFunction(Q)){E.bind(R,Q);
}});
}D.prototype.tooltip=function(G){var F=this.eq(typeof G=="number"?G:0).data("tooltip");
if(F){return F;
}var E=D.extend(true,{},D.tools.tooltip.conf);
if(D.isFunction(G)){G={onBeforeShow:G};
}else{if(typeof G=="string"){G={tip:G};
}}G=D.extend(true,E,G);
if(typeof G.position=="string"){G.position=G.position.split(/,?\s/);
}if(G.lazy!==false&&(G.lazy===true||this.length>20)){this.one("mouseover",function(H){F=new B(D(this),G);
F.show(H);
C.push(F);
});
}else{this.each(function(){F=new B(D(this),G);
C.push(F);
});
}return G.api?F:this;
};
})(jQuery);
(function(A){var B=A.tools.tooltip;
B.effects=B.effects||{};
B.effects.slide={version:"1.0.0"};
A.extend(B.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!A.browser.msie});
var C={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};
A.tools.tooltip.addEffect("slide",function(H){var F=this.getConf(),E=this.getTip(),D=F.slideFade?{opacity:F.opacity}:{},G=C[F.direction]||C.up;
D[G[1]]=G[0]+"="+F.slideOffset;
if(F.slideFade){E.css({opacity:0});
}E.show().animate(D,F.slideInSpeed,H);
},function(H){var F=this.getConf(),D=F.slideOffset,E=F.slideFade?{opacity:0}:{},G=C[F.direction]||C.up;
var I=""+G[0];
if(F.bounce){I=I=="+"?"-":"+";
}E[G[1]]=I+"="+D;
this.getTip().animate(E,F.slideOutSpeed,function(){A(this).hide();
H.call();
});
});
})(jQuery);
(function(C){var D=C.tools.tooltip;
D.plugins=D.plugins||{};
D.plugins.dynamic={version:"1.0.1",conf:{api:false,classNames:"top right bottom left"}};
function A(E){var H=C(window);
var F=H.width()+H.scrollLeft();
var G=H.height()+H.scrollTop();
return[E.offset().top<=H.scrollTop(),F<=E.offset().left+E.width(),G<=E.offset().top+E.height(),H.scrollLeft()>=E.offset().left];
}function B(E){var F=E.length;
while(F--){if(E[F]){return false;
}}return true;
}C.fn.dynamic=function(G){var F=C.extend({},D.plugins.dynamic.conf),H;
if(typeof G=="number"){G={speed:G};
}G=C.extend(F,G);
var I=G.classNames.split(/\s/),E;
this.each(function(){if(C(this).tooltip().jquery){throw"Lazy feature not supported by dynamic plugin. set lazy: false for tooltip";
}var J=C(this).tooltip().onBeforeShow(function(O,N){var K=this.getTip(),L=this.getConf();
if(!E){E=[L.position[0],L.position[1],L.offset[0],L.offset[1],C.extend({},L)];
}C.extend(L,E[4]);
L.position=[E[0],E[1]];
L.offset=[E[2],E[3]];
K.css({visibility:"hidden",position:"absolute",top:N.top,left:N.left}).show();
var M=A(K);
if(!B(M)){if(M[2]){C.extend(L,G.top);
L.position[0]="top";
K.addClass(I[0]);
}if(M[3]){C.extend(L,G.right);
L.position[1]="right";
K.addClass(I[1]);
}if(M[0]){C.extend(L,G.bottom);
L.position[0]="bottom";
K.addClass(I[2]);
}if(M[1]){C.extend(L,G.left);
L.position[1]="left";
K.addClass(I[3]);
}if(M[0]||M[2]){L.offset[0]*=-1;
}if(M[1]||M[3]){L.offset[1]*=-1;
}}K.css({visibility:"visible"}).hide();
});
J.onShow(function(){var K=this.getConf(),L=this.getTip();
K.position=[E[0],E[1]];
K.offset=[E[2],E[3]];
});
J.onHide(function(){var K=this.getTip();
K.removeClass(G.classNames);
});
H=J;
});
return G.api?H:this;
};
})(jQuery);

JASK.namespace("question");
(function(A){A.fn.ja_expandanswerarea=function(){return this.each(function(){A(this).keypress(function(D){var E=D.target;
var B=E.value.length;
var C=B%180;
if(C==0&&B!=0){A(this).attr("rows",parseInt(A(this).attr("rows"))+3);
}});
A(this).focusout(function(){var B=A(this).val();
if(!B||B==null||B==""||$j.trim(B).length==0){A(this).attr("rows",2);
}});
A(this).focusin(function(){var B=A(this).val();
if(charsMod==0&&charsEntered!=0){A(this).attr("rows",parseInt(A(this).attr("rows"))+3);
}else{A(this).attr("rows",6);
}});
});
};
})(jQuery);
(function(A){A.fn.ja_editAnswer=function(){return this.each(function(){A(this).click(function(B){B.preventDefault();
$j.jStorage.set("orginalAnswer",$j("#ans-edit-txt").val());
var C=$j("#ansid").val();
$j("#answer-"+C+" .hideOnEdit").hide();
$j("#ansMod").show();
});
});
};
})(jQuery);
(function(A){A.fn.ja_cancelEditAnswer=function(){return this.each(function(){A(this).click(function(D){D.preventDefault();
var B=A(this);
JASK.question.hideToolTip();
$j("#answer_error").html("");
$j("#ans-edit-txt").val($j.jStorage.get("orginalAnswer"));
var C=$j("#apid"+$j("#ansid").val());
$j("#answer-"+$j("#ansid").val()+" .hideOnEdit").show();
$j("#ansMod").hide();
});
});
};
})(jQuery);

JASK.namespace("question");
(function(A){A.fn.ja_submitanswer=function(B){return this.each(function(){A(this).click(function(){var C=A("#answerfrm > textarea"),H=$j("#answer-form-txt").val(),I=this;
if(JASK.question.okToAnswer(B)){var F=JASK.cfg.ldomain+"/ja-submit-answer?qid="+JASK.cfg.queryid;
var E=A.serializeObject(A(this).parents("form"));
var G=B?$j("#edit_ques_form"):$j("#answerfrm");
if($j("#recaptchaDialog").is(":visible")){if($j.trim($j("#answerRecaptcha .recaptcha").val()).length==0){$j("#recaptchaError").hide();
$j("#recaptchaEmpty").show();
JASK.cfg.ans_count=0;
return ;
}E=A.serializeObject(G);
E["recaptcha_challenge_field"]=Recaptcha.get_challenge();
E["recaptcha_response_field"]=$j("#answerRecaptcha .recaptcha").val();
$j("#recaptchaEmpty").hide();
$j("#recaptchaDialog").dialog("close");
}E["spellingErrorCount"]=G.find("textarea").data("spellErrors");
var D=$j("#answerfrm > #answer_error");
$j(D).html("");
$j(I).showBusy();
A.post(F,E,function(M){var K=false;
$j(I).showDone();
if($j("#ans-edit-txt").is(":visible")){K=true;
}if(A("errormessage",M).attr("type")=="error"&&A("errormessage",M).attr("code")==161){$j(D).html("<span class='error b txt3'>"+JASK.answer.throttleError+"</span>");
}else{if(A("errormessage",M).attr("type")=="error"&&A("errormessage",M).attr("code")==165){$j(D).html("<span class='error b txt3'>"+JASK.answer.dailyThrottleError+"</span>");
}else{if(A("errormessage",M).attr("type")=="error"&&A("errormessage",M).attr("code")==173){var N="Some one from your organization is already answered this question.";
$j(D).html("<span class='error b txt3'>"+N+"</span>");
}else{if(A("errormessage",M).attr("type")=="error"){var N="Sorry, there was an error saving your answer. Please try again!";
$j(D).html("<span class='error b txt3'>"+N+"</span>");
JASK.cfg.ans_count=0;
}else{if(A("errormessage",M).attr("type")=="spam"){$j("#recaptchaError").hide();
$j("#recaptchaEmpty").hide();
$j("#recaptchaBtn").unbind("click");
$j("#recaptchaBtn").ja_submitanswer(K);
if(!$j("#recaptchaDialog").data("inited")){$j("#recaptchaDialog").data("inited",true);
$j("#recaptcha_image").attr("id","recaptcha_image_old");
$j("#answerRecaptcha #answerRecaptchaImage").attr("id","recaptcha_image");
}Recaptcha.create("6LeUnAIAAAAAAFK4AJHqebEoW5xCHMe5MmwvQHJL","recaptcha_image",{theme:"custom"});
Recaptcha.focus_response_field=function(){};
var L=$j("#answerRecaptcha .recaptcha");
L.val(L.attr("default"));
L.toggleClass("prefocus",true);
L.toggleClass("postfocus",false);
$j("#recaptchaDialog").dialog("open");
JASK.cfg.ans_count=0;
}else{if(A("errormessage",M).attr("type")=="recaptcha"){$j("#recaptchaError").show();
$j("#recaptchaEmpty").hide();
$j("#recaptchaBtn").unbind("click");
$j("#recaptchaBtn").ja_submitanswer(K);
Recaptcha.reload();
var L=$j("#answerRecaptcha .recaptcha");
L.val(L.attr("default"));
L.toggleClass("prefocus",true);
L.toggleClass("postfocus",false);
$j("#recaptchaDialog").dialog("open");
JASK.cfg.ans_count=0;
}else{if(A("html",M).text()!=0){var J=A("html",M).text();
A("#ui-ans-container").html(J);
JASK.question.bindQuestionBehaviors();
A("a.collapsibleLink").ja_collapsibleMenu();
$j("#jaques_anch").hide();
$j(".editCntDwn").each(function(){JASK.question.countDownTimer($j(this));
});
if(K){$j("#editQStatus").html("<span> - <span class='succmsg txt2 pl0'>Answer updated!</span></span>");
}else{$j(document).trigger("cppthanks");
}JASK.question.bindAnswerSpellCheck();
$j(document).trigger("cppMessage");
if($j(".jaqa_edit")){$j(".jaqa_edit").ja_editAnswer();
$j("#jaqa_editCancel").ja_cancelEditAnswer();
}JASK.question.embedYouTube();
}}}}}}}},"xml");
}else{$j(".sc-answer-err").slideUp();
}return false;
});
A(this).keyup(function(D){var C=(D.keyCode?D.keyCode:D.which);
if(C==13){$j(".answerfrmbtn").trigger("click");
return false;
}});
A(this).focusin(function(){$j(this).css("outline","#000 dotted thin");
});
A(this).focusout(function(){$j(this).css("outline","none");
});
});
};
})(jQuery);
JASK.question.storeAnswer=function storeAnswer(){if($j("#answer-form-txt").length&&$j("#answer-form-txt").val()){$j.jStorage.set("answer",$j("#answer-form-txt").val());
}};

JASK.namespace("question");
JASK.namespace("answer");
JASK.answer.throttle="throttle";
JASK.answer.dailyThrottle="dailyThrottle";
JASK.answer.duplicate="duplicate";
JASK.answer.spam="spam";
JASK.answer.recaptcha="recaptcha";
JASK.answer.authentication="authentication";
JASK.answer.general="general";
JASK.answer.askerAnswered="askerAnswered";
JASK.answer.answeredTwice="answeredTwice";
JASK.answer.duplicateError="Some one from your organization has already answered this question.";
JASK.answer.generalError="Sorry, there was an error saving your answer. Please try again.";
JASK.answer.askerAnsweredError="Sorry, you can't answer your own question";
JASK.answer.answeredTwiceError="Sorry, you've already answered this question.";
JASK.question.answer=function(B,D){var A=D?D:function(){};
var C=B["quickAnswer"]?B["quickAnswer"]:false;
if(C){url=JASK.cfg.ldomain+"/ja-quick-answer?qid="+JASK.cfg.queryid;
}else{url=JASK.cfg.ldomain+"/ja-submit-answer?qid="+JASK.cfg.queryid;
}if(JASK.isAuthenticated()){$j.post(url,B,function(E){if($j("errormessage",E).attr("type")=="error"&&$j("errormessage",E).attr("code")==161){A($j.extend(B,{success:false,error:JASK.answer.throttle}),E);
}else{if($j("errormessage",E).attr("type")=="error"&&$j("errormessage",E).attr("code")==165){A($j.extend(B,{success:false,error:JASK.answer.dailyThrottle}),E);
}else{if($j("errormessage",E).attr("type")=="error"&&$j("errormessage",E).attr("code")==112){A($j.extend(B,{success:false,error:JASK.answer.answeredTwice}),E);
}else{if($j("errormessage",E).attr("type")=="error"&&$j("errormessage",E).attr("code")==113){A($j.extend(B,{success:false,error:JASK.answer.askerAnswered}),E);
}else{if($j("errormessage",E).attr("type")=="error"&&$j("errormessage",E).attr("code")==173){A($j.extend(B,{success:false,error:JASK.answer.duplicate}),E);
}else{if($j("errormessage",E).attr("type")=="error"){JASK.cfg.ans_count=0;
A($j.extend(B,{success:false,error:JASK.answer.general}),E);
}else{if($j("errormessage",E).attr("type")=="spam"){JASK.cfg.ans_count=0;
A($j.extend(B,{success:false,error:JASK.answer.spam}),E);
}else{if($j("errormessage",E).attr("type")=="recaptcha"){JASK.cfg.ans_count=0;
A($j.extend(B,{success:false,error:JASK.answer.recaptcha}),E);
}else{A($j.extend(B,{success:true}),E);
}}}}}}}}},"xml");
}else{A($j.extend(B,{success:false,error:JASK.answer.authentication}));
}};
(function(A){A.fn.submitAnswer=function(){return this.each(function(){A(this).click(function(){var D=A.serializeObject($j("#answerfrm"));
var C=JASK.question.validateAnswer(false,$j("#answer-form-txt").val());
if(C.valid){JASK.question.answer(D,B);
}else{}});
});
};
function B(E,F){var D=$j("#answerfrm > #answer_error");
if(E.success){if(A("html",F).text()!=0){var C=A("html",F).text();
A("#ui-ans-container").html(C);
JASK.question.bindQuestionBehaviors();
A("a.collapsibleLink").ja_collapsibleMenu();
$j("#jaques_anch").hide();
$j(document).trigger("cppthanks");
JASK.question.bindAnswerSpellCheck();
$j(document).trigger("cppMessage");
if($j(".jaqa_edit")){$j(".jaqa_edit").ja_editAnswer();
$j("#jaqa_editCancel").ja_cancelEditAnswer();
}}else{D.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
}}else{switch(E.error){case JASK.answer.throttle:D.html("<span class='error b txt3'>"+JASK.answer.throttleError+"</span>");
break;
case JASK.answer.dailyThrottle:D.html("<span class='error b txt3'>"+JASK.answer.dailyThrottleError+"</span>");
break;
case JASK.answer.duplicate:D.html("<span class='error b txt3'>"+JASK.answer.duplicateError+"</span>");
break;
case JASK.answer.answeredTwice:D.html("<span class='error b txt3'>"+JASK.answer.answeredTwiceError+"</span>");
break;
case JASK.answer.askerAnswered:D.html("<span class='error b txt3'>"+JASK.answer.askerAnsweredError+"</span>");
break;
case JASK.answer.spam:JASK.validation.getRecaptcha(false,function(G){$j.extend(E,G);
JASK.question.answer(E,B);
});
break;
case JASK.answer.recaptcha:JASK.validation.getRecaptcha(true,function(G){$j.extend(E,G);
JASK.question.answer(E,B);
});
break;
case JASK.answer.authentication:D.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
break;
case JASK.answer.general:D.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
break;
}}}})(jQuery);
(function(A){A.fn.editAnswer=function(C){return this.each(function(){A(this).click(function(){var E=A.serializeObject($j("#edit_ques_form"));
var D=JASK.question.validateAnswer(true,$j("#answer-form-txt").val());
if(D.valid){JASK.question.answer(E,B);
}else{}});
});
};
function B(E,F){var D=$j("#answerfrm > #answer_error");
if(E.success){if(A("html",F).text()!=0){var C=A("html",F).text();
A("#ui-ans-container").html(C);
JASK.question.bindQuestionBehaviors();
A("a.collapsibleLink").ja_collapsibleMenu();
$j("#jaques_anch").hide();
$j("#editQStatus").html("<span> - <span class='succmsg txt2 pl0'>Answer updated!</span></span>");
JASK.question.bindAnswerSpellCheck();
$j(document).trigger("cppMessage");
if($j(".jaqa_edit")){$j(".jaqa_edit").ja_editAnswer();
$j("#jaqa_editCancel").ja_cancelEditAnswer();
}}else{D.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
}}else{switch(E.error){case JASK.answer.throttle:D.html("<span class='error b txt3'>"+JASK.answer.throttleError+"</span>");
break;
case JASK.answer.dailyThrottle:D.html("<span class='error b txt3'>"+JASK.answer.dailyThrottleError+"</span>");
break;
case JASK.answer.duplicate:D.html("<span class='error b txt3'>"+JASK.answer.duplicateError+"</span>");
break;
case JASK.answer.spam:JASK.validation.getRecaptcha(false,function(G){$j.extend(E,G);
JASK.question.answer(E,B);
});
break;
case JASK.answer.recaptcha:JASK.validation.getRecaptcha(true,function(G){$j.extend(E,G);
JASK.question.answer(E,B);
});
break;
case JASK.answer.authentication:D.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
break;
case JASK.answer.general:D.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
break;
}}}})(jQuery);
(function(A){A.fn.quickSubmitAnswer=function(){return A(this).live("click",function(){function E(L,N){var M=L["id"];
var K=A("#quickanswerfrm-"+M);
var J=A(".quickanswererr",K);
if(L.success){if(A("html",N).text()!=0){var I=A("html",N).text();
K.parent("div").replaceWith(I);
JASK.question.countDownTimer($j(".editCntDwn","#questionContent"+M));
}else{J.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
}}else{switch(L.error){case JASK.answer.throttle:J.html("<span class='error b txt3'>"+JASK.communityCfg.answerThrottleError+"</span>");
break;
case JASK.answer.dailyThrottle:J.html("<span class='error b txt3'>"+JASK.communityCfg.answerDailyThrottleError+"</span>");
break;
case JASK.answer.duplicate:J.html("<span class='error b txt3'>"+JASK.answer.duplicateError+"</span>");
break;
case JASK.answer.answeredTwice:J.html("<span class='error b txt3'>"+JASK.answer.answeredTwiceError+"</span>");
break;
case JASK.answer.askerAnswered:J.html("<span class='error b txt3'>"+JASK.answer.askerAnsweredError+"</span>");
break;
case JASK.answer.spam:JASK.validation.getRecaptcha(false,function(O){$j.extend(L,O);
JASK.question.answer(L,E);
});
break;
case JASK.answer.recaptcha:JASK.validation.getRecaptcha(true,function(O){$j.extend(L,O);
JASK.question.answer(L,E);
});
break;
case JASK.answer.authentication:JASK.ask_dialog.initSignin(121,function(){JASK.signin.changeState.signedIn();
JASK.question.answer(L,E);
});
break;
case JASK.answer.general:J.html("<span class='error b txt3'>"+JASK.answer.generalError+"</span>");
break;
}}A("#quickanswerbtn-"+M).showDone();
}var H=A(this).attr("id").split("-")[1];
var F=$j(this).closest("form");
var C=F.find("#quickanswertxt-"+H);
var D=A(".quickanswererr",F);
if(C.data("unmodified")==true){C.data("unmodified",false);
C.val("");
}D.html("");
var G=A.serializeObject(F);
G["quickAnswer"]=true;
var B=JASK.question.validateAnswer(false,C.val());
if(B.valid){A(this).showBusy();
JASK.question.answer(G,E);
}else{D.html("<span class='error b txt3'>"+B.error+"</span>");
}});
};
})(jQuery);
JASK.answer.resetAnswerBox=function(A){A.data("unmodified",false);
A.unbind("keypress.dynSiz");
A.val("");
A.removeAttr("style");
};

JASK.cfg.ans_count=0;
JASK.namespace("answer");
JASK.namespace("question");
JASK.question.okToAnswer=function(E,C){var B=true;
JASK.cfg.ans_count++;
var D=(E)?$j("#edit_ques_form > #answer_error"):$j("#answerfrm > #answer_error");
var H="";
if(!E&&JASK.cfg.ans_count>1){B=false;
return B;
}var A=(E)?$j("#ans-edit-txt"):$j("#answer-form-txt");
if(C&&$j(C).length>0){A=$j(C);
D=$j("#mkt_error");
}var F=$j.noOfLinksInText(A.val());
var G=A.val();
if(!G){H="Sorry, you cannot submit a blank answer!";
$j(D).html("<span class='error b txt3'>"+H+"</span>");
JASK.cfg.ans_count=0;
B=false;
}else{if(G==null||G==""||$j.trim(G).length==0){H="Sorry, you cannot submit a blank answer!";
$j(D).html("<span class='error b txt3'>"+H+"</span>");
JASK.cfg.ans_count=0;
B=false;
}else{if(!G.match(/[a-z0-9]/)){H="Please don't use all caps for your answer.";
$j(D).html("<span class='error b txt3'>"+H+"</span>");
JASK.cfg.ans_count=0;
B=false;
}else{if(F>JASK.communityCfg.answerMaxUrlAllowedCount){$j(D).html("<span class='error b txt3'>"+JASK.communityCfg.answerSpamLinksError+"</span>");
JASK.cfg.ans_count=0;
B=false;
}}}}return B;
};
JASK.question.hideToolTip=function(){$j("#ans-sc-wrp").hide();
var A=$j(".sc-toggle > .hide-ss");
A.text("Show Suggestions");
A.removeClass("hide-ss").addClass("show-ss");
$j("#ans-sc-wrp").data("animateMode","0");
};
JASK.question.validateAnswer=function(C,B){var A={};
JASK.cfg.ans_count++;
var E="";
if(!C&&JASK.cfg.ans_count>1){A={valid:false};
}var D=$j.noOfLinksInText(B);
if(!B){E="Sorry, you cannot submit a blank answer.";
JASK.cfg.ans_count=0;
A={valid:false,error:E};
}else{if(B==null||B==""||$j.trim(B).length==0){E="Sorry, you cannot submit a blank answer.";
A={valid:false,error:E};
JASK.cfg.ans_count=0;
}else{if(!B.match(/[a-z0-9]/)){E="Please don't use all caps for your answer.";
A={valid:false,error:E};
JASK.cfg.ans_count=0;
}else{if(D>JASK.communityCfg.answerMaxUrlAllowedCount){A={valid:false,error:JASK.communityCfg.answerSpamLinksError};
JASK.cfg.ans_count=0;
}else{if(B.length>JASK.communityCfg.answerCharLimit){A={valid:false,error:JASK.communityCfg.answerCharLimitExceedError};
JASK.cfg.ans_count=0;
}else{A={valid:true};
}}}}}return A;
};

JASK.namespace("question");
JASK.namespace("validation");
JASK.question.validateDetail=function validateDetail(B){var A={"error":"","valid":true};
var C=B||"";
if(C.length===0){return A;
}else{if($j.hasHTML(C)){A={"error":"HTML is not allowed.","valid":false};
}else{if(C.length>1200){A={"error":"Sorry, the details for your question needs to be limited to only 1,200 characters.","valid":false};
}}}return A;
};
JASK.question.validateQuestion=function(G){var M={"error":"","valid":true};
var B=G||"";
var I=JASK.communityCfg;
var C=$j.trim(B).length;
if(C==0){M={"error":I.QUESTION_EMPTY,valid:false};
}else{if(B.length>I.qBoxCharLimit){M={"error":I.QUESTION_LEN,valid:false};
}else{var H=$j.trim(B).split(" ");
var E=H.length;
var K=$j.trim(B).replace(/[^a-zA-Z 0-9]+/g,"").split(" ");
var J=K.length;
if((E<15)){JASK.question.hasQuestionWarnings=1;
M={"error":"",valid:true};
}if(E<=2){M={"error":I.AS_A_QUESTION,valid:false};
}else{if($j.trim(B).match(/[A-Z]/)&&!$j.trim(B).match(/[a-z0-9]/)){M={"error":I.QUESTION_CAPS,valid:false};
}else{if((B.replace(/\s\s+/g,"").indexOf("??")>-1)||(B.replace(/\s\s+/g,"").indexOf("? ?")>-1)){M={"error":I.QUESTION_MULTI_QUES_MARK,valid:false};
}else{for(var F=0;
F<J;
F++){if(($j.inArray(K[F].toLowerCase(),I.INVALID_SHORTHAND_WORDS.split(","))>-1)){if(M.valid){M={"error":I.QUESTION_SHORT_TEXT,valid:false};
break;
}}}if(M.valid){var A=$j.trim(B).match(/\b[^\Wa-z0-9_]+\b/g);
var L=A!=null?A.length:0;
if(L>0){var D=0;
if(J==3){D=Math.round(J*(33/100));
}else{D=Math.round(J*(40/100));
}if(L>D){M={"error":I.QUESTION_CAPS_LIMITED,valid:false};
}}}}}}}}JASK.question.hasQuestionErrors=(M.valid?0:1);
return M;
};
JASK.question.charLimit=function(G){var H=G.target;
var A=$j(G.target).parents("form");
var D=A.find(".cdisplay:first");
var F=JASK.communityCfg.qBoxCharLimit;
var E=A.find(".aq_button");
var C=H.value.length;
var B=F-C;
if(B<0){D.css("color","#B10000");
if(E.hasClass("askpplbtn")){A.find(".aq_button").toggleClass("askpplbtn askpplbtn-dis");
}}else{D.css("color","#666666");
if(E.hasClass("askpplbtn-dis")){A.find(".aq_button").toggleClass("askpplbtn askpplbtn-dis");
}}D.text((B<0)?0:B);
};

JASK.namespace("question");
(function(A){A.fn.ja_vote=function(){return this.each(function(){A(this).click(function(){if(!JASK.isAuthenticated()){JASK.ask_dialog.initSignin(3155);
return false;
}else{var G=this.id.split("-");
var C=G[1];
var J=G[2];
var I="#rate-"+C+"-"+J;
var D="#cnt-"+C+"-"+J;
if(J==1){var F="#rate-"+C+"-6";
var K="#cnt-"+C+"-6";
}else{if(J==6){var F="#rate-"+C+"-1";
var K="#cnt-"+C+"-1";
}}if(A(this).hasClass("usr-voted")){A(I).removeClass("ratelink");
A(F).removeClass("ratelink");
A(I).unbind("click");
A(F).unbind("click");
var B="#usrvote-"+C+"-sorry";
A(B).fadeIn(200).fadeTo(1000,1).fadeOut(750);
return false;
}var H=this;
var E=JASK.cfg.ldomain+"/ja-vote";
A.post(E,{"id":C,"userId":JASK.cfg.uid,"type":J,"engine_id":"add_vote"},function(M){if(M&&M.status["@code"]==100){var L="#usrvote-"+C+"-thnks";
A(D).text((parseInt(A(D).text())+1));
if(J==1){if(JASK.ja.question.voteuppks&&JASK.ja.question.voteuppks[C]){spk(H,JASK.ja.question.voteuppks[C]);
}A(I).css("cursor","default");
A(F).css("cursor","default");
A(I).addClass("usr-voted");
A(I).removeClass("usrvote_up_enab");
A(I).addClass("usrvote_up_disab");
A(F).addClass("usr-voted");
A(D).parent("div").addClass("usrcnt_up_bg");
A(""+D+"> span").addClass("usrcnt_up_1");
A(""+D+"> span").unwrap();
A(""+K+"> span").addClass("usrcnt_down_1");
A(""+K+"> span").unwrap();
A("#answer-"+C+" .votes > span").show();
A(L).fadeIn(200).fadeTo(1000,1);
}else{if(J==6){if(JASK.ja.question.votedownpks&&JASK.ja.question.votedownpks[C]){spk(H,JASK.ja.question.votedownpks[C]);
}A(I).css("cursor","default");
A(F).css("cursor","default");
A(I).addClass("usr-voted");
A(F).addClass("usr-voted");
A(D).parent("div").addClass("usrcnt_down_bg");
A(""+D+"> span").addClass("usrcnt_down_6");
A(""+D+"> span").unwrap();
A(""+K+"> span").addClass("usrcnt_up_6");
A(""+K+"> span").unwrap();
A(L).fadeIn(200).fadeTo(1000,1).fadeOut(750);
}}}},"json");
return false;
}});
A(this).mouseover(function(){var B=this.id.split("-");
var E=B[1];
var C=B[2];
var D="#cnt-"+E+"-"+C;
A(D).css("text-decoration","underline");
});
A(this).mouseout(function(){var B=this.id.split("-");
var E=B[1];
var C=B[2];
var D="#cnt-"+E+"-"+C;
A(D).css("text-decoration","none");
});
});
};
})(jQuery);

JASK.namespace("question");
JASK.question.embedYouTube=function embedYouTube(){$j(".yte").each(function(B,C){var D=$j(C).attr("data-youtube-id");
if(!D){return true;
}var A="http://gdata.youtube.com/feeds/api/videos/"+D+"?alt=json-in-script&format=5&callback=?";
$j.getJSON(A,function(E){JASK.question.loadYouTubeData(D,E);
});
});
};
JASK.question.loadYouTubeData=function loadYouTubeData(D,C){var A=function(F,H){var E=F.length>H;
if(E){F=F.substring(0,H);
var G=F.lastIndexOf(" ");
if(G>0){F=F.substring(0,G);
}F+=" ...";
}return F;
};
var B="#yte-"+D+" ";
$j(B+".ytThumbnail").attr("src",C.entry.media$group.media$thumbnail[2].url);
$j(B+".ytThumbnail").attr("alt",C.entry.title.$t);
$j(B+".ytTitle a").text(A(C.entry.title.$t,35));
$j(B+".ytContent").text(A(C.entry.content.$t,110));
$j(B).css("visibility","visible");
$j(B+".ytImageSection").click(JASK.question.showYouTubePlayer);
$j(B+".ytTitle a").click(JASK.question.showYouTubePlayer);
$j("#ytp-"+D+" .hider").click(JASK.question.hideYouTubePlayer);
};
JASK.question.showYouTubePlayer=function showYouTubePlayer(A){A.preventDefault();
var C=$j(this).parents(".yte").attr("data-youtube-id");
var B=$j("#ytp-"+C+" .player").attr("data-src");
$j(this).parents(".yte").hide();
$j("#ytp-"+C).show();
$j("#ytp-"+C+" .player").attr("src",B);
};
JASK.question.hideYouTubePlayer=function showYouTubePlayer(A){A.preventDefault();
var B=$j(this).parents(".ytp").attr("data-youtube-id");
$j(this).parents(".ytp").hide();
$j("#yte-"+B).show();
$j("#ytp-"+B+" .player").attr("src","");
};

JASK.namespace("question");
(function(A){A.fn.ja_closeform=function(){return this.each(function(){A(this).focusout(function(){var C=A(this).val();
if(!C||C==null||C==""||$j.trim(C).length==0){var B=A(this).closest(".tglformcontainer").siblings(".tglform").first();
B.toggle();
A(this).closest(".tglformcontainer").toggle();
A(this).closest(".tglformcontainer").siblings(".com-box-beak").toggle();
}});
});
};
})(jQuery);
(function(A){A.fn.ja_openform=function(){return this.each(function(){A(this).focusin(function(){var D=A(this).siblings(".tglformcontainer").first();
D.toggle();
var C=D.find(".cmterror");
C.html("");
var B=D.find("textarea").first();
A(this).toggle();
A(this).siblings(".com-box-beak").toggle();
setTimeout(function(){B.focus();
},10);
});
});
};
})(jQuery);
JASK.question.okToPost=function okToPost(B,D){var A=true;
var E="";
var C="";
if($j(B).is("div")){C=$j(B).text();
}else{C=$j(B).val();
}if(!C||C==null||C==""||$j.trim(C).length==0){E="Sorry, you cannot submit a blank comment!";
D.html("<span class='error b txt3'>"+E+"</span>");
A=false;
}else{if(!C.match(/[a-z0-9]/)){E="Please don't use all caps for your comment.";
D.html("<span class='error b txt3'>"+E+"</span>");
A=false;
}}return A;
};
JASK.question.scrollToComment=function scrollToComment(){var I=$j.getUrlParam("cpid");
if(I!=null&&typeof I!="undefined"&&I.length>0){var J=$j("#cpid"+I);
if(J.length>0){var C=J.closest(".uiblock_comments");
var E=C.attr("id").split("-");
var B=E[0];
var A=C.siblings("a#"+B).attr("name");
if(A!=null&&typeof A!="undefined"&&A.length>0){window.location.hash=A;
var D=C.is(":hidden");
var G="#"+B+"-toggleStatus";
$j(G).toggleClass("tglplus",D);
$j(G).toggleClass("tglminus",!D);
}}else{var H="#apid"+I;
var F=$j(""+H+"> a").attr("name");
if(F!=null&&typeof F!="undefined"&&F.length>0){window.location.hash=F;
}}return false;
}};
(function(B){B.fn.storeComment=function A(){if($j(this).length&&$j(this).val()){$j.jStorage.set("comment",{"id":$j(this).attr("id"),value:$j(this).val()});
}};
B.fn.ja_comment=function(){return this.each(function(){var C=false;
B(this).click(function(){if(!JASK.isAuthenticated()){B("textarea",B(this).parent()).storeComment();
JASK.ask_dialog.initSignin(3154);
return false;
}else{var G=this;
if(C||$j(G).data("isBusy")){return false;
}var E=JASK.cfg.ldomain+"/ja-comment";
if(B(this).parent("form").length!=0){JASK["lastCommentForm"]=B.serializeObject(B(this).parent("form"));
}_form=JASK["lastCommentForm"];
var H=_form["commented_id"];
var D=B("#"+H+"cmtform");
var F=B("#"+H+"cmterror");
_form["engine_id"]="add_comment";
if(JASK.question.okToPost(D,F)){F.html("");
if($j("#recaptchaDialog").is(":visible")){if($j.trim($j("#answerRecaptcha .recaptcha").val()).length==0){$j("#recaptchaError").hide();
$j("#recaptchaEmpty").show();
return ;
}_form["recaptcha_challenge_field"]=Recaptcha.get_challenge();
_form["recaptcha_response_field"]=$j("#answerRecaptcha .recaptcha").val();
$j("#recaptchaEmpty").hide();
$j("#recaptchaDialog").dialog("close");
}$j(G).showBusy();
C=true;
B.post(E,_form,function(N){$j(G).showDone();
C=false;
if(B("errormessage",N).attr("type")=="spam"){$j("#recaptchaError").hide();
$j("#recaptchaEmpty").hide();
$j("#recaptchaBtn").unbind("click");
$j("#recaptchaBtn").ja_comment();
$j("#recaptcha_image").attr("id","recaptcha_image_old");
$j("#answerRecaptcha #answerRecaptchaImage").attr("id","recaptcha_image");
Recaptcha.create("6LeUnAIAAAAAAFK4AJHqebEoW5xCHMe5MmwvQHJL","recaptcha_image",{theme:"custom"});
Recaptcha.focus_response_field=function(){};
var M=$j("#answerRecaptcha .recaptcha");
M.val(M.attr("default"));
M.toggleClass("prefocus",true);
M.toggleClass("postfocus",false);
$j("#recaptchaDialog").dialog("open");
}else{if(B("errormessage",N).attr("type")=="recaptcha"){$j("#recaptchaError").show();
$j("#recaptchaEmpty").hide();
$j("#recaptchaBtn").unbind("click");
$j("#recaptchaBtn").ja_comment();
Recaptcha.reload();
var M=$j("#answerRecaptcha .recaptcha");
M.val(M.attr("default"));
M.toggleClass("prefocus",true);
M.toggleClass("postfocus",false);
$j("#recaptchaDialog").dialog("open");
}else{if(B("html",N).text()!=0){var P=(_form["comment_type"]==0)?"question":"answer";
var J=B("html",N).text();
var R="#"+P+H+"-comment-container";
$j(R).append(J);
$j(".com-box-beak",$j(R).siblings(".filled-box")).remove();
var Q="#"+H+"cmtcnt-st";
var I="#"+H+"cmtcnt-end";
B(Q).text("(");
B(I).text(")");
var S="#"+H+"cmtcnt-txt";
var K=(B(S).text()==null||B(S).text()=="")?"0":B(S).text();
if($j("span.abstract",J).length){B(S).text(parseInt(K)+1);
}D.val("");
if(B(S).text()>=1){B(Q).show();
B(S).show();
B(I).show();
}var O=B(J).find(".slidableComment").attr("id");
if(O!=null&&typeof O!="undefined"&&O.length>0){$j("#"+O).ja_slidablePost("Comment");
$j("#"+O.split("-")[0]+"-arrow").ja_slidablePost("Comment");
}}else{if(B("errormessage",N).attr("code")==162){F.html("<span class='error b txt3'>"+JASK.comment.throttleError+"</span>");
}else{if(B("errormessage",N).attr("code")==166){F.html("<span class='error b txt3'>"+JASK.comment.dailyThrottleError+"</span>");
}else{var L="Sorry, there was an error saving your comment. Please try again!";
F.html("<span class='error b txt3'>"+L+"</span>");
return false;
}}}}}},"xml");
return false;
}return false;
}});
B(this).keyup(function(E){var D=(E.keyCode?E.keyCode:E.which);
if(D==13){$j(this).trigger("click");
return false;
}});
B(this).focusin(function(){$j(this).css("outline","#000 dotted thin");
});
B(this).focusout(function(){$j(this).css("outline","none");
});
});
};
})(jQuery);

(function(C){function B(){var G=$j("#cppthanks");
if(G){G.fadeIn(200).fadeTo(1000,1).fadeOut(8000);
}}C(document).bind("cppthanks",B);
function E(){var G=$j("img[cpp]");
G.each(function(){var H=$j(this),I="#"+H.attr("cpp")+"PM";
H.attr("title","");
$j(this).tooltip({tip:I,effect:"slide",direction:"up",opacity:0.97,fadeOutSpeed:10,predelay:100,delay:300,position:"bottom right",offset:[-40,5]});
});
}function D(){var G=$j("img[cppab]","#ui-ans-container");
G.each(function(){var H=$j(this),I="#"+H.attr("cppab")+"AB";
H.attr("title","");
$j(this).tooltip({tip:I,effect:"slide",direction:"up",opacity:0.97,fadeOutSpeed:10,predelay:100,delay:300,position:"top right",offset:[60,2]});
});
}var A=false;
function F(){if(typeof _gaq!="undefined"&&_gaq&&_gaq.push&&!A){A=true;
$j("[data-program-id]").each(function(H,G){_gaq.push(["_trackPageview","/program/answer-view/"+$j(G).attr("data-program-id")]);
});
}}C(document).bind("cppMessage",E);
C(document).bind("cppMessage",D);
C(document).bind("cppMessage",F);
C(document).ready(function(){$j(document).trigger("cppMessage");
});
})(jQuery);

JASK.addInterest=function addInterest(B,A){A=$j.trim(A.replace(/[,]/g," "));
if(JASK.isValidInterest(B,A)){var D=[];
$j.each(JASK.profile.interests[B].hash,function(E,F){if($j.trim(F).length>0){D.push(F);
}});
D.push(A);
var C=$j.serializeObject($j("form#myForm4"));
C["interestsVersion"]=2;
C["engine"]=B;
C["interests"]=D.join(",");
$j.post(JASK.cfg.ldomain+"/ja-profile-interests?cp=true",C,function(G){if(G.status["@code"]!=100){return ;
}var F=JASK.profile.interests[B];
F.hash[A.toLowerCase()]=A;
F.count++;
var E=$j("."+B+" .template").clone().removeClass("template").addClass("interest").css("display","");
$j(E).insertAfter("."+B+" .template");
$j(E).find("span").text(A);
$j(E).find(".remove").attr("id",A);
$j(E).ja_makeInterestEditable(B);
$j("."+B+".add").val("");
$j("#profileProgress").load(JASK.cfg.ldomain+"/ja-profile-progress?cp=true&rnd="+new Date().getTime());
},"json");
}};
JASK.isValidInterest=function isValidInterest(B,A){$j("."+B+".errormsg").html("");
if($j.trim(A).length==0){return false;
}if($j.trim(A).length>JASK.ja.maxTopicLength){$j("."+B+".errormsg").html(JASK.ja.topicLengthErrMsg);
return false;
}var C={"interests":{"What do you know about?":1,"Example: Mountain biking":1},"favoritePlaces":{"Where you have been?":1,"Example: Oakland  CA":1},"favMovieMusicTV":{"What do you like?":1,"Example: The Hangover":1}};
if(C[B][A]){return false;
}if(JASK.profile.interests[B].hash[A.toLowerCase()]){$j("."+B+".errormsg").html("You have already added that topic.");
return false;
}if(JASK.cfg.isAnswerExchangePartner=="true"&&JASK.profile.interests[B].count>=150){$j("."+B+".errormsg").html("You may not enter more than 150 topics of interest. In order to add a new topic, please remove one or more of the existing topics.");
return false;
}else{if(JASK.profile.interests[B].count>=50){$j("."+B+".errormsg").html("You may not enter more than 50 topics of interest. In order to add a new topic, please remove one or more of the existing topics.");
return false;
}}if($j.hasHTML(A)){$j("."+B+".errormsg").html("HTML is not allowed.");
return false;
}return true;
};

(function(A){A.fn.ja_makeInterestEditable=function(B){return this.each(function(){var D=this;
A(this).mouseover(function(E){E.preventDefault();
A(this).addClass("selectedinterest");
A(this).children(".remove").addClass("delicon");
});
A(this).mouseleave(function(E){E.preventDefault();
A(this).removeClass("selectedinterest");
A(this).children(".remove").removeClass("delicon");
});
var C=this;
A(this).children(".remove").mouseover(function(E){E.preventDefault();
A(this).addClass("redicon");
A(this).removeClass("delicon");
A(C).addClass("removeinterest");
});
A(this).children(".remove").mouseleave(function(E){E.preventDefault();
A(this).removeClass("redicon");
A(this).addClass("delicon");
A(C).removeClass("removeinterest");
});
A(this).children(".remove").click(function(G){G.preventDefault();
sct("53685");
var E=$j(this).attr("id");
var F=A.serializeObject(A("#myForm4"));
F["engine"]=B;
F["interestsVersion"]=2;
var H=[];
$j.each(JASK.profile.interests[B].hash,function(I,J){if(J!=E){H.push(J);
}});
F["interests"]=H.join(",");
A.post(JASK.cfg.ldomain+"/ja-profile-interests?cp=true",F,function(J){A("#profileProgress").load(JASK.cfg.ldomain+"/ja-profile-progress?cp=true&rnd="+new Date().getTime());
var I=JASK.profile.interests[B];
delete I.hash[E.toLowerCase()];
I.count--;
A(D).remove();
},"json");
});
});
};
})(jQuery);


(function(A){A.fn.ja_editsocialprofile=function(){return this.each(function(){A(this).click(function(B){B.preventDefault();
var E={};
var I=false;
E["attributes"]={};
var D=JASK.cfg.ldomain+"/ja-edit-social-profile";
var H=$j("#editsocialprofile_frm");
var K=A.serializeObject(A("#editsocialprofile_frm"));
E["user"]=K;
var G="HTML is not allowed.";
var J="Your changes saved successfully";
var F="Error in saving your settings";
var L=true;
JASK.showValidateMsg("clear_html","#editprofile_ok");
$j("div.editproferroric").hide();
H.find(".txtin_pro").each(function(){var M=$j(this);
if(M.val()!=M.attr("data-val")){I=true;
}});
H.find("*[data-social]").each(function(N,P){var M=[];
var O="#"+$j(this).attr("id")+"-error";
if($j.hasHTML(P.value)){L=false;
JASK.showValidateMsg("error",O,G);
}else{$j(O).html("");
M.push(P.value);
M.push($j(this).attr("data-social"));
M.push($j(this).attr("data-social-id"));
E.attributes[P.name]=M;
}});
if($j.hasHTML(K["firstName"])){JASK.showValidateMsg("error","#prof-fName-error",G);
L=false;
}else{$j("#prof-fName-error").html("");
}if($j.hasHTML(K["lastName"])){JASK.showValidateMsg("error","#prof-lName-error",G);
L=false;
}else{$j("#prof-lName-error").html("");
}var C=K["zipCode"];
if(!(C==""||$j.trim(C).length==0)&&(!C.match(/[1-9]/)||C.length!=5)){JASK.showValidateMsg("error","#prof-zip-error","Please enter a valid zipcode");
L=false;
}else{$j("#prof-zip-error").html("");
}if($j.hasHTML(K["about"])){JASK.showValidateMsg("error","#prof-abt-error",G);
L=false;
}else{if(K["about"].length>1028){JASK.showValidateMsg("error","#prof-abt-error","The about me section cannot be greater than 1028 characters.");
L=false;
}else{$j("#prof-abt-error").html("");
}}if($j.hasHTML(K["hometown"])){JASK.showValidateMsg("error","#prof-ht-error",G);
L=false;
}else{$j("#prof-ht-error").html("");
}if($j.hasHTML(K["website"])){JASK.showValidateMsg("error","#prof-web-error",G);
L=false;
}else{$j("#prof-web-error").html("");
}if(I){if(L){A.post(D,"json="+encodeURIComponent($j.toJSON(E))+"&profileMode=site",function(N){if(N.status["@code"]==100){JASK.showValidateMsg("success_clear","#editprofile_ok",J,2000);
if($j("#edit-prof-title")&&E.attributes["title"]){$j("#edit-prof-title").val(E.attributes["title"][0]).attr("data-val",E.attributes["title"][0]);
if(E.attributes["title"][0]!=""&&$j.trim(E.attributes["title"][0]).length>0){$j("#view-prof-title").text(E.attributes["title"][0]);
$j("#prof-title").show();
}else{$j("#prof-title").hide();
}}if($j("#edit-prof-ind")&&E.attributes["industry"]){$j("#edit-prof-ind").val(E.attributes["industry"][0]).attr("data-val",E.attributes["industry"][0]);
if(E.attributes["industry"][0]!=""&&$j.trim(E.attributes["industry"][0]).length>0){$j("#view-prof-ind").text(E.attributes["industry"][0]);
$j("#prof-ind").show();
}else{$j("#prof-ind").hide();
}}var M=false;
if(K["firstName"]&&K["firstName"]!=""&&$j.trim(K["firstName"]).length>0){$j("#edit-prof-fName").val(K["firstName"]).attr("data-val",K["firstName"]);
$j("#view-prof-name").text(K["firstName"]);
M=true;
}else{$j("#view-prof-name").text("");
$j("#edit-prof-fName").val("").attr("data-val","");
}if(K["lastName"]&&K["lastName"]!=""&&$j.trim(K["lastName"]).length>0){$j("#edit-prof-lName").val(K["lastName"]).attr("data-val",K["lastName"]);
$j("#view-prof-name").text($j("#view-prof-name").text()+" "+K["lastName"]);
M=true;
}else{$j("#edit-prof-lName").val("").attr("data-val","");
}if(M){$j("#prof-name").show();
}else{$j("#prof-name").hide();
}if($j("#edit-prof-zip").length>0){if(!(C==""||$j.trim(C).length==0)){$j("#edit-prof-zip").val(K["zipCode"]).attr("data-val",K["zipCode"]);
$j("#view-prof-zip").text(K["zipCode"]);
$j("#prof-zip").show();
}else{$j("#edit-prof-zip").val(K["zipCode"]).attr("data-val",K["zipCode"]);
$j("#prof-zip").hide();
}}if($j("#edit-prof-web").length>0){if(!(K["website"]==""||$j.trim(K["website"]).length==0)){$j("#edit-prof-web").val(K["website"]).attr("data-val",K["website"]);
$j("#view-prof-web").text(K["website"]);
$j("#view-prof-web").attr("href",$j.prefixHttp(K["website"]));
$j("#prof-web").show();
}else{$j("#edit-prof-web").val(K["website"]).attr("data-val",K["website"]);
$j("#prof-web").hide();
}}if(!(K["hometown"]==""||$j.trim(K["hometown"]).length==0)){$j("#edit-prof-ht").val(K["hometown"]).attr("data-val",K["hometown"]);
$j("#view-prof-ht").text(K["hometown"]);
$j("#prof-ht").show();
}else{$j("#edit-prof-ht").val(K["hometown"]).attr("data-val",K["hometown"]);
$j("#prof-ht").hide();
}if(!(K["about"]==""||$j.trim(K["about"]).length==0)){$j("#edit-prof-abt,#view-prof-abt").attr("data-val",K["about"]);
$j("#view-prof-abt").text(K["about"]);
$j("#prof-abt").show();
}else{$j("#edit-prof-abt,#view-prof-abt").attr("data-val",K["about"]);
$j("#prof-abt").hide();
}$j("#editprofile").hide();
$j("#viewprof").show();
}else{JASK.showValidateMsg("error","#editprofile_ok",F);
}},"json");
}}else{$j("#viewprof").show();
$j("#editprofile").hide();
}});
A(this).keyup(function(C){var B=(C.keyCode?C.keyCode:C.which);
if(B==13){$j("#editsocialprofile_btn").trigger("click");
return false;
}});
A(this).focusin(function(){$j(this).css("outline","#000 dotted thin");
});
A(this).focusout(function(){$j(this).css("outline","none");
});
});
};
})(jQuery);

$j(document).ready(function(){var B=JASK.cfg.ldomain+"/ja-delete-avatar?tok="+$j("#userToken").text();
$j(".followLink").ja_addFollow();
$j(".blockLink").ja_blockUser();
$j("#changeavatar").css("display","block");
$j(".avatar").removeClass("avtbddum");
$j(".avatar").addClass("avtbd");
$j(".innerbd").addClass("avtinbd");
function C(F){$j("#profileimage, #editproimage, #mini_me_avatar, #nmAvatar img").attr("src",F);
$j("#profileProgress").load(JASK.cfg.ldomain+"/ja-profile-progress?rnd="+new Date().getTime());
$j("#avtDialog").dialog("close");
}function E(){$j.getJSON(B,{},function(F){});
}$j(".saveAvatar").click(function(){JASK.profile.avatar.doPick("avatar-save");
var G=JASK.cfg.ldomain+"/ja-avatar?cp=true";
var H=window.frames[0].AVT.getAvatarURL();
var F=$j("#userToken");
if(JASK.CPCookie.getAvatarURL()!=H){$j.post(G,{"avatarUrl":H,"userId":JASK.cfg.uid},function(K){var J=new RegExp("://(.[^/]+)");
var I=H.match(J)[1];
if(I!=JASK.cfg.staticDomain){B+="&avtcd=ap";
}E();
C(H);
});
}else{C(H);
}});
$j("#rmavatar").click(function(){E();
$j("#prightimage").attr("src",JASK.CPCookie.getAvatarURL());
});
$j(".cancelavatar").click(function(){JASK.profile.avatar.doPick("avatar-cancel");
$j("#avtDialog").dialog("close");
E();
});
$j("#collapsibleLink-profile").ja_collapsibleMenu();
$j(".flagprofile").click(JASK.profile.report);
$j(".interests .interest").ja_makeInterestEditable("interests");
$j(".favoritePlaces .interest").ja_makeInterestEditable("favoritePlaces");
$j(".favMovieMusicTV .interest").ja_makeInterestEditable("favMovieMusicTV");
function D(G){if(G==null){return{hash:{},count:0};
}if(G.length>1&&G.indexOf("[")==0){G=G.substring(1);
}if(G.length&&G.lastIndexOf("]")==(G.length-1)){G=G.substring(0,G.length-1);
}if($j.trim(G).length==0){return{hash:{},count:0};
}G=G.split(",");
var H={},F=[];
$j.each(G,function(I,J){if($j.trim(J).length>0){H[$j.trim(J.toLowerCase())]=$j.trim(J);
}});
return{hash:H,count:G.length};
}var A=JASK.profile.interests={};
A.interests=D($j("#myForm4 input[name=interests]").val());
A.favoritePlaces=D($j("#myForm4 input[name=places]").val());
A.favMovieMusicTV=D($j("#myForm4 input[name=peoplelist]").val());
$j(".addinterest").click(function(F){JASK.addInterest("interests",$j("#newinterest").val());
});
$j(".addplaces").click(function(F){JASK.addInterest("favoritePlaces",$j("#newplace").val());
});
$j(".addpeople").click(function(F){JASK.addInterest("favMovieMusicTV",$j("#newpeople").val());
});
});
$j(document).ready(function(){var B=new JASK.logging.JALogger();
var A=$j("#connectionsProfile .followLink");
if(A.length>0){var D=A.attr("data-state");
var C="/connections/profile/"+D;
B.impression({"iId":C});
B.bindActivity("#connectionsProfile");
}});
$j(document).ready(function(){var E="jav";
var D="00000000000000000000000000000001";
var C=$j("#claraAdCat").text();
var B=JASK.cfg.ldomain+"/ja-avatar-dialog";
function A(G){var F=JASK.cfg.ldomain+"/comm-match?qsrc="+$j("#querySource").text()+"&id="+G+"&qid="+D+"&ac="+C;
$j.get(F);
}$j("#changelink, #profileAvatar").click(function(){A(E);
$j("#tglplus").css("display","block");
$j("#tglminus").css("display","none");
$j("#galavatars").css("display","none");
$j("#choosegaldisp").css("display","block");
$j("#choosegalhide").css("display","none");
$j("#avtDialog").dialog("open");
});
$j("#avtDialog").dialog({width:710,height:1010,autoOpen:$j("#avtDialogOpen").text()=="true"?true:false,modal:true,open:function(){$j("#avtframediv").html('<iframe src="'+B+"?uperr=false&date="+new Date().getTime()+'" width="680px" height="200px" scrolling="no" frameborder="0" style="margin-left:-8px;"/>');
}});
sct(53687);
});

JASK.namespace("profile");
JASK.profile.removeAvatar=function(){var A=JASK.cfg.ldomain+"/ja-delete-avatar?tok="+$j("#userToken").text();
$j.getJSON(A,{"":""},function(B){});
};
JASK.profile.report=function(){if(!JASK.isAuthenticated()){JASK.ask_dialog.initSignin();
return false;
}var C=$j(this).attr("data-reason"),A=$j("#otherUserId").val(),B=this;
var D=function(){$j("#collapsibleLink-profile, #collapsibleMenu-profile").remove();
$j("#reportedReason").text($j(B).text().toLowerCase());
$j("#reported").show();
};
$j.post(JASK.cfg.ldomain+"/reportProfile",{"userId":A,"reason":C},function(E){if(E.status["@code"]==100){D();
}},"json");
};
(function(A){A.fn.ja_interestfocus=function(){return this.each(function(){var B=A(this).attr("id");
A(this).focus(function(C){C.preventDefault();
switch(B){case"newinterest":if($j("input#"+B).val()=="Example: Mountain biking"){$j("input#"+B).val("");
}break;
case"newplace":if($j("input#"+B).val()=="Example: Oakland, CA"){$j("input#"+B).val("");
}break;
case"newpeople":if($j("input#"+B).val()=="Example: The Hangover"){$j("input#"+B).val("");
}break;
}});
});
};
})(jQuery);
(function(A){A.fn.ja_selectimg=function(){return this.each(function(){A(this).mouseover(function(B){B.preventDefault();
A(this).css("border-color","#55BBDD");
});
A(this).mouseleave(function(B){B.preventDefault();
A(this).css("border-color","#FFFFFF");
});
A(this).click(function(G){var F=A(this).attr("src");
var D=A("#userToken");
var E=new RegExp("://(.[^/]+)");
var C=F.match(E)[1];
if(C==GlobalNav.Variables["_staticDomain"]){var B=JASK.cfg.ldomain+"/ja-delete-avatar?tok="+D.text();
$j.getJSON(B,{"":""},function(H){if(H){}});
}if(window.frames.length>0){window.frames[0].AVT.setPreview(F);
}});
});
};
})(jQuery);
$j(document).ready(function(){$j("#newinterest").profileSuggestion("http://"+JASK.ssCfg.server+"/query?sstype=soft&fn=topicsSuggestion&pn=ctopic","newinterest");
$j("#newplace").profileSuggestion("http://"+JASK.ssCfg.server+"/query?sstype=prefix&fn=topicsSuggestion&pn=location","newplace");
$j("#newpeople").profileSuggestion("http://"+JASK.ssCfg.server+"/query?sstype=soft&fn=topicsSuggestion&pn=entertainment","newpeople");
});
$j(document).ready(function(){$j("#newinterest, #newplace, #newpeople").ja_interestfocus();
});
$j(document).ready(function(){$j("#newinterest").keyup(function(B){var A=(B.keyCode?B.keyCode:B.which);
if(A==13){$j(".ac_results_profile").css("display","none");
JASK.addInterest("interests",$j("#newinterest").val());
return false;
}});
});
$j(document).ready(function(){$j("#newplace").keyup(function(B){var A=(B.keyCode?B.keyCode:B.which);
if(A==13){$j(".ac_results_profile").css("display","none");
JASK.addInterest("favoritePlaces",$j("#newplace").val());
return false;
}});
});
$j(document).ready(function(){$j("#newpeople").keyup(function(B){var A=(B.keyCode?B.keyCode:B.which);
if(A==13){$j(".ac_results_profile").css("display","none");
JASK.addInterest("favMovieMusicTV",$j("#newpeople").val());
return false;
}});
});
$j(document).ready(function(){$j("#editproflk").click(function(A){A.preventDefault();
sct("53683");
$j("#editsocialprofile_frm .form_error_field").html("");
$j("#editsocialprofile_frm .form_error_field").hide("");
JASK.showValidateMsg("clear_html","#editprofile_ok");
$j("#viewprof").toggle();
$j("#editprofile").toggle();
$j("#editsocialprofile_frm input").each(function(){$j(this).val($j(this).attr("data-val"));
});
$j("#editsocialprofile_frm textarea").each(function(){$j(this).val($j(this).attr("data-val"));
});
$j("div.editproferroric").hide();
});
$j("#editsocialprofile_cancel").click(function(A){A.preventDefault();
JASK.showValidateMsg("clear_html","#editprofile_ok");
$j("#viewprof").show();
$j("#editprofile").hide();
});
$j("#editsocialprofile_btn").ja_editsocialprofile();
});
(function(A){A.fn.ja_deleteSocialAtt=function(B){return this.each(function(){var C=this;
A(this).mouseover(function(D){D.preventDefault();
A(this).css({"border-style":"solid","border-color":"#B10000","border-width":"1px"});
A(".remove",D.currentTarget).addClass("delicon");
});
A(".remove",this).mouseover(function(){A(this).removeClass("delicon");
A(this).addClass("redicon");
});
A(".remove",this).mouseleave(function(){A(this).removeClass("redicon");
A(this).addClass("delicon");
});
A(".remove",this).click(function(F){F.preventDefault();
var G=A(this).attr("data-provider");
var E=JASK.cfg.ldomain+"/ja-delete-social-attribute?provider="+G+"&name="+B;
var D={};
A.post(E,D,function(H){if(H&&H.status["@code"]==100){A(C).hide();
A("."+G+"_connections").hide();
}},"json");
});
A(this).mouseleave(function(D){D.preventDefault();
A(this).css({"border-style":"solid","border-color":"#FFFFFF","border-width":"1px"});
A(".remove",D.currentTarget).removeClass("redicon");
A(".remove",D.currentTarget).removeClass("delicon");
});
});
};
})(jQuery);
(function(A){A.fn.ja_dispgal=function(){var B=false;
return this.each(function(){A(this).click(function(){if(!B){$j.get(JASK.cfg.ldomain+"/ja-avatar-gallery",{},function(C){$j("#galavatars").html(C);
$j(".avtr").ja_selectimg();
B=true;
});
}A("#tglminus").css("display","block");
A("#tglplus").css("display","none");
A("#galavatars").css("display","block");
A("#choosegaldisp").css("display","none");
A("#choosegalhide").css("display","block");
});
});
};
})(jQuery);
(function(A){A.fn.ja_hidegal=function(){return this.each(function(){A(this).click(function(){A("#tglplus").css("display","block");
A("#tglminus").css("display","none");
A("#galavatars").css("display","none");
A("#choosegaldisp").css("display","block");
A("#choosegalhide").css("display","none");
});
});
};
})(jQuery);
(function(A){A.fn.ja_dispload=function(){return this.each(function(){A(this).click(function(B){B.preventDefault();
$j("#uploadbtn").hide().delay(100).fadeIn(100,function(){$j("#uploadbtn").hide();
$j("#uploadblock").show();
$j("#uploadtxt").show();
document.uploadavatarform.submit();
});
});
});
};
})(jQuery);
$j(document).ready(function(){$j(".uploadbtn").ja_dispload();
$j("#tglplus").ja_dispgal();
$j("#tglminus").ja_hidegal();
$j("#choosegaldisp").ja_dispgal();
$j("#choosegalhide").ja_hidegal();
$j(".edit_linkedin_connections").ja_deleteSocialAtt("connections");
$j(".edit_facebook_connections").ja_deleteSocialAtt("connections");
$j(document).trigger("cppMessage");
});

JASK.namespace("profile.avatar");
JASK.profile.avatar.doPick=(function(){var D="javu";
var B="javi";
var H="javc";
var G="jau";
var F="00000000000000000000000000000001";
function C(){var I="0";
var L=$j.cookie("ldpt");
if(L&&L.length>0){var J=L.indexOf("porg=");
if(J!=-1){try{I=L.substring(J+5,J+9);
}catch(K){}}}return I;
}function A(K){var I=K;
var J=C();
var L=K.indexOf("&ex=");
if(L!=-1){I=K.substring(0,L);
}return($j.param.querystring(I,"ld="+J)+"&ex=");
}function E(M){var L={en:"",io:"0",b:"",tp:"d",ec:"1",ex:""};
var I=M.split("-");
var J=I[0];
var K=I[1];
if(K=="cancel"){L.en=H;
}else{if(K=="upload"){L.en=D;
}else{if(K=="save"){L.en=B;
}}}if(J=="avatar"){L.b=G;
}return L;
}return(function(L){var K=E(L);
var J=encodeURI(_SP(K));
J=A(J);
J=$j.param.querystring(J,"qs="+JASK.cfg.trackerData.qsrc);
J=$j.param.querystring(J,"id="+F);
J=decodeURI($j.param.querystring(J,"p=1"));
var I=new Image();
I.src=J;
});
})();

JASK.namespace("qserp");
$j(document).ready(function(){$j("#aq_form").askQuestion();
$j("#sq_form").submitQuestion();
JASK.qserp.bindQuestionSpellcheck("qtxt");
JASK.qserp.bindQuestionSpellcheck("qdetail");
$j("#askq_tt_wrp .tt-close").click(function(){$j(".scq-toggle > .hide-ss").click();
});
});
JASK.qserp.bindQuestionSpellcheck=function bindQuestionSpellcheck(A){$j("#"+A).focus(function(){var B=$j(this).attr("id");
$j(".sc_error").each(function(){if(B+"_error"!=$j(this).attr("id")){$j(this).hide();
}});
});
JASK.qserp.showTooltip($j("#"+A));
$j("#"+A).ja_spellcheck({events:{shouldSpellCheck:function(){var C=this._element;
var D=$j("#"+C);
var B=(D.data("spellErrors")>0);
return B;
}},url:JASK.cfg.scDomain+"/ja-spellcheck",renderError:function(E,D,C){var F=$j("#"+A).data("spellErrors");
if(F>0){$j("#"+A+"_error_msg").html(F+" misspelling"+(F==1?"":"s")+" above");
$j("#"+A+"_error").show();
var B=$j("#askq_tt_wrp");
B.find(".sc-desc").html(D);
}else{$j("#"+A+"_error").hide();
}if(!C){JASK.qserp.resetErrorMessage(A);
}},hideSuggestion:function(B){var C=$j("#"+A).data("spellErrors");
if(C>0&&!B){$j("#"+A).trigger("displaySpellErrors");
}else{$j("#askq_tt_wrp").css("display","none");
}}});
};
JASK.qserp.hideSuggestions=function hideSuggestions(A){$j(".scq-toggle > .hide-ss").click();
};
$j(".scq-toggle > .show-ss").live("click",function(){$j(this).removeClass("show-ss").addClass("hide-ss");
var A=$j(this).data("input-id");
JASK.spellcheck.showSuggestions(A);
$j("#"+A).trigger("tt");
$j(this).html("Close");
return false;
});
$j(".scq-toggle > .hide-ss").live("click",function(){$j("#askq_tt_wrp").css("display","none");
$j(this).removeClass("hide-ss").addClass("show-ss");
$j(this).html("Show Suggestions &raquo;");
});
JASK.qserp.resetErrorMessage=function resetErrorMessage(B){$j("#askq_tt_wrp").css("display","none");
var A=$j("#"+B+"_error").find(".toggle-ss");
A.removeClass("hide-ss").addClass("show-ss");
A.html("Show Suggestions &raquo;");
};
JASK.qserp.showTooltip=function showTooltip(A){A.tooltip({events:{input:"tt, tt2",tooltip:""},tip:"#askq_tt_wrp",position:"center right",offset:[A.attr("id")=="qtxt"?30:15,17],onShow:function(){if(this.getTrigger().data("spellErrors")<=0){JASK.question.hideToolTip();
}else{A.ui_position({target:"#askq_tt_wrp",offset:"0 0",at:"top"});
var B=$j("#askq_tt_wrp");
if(B.data("animateMode")!="1"){B.animate({left:"-=15"});
B.data("animateMode","1");
}else{B.css("left",(B.position().left-15)+"px");
}}}});
JASK.spellcheck.showSuggestions(A.attr("id"));
};

(function(A){A.fn.ja_blockUser=function(){return this.each(function(){A(this).click(function(I){I.preventDefault();
var F=A(this);
if(F.attr("requesting")=="true"){return ;
}var H=F.attr("data-state");
var E=JASK.cfg.ldomain+"/ja-follow";
var D=F.attr("data-id");
var G=$j("#dynupdate").val()||"";
var C=F.attr("data-uname");
var B=JASK.cfg.ldomain+"/ja-following-update?id="+D+"&uname="+C;
if(H==="block"){F.attr("requesting","true");
$j.post(E,{connectToId:D,type:1},function(J){if(J&&J.status["@code"]==100){sct("54408");
F.attr("data-state","unblock");
if(A(F.find("span")).length>0){var L=A(F.find("span")[0]);
var K=A(F.find("span")[1]);
K.html(K.html().replace(/Block/,"Unblock"));
L.removeClass("blockico").addClass("unblockico");
}else{F.find(".blue-sbtn-title").text(F.find(".blue-sbtn-title").text().replace(/Block/,"Unblock"));
F.find(".bgButtonSm").text(F.find(".bgButtonSm").text().replace(/Block/,"Unblock"));
}if(G){A.get(B,function(M){if(M!=null&&M.length!=0){$j("#followingBlock").html(M);
}});
}$j("#errormsg").hide();
$j("#successmsg").show();
$j("#blocksuccess").show();
$j("#unblocksuccess").hide();
$j("#unfollowsuccess").hide();
$j("#followsuccess").hide();
}else{$j("#errormsg").show();
}F.attr("requesting","false");
},"json");
}else{if(H==="unblock"){F.attr("requesting","true");
$j.post(E,{connectToId:D,type:3},function(J){if(J&&J.status["@code"]==100){sct("54438");
F.attr("data-state","block");
if(A(F.find("span")).length>0){var L=A(F.find("span")[0]);
var K=A(F.find("span")[1]);
K.html(K.html().replace(/Unblock/,"Block"));
L.removeClass("unblockico").addClass("blockico");
}else{F.find(".blue-sbtn-title").text(F.find(".blue-sbtn-title").text().replace(/Unblock/,"Block"));
F.find(".bgButtonSm").text(F.find(".bgButtonSm").text().replace(/Unblock/,"Block"));
}$j("#errormsg").hide();
$j("#successmsg").show();
$j("#unblocksuccess").show();
$j("#blocksuccess").hide();
}else{$j("#errormsg").show();
}F.attr("requesting","false");
},"json");
}}});
});
};
})(jQuery);
(function(A){A.fn.ja_addFollow=function(){return this.each(function(){A(this).click(function(I){I.preventDefault();
var F=A(this);
if(F.attr("requesting")=="true"){return ;
}var H=F.attr("data-state");
var E=JASK.cfg.ldomain+"/ja-follow";
var D=F.attr("data-id");
var G=$j("#dynupdate").val()||"";
var C=F.attr("data-uname");
var B=JASK.cfg.ldomain+"/ja-follow-update?id="+D+"&uname="+C;
if(H==="follow"){F.attr("requesting","true");
$j.post(E,{connectToId:D,type:0},function(J){if(J&&J.status["@code"]==100){sct("54406");
F.attr("data-state","unfollow");
if(A(F.find("span")).length>0){var L=A(F.find("span")[0]);
var K=A(F.find("span")[1]);
K.text(K.text().replace(/Follow/,"Unfollow"));
L.removeClass("followico").addClass("unfollowico");
}else{F.find(".blue-sbtn-title").text(F.find(".blue-sbtn-title").text().replace(/Follow/,"Unfollow"));
F.find(".bgButtonSm").text(F.find(".bgButtonSm").text().replace(/Follow/,"Unfollow"));
}if(G){A.get(B,function(M){if(M!=null&&M.length!=0){$j("#followersBlock").html(M);
}});
}$j("#errormsg").hide();
$j("#successmsg").show();
$j("#followsuccess").show();
$j("#unfollowsuccess").hide();
$j("#blocksuccess").hide();
$j("#unblocksuccess").hide();
}else{$j("#errormsg").show();
}F.attr("requesting","false");
},"json");
}else{if(H==="unfollow"){F.attr("requesting","true");
$j.post(E,{connectToId:D,type:2},function(J){if(J&&J.status["@code"]==100){sct("54407");
F.hide();
F.parent(".connectionBlock").slideUp();
if(JASK.cfg.viewerIsOwner=="true"){$j(".followingHeaderTotal").each(function(){var K=parseInt($j(this).text());
K--;
$j(this).text(K);
});
}if(G){A.get(B,function(K){if(K!=null&&K.length!=0){$j("#followersBlock").html(K);
}});
}$j("#errormsg").hide();
$j("#successmsg").show();
$j("#unfollowsuccess").show();
$j("#followsuccess").hide();
$j("#blocksuccess").hide();
$j("#unblocksuccess").hide();
}else{$j("#errormsg").show();
}F.attr("requesting","false");
},"json");
}}});
});
};
})(jQuery);

JASK.namespace("connections");
JASK.connections=(function(A){A.importContacts=function F(O){var L={"facebook":54514,"linkedin":54515,"yahoo":54516,"google":54517};
var N=L[O];
if(N){sct(N);
}var M={};
var I={};
var J=$j("#userId").val();
var K=$j("#userEmail").val();
var H=JASK.cfg.ldomain+"/ja-create-token";
$j("#successmsg").hide();
$j("#import_ok").hide();
$j("#invtemails_ok").hide();
$j("#invtemails_error").hide();
if(O=="facebook"){$j.post(H,{userid:J,email:K},function(P){if(P&&P.status["@code"]==100&&P.status["@message"]!=null){var Q=B(P.status["@message"]);
var R="Get great answers on Ask.com from the web and real people too!";
R+=" Click 'Accept' below to join your friends in the Ask.com community.";
I={title:"Invite your friends to connect on Ask.com",text:R,name:"Ask.com",actionText:"Grow your Ask.com network",actionURL:Q,repeatFreq:1,repeatCap:100,reinviteFreq:1,reinviteCap:100};
M={invite:I,provider:O};
gigya.services.socialize.removeConnection(JASK.social.conf,{callback:function(){gigya.services.socialize.addConnection(JASK.social.conf,M);
}});
}else{JASK.showValidateMsg("error_message","#import_ok","Oops, Please try again");
}},"json");
}else{if(O=="linkedin"){$j.post(H,{userid:J,email:K},function(P){if(P&&P.status["@code"]==100&&P.status["@message"]!=null){var Q={multiInviteUrl:B(P.status["@message"])};
M={context:Q,provider:O,enabledProviders:O,disabledProviders:"facebook",callback:D};
gigya.services.socialize.addConnection(JASK.social.conf,M);
}else{JASK.showValidateMsg("error_message","#import_ok","Oops, Please try again");
}},"json");
}else{$j("#hidden_emails").val("");
$j("#invite_emails").val("");
$j("#social_import_search").val("");
$j("#hiddenemail_provider").val($j.capitalize(O));
$j("#social_import_panel").hide();
$j("#social_import_data").html("");
$j("#social_import_spinner").show();
$j("#social_import_close").show();
$j("#no_contacts").hide();
$j("#social_import_msg_panel").show();
$j("#social_import_titleicon").removeClass().addClass(O+"-icon");
$j("#contactsDlg_titlebar").text($j.capitalize(O));
$j("#contactsDlg span.social_contact_provider").text($j.capitalize(O));
$j("#social_import_ok").html("");
$j("#social_import_error").html("");
$j("#social_import_panel INPUT[type='checkbox']").attr("checked",false);
JASK.showValidateMsg("clearTip","#multinvt_tt");
$j("#contactsDlg").dialog("open");
gigya.services.socialize.addConnection(JASK.social.conf,{provider:O,callback:JASK.connections.addConnectionSuccess,context:{askProvider:O}});
}}};
function B(H){return JASK.cfg.ldomain+"/jinv?id="+encodeURIComponent(H)+"&tokentype=multi";
}A.addConnectionSuccess=function C(H){if(H.errorCode==0&&H.user){gigya.services.socialize.getContacts(JASK.social.conf,{enabledProviders:H.context.askProvider,callback:JASK.connections.getContactsSuccess});
}};
A.getContactsSuccess=function E(K){if(K.errorCode==0){var O=K["contacts"].asArray();
O.sort(function(R,Q){var T=R["firstName"];
var S=Q["firstName"];
if(!T||T==""){return 1;
}else{if(!S||S==""){return -1;
}else{T=T.charAt(0).toUpperCase();
S=S.charAt(0).toUpperCase();
if(!T.match(/[a-zA-Z]/)){return 1;
}if(!S.match(/[a-zA-Z]/)){return -1;
}return(T<S)?-1:(T>S)?1:0;
}}});
if(null!=O&&O.length>0){var P=$j("#template_social_contact");
var J="";
for(var N in O){var H=P.html();
var I=O[N];
var L=$j("#defaultavt-"+$j("#hiddenemail_provider").val()).val();
if(I["photoURL"]&&I["photoURL"]!=""){L=I["photoURL"];
}H=H.replace(/socialcnt-val/,I["email"]);
H=H.replace(/socialcnt-email/,I["email"]);
H=H.replace(/socialcnt-name/,I["firstName"]+" "+I["lastName"]);
H=H.replace(/xsrc="socialcnt-src/,'src="'+L);
if(N==O.length-1){H=H.replace("uiblock_br","");
}J+=H;
}$j("#social_import_data").html(J);
$j("#social_contact_no").text(O.length);
$j("#social_import_msg_panel").hide();
$j("#social_import_panel").show();
$j(".social_contact_row").click(function(){var Q=$j(this).find(".socialcnt-check").get()[0];
if($j(this).data("selectState")!="on"){$j(this).css("background-color","#dcf1f9");
$j(this).data("selectState","on");
Q.checked=true;
}else{$j(this).css("background-color","#fff");
$j(this).data("selectState","off");
Q.checked=false;
}});
}else{$j("#social_import_panel").hide();
$j("#social_import_spinner").hide();
$j("#no_contacts").show();
$j("#social_import_close").show();
$j("#social_import_msg_panel").show();
}}else{$j("#social_import_panel").hide();
$j("#social_import_spinner").hide();
$j("#no_contacts").hide();
$j("#social_import_close").show();
var M="Sorry, we were'nt able to import your "+$j("#hiddenemail_provider").val()+" contacts at this time.";
JASK.showValidateMsg("error_message","#social_import_ok",M);
}};
function D(H){if(H.user!=null&&typeof H.user!="undefined"){var J="";
if(H.context!=null&&typeof H.context!="undefined"){J=H.context.multiInviteUrl;
}var I={multiInviteUrl:J,userFirstName:H.user.firstName,userLastName:H.user.lastName};
var K={width:700,height:400,context:I,showCaption:true,enabledProviders:"linkedin",disabledProviders:"facebook",captionText:"Invite your friends to connect on Ask.com",showTermsLink:false};
K["onSelectionDone"]=function(M){if(M!=null&&typeof M!="undefined"){var O=M["friends"];
if(null!=O){var L=0;
var S=O["arr"];
if(S!=null){L=S.length;
}var N={friendsCount:L};
var P="I'd like to connect with you on Ask.com";
if(M.context!=null&&typeof M.context!="undefined"){P="Get great answers from the web and real people too!";
P+="\n\nWhat do you get by joining?";
P+="\n- Answers from real people";
P+="\n- When you send a question to the community you're asking real people with real experience";
P+="\n- The chance to help others";
P+="\n- Make someone's day by answering a question about something you know";
P+="\n- See what people are asking";
P+="\n- Discover what's on people's minds and lend your point of view too";
P+="\n\nTo create your new account, click the invitation link below.";
P+="\n\n"+M.context.multiInviteUrl;
}var R={context:N,recipients:O,body:P,callback:G,subject:"Join me at Ask.com"};
if(L>0){gigya.services.socialize.sendNotification(JASK.social.conf,R);
}else{var Q="You did not select any of your LinkedIn contacts.";
JASK.showValidateMsg("error_message","#import_ok",Q);
$j("#import_ok").show();
}}}};
if(H.errorCode==0){gigya.services.socialize.showFriendSelectorUI(JASK.social.conf,K);
}}}function G(H){var I="";
if(H!=null&&H.errorCode==0){I="Congratulations, you've sent "+H.context.friendsCount;
if(H.context.friendsCount>1){I+=" connection requests!";
}else{I+=" connection request!";
}JASK.showValidateMsg("success_message","#import_ok",I);
}else{I="LinkedIn reported an error with your request. Please try again.";
JASK.showValidateMsg("error_message","#import_ok",I);
}$j("#import_ok").show();
}return A;
})(JASK.connections);
(function(A){A.fn.inPageSearch=function(B){return this.each(function(){A(this).keyup(function(){var C=$j.trim(A(this).val());
if(C.length>0){A(B).hide();
A(B).filter(":containsIgnoreCase("+C+")").show();
}else{A(B).show();
}});
});
};
})(jQuery);

$j(document).ready(function(){$j("#contactsDlg").dialog({width:700,height:530,autoOpen:false,modal:true,draggable:false,resizable:false,show:{effect:"fade",duration:400},hide:{effect:"fade",duration:400}});
});
$j(document).ready(function(){$j(".social_importnone").click(function(A){A.preventDefault();
$j("#social_import_data .social_contact_row:visible").each(function(){if($j(this).data("selectState")=="on"){$j(this).click();
}});
});
$j(".social_importall").click(function(A){A.preventDefault();
$j("#social_import_data .social_contact_row:visible").each(function(){if($j(this).data("selectState")!="on"){$j(this).click();
}});
});
$j("#social_import_submit").click(function(){var C=[];
$j("#social_import_data input:checkbox:checked").each(function(){C.push($j(this).val());
});
if(null!=C&&C.length>0){$j("#invite_emails").val($j.uniqueArray(C).join(", "));
var A="";
if(C.length>1){A=C.length+" email addreesses from ";
}else{A=C.length+" email address from ";
}$j("#importsuccess_no").text(A);
$j("#importsuccess_provider").text($j("#hiddenemail_provider").val());
$j("#invite_emails").tooltip({tip:"#multinvt_tt_container",relative:true,position:"center right",offset:[25,12],delay:0,events:{tooltip:""},onShow:function(){if($j("#invite_emails").data("tooltip-displayed")){var D=$j("#invite_emails").data("tooltip");
D.hide();
}else{$j("#invite_emails").data("tooltip-displayed",true);
}}});
$j("#invite_emails").data("tooltip-displayed",false);
$j("#contactsDlg").dialog("close");
$j(document).scrollTop($j("#invite_emails").position().top);
$j("#invite_emails").get()[0].focus();
}else{var B="Please select emails to continue.";
JASK.showValidateMsg("error_message","#social_import_error",B);
}return false;
});
$j("#social_import_cancel,#social_import_close").click(function(A){A.preventDefault();
$j("#contactsDlg").dialog("close");
});
$j("#social_import_search").inPageSearch("#social_import_data div.social_contact_row");
$j("#social_import_search").keydown(function(B){var A=(B.keyCode?B.keyCode:B.which);
if(A==13){B.preventDefault();
return false;
}});
$j("#multi_invite_submit").click(function(A){A.preventDefault();
JASK.connections.userMultiInvites();
});
$j("#inviter_name").focusin(function(){var A=$j("#inviter_name").val();
if(A!=null&&$j.trim(A).length>0&&(A=="Enter First Name, Last Name"||A=="Your name")){$j("#inviter_name").val("");
$j("#inviter_name").css("font-style","");
$j("#inviter_name").removeClass("info");
}});
});

JASK.namespace("connections");
JASK.connections.userMultiInvites=function userMultiInvites(){$j("#invtemails_ok").hide();
$j("#invtemails_error").hide();
var B=JASK.cfg.ldomain+"/ja-multi-invite";
B+="?qsrc=4109";
var A=$j.serializeObject($j("#multi_invt_form"));
A["engine_id"]="multi_invite";
A["invite_cc"]=$j("input[name=invite_cc][type=checkbox]").is(":checked")?1:0;
A["note"]=$j.stripURLs(A["note"]);
if(JASK.connections.validateMultiInviteFields()&&JASK.connections.validateInviteEmails()){$j.post(B,A,function(C){if(C==null){JASK.showValidateMsg("error_message","#invtemails_error","Oops, Please try again");
$j("#invtemails_error").show();
}else{if(C.status["@code"]==100){JASK.showValidateMsg("success_message","#invtemails_ok","Request successfully sent");
$j("#invtemails_ok").show();
$j("#invite_emails").val("");
}else{JASK.showValidateMsg("error_message","#invtemails_error","Oops, Please try again");
$j("#invtemails_error").show();
}}$j("#successmsg").hide();
$j("#import_ok").hide();
},"json");
}return false;
};
JASK.connections.validateMultiInviteFields=function validateMultiInviteFields(){var B=true;
var D=$j("#invite_emails").val();
var A=$j("#inviter_note").val();
var C=$j("#inviter_name").val();
if(!D||D==null||D==""||$j.trim(D).length==0){B=false;
}else{if(!A||A==null||A==""||$j.trim(A).length==0||$j.hasHTML(A)){B=false;
}else{if(!C||C==null||C==""||$j.trim(C).length==0||C=="Enter First Name, Last Name"){B=false;
}}}if(!B){JASK.showValidateMsg("error_message","#invtemails_error","Please complete all the fields");
$j("#invtemails_error").show();
}return B;
};
JASK.connections.validateInviteEmails=function validateInviteEmails(){var C=true;
var D="Please enter a valid email address";
var E=$j("#invite_emails").val().split(",");
for(var B=0;
B<E.length;
B++){var A=E[B];
C=$j.isValidEmail($j.trim(A));
if(!C){break;
}}if(C&&E.length>75){C=false;
D="You can send a maximum of 75 connection requests per day";
}if(!C){JASK.showValidateMsg("error_message","#invtemails_error",D);
$j("#invtemails_error").show();
}return C;
};

JASK.namespace("question");
JASK.question.editTimer=function countDownTimer(C){var B=new Date(C.data("expires"));
var A=C.data("post-id");
C.countdown({until:B,onTick:function(D){$j(C).text(JASK.question.getCountdownMessage(D));
},tickInterval:1,onExpiry:function(){JASK.question.editTimedOut();
}});
};
JASK.question.getCountdownMessage=function getCountDownMessage(C){var B=0;
var A;
if(C[5]>0){B=C[5];
if(C[5]>1){A=" minutes ";
}else{A=" minute ";
}}else{B=C[6];
if(C[6]>1){A=" seconds ";
}else{if(C[6]==1){A=" second ";
}else{$j("#editQ").hide();
}}}if(B&&A){return"("+B+A+"left)";
}else{return"";
}};
JASK.question.editTimedOut=function editTimedOut(){$j("#saveQuestion, #saveAnswer").unbind();
$j(".jaq_edit, .jaqa_edit").unbind().hide();
$j(".editTimer").html("<span class='error b'>Sorry, you ran out of time</span>");
};
JASK.question.editQuestion=function editQuestion(B){var A="";
B.preventDefault();
if($j("#ques-edit-txt").is("div")){A=$j("#ques-edit-txt").text();
}else{A=$j("#ques-edit-txt").val();
}$j.jStorage.set("orginalQTitle",A);
$j.jStorage.set("orginalQDesc",$j("#ques-detail-txt").val());
$j("#ques-edit-txt").live("keyup",function(H){var I=H.target;
var G=$j(H.target).parents("form");
var C=G.find(".cdisplay");
var F=JASK.question.qBoxLength;
var E=I.value.length;
var D=F-E;
if(D<=0){$j(".charlimit").css("color","#B10000");
}else{$j(".charlimit").css("color","#666666");
}C.text((D<0)?0:D);
});
$j("#ques-edit-txt").keyup();
$j("#ques-edit-txt").live("focus",function(){$j(".charlimit").fadeIn();
});
$j("#ques-edit-txt").live("blur",function(){$j(".charlimit").fadeOut();
});
$j(".question .hideOnEdit").hide();
$j("#editQStatus").html("");
$j("#quesMod").show();
};
JASK.question.cancelEditQuestion=function cancelEditQuestion(A){if(A){A.preventDefault();
}$j("#ques-edit-txt").val($j.jStorage.get("orginalQTitle"));
$j("#ques-detail-txt").val($j.jStorage.get("orginalQDesc"));
JASK.question.hideEditQuestion();
};
JASK.question.hideEditQuestion=function hideEditQuestion(){$j("#quesMod").hide();
$j(".qimg-l").show();
$j(".question .hideOnEdit").show();
$j("#question_ok").html("");
$j("#detail_ok").html("");
$j(".uiblock_medcontent").css("margin-left","63px");
};
JASK.question.saveQuestionEdit=function saveQuestionEdit(F){F.preventDefault();
var D=$j(this);
var C=JASK.cfg.ldomain+"/ja-edit-question";
var B=$j.serializeObject(D.parents("#edit_ques_form"));
var E=$j("#question_ok");
var A=JASK.question.validateQuestion($j("#ques-edit-txt").val());
if(!A.valid){E.html(A.error);
return false;
}A=JASK.question.validateDetail($j("#ques-detail-txt").val());
if(!A.valid){E.html(A.error);
return false;
}E.html("");
$j.post((C+"?tfid=JAAskQForm"),B,function(L){question_updated=false;
sct(53701);
var G=L.status["@code"];
if(G==100||G==158){$j("#quesMod").hide();
var I=D.parents(".question");
var K=$j.trim($j("#ques-edit-txt").val());
var H=K.charAt(0).toUpperCase()+K.slice(1);
$j("#questionText").html(H);
$j("#questionDetail").html($j("#ques-detail-txt").val());
$j(".question .hideOnEdit").show();
$j("#editQStatus").show();
$j("#editQStatus").html("<span class='succmsg b'>Your question has been updated!</span>");
}else{var J="Sorry, there was an error saving your question. Please try again!";
E.html("<span class='error b'>"+J+"</span>");
return false;
}$j("#question_ajx_err").unbind();
},"json");
question_updated=true;
return false;
};

JASK.namespace("question");
(function(A){A.fn.ja_report=function(){return this.each(function(){A(this).click(function(){if(!JASK.isAuthenticated()){JASK.ask_dialog.initSignin(JASK.question.getFlagLinkQsrc(this));
return false;
}else{var D=JASK.cfg.ldomain+"/ja-report";
var C=this.id.split("-");
var F=C[1];
var E=C[2];
var B=this;
A.post(D,{"id":F,"userId":JASK.cfg.uid,"type":E,"engine_id":"add_vote"},function(J){if(J.status["@code"]==100){if(JASK.ja.question.flagpks&&JASK.ja.question.flagpks[F]){spk(B,JASK.ja.question.flagpks[F]);
}var G="#flag-"+F+"-"+E;
var I=A(G).closest(".c-linkmenu");
var H=I.siblings("div");
I.toggle();
H.children(".collapsibleLink").remove();
H.children(".post-report-template").show();
I.remove();
}},"json");
return false;
}});
});
};
})(jQuery);
JASK.question.getFlagLinkQsrc=function getFlagLinkQsrc(B){var A="";
var E=($j(B).parents()[2]).id;
var C=E.split("-");
var D=C[1];
if(D.indexOf("cmt")!=-1){A=3153;
}else{if(D.indexOf("q")!=-1){A=3157;
}else{A=3156;
}}return A;
};

JASK.namespace("question");
JASK.question.qBoxLength=140;
JASK.question.INVALID_SHORTHAND_WORDS=JASK.question.INVALID_SHORTHAND_WORDS||"";
JASK.question.bindQuestionBehaviors=function bindQuestionBehaviors(){$j(".ratelink").ja_vote();
$j(".flaglink").ja_report();
$j(".commentSlideLink").ja_slidableLink({speed:15});
$j(".slidableLink").ja_slidableLink();
$j(".commentbutton").ja_comment();
$j(".answerfrmbtn").ja_submitanswer();
$j(".editanswerfrmbtn").ja_submitanswer();
$j("#saveAnswer").ja_submitanswer(true);
$j("#saveAnswer").ja_addClickId(54486);
$j("#saveQuestion").click(JASK.question.saveQuestionEdit);
$j("#saveQuestion").keyup(function(B){var A=(B.keyCode?B.keyCode:B.which);
if(A==13){$j(this).trigger("click");
return false;
}});
$j("#saveQuestion").focusin(function(){$j(this).css("outline","#000 dotted thin");
});
$j("#saveQuestion").focusout(function(){$j(this).css("outline","none");
});
$j("#saveQuestion").ja_addClickId(54483);
$j(".tglform").ja_openform();
$j(".cmtform").ja_closeform();
$j(".cmtform").val("");
$j(".cmtform").ja_textarealimit({limit:2048});
$j("#answer-form-txt").val("");
$j("#answer-form-txt").ja_expandanswerarea();
$j("#ques-detail-txt").ja_expandanswerarea();
$j("#ans-edit-txt").ja_expandanswerarea();
$j(".jaq_edit").ja_addClickId(54482);
$j(".jaqa_edit").ja_addClickId(54485);
$j("#jaq_editCancel").ja_addClickId(54484);
$j("#jaqa_editCancel").ja_addClickId(54487);
$j("#leftnav li a.lnv_qna").ja_addClickId(53324);
$j("#leftnav li a.lnv_prof").ja_addClickId(53323);
$j("#leftnav li a.lnv_browse").ja_addClickId(53322);
$j("a.nb_user_link:eq(0)").ja_addClickId(54183);
$j("a.pImgLink").not(".noTrack").ja_addClickId(53320);
$j("a.pUsernameLink").ja_addClickId(53320);
$j("#profileProgress #progressInterest").ja_addClickId(53321);
$j("#profileProgress #progressAvatar").ja_addClickId(53750);
$j("#jaques_anch").ja_addClickId(53319);
$j(".commentSlideLink").click(JASK.question.hideToolTip);
$j(".slidableAnswer").ja_slidablePost("Answer");
$j(".slidableComment").ja_slidablePost("Comment");
$j(".slidableQuestion").ja_slidablePost("Question");
$j("#jaques_anch").click(function(){setTimeout(function(){$j("#answer-form-txt").focus();
},10);
});
$j("#jaques_anch").click(function(){setTimeout(function(){$j("#answer-form-txt").focus();
},10);
});
$j(".editTimer").each(function(){JASK.question.editTimer($j(this));
});
};
JASK.question.bindAnswerSpellCheck=function bindAnswerSpellCheck(){$j("#answer-form-txt,#ans-edit-txt").ja_spellcheck({events:{shouldSpellCheck:function(){var C=$j("#answer-form-txt");
if($j("#ans-edit-txt").is(":visible")){C=$j("#ans-edit-txt");
}var A=(C.data("spellErrors")>0);
if(!A){var B=$j("#ans-sc-wrp");
B.addClass("hide");
B.find(".sc-desc").html("");
}return A;
}},url:JASK.cfg.scDomain+"/ja-spellcheck",renderError:function(E,C){var F=$j("#answer-form-txt");
if($j("#ans-edit-txt").is(":visible")){F=$j("#ans-edit-txt");
}var B=F.data("spellErrors");
var A=$j("#ans-sc-wrp");
if(B<=0){$j(".sc-answer-err").slideUp();
A.hide();
}else{if(B){$j(".sc-answer-err").slideDown();
$j("#answer_error").html("");
var D=B+" misspelling"+((B>1)?"s":"")+" found";
$j(".sc-count").html(D);
A.find(".sc-desc").html(C);
}}},hideSuggestion:function(){JASK.question.hideToolTip();
}});
};
$j(document).ready(function(){JASK.question.bindQuestionBehaviors();
JASK.question.scrollToComment();
});
$j(document).ready(function(){$j(".jaq_edit").click(JASK.question.editQuestion);
$j("#jaq_editCancel").click(JASK.question.cancelEditQuestion);
$j(".jaqa_edit").ja_editAnswer();
$j("#jaqa_editCancel").ja_cancelEditAnswer();
});
$j(document).ready(function(){if($j("#answer-form-txt").length&&$j.jStorage.get("answer")){var A=$j.jStorage.get("answer").length;
var C=Math.floor(A/180);
if(C>0&&A>0){var B=6+(C*3);
$j("#answer-form-txt").attr("rows",B);
}$j("#answer-form-txt").val($j.jStorage.get("answer"));
$j.jStorage.deleteKey("answer");
}});
$j(document).ready(function(){var B=$j.jStorage.get("comment");
if(B&&B.id&&B.value){var A="#"+B.id;
$j(A).val(B.value);
$j(".commentSlideLink",$j(A).parents(".filled-box")).click();
$j(".tglform",$j(A).parents(".filled-box")).focusin();
$j.jStorage.deleteKey("comment");
}});
$j(document).ready(function(){function A(){var B=$j("#answer-form-txt");
if($j("#ans-edit-txt").is(":visible")){B=$j("#ans-edit-txt");
}B.tooltip({events:{input:"focus, click dummyevent",tooltip:""},tip:"#ans-sc-wrp",position:"center right",offset:[0,20],onShow:function(){if(this.getTrigger().data("spellErrors")<=0){JASK.question.hideToolTip();
}else{B.ui_position({target:"#ans-sc-wrp",offset:[0,-10],at:"top"});
var C=$j("#ans-sc-wrp");
if(C.data("animateMode")!="1"){C.animate({left:"-=15"});
C.data("animateMode","1");
}else{C.css("left",(C.position().left-15)+"px");
}}}});
JASK.spellcheck.showSuggestions(B.attr("id"));
$j("#ans-sc-wrp").css("border-left","none");
}$j(".sc-toggle > .show-ss").live("click",function(){$j(this).removeClass("show-ss").addClass("hide-ss");
$j(this).text("Close");
A();
});
$j(".sc-toggle > .hide-ss").live("click",JASK.question.hideToolTip);
JASK.question.bindAnswerSpellCheck();
});
$j(document).ready(function(){$j("#answer-form-txt").bind("paste",function(B){var A=$j(this);
setTimeout(function(){var F=$j(A).val();
var C=F.length;
var E=Math.floor(C/180);
if(E>0&&C>0){var D=6+(E*3);
A.attr("rows",D);
}},100);
});
});
$j(document).ready(function(){JASK.question.embedYouTube();
$j(".viewComments").click(function(){$j(".filled-box",$j(this).parents(".comments")).show();
$j(this).parents(".filled-box").hide();
});
var C=window.location.hash;
if(C){var A=C.substring(0,6);
if(A==="#edit/"){var B="#eid_"+C.substring(6);
$j(B).trigger("click");
}}});

$j(document).ready(function(){$j("#cnbWebText").click(function(A){if($j("#qtxt").val()){A.preventDefault();
window.location.href=$j.param.querystring(JASK.cfg.ldomain+"/web",$j.param.querystring(window.location.href,{"q":$j.trim($j("#qtxt").val())}));
}});
$j("#browseVideoDlg").dialog({width:720,height:580,autoOpen:false,modal:true,draggable:false,resizable:false,show:{effect:"fade",duration:400},hide:{effect:"fade",duration:400}});
$j(".vid-preview").click(function(A){$j("#browseVideoDlg").dialog("open");
});
$j(".browse_video_close").click(function(A){$j(".browse_video_video").html("");
$j("#browseVideoDlg").dialog("close");
$j(".browse_video_video").hide();
$j(".browse_video_cta").show();
});
$j("#browse_video_next").click(function(A){window.location=$j("#browse_video_next").attr("data-url");
});
$j(".browse_video_cta").click(function(){$j(".browse_video_video").css("display","block");
if(!$j("#browseVideoVideo").length){$j("<iframe id='browseVideoVideo' width='660' height='371' frameborder='0' src='http://player.vimeo.com/video/17800937?byline=0&portrait=0&color=55bbdd&autoplay=1'>").appendTo($j(".browse_video_video"));
}$j(this).css("display","none");
});
$j("#bqnv_all").ja_addClickId(546326);
$j("#bqnv_co").ja_addClickId(546327);
$j("#bqnv_intr").ja_addClickId(546328);
$j("#bqnv_ro").ja_addClickId(546329);
$j("#bunaimp").ja_impression($j("#bunaimp").val());
$j("#sunaimp").ja_impression($j("#sunaimp").val());
if($j("#sunaimp").length){$j("#bqnv_una_a").ja_addClickId(546456);
$j("#bqnv_una_b").ja_addClickId(546457);
}$j(".editCntDwn").each(function(){JASK.question.countDownTimer($j(this));
});
$j("#recentQuestion,#rightRailZoom").slideDown();
$j("#ans-sc-wrp .tt-close").click(function(){JASK.question.hideToolTip();
});
});
$j(document).ready(function(){$j(".quickanswerbox").live("keypress",function(A){if($j(this).data("events")==undefined||$j(this).data("events").keypress==undefined){$j(this).autoResize();
}if($j(this).data("unmodified")==true){$j(this).data("unmodified",false);
}});
$j(".quickanswerbox").live("focus",function(){var A=$j(this);
if(A.data("unmodified")==true){JASK.answer.resetAnswerBox(A);
}$j(".quickanswerfrm").each(function(){var B=$j(this).find(".quickanswerbox");
if(!B.is(A)&&(B.val()==""||B.data("unmodified")==true)){$j(this).find(".quickansweraction").hide();
}else{$j(this).find(".quickansweraction").show();
}});
});
$j(".quickanswerbtn").quickSubmitAnswer();
$j(".quickanswerclear").live("click",function(B){B.preventDefault();
$j(this).closest("form").find(".sc-answer-err").slideUp();
var C=$j(this).attr("id").split("-")[1];
var A=$j("#quickanswertxt-"+C);
$j("#quickanswererr-"+C).html("");
A.trigger("keyup");
JASK.question.hideToolTip();
JASK.answer.resetAnswerBox(A);
});
JASK.question.bindLoadMore("#getMoreLink");
});
JASK.question.countDownTimer=function countDownTimer(C){var B=new Date(C.data("expires"));
var A=C.data("post-id");
C.countdown({until:B,onTick:function(D){$j(C).text(JASK.question.getCountdownMessage(D));
},tickInterval:1,onExpiry:function(){$j(C).hide();
$j("#eid_"+A).hide();
$j("#editPost"+A).hide();
}});
};
JASK.question.bindQuickAnswerSpellCheck=function bindQuickAnswerSpellCheck(B){var A=$j("#"+B).closest("form");
$j("#"+B).ja_spellcheck({events:{shouldSpellCheck:function(){var E=this._element;
var F=$j("#"+E);
var C=(F.data("spellErrors")>0);
if(!C){var D=$j("#ans-sc-wrp");
D.addClass("hide");
D.find(".sc-desc").html("");
}return C;
}},url:JASK.cfg.scDomain+"/ja-spellcheck",renderError:function(H,F){var I=$j("#"+B);
var C=B.split("-")[1];
var E=I.data("spellErrors");
var D=$j("#ans-sc-wrp");
if(E<=0){$j(".sc-answer-err",A).slideUp();
D.hide();
}else{if(E){$j(".sc-answer-err",A).slideDown();
$j("#answer_error").html("");
var G=E+" misspelling"+((E>1)?"s":"")+" found";
$j(".sc-count",A).html(G);
D.find(".sc-desc").html(F);
}}},hideSuggestion:function(){JASK.question.hideToolTip();
}});
};
JASK.question.bindLoadMore=function bindLoadMore(A){$j(A).ja_loadMoreButton();
var B=true;
$j(".quickanswerbox").live("keypress",function(C){if($j(this).data("events")==undefined||$j(this).data("events").keypress==undefined){JASK.question.bindQuickAnswerSpellCheck(this.id);
}});
};
function jaDisplaySpellcheckDetails(B,A){B.tooltip({events:{input:"focus, click dummyevent",tooltip:""},tip:"#ans-sc-wrp",position:"center right",offset:[0,20],onShow:function(){if(this.getTrigger().data("spellErrors")<=0){JASK.question.hideToolTip();
}else{var C=$j("#ans-sc-wrp");
if(C.data("animateMode")!="1"){C.animate({left:"-=15"});
C.data("animateMode","1");
}else{C.css("left",(C.position().left-15)+"px");
}}}});
JASK.spellcheck.showSuggestions(B.attr("id"));
}$j(".sc-toggle > .show-ss").live("click",function(){$j(this).removeClass("show-ss").addClass("hide-ss");
var A=$j(this).attr("id").split("-")[1];
$j(this).text("Close");
jaDisplaySpellcheckDetails($j("#quickanswertxt-"+A),A);
});
$j(".sc-toggle > .hide-ss").live("click",JASK.question.hideToolTip);

(function(A){A.fn.ja_loadMoreButton=function(){var D,E,G,C,F,B;
if(A(".pageSegment").length&&A(".pageSegment:last").attr("data-last-question")!="disabled"){if(this.length){D=($j.bbq.getState("pg"))?$j.bbq.getState("pg").split(","):[];
E=(D.length+1);
G=$j(this);
C=G.attr("data-url");
(function(){function H(J){var K=C.replace(/(page\=)(\d*)/,"$1"+(J));
$j.get($j.param.querystring(K,{"ajax":"true","lqid":D[J]}),{},function(L){$j(("#qBlock-"+J)).replaceWith(L);
var M=$j(L).filter(".pageSegment:last").attr("data-last-question");
if(M=="true"){G.hide();
}});
}function I(){if(D.length){if(A(".pageSegment:first").attr("data-qid")===D[0]){var K=[];
for(var J=0;
J<D.length;
J++){K.push('<div id="qBlock-'+J+'"></div>');
H(J);
}$j("#questionBlock .pageSegment:last").after(K.join(" "));
}else{$j.bbq.removeState("pg");
E=1;
}}}$j(window).bind("hashchange",function(J){var K=(J&&J.fragment)?J.fragment:"";
if(!K||K.split(",").length!==D.length){D=($j.bbq.getState("pg"))?$j.bbq.getState("pg").split(","):[];
$j(".pageSegment").not(":first").remove();
I();
}});
I();
})();
return this.each(function(){if(E>=F){G.hide();
}$j(this).click(function(I){if(!$j(this).data("isBusy")){var H=A(".pageSegment:last").attr("data-qid");
var J=C.replace(/(page\=)(\d*)/,"$1"+(++E));
I.preventDefault();
G.showBusy();
$j.get($j.param.querystring(J,{"ajax":"true","lqid":H}),{},function(L){$j(L).insertAfter("#questionBlock .pageSegment:last");
D.push(H);
G.showDone(true);
var K=($j.bbq.getState("pg"))?$j.bbq.getState("pg").split(","):[];
K.push(H);
$j.bbq.pushState({"pg":K.join()},0);
var M=$j(L).filter(".pageSegment:last").attr("data-last-question");
if(M=="true"){G.hide();
}});
}});
});
}}else{if(A(".q:last").attr("data-qid")){if(this.length){D=($j.bbq.getState("pg"))?$j.bbq.getState("pg").split(","):[];
E=(D.length+1);
G=$j(this);
C=G.attr("data-url");
F=G.attr("data-total");
(function(){function H(J){var K=C.replace(/(page\=)(\d*)/,"$1"+(J));
$j.get($j.param.querystring(K,{"ajax":"true","lqid":D[J]}),{},function(L){$j(("#qBlock-"+J)).replaceWith(L);
});
}function I(){if(D.length){if(A(".q:last").attr("data-qid")===D[0]){var K=[];
for(var J=0;
J<D.length;
J++){K.push('<div id="qBlock-'+J+'"></div>');
H(J);
}$j("#questionBlock .q:last").after(K.join(" "));
}else{$j.bbq.removeState("pg");
E=1;
}}}$j(window).bind("hashchange",function(J){var K=(J&&J.fragment)?J.fragment:"";
if(!K||K.split(",").length!==D.length){if(D[0]){$j("#questionBlock .q[data-qid="+D[0]+"]").nextAll().remove();
}D=($j.bbq.getState("pg"))?$j.bbq.getState("pg").split(","):[];
I();
}});
I();
})();
return this.each(function(){if(E>=F){G.hide();
}$j(this).click(function(I){if(!$j(this).data("isBusy")){var H=A(".q:last").attr("data-qid");
var J=C.replace(/(page\=)(\d*)/,"$1"+(++E));
I.preventDefault();
G.showBusy();
$j.get($j.param.querystring(J,{"ajax":"true","lqid":H}),{},function(L){var M=$j(L).insertAfter("#questionBlock .q:last");
D.push(H);
G.showDone(true);
var K=($j.bbq.getState("pg"))?$j.bbq.getState("pg").split(","):[];
K.push(H);
$j.bbq.pushState({"pg":K.join()},0);
if(E>=F){G.hide();
}});
}});
});
}}else{if(this.length){E=($j.bbq.getState("pg",true)>1)?$j.bbq.getState("pg",true):1;
G=$j(this);
C=G.attr("data-url");
F=G.attr("data-total");
(function(){function I(K){var L=C.replace(/(page\=)(\d*)/,"$1"+(K));
$j.get($j.param.querystring(L,{"ajax":"true"}),{},function(M){$j(("#qBlock-"+K)).html(M);
});
}if(E>1){var J=[];
for(var H=2;
H<=E;
H++){J.push('<div id="qBlock-'+H+'"></div>');
I(H);
}$j("#questionBlock .q:last").after(J.join(" "));
}})();
return this.each(function(){if(E>=F){G.hide();
}var H=0;
$j(this).click(function(I){if(!$j(this).data("isBusy")){var J=C.replace(/(page\=)(\d*)/,"$1"+(++E));
I.preventDefault();
G.showBusy();
A(".unanswered").removeClass("unanswered");
$j.get($j.param.querystring(J,{"ajax":"true"}),{},function(K){var L=$j(K).insertAfter("#questionBlock .q:last");
G.showDone(true);
$j.bbq.pushState({"pg":E},0);
if(E>=F){G.hide();
}if(A("#browseUnanswered").length>0){H++;
if(A(".unanswered").length===0&&H>=2){G.hide();
}else{if(A(".unanswered").length===0){G.click();
}else{H=0;
}}}});
}});
});
}}}};
})(jQuery);

$j(document).ready(function(){$j("#emailAddressTextResend").focus();
$j(".resetPwdBtn").click(function(){var C=JASK.cfg.protocol+"://"+JASK.cfg.secureDomain+"/ja-change-password?callback=?";
var B=$j.serializeObject($j("#confirmPassword"));
B["engine_id"]="confirmPassword";
var D=B["newPwd"];
var A=B["confirmPwd"];
$j("#errorBlock").css("display","none");
if(($j.trim(D).length==0)||(D==null)||(D=="")||(A==null)||(A=="")||($j.trim(A).length==0)||($j.trim(A).length==0)){JASK.showValidateMsg("error","#errorBlock","Passwords cannot be null");
return false;
}if(D.match(/[ ]/)||D.match(/[ ]/)){JASK.showValidateMsg("error","#errorBlock","Passwords cannot have spaces");
return false;
}if(D!=A){JASK.showValidateMsg("error","#errorBlock","Passwords do not match");
return false;
}if(D.length<6){JASK.showValidateMsg("error","#errorBlock","Password should have a minimum of 6 characters");
return false;
}$j.getJSON(C,B,function(E){if(E&&E.status["@code"]==100){$j("#changePwdForm").hide();
$j("#resetConfirmationForm").show();
}else{JASK.showValidateMsg("error","#errorBlock","Password has not been reset");
return false;
}});
});
$j(".continueBtn").click(function(){var A="http://"+JASK.cfg._ldomain+"/answers";
window.location=A;
});
$j("#failureConfirmation").submit(function(A){A.preventDefault();
});
$j(".resendBtn").click(function(){if($j("#emailAddressTextResend").val().match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)){$j.post($j("#failureConfirmation").attr("action"),{"email":$j("#emailAddressTextResend").val(),"engine_id":"reset"},function(A){if(A&&A.status["@code"]==100){window.location="http://"+JASK.cfg._ldomain;
}},"json");
}else{JASK.showValidateMsg("error","#errorText","Invalid email format");
return false;
}return true;
});
$j("#failureConfirmation").keyup(function(B){var A=(B.keyCode?B.keyCode:B.which);
if(A==13){B.preventDefault();
$j(".resendBtn").click();
}});
});

$j(document).bind("login",function(){window.location.reload();
});
$j(document).bind("logout",function(){$j("body").append("<img src="+JASK.cfg.feedbackUrl+"/logout.json width=1 height=1>");
window.location.reload();
});
$j(function(){var C=$j("#qtxt");
C.bind("updateCharCount",JASK.question.charLimit);
C.focus(function(){C.trigger("updateCharCount");
C.keyup(JASK.question.charLimit);
});
C.autoResize({extraSpace:0}).keyup();
var A=$j("#serp_ftr a:contains('Help')");
if(A.length){var B=JASK.cfg.ldomain+"/answers/help";
if(A.attr("href").match("wzus")){A.attr("href",A.attr("href").replace(/\&u=http.*/,"&u="+encodeURIComponent(B)));
}else{A.attr("href",B);
}}});

JASK.namespace("signin");
JASK.signin.changeState=(function(){function A(){$j("#lnvConnMod").load(JASK.cfg.ldomain+"/ja-following-update?rnd="+new Date().getTime()+"&lnvConnMod=1&maxconn=24").show();
}return{signedIn:function(){JASK.nanoMe.signedIn();
A();
},signedOut:function(){JASK.nanoMe.signedOut();
},getConnections:function(){A();
}};
})();


