function footernav_init(){var fnav=jQuery("div#footernav div#fnav");fnav.load("/static/footer.html");var expander=jQuery("div#footernav a.expander");expander.click(function(){fnav.toggle();return false});expander.toggle(function(){jQuery(this).css({backgroundPosition:"bottom right"});jQuery("#footernav").css({marginBottom:"525px"})},function(){jQuery(this).css({backgroundPosition:"top right"});jQuery("#footernav").css({marginBottom:"0"})})}function gateway_init(){var isIE=navigator.appName.indexOf("Microsoft")!=-1;flash_player=(isIE)?window.flash_player1:document.flash_player1}function doClear(theText){if(theText.value==theText.defaultValue){theText.value=""}}jQuery.fn.doClear2=function(){return this.focus(function(){if(this.value==this.defaultValue){this.value=""}}).blur(function(){if(!this.value.length){this.value=this.defaultValue}})};function todaystring(){var today=new Date();var day="";switch(today.getDay()){case 0:day="Sunday";break;case 1:day="Monday";break;case 2:day="Tuesday";break;case 3:day="Wednesday";break;case 4:day="Thursday";
break;case 5:day="Friday";break;case 6:day="Saturday";break}var mo=today.getMonth()+1;mo=(mo<10)?"0"+mo:mo;var daydigit=today.getDate();daydigit=(daydigit<10)?"0"+daydigit:daydigit;var year=today.getFullYear();year=(year+"").substring(2,4);return day+", "+mo+"."+daydigit+"."+year}function loadFile(id,file){jQuery("div#"+id).load(file)}function loadGridPane_sort(file){jQuery("div#grid div.latest").load(file+".html");jQuery("div#grid div.alpha").load(file+"_alpha.html")}function loadGridPane(file){jQuery("div#grid").load(file)}function reinitialiseScrollPane(){jQuery("#grid").jScrollPane({showArrows:true,scrollbarWidth:16,scrollbarMargin:0,arrowSize:24,dragMinHeight:88})}function loadCommunity(section,obj){jQuery("p#newsfrom_bcounty").remove();jQuery("li.load_msg").show();jQuery("div#community_template").load("/"+section+"/v-community/index.html",function(){jQuery("li.load_msg").hide();if(section==467){drawNewsFrom(obj)}});return false}function drawNewsFrom(obj){var aText=jQuery(obj).text();var newsFrom='<p id="newsfrom_bcounty" class="newsfrom" style="float: none;"><span>NEWS FROM:</span> Broward County and '+aText+"</p>";
jQuery("div#community_template").prepend(newsFrom)}jQuery(document).ready(function(){window.setTimeout("footernav_init();",500);var navLink=jQuery("div.panelnav ul:not(.link-list) li:not(.sort) a, div.tab div.subnav ul li a, div.subnav_bottom ul li a");navLink.click(function(){jQuery(this).parent("li").siblings().removeClass("x");jQuery(this).parent("li").addClass("x");return false});jQuery("ul.newsgrid li:eq(1)").addClass("x");jQuery("div#newsgrid span.newsgrid").children("div.topStories:first").show();jQuery("a.newsgridTab").click(function(){var tabID=jQuery(this).attr("id");tabID=tabID.replace("tab_","");jQuery("#newsgrid span.newsgrid").children("div.topStories").hide();jQuery("div."+tabID).show();return false});var timestamps=jQuery("span.timestamp");jQuery.each(timestamps,function(){var current_time=Math.round(new Date().getTime()/1000);var modified_time=parseInt(jQuery(this).text(),10);var time_diff=current_time-modified_time;var timestamp=new Date(modified_time*1000);var hrs=timestamp.getHours();var ampm=(hrs<12)?" AM ":" PM ";hrs=(hrs>12)?hrs-12:hrs;
var mins=timestamp.getMinutes();mins=(mins<10)?"0"+mins:mins;var mins_ago=new Date((current_time-modified_time)*1000);mins_ago=mins_ago.getMinutes();mins_ago=(mins_ago==0)?1:mins_ago;var min_string=(mins_ago==1)?" minute ago":" minutes ago";if(time_diff<3300){timestamp="Updated "+mins_ago+min_string}else{timestamp=hrs+":"+mins+ampm+" ET"}jQuery(this).text("- "+timestamp);jQuery(this).show()});jQuery.scrollTo.defaults.axis="x";jQuery("div.scroll").scrollTo(0);jQuery.scrollTo(0);var paneTarget=jQuery("div.scroll");jQuery("img.right").click(function(){jQuery(this).nextAll(paneTarget).stop().scrollTo("+=264px",800)});jQuery("img.left").click(function(){jQuery(this).nextAll(paneTarget).stop().scrollTo("-=264px",800)});jQuery("ul.tabs li a").click(function(){jQuery(this).parent("li").siblings().removeClass("x");jQuery(this).parent("li").addClass("x");return false});jQuery("a#alpha").click(function(){jQuery("div.panelnav ul li.sort a").removeClass("x");jQuery(this).addClass("x");jQuery("div.latest").hide();jQuery("div.alpha").show();return false});jQuery("a#latest").click(function(){jQuery("div.panelnav ul li.sort a").removeClass("x");
jQuery(this).addClass("x");jQuery("div.alpha").hide();jQuery("div.latest").show();return false});if(jQuery("#navbar ul li.f").children("a").hasClass("x")){jQuery("#navbar ul li.f").css({backgroundPosition:"-26px 100%"})}if(jQuery("#navbar ul li.l").children("a").hasClass("x")){jQuery("#navbar").css({backgroundPosition:"976px 100%"})}jQuery("#navbar ul li.f a").hover(function(){jQuery("#navbar ul li.f").css({backgroundPosition:"-26px 100%"})},function(){if(jQuery(this).hasClass("x")){return false}else{jQuery("#navbar ul li.f").css({backgroundPosition:"-26px 0"})}});jQuery("#navbar ul li.l a").hover(function(){jQuery("#navbar").css({backgroundPosition:"976px 100%"})},function(){if(jQuery(this).hasClass("x")){return false}else{jQuery("#navbar").css({backgroundPosition:"976px 0"})}});jQuery("ul.newsgrid li:last").addClass("end");jQuery("a.external").append('&nbsp;<img src="/images/redesign/icons/external.gif" />');window.setTimeout("addPagerLinks();",3000)});function getQueryStrVariable(variable,hrefstring){if(!(hrefstring)){var hrefstring=window.location.href}var queryIndex=hrefstring.indexOf("?")+1;
var query=hrefstring.substring(queryIndex);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0]==variable){return pair[1]}}return false}function addPagerLinks(){var pageNum=parseInt(jQuery("div#nyxComments_pager span.paginationNavLinks span").text());pageNext=pageNum+1;var pageUrl=location.href;pageUrl=pageUrl.substring(0,pageUrl.lastIndexOf("?"));var nextUrl=pageUrl+"?pageNum="+pageNext+"&mi_pluck_action=page_nav#Comments_Container";var nextLink='<a class="pager" href="'+nextUrl+'">Next</a>';jQuery("div#nyxComments_pager span.paginationNavLinks a:last-child").after(" "+nextLink);if(pageNum>1){pagePrev=pageNum-1;var prevUrl=pageUrl+"?pageNum="+pagePrev+"&mi_pluck_action=page_nav#Comments_Container";var prevLink='<a class="pager" href="'+prevUrl+'">Prev</a>';jQuery("div#nyxComments_pager span.paginationNavLinks a:first-child").before(" "+prevLink+" ")}}function alertTest2(alertTestMessage){if(getQueryStrVariable("test")=="2"){alert(alertTestMessage)}}function alertTest(alertTestMessage){if(getQueryStrVariable("test")=="1"){alert(alertTestMessage)
}}jQuery.fn.exists=function(){return(this.length>0)};jQuery.fn.ifExists=function(){if(this.length>0){return this}};function getFlashGalleryURL(whichGallery,hideURL){var langFileSuffix="-es";var previewSuffix="-preview";var mediaSubDomain="media";var flashGalleryURL="";var thisDomain=window.location.hostname;var previewSuffix="";var thisSubDomain="www";if(thisDomain.indexOf("preview.")===0){previewSuffix="-preview";thisSubDomain="preview";mediaSubDomain=mediaSubDomain}var thisDomainStartChar=thisDomain.indexOf("miamiherald.com");if(thisDomainStartChar==-1){thisDomainStartChar=thisDomain.indexOf("elnuevoherald.com")}else{langFileSuffix=""}thisDomain=thisDomain.substring(thisDomainStartChar);var thisChannelURL="http://"+mediaSubDomain+"."+thisDomain+"/static/multimedia/channels/";var thisPanelURL="http://"+mediaSubDomain+"."+thisDomain+"/static/multimedia/panels/";var thisStoryDetailURL="http://"+mediaSubDomain+"."+thisDomain+"/static/multimedia/story_detail/";if(hideURL==true){thisChannelURL="";thisPanelURL="";thisStoryDetailURL=""
}var thisVersionSuffix="";switch(whichGallery){case"SectionFrontPhotoGallery":flashGalleryURL=thisChannelURL+"SectionFrontPhotoGallery";thisVersionSuffix=(langFileSuffix=="")?"-v7a":"-v7a";break;case"VideoPlayer-SectionFront":flashGalleryURL=thisChannelURL+"VideoPlayer-SectionFront";thisVersionSuffix=(langFileSuffix=="")?"-v2":"-v2a";break;case"MultimediaPanel-PhotoGallery":flashGalleryURL=thisPanelURL+"MiamiHerald-MultimediaPanel-PhotoGallery";thisVersionSuffix=(langFileSuffix=="")?"-v8a":"-v8a";break;case"MultimediaPanel-VideoPlayer":flashGalleryURL=thisPanelURL+"MiamiHerald-MultimediaPanel-VideoPlayer";thisVersionSuffix=(langFileSuffix=="")?"-v3":"-v3";break;case"CommNewsUserPhotosSectionFront-PhotoGallery":flashGalleryURL=thisPanelURL+"CommNews-MultimediaPanel-PhotoGallery";langFileSuffix="";thisVersionSuffix=(langFileSuffix=="")?"-v7a":"-v7a";break;case"StoryLevel-VideoPromo":flashGalleryURL=thisStoryDetailURL+"MiamiHerald-StoryLevel-VideoPromo";thisVersionSuffix="";langFileSuffix="";break;case"StoryLevel-PhotoGallery":flashGalleryURL=thisStoryDetailURL+"StoryLevel-PhotoGallery";
thisVersionSuffix=(langFileSuffix=="")?"-v8m":"-v8a";break;case"UnifiedVideoPlayer":flashGalleryURL=thisStoryDetailURL+"UnifiedVideoPlayer";thisVersionSuffix="";langFileSuffix="";break}return flashGalleryURL+langFileSuffix+previewSuffix+thisVersionSuffix+".swf"}function displayEmailForm_launcher(url){var url_=url;var email_url_version="v-emailform";if((window.location.hostname).indexOf("preview.")===0){url_=url_.replace("www.","preview.")}if(url_.indexOf(email_url_version)==-1){var urlAry=url_.split("/");var urlAryLen=urlAry.length;url_="";for(var i=0;i<(urlAryLen-2);i++){url_+=urlAry[i]+"/"}url_+=email_url_version+"/";url_+=urlAry[urlAryLen-2]+"/";url_+=urlAry[urlAryLen-1]}displayEmailForm(url_);return false};
var cookies=document.cookie;var pos=cookies.indexOf('global_comment_pref=');if(pos!=-1){var start=pos+20;var end=cookies.indexOf(";",start);if(end==-1)end=cookies.length;var comment_cookie=cookies.substring(start,end)}else if(pos==-1){var mhcomcookie='0'}if(comment_cookie=='1'){var mhcomcookie='1'}else if(comment_cookie==''){var mhcomcookie='0'}$(document).ready(function(){var date=new Date();date.setTime(date.getTime()+(365*24*60*60*1000));var expires=date.toGMTString();if(mhcomcookie=='0'){$('#comment_toggle').attr('class','hide');$('#comment_toggle span.hide, div#guidelines-wrap, div#disclaimer-wrap, div#commentingStage').show()}else if(mhcomcookie=='1'){$('#comment_toggle').attr('class','show');$('#comment_toggle span.show').show()}$('span#comment_pref a').click(function(){$('#comment_bubble_top').fadeIn()});$('#comment_bubble_up img.ok').click(function(){document.cookie='global_comment_pref=; expires='+expires+'; path=/; domain=.miamiherald.com';window.location.reload()});$('#comment_bubble_top img.ok').click(function(){document.cookie='global_comment_pref=; expires='+expires+'; path=/; domain=.miamiherald.com';window.location.reload()});$('#comment_toggle').click(function(){$('#comment_bubble').fadeIn();if($(this).attr('class')=='hide'){$('#comment_bubble p').text('Comments will be hidden on all stories.')}else if($(this).attr('class')=='show'){$('#comment_bubble p').text('Comments will be displayed on all stories.')}});$('img.ok').click(function(){var state=$(this).parents('#comment_toggle').attr('class');if(state=='hide'){document.cookie='global_comment_pref=1; expires='+expires+'; path=/; domain=.miamiherald.com';window.location.reload()}if(state=='show'){document.cookie='global_comment_pref=; expires='+expires+'; path=/; domain=.miamiherald.com';window.location.reload()}});$('img.cancel').click(function(){$('#comment_bubble, #comment_bubble_up, #comment_bubble_top').fadeOut();return false})});
