$(document).ready(function(){
navPosition();
superfish();if ($(
"#wxalerts li"
).length>1){wxalertCarousel();}
if ($(
'#skybox_carousel'
).length){skyboxCarousel();}
if ($(
'#poster'
).length){posterCarousel();}
fontResize(
"story_font_size"
);
var tabWrappers=$(
".tab_wrapper"
);
tabWrappers.tabs();if ($(
'.popmenu_button'
).length){$(
'.popmenu_button'
).popmenu({activeClass:
"active"
});}
initContentRatings($(
'input[type=radio].rating-star'
),$(
'form.rating_form'
));
initCellarBD();initAsphaltAppTap();
});
function superfish(){
var path=
'current'
;
var current_nav=$(
'ul#site_nav'
).attr(
'class'
).match(
/nav_[a-z]*/);
if (current_nav==null||current_nav[0]==
'nav_'
){$(
'ul#site_nav li#nav_news'
).addClass(path);}
else {$(
'ul#site_nav li#'
+current_nav[0]).addClass(path);$(
'ul#site_nav li#'
+current_nav[0]+
' > ul.secondary_nav'
).css(
'display'
,
'block'
);
}
$(
'ul#site_nav'
).superfish({pathClass:path,hoverClass:
'hover'
,pathLevels:2,delay:1500,speed:
'fastest'
,autoArrows:true,dropShadows:false});}
function wxalertCarousel(){function wxalert_init(carousel){var controls=
"<div id='wxalert_controls'><a href='#alert_body' class='carousel_control carousel_prev'>Previous</a><a href='#alert_body' class='carousel_control carousel_next'>Next</a></div>"
;
$(
'#alert_body'
).prepend(controls);
$(
'#wxalert_controls a.carousel_prev'
).bind(
'click'
,function(){carousel.prev();carousel.startAuto(0);return false;});$(
'#wxalert_controls a.carousel_next'
).bind(
'click'
,function(){carousel.next();carousel.startAuto(0);return false;});
carousel.clip.hover(function(){carousel.stopAuto();},function(){carousel.startAuto();});}
function onSlide(carousel,item,current_page,state){$(
'#wx_controls li a'
).each(function(){if ($(this).attr(
'id'
)==
'page'
+current_page){$(this).parent().addClass(
'current'
);}
else {$(this).parent().removeClass(
'current'
);}});}
$(
'#wxalerts'
).jcarousel({auto:8,animation:250,easing:
'linear'
,scroll:1,wrap:
'both'
,initCallback:wxalert_init,itemFirstInCallback:onSlide,buttonNextHTML:null,buttonPrevHTML:null});}
function skyboxCarousel(){function carouselInit(carousel){var pages=$(
'#skybox_carousel'
).children().size();
var controls_list=$(
'#skybox_controls ul'
);
var controls=
"<a href='#skybox_carousel' class='carousel_control carousel_prev' title='See previous group of skyboxes'>Previous</a><a href='#skybox_carousel' class='carousel_control carousel_next' title='See next group of skyboxes'>Next</a>"
;controls_list.after(controls);
for(i=1;i<=pages;i++){controls_list.append(
"<li><a href='#skybox_wrapper' id='page"
+i+
"' title='Jump to Skybox page "
+i+
"'>"
+i+
"</a></li>"
);}
$(
'#skybox_controls ul li:first-child'
).addClass(
'current'
);
$(
'#skybox_controls li'
).bind(
'click'
,function(){carousel.scroll($.jcarousel.intval($(this).text()));$(
'#skybox_controls li'
).each(function(){if ($(this).hasClass(
'current'
)){$(this).removeClass(
'current'
);}});$(this).toggleClass(
'current'
);return false;});
$(
'#skybox_controls .carousel_next'
).bind(
'click'
,function(){carousel.next();execAppTapEvent(this,
"Event64"
,false);return false;});
$(
'#skybox_controls .carousel_prev'
).bind(
'click'
,function(){carousel.prev();execAppTapEvent(this,
"Event64"
,false);return false;});}
function onSlide(carousel,item,current_page,state){$(
'#skybox_controls ul li a'
).each(function(){if ($(this).attr(
'id'
)==
'page'
+current_page){$(this).parent().addClass(
'current'
);}
else {$(this).parent().removeClass(
'current'
);}});}
$(
'#skybox_carousel'
).jcarousel({initCallback:carouselInit,scroll:1,wrap:
"both"
,buttonNextHTML:null,buttonPrevHTML:null,itemFirstInCallback:onSlide});}
function posterCarousel(){function poster_init(carousel){var pages=$(
'#poster'
).children().size();
var controls_list=$(
'#poster_controls ul'
);
var controls=
"<a href='#poster' class='carousel_control carousel_prev' title='See previous poster content'>Previous</a><a href='#poster' class='carousel_control carousel_next' title='See next poster content'>Next</a>"
;controls_list.after(controls);
for(i=1;i<=pages;i++){controls_list.append(
"<li><a href='#poster' id='page"
+i+
"' + title='See poster page: "
+i+
"'>"
+i+
"</a></li>"
);}
$(
'#poster_controls ul li:first-child'
).addClass(
'current'
);
$(
'#poster_controls li'
).bind(
'click'
,function(){carousel.scroll($.jcarousel.intval($(this).text()));$(
'#poster_controls li'
).each(function(){if ($(this).hasClass(
'current'
)){$(this).removeClass(
'current'
);}});$(this).toggleClass(
'current'
);carousel.startAuto(0);return false;});
$(
'#poster_controls a.carousel_prev'
).bind(
'click'
,function(){carousel.prev();carousel.startAuto(0);execAppTapEvent(this,
"Event65"
,false);return false;});$(
'#poster_controls a.carousel_next'
).bind(
'click'
,function(){carousel.next();carousel.startAuto(0);execAppTapEvent(this,
"Event65"
,false);return false;});
carousel.clip.hover(function(){carousel.stopAuto();},function(){carousel.startAuto();});}
function onSlide(carousel,item,current_page,state){$(
'#poster_controls ul li a'
).each(function(){if ($(this).attr(
'id'
)==
'page'
+current_page){$(this).parent().addClass(
'current'
);}
else {$(this).parent().removeClass(
'current'
);}});}
$(
'#poster'
).jcarousel({auto:8,animation:250,easing:
'linear'
,scroll:1,wrap:
'both'
,initCallback:poster_init,itemFirstInCallback:onSlide,buttonNextHTML:null,buttonPrevHTML:null});}
function galleryCarousel(){function carouselInit(carousel){var target_gallery=
"#photo_gallery_"
;var pages=$(
''
+target_gallery+
' .story_gallery'
).children().size();
var controls_list=$(
''
+target_gallery+
' ul.story_gallery'
);
var controls=
"<a href='"
+target_gallery+
"' class='carousel_control carousel_prev'>Previous</a><a href='"
+target_gallery+
"' class='carousel_control carousel_next'>Next</a>"
;controls_list.after(controls);
$(
""
+target_gallery+
".carousel_next"
).bind(
'click'
,function(){carousel.next();return false;});
$(
""
+target_gallery+
".carousel_prev"
).bind(
'click'
,function(){carousel.prev();return false;});}
$(
'.story_gallery'
).jcarousel({initCallback:carouselInit,scroll:1,animation:200,wrap:
"both"
,buttonNextHTML:null,buttonPrevHTML:null});}
function navPosition(){
var wrapper_offset=$(
"#page_wrapper"
).offset();var nav_offset=844+wrapper_offset.left;
$(
"ul.tertiary_nav"
).each(function(){var offset=$(this).offset();if (offset.left>nav_offset){$(this).addClass(
"shift_left"
);}});
$(
"ul.quaternary_nav"
).each(function(){var offset=$(this).offset();if (offset.left>nav_offset){$(this).addClass(
"pop_left"
);}});}
function dropCap(selector){var firstElement=$(selector);var newElement=firstElement.clone(true);newElement.addClass(
"first_graph"
);if($.browser.safari||$.browser.opera){newElement.addClass(
"safari_opera"
);}
firstElement.replaceWith(newElement);}
function updownInit(item_selector,container_selector,ad_selector,ad_location,cookie_name){
if ($.cookie(cookie_name)){var itemIDs=$.cookie(cookie_name).split(
","
)||[];
var itemsList=$(item_selector);
var itemsContainer=$(container_selector);
var itemsLength=itemIDs.length-1;
if (!ad_location){var breakPoint=itemsLength;} else {var breakPoint=ad_location-1;}
for (var i=breakPoint;i>=0;i--){var item=$(
"#"
+itemIDs[i]);
if (item.length>0){item.prependTo(itemsContainer);
}}
if (ad_location){for (var i=ad_location;i<=itemsLength;i++){var item=$(
"#"
+itemIDs[i]);
if (item.length>0){item.appendTo(itemsContainer);
}}}
var newItemsList=$(item_selector);}
writeArrows(item_selector,ad_selector,ad_location,cookie_name);}
function writeArrows(item_selector,ad_selector,ad_location,cookie_name){var items=$(item_selector);for (var i=0;i<items.length;i++){var item=$(items[i]);
var itemID=
"#"
+item.attr(
"id"
);
var titlebar=$(itemID+
" .titlebar"
);
var upDownLinks=
'<ul class="updown"><li class="up">'
;
if (i !=0){upDownLinks+=
'<a href="'
+itemID+
'" title="Reorder Section Up: '
+itemID+
'">Up</a>'
;} else {upDownLinks+=
'Up'
;}
upDownLinks+=
'</li><li class="down">'
;if (i !=(items.length-1)){upDownLinks+=
'<a href="'
+itemID+
'" title="Reorder Section Down: '
+itemID+
'">Down</a>'
;} else {upDownLinks+=
'Down'
;}
upDownLinks+=
'</li></ul>'
;
titlebar.append(upDownLinks);
}
$(
'li.up a'
).click(function(){moveItem($(getTargetID($(this))),
"up"
,item_selector,ad_selector,ad_location,cookie_name);return false;});
$(
'li.down a'
).click(function(){moveItem($(getTargetID($(this))),
"down"
,item_selector,ad_selector,ad_location,cookie_name);return false;});
registerAppTapEvent(
"li.up a, li.down a"
,
"Event63"
,false);}
function moveItem(item,direction,item_selector,ad_selector,ad_location,cookie_name){var items=$(item_selector);
var itemIndex=items.index(item);
var prevItem=$(items.get(itemIndex-1));
var nextItem=$(items.get(itemIndex+1));
item.fadeOut(
"fast"
,function(){
if (direction==
"up"
){item.insertBefore(prevItem);
if (itemIndex==ad_location){prevItem.insertBefore(nextItem);}}
else if (direction==
"down"
){item.insertAfter(nextItem);
if (itemIndex==ad_location-1){nextItem.insertAfter(prevItem);}}
$(
"ul.updown"
).remove();writeArrows(item_selector,ad_selector,ad_location,cookie_name);
var order=
""
;var movedItems=$(item_selector);
movedItems.each(function (){order=order+this.id+
","
;});order=order.substring(0,order.length-1);
$.cookie(cookie_name,order,{expires:730});
});item.fadeIn(
"slow"
);
}
function getTargetID(item){
var href=item.attr(
"href"
);var bits=href.split(
/\//);var id=bits[bits.length-1];if (id.charAt(0)==
"#"
){return id;
} else {return null;}}
function fontResize(cookie_name){if ($.cookie(cookie_name)){switch($.cookie(cookie_name)){case
"14"
:$(
'#article_body'
).css(
'font-size'
,14);
if (!$(
'a#font_small'
).hasClass(
'active'
)){$(
'a#font_small'
).addClass(
'active'
);}
if ($(
'a#font_default'
).hasClass(
'active'
)){$(
'a#font_default'
).removeClass(
'active'
);}
if ($(
'a#font_large'
).hasClass(
'active'
)){$(
'a#font_large'
).removeClass(
'active'
);}
break;case
"16"
:$(
'#article_body'
).css(
'font-size'
,16);
if (!$(
'a#font_default'
).hasClass(
'active'
)){$(
'a#font_default'
).addClass(
'active'
);}
if ($(
'a#font_small'
).hasClass(
'active'
)){$(
'a#font_small'
).removeClass(
'active'
);}
if ($(
'a#font_large'
).hasClass(
'active'
)){$(
'a#font_large'
).removeClass(
'active'
);}
break;case
"18"
:$(
'#article_body'
).css(
'font-size'
,18);
if (!$(
'a#font_large'
).hasClass(
'active'
)){$(
'a#font_large'
).addClass(
'active'
);}
if ($(
'a#font_small'
).hasClass(
'active'
)){$(
'a#font_small'
).removeClass(
'active'
);}
if ($(
'a#font_default'
).hasClass(
'active'
)){$(
'a#font_default'
).removeClass(
'active'
);}
break;}}
else {$(
'a#font_default'
).addClass(
'active'
);}
$(
'a#font_large'
).click(function(){$(
'#article_body'
).css(
'font-size'
,18);$.cookie(cookie_name,18);
if (!$(this).hasClass(
'active'
)){$(this).addClass(
'active'
);
if ($(
'a#font_default'
).hasClass(
'active'
))
$(
'a#font_default'
).removeClass(
'active'
);if ($(
'a#font_small'
).hasClass(
'active'
))
$(
'a#font_small'
).removeClass(
'active'
);}
return false;});
$(
'a#font_default'
).click(function(){$(
'#article_body'
).css(
'font-size'
,16);$.cookie(cookie_name,16);
if (!$(this).hasClass(
'active'
)){$(this).addClass(
'active'
);
if ($(
'a#font_large'
).hasClass(
'active'
))
$(
'a#font_large'
).removeClass(
'active'
);if ($(
'a#font_small'
).hasClass(
'active'
))
$(
'a#font_small'
).removeClass(
'active'
);}
return false;});
$(
'a#font_small'
).click(function(){$(
'#article_body'
).css(
'font-size'
,14);$.cookie(cookie_name,14);
if (!$(this).hasClass(
'active'
)){$(this).addClass(
'active'
);
if ($(
'a#font_default'
).hasClass(
'active'
))
$(
'a#font_default'
).removeClass(
'active'
);if ($(
'a#font_large'
).hasClass(
'active'
))
$(
'a#font_large'
).removeClass(
'active'
);}
return false;});}
function searchFilter(url){$(
"input#search_button"
).remove();$(
".ajax_loader"
).ajaxStart(function(){$(this).show();$(this).next().fadeTo(
"medium"
,0.25);});$(
".ajax_loader"
).ajaxStop(function(){$(this).hide();$(this).next().fadeTo(
"medium"
,1);});$(
"#browse_search_form .vSelectField"
).change(function (){var query=
""
;$(
"#browse_search_form .vSelectField"
).each(function(i){if ($(this).val() !=
""
){query+=$(this).attr(
"name"
)+
"="
+$(this).val()+
"\&"
;}});query=query.substring(0,query.length-1);$.ajax({type:
"GET"
,url:url,data:query,dataType:
"html"
,success:function(results){$(
"ul.browse_list"
).html(results);}});});}
function yahooMap(id,lat,long,name,address,city,zip,width,height){
var mapsize=new YSize(width,height);var map=new YMap(document.getElementById(
'mapwindow_'
+id),YAHOO_MAP_REG,mapsize);
map.addZoomShort();map.disableKeyControls();map.removeZoomScale();
var geopoint=new YGeoPoint(lat,long);var newMarker=new YMarker(geopoint);
var markerMarkup=
"<div style='padding: 3px 7px; font-family: Verdana; font-size: 0.8em; width: 175px;'><strong>"
+name+
"</strong><br/>"
+address+
"<br/>"
+city+
" "
+zip+
"</div>"
;
YEvent.Capture(newMarker,EventsList.MouseClick,function(){newMarker.openSmartWindow(markerMarkup);});
map.addOverlay(newMarker);map.drawZoomAndCenter(geopoint,5);
$(
"#mapbutton_"
+id).click(function (){$(this).next(
'div.list_map'
).slideToggle();return false;});}
$.fn.popmenu=function(options){var defaults={menu:
".popmenu"
,activeClass:false,time:1500,speed:
""
,effect:
""
};var options=$.extend(defaults,options);var active_menu=null;var timeout;return this.each(function(){var button=$(this);var menu=$(this).next();button.click(function(e){clearTimeout(timeout);
if (menu.is(
':hidden'
)){
$(
""
+options.menu+
":visible"
).each(function(){$(this).hide(options.speed);$(this).prev().removeClass(options.activeClass);});menu.show(options.speed);if (options.activeClass !=false){button.addClass(options.activeClass);}}
else {menu.hide(options.speed);if (options.activeClass !=false){button.removeClass(options.activeClass);}}
active_menu=menu.index(menu);return false;});
button.mouseover(function(){clearTimeout(timeout);active_menu=menu.index(menu);});
menu.mouseover(function(){clearTimeout(timeout);active_menu=menu.index(menu);});
button.mouseout(function(){timeout=setTimeout(function(){if(options.activeClass !=false){button.removeClass(options.activeClass);}
menu.hide(options.speed);},options.time);active_menu=null;});
menu.mouseout(function (){timeout=setTimeout(function(){if(options.activeClass !=false){button.removeClass(options.activeClass);}
menu.hide(options.speed);},options.time);active_menu=null;});
$(document).click(function(e){if (active_menu==null){$(options.menu+
":visible"
).each(function(){$(this).hide(options.effect,options.speed);$(this).prev().removeClass(options.activeClass);});}});});};ratingSubmit=function(value,link){value=value||0;if (value !=0){
var f=$(this.form);if(!f.hasClass(
"user_rating_form"
)){f.addClass(
"user_rating_form"
);}} else {
var f=cancelThisForm;f.removeClass(
"user_rating_form"
);}
$.post(f.attr(
"action"
),{rating:value},function(data,textStatus){if (value==0){
var newData=eval(
"("
+data+
")"
);var newRating=newData.rating
var inputs=f.children(
'input[type=radio].rating-star'
);var input=inputs.filter(
"[value="
+newRating+
"]"
);var overallInput=$(input[0]);overallInput.attr(
"checked"
,
"checked"
);inputs.attr(
"class"
,
"rating-star"
);f.find(
'span.star-rating-control'
).remove();initContentRatings(inputs,f);}});}
initContentRatings=function(inputObjects,cancelScope){inputObjects.rating({callback:ratingSubmit});$(
'.star-rating-readonly'
).click(function(){alert(
"Please login to rate content"
);});cancelScope.find(
'div.rating-cancel a'
).click(function(){cancelThisForm=$($(this).parents(
"form"
)[0]);});}
initCellarBD=function(){
if ($(
"#business_directory"
).length>0){var bd=$(
'#business_directory_prompt'
);
var bdLinks=$(
"#business_directory_links"
);
bdLinks.hide();
bd.append(
'<a href="#business_directory"> See directory links</a>'
);
var bdToggle=$(
'#business_directory_prompt a'
);
bdToggle.click(function(clickEvent){
clickEvent.preventDefault();var a=$(this);var t=a.text();
bdLinks.toggle();
if (t.search(
'See'
)>=0){a.text(t.replace(
' See'
,
' Hide'
));} else {a.text(t.replace(
' Hide'
,
' See'
));}
});}}
function eventTabs(){$(
"input#search_button"
).remove();
$(
"#events_browse ul.cal_tab_header a"
).click(function (){
if ($(this).hasClass(
"browse_cal"
)){$(
".search_results_wrapper"
).hide();$(
"#browse_cal"
).show();} else {$(
"#browse_cal"
).hide();$(
".search_results_wrapper"
).show();}
$(
"#day_load"
).ajaxStart(function(){$(this).show();$(this).next().fadeTo(
"medium"
,0.25);});$(
"#day_load"
).ajaxStop(function(){$(this).hide();$(this).next().fadeTo(
"medium"
,1);});$(this).parent().siblings().removeClass(
"ui-tabs-selected"
);
$(this).parent().addClass(
"ui-tabs-selected"
);
query=
"start_date="
+$(this).attr(
"value"
)+
"&framing=event_day_list"
;
$.ajax({type:
"GET"
,url:
"/events/"
,data:query,dataType:
"html"
,success:function(results){
$(
".search_results_wrapper"
).html(results);
$(
"input#search_button"
).remove();$(
"#browse_search_form .vSelectField"
).change(function (){$(
"#filter_load"
).ajaxStart(function(){$(this).show();$(this).next().fadeTo(
"medium"
,0.25);});$(
"#filter_load"
).ajaxStop(function(){$(this).hide();$(this).next().fadeTo(
"medium"
,1);});query=filterQuery();
query+=
"&framing=event_filter_list"
$.ajax({type:
"GET"
,url:
"/events/"
,data:query,dataType:
"html"
,success:function(results){$(
"ul.browse_list"
).html(results);}});});}});return false;});
$(
"#browse_search_form .vSelectField"
).change(function (){
$(
"#filter_load"
).ajaxStart(function(){$(this).show();$(this).next().fadeTo(
"medium"
,0.25);});$(
"#filter_load"
).ajaxStop(function(){$(this).hide();$(this).next().fadeTo(
"medium"
,1);});query=filterQuery();
query+=
"&framing=event_filter_list"
$.ajax({type:
"GET"
,url:
"/events/"
,data:query,dataType:
"html"
,success:function(results){
$(
"ul.browse_list"
).html(results);}});});
function filterQuery(query){var query=
""
;
$(
"#events_browse ul.cal_tab_header li"
).each(function (){if ($(this).hasClass(
"ui-tabs-selected"
)){date=$(this).children(
"a"
).attr(
"value"
);}});
$(
"#browse_search_form .vSelectField"
).each(function(i){if ($(this).val() !=
""
){query+=$(this).attr(
"name"
)+
"="
+$(this).val()+
"\&"
;}});return query+=
"&start_date="
+date;}}
function execAppTapEvent(trigger,eventName,isMacro){var trigger=$(trigger);var title=trigger.attr(
"title"
);sendEvent(trigger,eventName,title);
if (isMacro){retarget(getEventPath(trigger),title);}
}
function registerAppTapEvent(selector,eventName,isMacro){$(selector).click(function(){execAppTapEvent(this,eventName,isMacro);});}
function getEventPath(trigger){if (path[-1] !=
"/"
){path+=
"/"
;}
return path+trigger.attr(
"href"
);
}
function initAsphaltAppTap(){registerAppTapEvent(
".macro_tab_header li a"
,
"Event60"
,true);registerAppTapEvent(
"#content_wrapper :not('#secondary_content') .tab_header:not('.macro_tab_header') li a"
,
"Event61"
,false);registerAppTapEvent(
"#secondary_content .tab_header li a"
,
"Event62"
,false);}
function loadComments(baseurl,page,comment){var getComment=comment||0;var getPage=page||0;var getURL=baseurl+getPage+
"/"
;var loaderElement=
'<div id="filter_load" class="ajax_loader" style="display: block;"><img src="'
+loadImgURL+
'" alt="Loading content" /><p>&nbsp;&nbsp;&nbsp;Loading...</p></div>'
;var jcomments=$(
"#comments_container"
);jcomments.html(loaderElement);if (getComment !=0){var d={comments_id:getComment};} else {var d={};}
$.get(getURL,d,function(data){jcomments.html(data);handleCommentsLinks();updateCommentCounts(
".dynamic_comment_count"
);if (d[
'comments_id'
]&&firstCommentsLoad){
$.scrollTo($(
"#c"
+d[
'comments_id'
].toString()));}
firstCommentsLoad=false;});}
function revealComment(element){var comment=$(
"#ccr"
+element);var warning=$(
"#cch"
+element);
if (comment.length>0&&warning.length>0){comment.show();warning.hide();}}
function writeCommentCookie(action){document.cookie=
"hidecomments="
+encodeURIComponent(action)+
"; path=/; max-age="
+(60 * 60 * 24 * 365);}
function toggleComments(toggleLink,commentsDiv){if (toggleLink.text()==
"Hide"
){
commentsDiv.hide();writeCommentCookie(
"out"
);toggleLink.text(
"Show"
);} else {
loadComments(commentsURL,0,0);commentsDiv.show();writeCommentCookie(
"in"
);toggleLink.text(
"Hide"
);}}
function handleCommentsLinks(){$(
".comments_prev"
).click(function(event){
event.preventDefault();$.scrollTo($(
"#comments"
));loadComments(commentsURL,commentsPreviousPage,0);});$(
".comments_next"
).click(function(event){
event.preventDefault();$.scrollTo($(
"#comments"
));loadComments(commentsURL,commentsNextPage,0);});$(
"select.comments_pages_select"
).change(function(){$.scrollTo($(
"#comments"
));var selectedOption=$(this).children(
"option:selected"
);var re=
/\d+/;var newIndex=re.exec(selectedOption.attr(
"class"
))[0] * 1;
loadComments(commentsURL,newIndex,0);});}
function updateCommentCounts(destinationSelector){var re=
/\d+/;var commentCount=re.exec($(
"#comment_wrapper .comment_list_wrapper:first"
).attr(
"id"
))[0] * 1;if ($(
'#titlebar_comment_count'
).length==0){
var titlebarCommentCount=
' <span id="titlebar_comment_count">&raquo; <span class="'
+destinationSelector.replace(
"."
,
""
)+
'"></span></span>'
;$(
"#comments .titlebar:first h3:first"
).append(titlebarCommentCount);
}
$(destinationSelector).each(function(){$(this).text(commentCount);
});}
function initComments(){var commentsDiv=$(
"#comments"
);var toggleDiv=$(
"#comment_wrapper"
);if (commentsDiv.length>0){if (hideComments==true){toggleDiv.hide();
var toggleText=
'Show'
;} else {var toggleText=
'Hide'
;}
var toggleUL=
'<ul class="deeplinks"><li><a href="#comments" id="comments_toggle">'
+toggleText+
'</a></li></ul>'
;var commentsTitlebar=$(
"#comments .titlebar:first"
);commentsTitlebar.append(toggleUL);
$(
"#comments_toggle"
).click(function(event){
event.preventDefault();toggleComments($(this),toggleDiv);});handleCommentsLinks();}}
function showMobilePrompt(mobileURL){var width=getBrowserWidth();if ($.cookie(
"preventMobileRedirect"
)&&!$.cookie(
"hideMobilePrompt"
)&&width !=0&&width<=800){var prompt=
'<div id="mobile_prompt" style="width: 994px; height: 60px; margin: 0 auto 10px;line-height: 60px; font-size: 24px;"><a id="visitMobileSite" href="'
+mobileURL+
'" style="margin-left: 15px;">Visit our mobile-optimized site</a><a id="hideMobilePrompt" href="#" style="font-size: 18px; color: #444; margin-left: 15px; text-transform: uppercase">Hide this message</a></div>'
;$(
"#utilities_wrapper"
).prepend(prompt);
$(
"#hideMobilePrompt"
).click(function(e){e.preventDefault();
$(
"#mobile_prompt"
).remove();
$.cookie(
"hideMobilePrompt"
,1,{expires:365});
});
$(
"#visitMobileSite"
).click(function(){$.cookie(
"preventMobileRedirect"
,null);});}}