var topnav_default="",topnav_over_main="",topnav_over_sub="",subnav_default=jQuery("#main-nav .subnav li.active"),subnav_over="",subsubnav_default=jQuery(".subsubnav li.active"),subsubnav_over="",multimediabar_enabled=!1,mini_slideshow_enabled=!1;
function manage_topnav(){var b="";topnav_over_main||topnav_over_sub?(topnav_over_main&&!topnav_over_sub?b=topnav_over_main:!topnav_over_main&&topnav_over_sub?b=topnav_over_sub:topnav_over_main==topnav_over_sub&&(b=topnav_over_main),jQuery("#main-nav>ul>li.active").removeClass("active"),jQuery(b).addClass("active")):"active"!=jQuery(topnav_default).attr("class")&&(jQuery("#main-nav>ul>li.active").removeClass("active"),jQuery(topnav_default).addClass("active"))}
function manage_subnav(){if(subnav_over){var b=jQuery("#main-nav .subnav li.active").eq(0).html();jQuery(subnav_over).html()!=b&&(jQuery("#main-nav .subnav li.active").removeClass("active"),jQuery(subnav_over).addClass("active"))}else jQuery(subnav_default).hasClass("active")||(jQuery("#main-nav .subnav li.active").removeClass("active"),jQuery(subnav_default).addClass("active"))}
function manage_subsubnav(){if(subsubnav_over){var b=jQuery(".subsubnav li.active").eq(0).html();jQuery(subsubnav_over).html()!=b&&(jQuery(".subsubnav li.active").removeClass("active"),jQuery(subsubnav_over).addClass("active"))}else jQuery(subsubnav_default).hasClass("active")||(jQuery(".subsubnav li.active").removeClass("active"),jQuery(subsubnav_default).addClass("active"))}
function set_nav_subnav(b,c){Sacbee.set_nav_subnav("main-navbar",b.replace("#",""),c);jQuery("#main-nav li").removeClass("active");topnav_default=b;if(c){var a=jQuery(topnav_default+" li a:contains("+c+")").parent();subnav_default=a;a.addClass("active").parent().parent().addClass("active")}manage_topnav()}
function enable_navbar(){topnav_default="#"+jQuery("div#main-nav ul li.active").attr("id");var b;jQuery("div#main-nav ul:first>li").hover(function(){topnav_over_main="#"+jQuery(this).attr("id");clearTimeout(b);manage_topnav()},function(){topnav_over_main="";b=setTimeout("manage_topnav();",500)});jQuery("div#main-nav ul ul").hover(function(){topnav_over_sub="#"+jQuery(this).parents("li").attr("id");manage_topnav()},function(){topnav_over_sub="";manage_topnav()});subnav_default=jQuery("#main-nav .subnav li.active");
jQuery("#main-nav .subnav li").hover(function(){subnav_over=jQuery(this);manage_subnav()},function(){subnav_over="";manage_subnav()});jQuery(".subsubnav").length&&(subsubnav_default=jQuery(".subsubnav li.active"),jQuery(".subsubnav li").hover(function(){subsubnav_over=jQuery(this);manage_subsubnav()},function(){subsubnav_over="";manage_subsubnav()}))}function enable_searchbox(){Sacbee.enable_searchbox()}function enable_readerservices_menus(){Sacbee.enable_readerservices_menus()}
function enable_multimediabar(){Sacbee.enable_multimediabar();multimediabar_enabled=!0}function enable_mini_slideshow(){jQuery("#mini-slideshow").addClass("mini-slideshow");jQuery("#mini-slideshow-loader").addClass("mini-slideshow-loader");Sacbee.enable_mini_slideshow("mini-slideshow");mini_slideshow_enabled=!0}function enable_big_slideshow2(b){Sacbee.enable_big_slideshow(b)}function display_date_str(){return Sacbee.display_date_str()}
function enable_comment_toggle(){Sacbee.enable_comment_toggle()}function miScriptScheduler(){this.scriptPath=this.scriptCheck=""}miScriptScheduler.prototype.scheduleScript=function(){if(this.scriptCheck)return 0;var b=document.createElement("script");b.src=this.scriptPath;var c=document.getElementsByTagName("base");c.length&&c[0].childNodes.length?c[0].appendChild(b):document.getElementsByTagName("head")[0].appendChild(b)};
jQuery(document).ready(function(){jQuery("ul.zebra").each(function(){jQuery("li:nth-child(odd)",this).addClass("odd")});jQuery("table.zebra").each(function(){jQuery("tr:nth-child(odd)",this).addClass("odd")});jQuery("div.tabbed").length&&(jQuery("div.tabbed").tabs(),jQuery("div.tabbed ul.tabs li a").focus(function(){this.blur()}));jQuery("div#socialwidget li#social-dropdown div.ctrl a").toggle(function(){jQuery(this).addClass("active");jQuery(this).parents("li#social-dropdown").find("div.dropdown").show()},
function(){jQuery(this).removeClass("active");jQuery(this).parents("li#social-dropdown").find("div.dropdown").hide()});jQuery("div#socialwidget li#social-dropdown div.ctrl a").focus(function(){this.blur()});jQuery("body").click(function(){jQuery("li#social-dropdown div.dropdown:visible").get(0)&&jQuery("div#socialwidget li#social-dropdown div.ctrl a").trigger("click");jQuery.each(jQuery("div.readerservices-menu"),function(){jQuery(this).parent(".active").get(0)&&jQuery(this).find("a").trigger("click")})});
jQuery("#multimediabar").length&&!multimediabar_enabled&&enable_multimediabar();jQuery("#mini-slideshow").length&&!mini_slideshow_enabled&&enable_mini_slideshow();jQuery("div.factbox_header a").click(function(){var b=this.id;jQuery("div."+b).is(":hidden")?(jQuery("span."+b).removeClass("icon-down"),jQuery("span."+b).addClass("icon-up")):(jQuery("span."+b).removeClass("icon-up"),jQuery("span."+b).addClass("icon-down"));jQuery("div."+b).slideToggle("normal")});jQuery("div.factbox_header a:first").click();
jQuery("div.comment_guidelines a").click(function(){var b=this.id;jQuery("div."+b).is(":hidden")?(jQuery("span."+b).removeClass("icon-down"),jQuery("span."+b).addClass("icon-up")):(jQuery("span."+b).removeClass("icon-up"),jQuery("span."+b).addClass("icon-down"));jQuery("div."+b).slideToggle("normal")});jQuery(".stories li:last-child").addClass("last");jQuery(".links li:last-child").addClass("last");jQuery(".highlights .story:last").addClass("last");jQuery(".gallery_index .grid-a .story:last").removeClass("last");
jQuery(".gallery_index .grid-d .story:last").removeClass("last");jQuery("#bloggers dd:last").addClass("last");jQuery("#commented li:last").addClass("last");jQuery(".cartoon").removeClass("last");jQuery(".story-top").removeClass("last");jQuery("div.boxshade .story-top").addClass("last");10>jQuery("#latest li").length&&(jQuery("#latest .stories >li:last").removeClass("last"),jQuery("#extrastories >li:last").addClass("last"));jQuery("div.button a button").click(function(){document.location=jQuery(this).parent().attr("href")});
Sacbee.enable_comment_toggle()});
var Sacbee=function(){function b(a){jQuery("#"+a+" li").removeClass("active");jQuery("#"+a+" .subnav").removeClass("active");jQuery("#"+a+" .default_active").addClass("active");jQuery("#"+a+" .default_active .subnav").addClass("active")}var c={};document.location.search.replace(/\??(?:([^=]+)(?:=([^&]*))?&?)/g,function(a,h,b){function d(a){if("undefined"!==typeof a)return decodeURIComponent(a.split("+").join(" "))}c[d(h)]=d(b)});return{GET:c,addScriptNode:function(a,h){var b=document,d=b.createElement("script");
d.setAttribute("src",a);d.onloadDone=!1;d.onload=function(){d.onloadDone=!0;"function"===typeof h&&h(d)};d.onreadystatechange=function(){if(("loaded"===d.readyState||"complete"===d.readyState)&&!d.onloadDone)d.onloadDone=!0,h(d)};b.getElementsByTagName("head")[0].appendChild(d)},addStyleNode:function(a){var b=document,e=b.createElement("link");e.setAttribute("rel","stylesheet");e.setAttribute("type","text/css");e.setAttribute("href",a);b.getElementsByTagName("head")[0].appendChild(e)},enable_navbar:function(a,
h,e){"undefined"===typeof h&&(h="nav-news");Sacbee.set_nav_subnav(a,h,e);jQuery("#"+a+" .topnav").mouseover(function(){"nav-ad"!=jQuery(this).attr("id")&&(jQuery("#"+a+" .topnav").removeClass("active"),jQuery(this).addClass("active"),jQuery("#"+a+" .topnav").find(".subnav").removeClass("active"),jQuery(this).find(".subnav").addClass("active"))});jQuery("#"+a+" .subnav li").mouseover(function(){jQuery("#"+a+" .subnav li").removeClass("active");jQuery(this).addClass("active")});jQuery("#"+a).mouseout(function(){b(a)})},
set_nav_subnav:function(a,h,e){0===jQuery("#"+a+" #"+h).length&&(h="nav-news");jQuery(".default_active").removeClass("default_active");jQuery("#"+a+" #"+h).addClass("default_active");"undefined"!==typeof e&&""!==e&&jQuery("#"+a+" #"+h+' .subnav li a:contains("'+e+'")').parent().addClass("default_active");b(a)},enable_mini_slideshow:function(a){"undefined"===typeof a&&(a="mini-slideshow");jQuery("#"+a+" div.slides ul").cycle({fx:"scrollHorz",speed:200,timeout:0,prev:"#"+a+" span.prev a",next:"#"+a+
" span.next a",pager:"#"+a+" span.indicator",pagerAnchorBuilder:function(){return'<a href="#"><img src="http://media.sacbee.com/static/img/blank.gif" alt=""/></a>'},after:function(){jQuery("#"+a+" div.slides ul").animate({height:parseInt(jQuery("img",this).attr("height")+1)+"px"},"fast");jQuery("#"+a+" div.captions").hide().html(jQuery(".txt",this).html()).show()}});jQuery("#"+a+" .mini-slideshow-loader").hide();jQuery("#"+a+" div.txt").hide();jQuery("#"+a+" div.slides").after(jQuery("<div/>").addClass("captions").html(jQuery("#"+
a+" ul li:first .txt").html()));jQuery("#"+a+" div.slides ul li").css("height",parseInt(jQuery("#"+a+" ul li:first img").attr("height")+1)+"px")},gallery_mini_slideshow:function(a,b,e){var d="#"+a,m=b.replace(/\.html$/,".xml"),f=e.title?e.title:"Gallery Slideshow";jQuery(d).addClass("mini-slideshow");var c=jQuery("<div/>").addClass("boxheader").appendTo(d),g=jQuery("<div/>").addClass("header").appendTo(c),n=jQuery("<div/>").addClass("name").appendTo(g),f=jQuery("<a/>").attr("href",b).html(f).appendTo(n),
f=jQuery("<span/>").addClass("mini-slideshow-loader").appendTo(n);jQuery("<img/>").attr("src","http://media.sacbee.com/static/img/ajax-loader-slideshow.gif").attr("alt","Loading").appendTo(f);g=jQuery("<div/>").addClass("controls").css("margin-top","7px").appendTo(g);f=jQuery("<span/>").addClass("prev").appendTo(g);f=jQuery("<a/>").appendTo(f);jQuery("<img/>").attr("src","http://media.sacbee.com/static/img/mm-mini-left-transparent.gif").attr("alt","previous").appendTo(f);jQuery("<span/>").addClass("indicator").appendTo(g);
g=jQuery("<span/>").addClass("next").appendTo(g);g=jQuery("<a/>").appendTo(g);jQuery("<img/>").attr("src","http://media.sacbee.com/static/img/mm-mini-right-transparent.gif").attr("alt","next").appendTo(g);var t=jQuery("<div/>").addClass("slides").appendTo(c),d=jQuery("<div/>").addClass("button").css("margin-left","5px").appendTo(d),d=jQuery("<a/>").attr("href",b).appendTo(d);jQuery("<button/>").html("See Full Gallery").appendTo(d);jQuery.ajax({url:m,success:function(d){for(var f=jQuery("<ul/>").appendTo(t),
d=d.getElementsByTagName("img"),g=0,m=d.length;g<m&&!(e.count&&g>=e.count);g++){var c=d[g],k=c.getAttribute("src"),l=316*c.getAttribute("height")/640,n=316*c.getAttribute("width")/640,i=/\s*\((.*?)\)$/,o=c.getAttribute("caption").match(i),o=o?jQuery("<h4/>").html(o[1]):"",c=c.getAttribute("caption").replace(i,""),i=jQuery("<li/>"),p=jQuery("<div/>").addClass("image embedded box multi").appendTo(i),p=jQuery("<a/>").attr("href",b+"?image="+(g+1)).appendTo(p);jQuery("<img/>").attr("src",k.replace("standalone",
"embedded")).attr("height",l).attr("width",n).appendTo(p);jQuery("<div/>").addClass("txt").css("display","none").html(c).prepend(o).appendTo(i);i.appendTo(f)}Sacbee.enable_mini_slideshow(a)}})},gallery_big_slideshow:function(a,b,e){var a="#"+a,d=b.replace(/\.html$/,".xml"),c=e.title?e.title:"Gallery Slideshow";jQuery(a).addClass("big-slideshow");var f=jQuery("<div/>").addClass("name").appendTo(a),c=jQuery("<a/>").attr("href",b).html(c).appendTo(f),c=jQuery("<span/>").attr("id","big-slideshow-loader").appendTo(f);
jQuery("<img/>").attr("src","http://media.sacbee.com/static/img/ajax-loader-slideshow.gif").attr("alt","Loading").appendTo(c);c=jQuery("<div/>").addClass("controls").css("margin-top","7px").appendTo(a);f=jQuery("<span/>").addClass("prev").appendTo(c);f=jQuery("<a/>").appendTo(f);jQuery("<img/>").attr("src","http://media.sacbee.com/static/img/mm-mini-left-transparent.gif").attr("alt","previous").appendTo(f);jQuery("<span/>").addClass("indicator").appendTo(c);c=jQuery("<span/>").addClass("next").appendTo(c);
c=jQuery("<a/>").appendTo(c);jQuery("<img/>").attr("src","http://media.sacbee.com/static/img/mm-mini-right-transparent.gif").attr("alt","next").appendTo(c);var r=jQuery("<div/>").addClass("slides").appendTo(a);jQuery.ajax({url:d,success:function(a){for(var d=jQuery("<ul/>").appendTo(r),a=a.getElementsByTagName("img"),c=0,f=a.length;c<f&&!(e.count&&c>=e.count);c++){var j=a[c],m=j.getAttribute("src"),u=j.getAttribute("height"),v=j.getAttribute("width"),k=/\s*\((.*?)\)$/,l=j.getAttribute("caption").match(k),
l=l?l[1]:"",j=j.getAttribute("caption").replace(k,""),k=jQuery("<li/>"),q=jQuery("<div/>").addClass("image standalone").appendTo(k),i=jQuery("<a/>").attr("href",b+"?image="+(c+1)).appendTo(q);jQuery("<img/>").attr("src",m.replace("standalone","embedded")).attr("height",u).attr("width",v).appendTo(i);jQuery("<div/>").addClass("gallerycaption").css("display","none").append(jQuery("<div/>").addClass("galcaption").html(j)).append(jQuery("<div/>").addClass("galbyline").html(l)).appendTo(q);k.appendTo(d)}Sacbee.enable_big_slideshow()}})},
enable_searchbox:function(){jQuery("div.searchmain input:text").focus(function(){jQuery("div.searchmain div.controller span:hidden").css("cursor","pointer").show();jQuery("div.searchdropdown:hidden").show();jQuery(this).css("background-position","0 -18px")});jQuery("div.searchmain input:text").blur(function(){""==jQuery("div.searchmain input:text").val()&&jQuery(this).css("background-position","0 0")});jQuery("div.searchmain div.controller span").click(function(){jQuery(this).hide();jQuery("div.searchdropdown:visible").hide();
""==jQuery("div.searchmain input:text").val()&&jQuery(this).css("background-position","0 0")})},enable_readerservices_menus:function(){jQuery("div.readerservices-menu").parent().hover(function(){jQuery(this).addClass("active")},function(){jQuery(this).removeClass("active")});jQuery("div.readerservices-menu a").click(function(){return!1})},display_date_str:function(){var a=new Date;return"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(",")[a.getDay()]+", "+"January,February,March,April,May,June,July,August,September,October,November,December".split(",")[a.getMonth()]+
" "+a.getDate()+", "+a.getFullYear()},enable_comment_toggle:function(){if(jQuery("#comment_toggle").length){var a=function(){jQuery("#comment_toggle img").attr("src","/static/images/comments/commentsShow.gif").attr("alt","show comments");jQuery(".comment_guidelines").hide();jQuery("#commentingStage").hide();jQuery("#disqus_thread").hide()},b=function(){jQuery("#comment_toggle img").attr("src","/static/images/comments/commentsHide.gif").attr("alt","hide comments");jQuery(".comment_guidelines").show();
jQuery("#commentingStage").show();jQuery("#disqus_thread").show()};"hide"==jQuery.cookie("global_comment_pref")?a():b();jQuery("#comment_toggle").show();jQuery("#comment_toggle").click(function(){"hide"==jQuery.cookie("global_comment_pref")?(jQuery.cookie("global_comment_pref","show",{path:"/",expires:0,domain:"sacbee.com"}),jQuery.cookie("global_comment_pref","show",{path:"/",expires:0,domain:"www.sacbee.com"}),jQuery.cookie("global_comment_pref","show",{path:"/",expires:0,domain:"blogs.sacbee.com"}),
"undefined"!=typeof s&&s.tl(this,"o","Comments-show"),b()):(jQuery.cookie("global_comment_pref","hide",{path:"/",expires:365,domain:"sacbee.com"}),"undefined"!=typeof s&&s.tl(this,"o","Comments-hide"),a())})}},enable_multimediabar:function(){jQuery("div#multimediabar .mm-links li:first").addClass("active");jQuery("div#multimediabar div.mm-panelset").each(function(a){a+=1;jQuery("div.mm-panels",this).cycle({fx:"scrollHorz",speed:500,timeout:0,cleartypeNoBg:!0,next:"#mm-panelset"+a+" .mm-right a",prev:"#mm-panelset"+
a+" .mm-left a",pagerAnchorBuilder:function(){return'<a href="#"><img src="http://media.sacbee.com/static/img/blank.gif" alt=""></a>'}})});jQuery("#multimediabar .mm-left a, #multimediabar .mm-right a").focus(function(){this.blur()});jQuery("div#multimediabar div.mm-panelset:not(#mm-panelset1) div.mm-panels").cycle("pause");jQuery("div#multimediabar .mm-links a").click(function(){jQuery(this).parents("ul").find(".active").removeClass("active");jQuery(this).parent("li").addClass("active");jQuery("div#multimediabar div.mm-panels").cycle("stop");
var a="#"+jQuery(this).attr("class");jQuery(this).parents("ul").removeClass();jQuery(this).parents("ul").removeClass();jQuery(this).parents("ul").addClass("mm-links");jQuery(this).parents("ul").addClass(jQuery(this).attr("class"));jQuery(".mm-panelset:not("+a+")").fadeOut("normal",function(){jQuery(a).fadeIn("normal",function(){jQuery(a+" div.mm-panels").cycle("resume")})});this.blur();return!1})},enable_big_slideshow:function(a){"undefined"==typeof a&&(a=Sacbee.GET.image?Sacbee.GET.image-1:0);jQuery("<div/>").addClass("captions").appendTo("#big-slideshow div.slides");
jQuery("div#big-slideshow div.slides ul").cycle({fx:"scrollHorz",speed:200,timeout:0,startingSlide:a,cleartypeNoBg:!0,prev:"div#big-slideshow span.prev a",next:"div#big-slideshow span.next a",pager:"div#big-slideshow span.indicator",pagerAnchorBuilder:function(){return'<a href="#"><img src="http://media.sacbee.com/static/img/blank.gif" alt=""></a>'},after:function(){jQuery(".bigIndex").html(jQuery(this).prevAll().length+1);jQuery("#big-slideshow div.slides ul").animate({height:parseInt(jQuery("img",
this).attr("height")+1)+"px"},"fast");jQuery("#big-slideshow div.captions").hide().html(jQuery("div.gallerycaption",this).html()).show();if(jQuery("#railads").length){"undefined"!=typeof s&&mistats_resend();try{var a=_gat._getTracker("UA-2767905-6");a._setDomainName(".sacbee.com");a._trackPageview()}catch(b){}jQuery("#railads").attr("src",jQuery("#railads").attr("src"))}}});jQuery("#big-slideshow-loader").hide();jQuery("#big-slideshow div.gallerycaption").hide();1==jQuery("div#big-slideshow div.slides ul li").length&&
jQuery("div#big-slideshow div.slides ul li").show()},MobileDetect:{getBrowser:function(){var a,b=["iPhone","iPad","iPod","Android"];for(x=0;x<b.length;x++)if(-1!==navigator.userAgent.indexOf(b[x])){a=b[x];break}return a},showAppLink:function(a){var b=Sacbee.MobileDetect.getBrowser(),c="Click here for the free Sacbee iPhone App!",d;if(b&&!$.cookie("hide_mobileteaser")){switch(b){case "iPhone":d="http://itunes.apple.com/us/app/the-sacramento-bee/id382902278";break;case "iPod":c="Click here for the free Sacbee iPod App!";
d="http://itunes.apple.com/us/app/the-sacramento-bee/id382902278";break;case "iPad":c="Click here for the Sacbee iPad App!";d="http://itunes.apple.com/us/app/the-sacramento-bee-for-ipad/id446757012";break;case "Android":c="Click here for the free Sacbee Android App!",d="https://market.android.com/details?id=com.ap.sacramento"}$(a).append($("<img/>").attr("src","http://media.sacbee.com/static/img/button-search-close.gif").addClass("closebox").click(function(){Sacbee.MobileDetect.trackEvent(this,"MobileTeaser - Hide");
Sacbee.MobileDetect.hideAppLink(a)})).append($("<div/>").html(c).click(function(){Sacbee.MobileDetect.trackEvent(this,"MobileTeaser - Get App - "+b);window.location=d})).show()}},hideAppLink:function(a){$.cookie("hide_mobileteaser","yes",{expires:30});$(a).hide()},trackEvent:function(a,b){"s"in window&&"tl"in window.s&&window.s.tl(a,"o","Kiosk-Airport "+b)}}}}();
