function seeMoreOnComment(el){var $el=$(el).parent("span");$el.hide();$el.next("span").css("display","inline")}function seeLessOnComment(el){var $el=$(el).parent("span").parent("span");$el.prev().css("display","inline");$el.hide()}(function($){$.fn.focusNextField=function(){return this.each(function(){var fields=$(this).parents("form:eq(0),body").find("a,button,input,textarea,select");var index=fields.index(this);if(index>-1&&(index+1)<fields.length){fields.eq(index+1).focus()}return false})}})(jQuery);(function($){$.fn.extend({TextTip:function(options){var defaults={idle_class:"formfield-quiet",focus_class:"formfield-current",data_class:"formfield-filled",cleanEvents:false};var options=$.extend(defaults,options);return this.each(function(){var o=options;var $el=$(this);var text_tip=$el.attr("title")?$el.attr("title"):"";if(o.cleanEvents){$el.unbind()}function out(){var new_class="";if($.trim($el.val())==""||($el.val()==text_tip)){$el.val(text_tip);new_class=o.idle_class}else{new_class=o.data_class!=""?o.data_class:o.idle_class}$el.removeClass(o.focus_class).addClass(new_class)}$el.focus(function(){$el.removeClass(o.idle_class).removeClass(o.data_class).addClass(o.focus_class);if(this.value==text_tip){$el.val("")}else{this.select()}});$el.blur(function(){out()});$el.keyup(function(event){if(event.keyCode==27){$el.focus()}});if(($el.val()=="")||($el.val()==text_tip)){$el.blur()}})},cleanTextTip:function(options){return this.each(function(){$(this).submit(function(event){$("input:text, textarea",this).each(function(){if($(this).val()==$(this).attr("title")){$(this).val("")}});return true})})},TextTipForm:function(options){return this.each(function(){$("input:text, textarea",this).each(function(){$(this).TextTip()});$(this).submit(function(event){$("input:text, textarea",this).each(function(){var $el=$(this);if($el.val()==$el.attr("title")){$el.val("")}});return true})})}})})(jQuery);(function($){$.fn.extend({cleanTxt:function(){return this.each(function(){if(this.type!="textarea"){return false}var $textarea=$(this),$twin=$("#elastic_"+$textarea.attr("id"));$twin.html("");$textarea.val("");$textarea.css({height:"",overflow:"hidden"}).blur()})},elastic:function(options){var defaults={updateOnFocus:false};var options=$.extend(defaults,options);var mimics=["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"];return this.each(function(){if(this.type!="textarea"){return false}var $textarea=$(this);if(!$textarea.attr("id")){$textarea.attr("id","elastic_"+Math.floor(Math.random()*9999+1))}var $twin=$('<div id="elastic_'+$textarea.attr("id")+'" />').css({position:"absolute",display:"none"}),lineHeight=parseInt($textarea.css("lineHeight"),10)||parseInt($textarea.css("fontSize"),"10"),minheight=parseInt($textarea.css("height"),10)||lineHeight*3,maxheight=parseInt($textarea.css("max-height"),10)||lineHeight*25,goalheight=0,i=0;$twin.appendTo($textarea.parent());var i=mimics.length;while(i--){$twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString()))}function setHeightAndOverflow(height,overflow){curratedHeight=Math.floor(parseInt(height,10));if($textarea.height()!=curratedHeight){$textarea.css({height:curratedHeight+"px",overflow:overflow})}}function update(){var textareaContent=$textarea.val().replace(/<|>/g," ").replace(/\n/g,"<br />").replace(/&/g,"&amp;");var twinContent=$twin.html();if(textareaContent+"&nbsp;"!=twinContent){$twin.html(textareaContent+"&nbsp;");if(Math.abs($twin.height()+lineHeight-$textarea.height())>3){var goalheight=$twin.height()+lineHeight;if(goalheight>=maxheight){setHeightAndOverflow(maxheight,"auto")}else{if(goalheight<=minheight){setHeightAndOverflow(minheight,"hidden")}else{setHeightAndOverflow(goalheight,"hidden")}}}}}var has_focuse=false;var last_call=0;$textarea.bind("blur",function(){has_focuse=false;clearTimeout($textarea.timer);if(!$textarea.val().length){$twin.html("");$textarea.val("")}if(!$textarea.val().length||$textarea.val()===$textarea.attr("title")){$textarea.css({height:"",overflow:"hidden"});return false}else{update()}});$textarea.bind("change",function(){if(!has_focuse){update()}});$textarea.bind("focus",function(){has_focuse=true;last_call=(new Date).getTime();if(options.updateOnFocus){update()}});$textarea.css({overflow:"hidden"});$textarea.keyup(function(e){$textarea.e=e.keyCode;if(e.keyCode!=13){var now=(new Date).getTime();if((now-last_call)>200){last_call=now;update()}}else{update()}});$textarea.scroll(function(){$textarea.timer=setTimeout(update,250)})})}})})(jQuery);function analyticsTrackEvent(category,action,label,value){var intValue;try{if(isNaN(intValue=parseInt(value,10))){return pageTracker._trackEvent(category,action,label)}else{return pageTracker._trackEvent(category,action,label,intValue)}}catch(err){}return false}function relocateAds(tgt){try{var $s=$("#"+tgt+"_src");var $t=$("#"+tgt);var last_pos=0;var last_height=0;$s.css({position:"absolute",width:$t.width()}).show();setInterval(function(){var pos=$t.offset();if(pos!==last_pos){last_pos=pos;$s.css(pos)}var height=$s.height();if(height!==last_height){last_height=height;$t.css({height:last_height})}},1000)}catch(e){}};