
/* start ~/Content/scripts/article.js*/
WL.registerOnloadEvent(function(){resizeTables();resizeImages();styleTables();alignImages();removeOtherTags()});var removeOtherTags=function(){$(".articleBody div:contains(Technorati Tags:)").remove()};var resizeImages=function(){var a=$("#postDetail .main .inner").innerWidth()-40;$("#postDetail img").each(function(){var d=$(this);var g=d.outerWidth();if(g>a){var b=d.outerHeight();var e=a/g;var f=g*e;var c=b*e;d.attr("width",f).attr("height",c).css({width:f,height:c}).wrap('<span class="wlOversizedImage"></span>').after($('<a href="'+d.attr("src")+'">(View full-size image)</a>').click(function(h){h.preventDefault();window.open(d.attr("src"),"largeImage","width="+(g+50)+",height="+(b+50))}))}})};var resizeTables=function(){var a=$("#postDetail .main .inner").innerWidth()-40;$("#postDetail table[width]").each(function(){var e=$(this);var d=e.outerWidth();if(d>a){var b=e.find("tr:first td");var f=[];b.each(function(){f.push($(this).outerWidth())});for(var c=f.length-1;c>=0;c--){f[c]=(f[c]/d)*a}e.attr("width",a).css({width:a});e.find("tr").each(function(){$(this).find("td").each(function(g){$(this).attr("width",f[g]).css({width:f[g]})})})}})};var styleTables=function(){$("#postDetail .articleBody table").each(function(){var c=$(this);var b=c.attr("cellpadding");if(!b){b=1}var a=c.attr("cellspacing");if(!a){a=1}var d=c.attr("border");if(!d){d=1}c.attr("border",$.browser.msie?null:0).attr("cellpadding",null).attr("cellspacing",null).find("th, td").each(function(){var f=$(this);var h={verticalAlign:e,margin:a+"px",padding:b+"px",borderWidth:d+"px"};var e=f.attr("valign");h.verticalAlign=e?e:"middle";var g=f.attr("align");if(g=="middle"){g="center"}h.textAlign=g?g:null;f.css(h)})})};var alignImages=function(){$("#postDetail .articleBody img[align]").each(function(){var a=$(this);var b=a.attr("align").toLowerCase();var c={};switch(b){case"left":case"right":c["float"]=b;break;case"top":case"texttop":c.verticalAlign="top";break;case"default":case"bottom":case"absbottom":case"baseline":c.verticalAlign="bottom";break;case"middle":case"absmiddle":default:c.verticalAlign="middle";break}a.css(c)})};
/* end ~/Content/scripts/article.js */
/* start ~/Content/scripts/ratings.js*/
WL.registerOnloadEvent(function(){initPERating();initAttributeRatings();WL.eventHandler.events.peRate=function(b){var a=b.parents(".origRating");b.parent().addClass("rated");$(".peRating span").unbind();a.find("select option[value="+b.attr("title")+"]")[0].selected=true;a.find("input.origSubmit").val(b.attr("title"));sendRating(b);$(".peRate").removeClass("peRate")}});var initAttributeRatings=function(){$(".attributeRating").bind("click",function(a){var b=$(a.target);sendRating(b);b.siblings("input").andSelf().attr("disabled","disabled")})};var sendRating=function(e){var c="/Service/rating.svc/rate",b=$("#articleId").val(),a=e.attr("rel"),d=e.attr("title");$.ajax({beforeSend:function(){},url:c+"?contentId="+b+"&ratingQualityId="+a+"&ratingValue="+d,data:"",dataType:"html",type:"post",success:function(h){var g=$(".ratingTotal");var f=parseInt(g.text().match(/\d+/))+1;g.text("("+f+" ratings)")},error:function(g,f,h){},cache:false})};var initPERating=function(){$(".origRating").each(function(){var b=$(this).find("select"),c=($(this).find("form").attr("rel")*100),a=['<div class="peRating star'+c+'">'];b.siblings("input.origSubmit").andSelf().addClass("hidden");var d=b.find("option").not(".choose").each(function(){a.push('<span title="'+$(this).attr("value")+'" class="peRate scStarRating" rel="'+$("#ratingQualityId").val()+'">'+$(this).html()+"</span>")});a.push("</div>");b.after(a.join(""));$(".peRating span").hover(function(){$(this).parent().addClass("userstar"+($(this).attr("title")*100))},function(){$(this).parent().removeClass("userstar"+($(this).attr("title")*100))})})};
/* end ~/Content/scripts/ratings.js */