function HomepageFeatured(){var f=0;var b=0;var d=140;var a=10;var c=4;var e;$(document).ready(function(){var g=FeaturedScroller({itemWidth:140,itemGap:10,visibleItems:c,$itemContainer:$("#homepageFeatured"),itemIndexChangedCallback:j,itemClickCallback:k});e=DottedSelector({$container:$("#homepageFeatured .selector"),itemCount:g.getItemCount(),windowSize:c,itemIndexChangedCallback:i,itemClickCallback:k,autoChangeIntervalMs:10000,$autoChangeFriendContainer:$("#homepageFeatured").find(".items"),dottedSelectorName:"HomePageFeatured"});var h=5;function j(l){e.setCurrentItem(l)}function i(l,m){g.setCurrentItem(l,m)}function k(){e.stopAutoChange()}})}var SideBarFeaturedDocumentReadied=false;function SideBarFeatured(){if(SideBarFeaturedDocumentReadied){return}SideBarFeaturedDocumentReadied=true;$(document).ready(function(){$(".side-featured").each(function(e,f){var a=FeaturedScroller({itemWidth:300,itemGap:10,visibleItems:1,$itemContainer:$(f),itemIndexChangedCallback:b});var d=DottedSelector({$container:$(f).find(".selector"),itemCount:a.getItemCount(),windowSize:1,itemIndexChangedCallback:c,autoChangeIntervalMs:15000,$autoChangeFriendContainer:$(f).find(".items"),dottedSelectorName:"SideBarFeatured"});function b(g){d.setCurrentItem(g)}function c(g,h){a.setCurrentItem(g,h)}})})}$(document).ready(function(){$("#site-searchbox input[type='text']").focus(function(){$(this).siblings("span").hide()}).blur(function(){if($(this).val().length==0){$(this).siblings("span").show()}});$("#site-searchbox span.label").click(function(){$(this).siblings("input").focus()})});function NewsList(i){var m=i.allTags;var l=i.news;var I="news_tags";var j=10;var O=0;var a=false;var P;var H=false;var A=false;var n;var u;function G(){Q();E();K()}function E(){var S={};ArrayUtils.forEach(m,function(T){if(T.visible){S[T.name]=true}});ArrayUtils.forEach(l,function(T){var U=ArrayUtils.count(T.news,function(V){return(V.tag==null||S[V.tag])});if(U==0){CssUtils.addRule("#"+T.htmlElementId,"display: none;")}else{ArrayUtils.forEach(T.news,function(V){if(V.tag&&!S[V.tag]){CssUtils.addRule("#"+V.htmlElementId,"display: none;")}})}})}function R(S){S.push('<table border="0" cellspacing="0" cellpadding="0" class="darkMenu" style="left: -24px; top: 14px; display: none;" id="newsPickerDropdown">');S.push("<tr>");S.push('<td class="shadow11"><div></div></td>');S.push('<td class="shadow12" style="background-position: -480px 0px"><div></div></td>');S.push('<td class="shadow13"><div></div></td>');S.push("</tr>");S.push("<tr>");S.push('<td class="shadow21"><div></div></td>');S.push('<td class="shadow22">')}function s(S){S.push("</td>");S.push('<td class="shadow23"><div></div></td>');S.push("</tr>");S.push("<tr>");S.push('<td class="shadow31"><div></div></td>');S.push('<td class="shadow32"><div></div></td>');S.push('<td class="shadow33"><div></div></td>');S.push("</tr>");S.push("</table>")}function r(S){S.push('<div class="group first" style="padding: 4px 5px;">');ArrayUtils.forEach(m,function(T){var U=ArrayUtils.sum(l,function(V){return ArrayUtils.count(V.news,function(W){return W.tag==T.name||W.tag==null})});S.push('<div style="padding: 1px 0px 1px 0px; white-space: nowrap">');S.push('<span class="tag tag'+T.name+'" id="'+D(T)+'" style="cursor: pointer">'+StringUtils.htmlEncode(T.label.toUpperCase())+"</span>");S.push(" ");S.push('<span class="count">('+U+")</span>");S.push("</div>")});S.push("</div>");S.push('<div class="group last" style="padding: 5px 5px 3px 5px; text-align: left; cursor: pointer" id="newsPickerAdvancedModeSwitch">');S.push("Goto advanced mode &raquo;");S.push("</div>")}function f(S){S.push('<div class="group left" style="padding: 5px;">');S.push('<table boder="0" cellspacing="0" cellpadding="0">');S.push("<tr>");S.push('<td style="padding: 2px 0px 2px 0px">');S.push('<input style="margin: 0px;" type="checkbox" '+(J()?'checked="checked"':"")+' id="'+L()+'">');S.push("</td>");S.push('<td style="padding: 0px 0px 2px 5px; white-space: nowrap">');S.push('<label for="'+L()+'" id="'+e()+'"><span class="tag">All</span></label>');S.push(" ");S.push('<span class="count">('+y()+")</span>");S.push("</td>");S.push("</tr>");ArrayUtils.forEach(m,function(T){var U=ArrayUtils.sum(l,function(V){return ArrayUtils.count(V.news,function(W){return W.tag==T.name||W.tag==null})});S.push("<tr>");S.push('<td style="padding: 2px 0px 2px 0px">');S.push('<input style="margin: 0px;" type="checkbox" '+(T.visible?'checked="checked"':"")+'id="'+p(T)+'">');S.push("</td>");S.push('<td style="padding: 0px 0px 2px 5px; white-space: nowrap">');S.push('<label for="'+p(T)+'" id="'+g(T)+'"><span class="tag tag'+T.name+'">'+StringUtils.htmlEncode(T.label.toUpperCase())+"</span></label>");S.push(" ");S.push('<span class="count">('+U+")</span>");S.push("</td>");S.push("</tr>")});S.push("</table>");S.push("</div>");S.push('<div class="group last" style="padding: 5px 5px 0px 5px;">');S.push('<div style="white-space: nowrap">');S.push('<input type="button" id="newsPickerDoneButton" value="Done">');S.push(" ");S.push('<input type="button" id="newsPickerSaveButton" value="Make default">');S.push("</div>");S.push('<div id="newsPickerBasicModeSwitch" style="padding-top: 5px; cursor: pointer">');S.push("&laquo; Go back to basic mode");S.push("</div>");S.push("</div>")}function F(S){R(S);S.push('<div id="newsPickerBasicMode">');r(S);S.push("</div>");S.push('<div id="newsPickerAdvancedMode" style="display: none;">');f(S);S.push("</div>");s(S)}function K(){var S=[];S.push('<div style="margin-bottom: 10px; height: 24px; background-image: url(/resources/images/article-footer.png); background-repeat: no-repeat;">');S.push('<table boder="0" cellspacing="0" cellpadding="0">');S.push("<tr>");S.push('<td style="color: #AAA; height: 24px; padding-left: 10px;">');S.push("Filter news:");S.push("</td>");S.push('<td style="height: 24px; padding-left: 5px;">');S.push('<div style="position: relative; background-image: url(/resources/images/arrow-down.png); background-repeat: no-repeat; background-position: 2px center; padding-left: 16px;">');S.push('<div id="newsPickerButton" style="cursor: pointer;">');S.push(B());S.push("</div>");F(S);S.push("</div>");S.push("</td>");S.push("</tr>");S.push("</table>");S.push("</div>");document.write(S.join(""));var U=false;var V=$("#newsPickerDropdown");var T=function(W){if(!$.contains(V.get(0),W.target)){V.hide();$(document).unbind("click",T)}};$("#newsPickerButton").click(function(W){var X=$("#newsPickerDropdown");if(!U){X.show();$(document).click(T);W.stopPropagation();U=true}else{$(document).unbind("click",T);X.hide();U=false}});$("#newsPickerDoneButton").click(function(){if(U){$(document).unbind("click",T);V.hide();U=false}});$("#newsPickerSaveButton").click(function(){x();v(true);var X=$(this);var W=$("<span/>").text("Saving ...").css("display","inline-block").css("background-image","url(/resources/images/ajax-loader-selftimer-333.gif)").css("background-position","5px center").css("background-repeat","no-repeat").css("padding-left","25px").css("line-height","16px");X.before(W).hide();setTimeout(function(){W.remove();X.show()},500)});$("#"+L()).click(function(){var W=$(this).is(":checked");ArrayUtils.forEach(m,function(X){var Y=$("#"+p(X));if(W){Y.attr("checked","checked")}else{Y.removeAttr("checked")}});C();w();t(false);v(false)});ArrayUtils.forEach(m,function(W){$("#"+p(W)).click(function(){w();M();C();t(true);v(false)})});ArrayUtils.forEach(m,function(W){var X=$("#"+D(W)).closest("div");X.mouseover(function(){q(W)});X.mouseout(function(){h()});X.click(function(){o(W);w();M();C();t(false);$(document).unbind("click",T);V.hide();U=false})});$("#newsPickerAdvancedModeSwitch").click(function(){$("#newsPickerBasicMode").hide();$("#newsPickerAdvancedMode").fadeIn("fast")});$("#newsPickerBasicModeSwitch").click(function(){$("#newsPickerAdvancedMode").hide();$("#newsPickerBasicMode").fadeIn("fast")})}function L(){return"newsPickerTagCheckboxAll"}function e(){return"newsPickerTagLabelAll"}function D(S){return"newsPickerTag_"+S.name}function p(S){return"newsPickerTagCheckboxTag_"+S.name}function g(S){return"newsPickerTagLabelTag_"+S.name}function k(S){ArrayUtils.forEach(m,function(T){$("#"+g(T)).css("opacity",S.name==T.name?1:0.33)})}function N(){ArrayUtils.forEach(m,function(S){$("#"+g(S)).css("opacity",1)})}function q(S){ArrayUtils.forEach(m,function(T){$("#"+D(T)).css("opacity",S.name==T.name?1:0.33)})}function h(){ArrayUtils.forEach(m,function(S){$("#"+D(S)).css("opacity",1)})}function y(){if(!H){n=ArrayUtils.sum(l,function(S){return S.news.length});H=true}return n}function d(){if(!A){var S={};ArrayUtils.forEach(m,function(T){if(T.visible){S[T.name]=true}});u=ArrayUtils.sum(l,function(T){return ArrayUtils.count(T.news,function(U){return U.tag==null||S[U.tag]})});A=true}return u}function z(){return y()==d()}function b(){return ArrayUtils.count(m,function(S){return S.visible})}function J(){return b()==m.length}function M(){var S=$("#"+L());if(J()){S.attr("checked","checked")}else{S.removeAttr("checked")}}function o(S){ArrayUtils.forEach(m,function(T){if(S.name==T.name){$("#"+p(T)).attr("checked","checked")}else{$("#"+p(T)).removeAttr("checked")}})}function w(){ArrayUtils.forEach(m,function(S){var T=$("#"+p(S));S.visible=T.is(":checked")});A=false}function C(){$("#newsPickerButton").text(B())}function B(){var T=y();var S=d();if(S==T){return"All news stories shown ("+T+")"}else{if(S>0){return S+" out of "+T+" "+Utils.stringCount(S,"news story","news stories")+" shown"}else{return"All news stories hidden ("+T+")"}}}function t(T){var U={};ArrayUtils.forEach(m,function(V){if(V.visible){U[V.name]=true}});ArrayUtils.forEach(l,function(V){var W=$("#"+V.htmlElementId);var X=ArrayUtils.count(V.news,function(Y){return Y.tag==null||U[Y.tag]});if(X==0){if(T){W.stop(true,false).fadeOut("fast")}else{W.hide()}ArrayUtils.forEach(V.news,function(Z){var Y=$("#"+Z.htmlElementId);Y.stop(true,false)})}else{if(X==V.news.length){ArrayUtils.forEach(V.news,function(Z){var Y=$("#"+Z.htmlElementId);Y.stop(true,false).show()});if(T){W.stop(true,false).fadeIn("fast")}else{W.show()}}else{W.stop(true,false).show();ArrayUtils.forEach(V.news,function(Z){var Y=$("#"+Z.htmlElementId);if(Z.tag==null||U[Z.tag]){if(T){Y.stop(true,false).fadeIn("fast")}else{Y.show()}}else{if(T){Y.stop(true,false).fadeOut("fast")}else{Y.hide()}}})}}});var S=ArrayUtils.count(m,function(V){return V.visible});if(S==0||d()==0){$("div.mainContent div.news").append($("<div/>").addClass("noNews").css("border-radius","5px").css("-moz-border-radius","5px").css("-webkit-border-radius","5px").css("border","1px solid #666").css("padding","40px 20px").css("text-align","center").text(S==0?"You have delected all news tags. Please select at least one tag to see some news.":"There is no news correspoding to your selection of tags."))}else{$("div.mainContent div.news div.noNews").remove()}}function Q(){var S=DprCookieUtils.getCookie(I);if(S){if(S=="[none]"){ArrayUtils.forEach(m,function(U){U.visible=false})}else{var T=S.split(/\s+/);ArrayUtils.forEach(m,function(U){U.visible=ArrayUtils.contains(T,U.name)})}}else{ArrayUtils.forEach(m,function(U){U.visible=true})}}function x(T){var U=ArrayUtils.filter(m,function(V){return V.visible});var S=ArrayUtils.isEmpty(U)?"[none]":U.map(function(V){return V.name}).join(" ");DprCookieUtils.setCookie(I,S,{path:"/",expires:60});clearTimeout(O);O=setTimeout(function(){logCookie(U)},j*1000)}function v(S){var T=ArrayUtils.filter(m,function(U){return U.visible});clearTimeout(O);if(S){c(T,true)}else{O=setTimeout(function(){var U=!a||!ArrayUtils.equal(T,P,function(V){return V.name});if(U){c(T,false);a=true;P=T}},j*1000)}}function c(T,S){var U=ArrayUtils.map(T,function(V){return V.name}).join(" ");$.get("/news/logtagschange.asp",{tags:U,persistent:S?"true":"false"})}};