$(document).ready(bar_nav_overflow_chk);var bar_nav_overflow=0;function bar_nav_overflow_chk(){if(bar_nav_overflow){return;}
var bars=$('p.bar_nav').get();for(var bar in bars){if($(bars[bar]).css('background-image')=='none'){continue;}
var last_son=$(':last-child',bars[bar]).get(0);var lsp=$(last_son).position();if(lsp.top>15){var sons=$('a,b',bars[bar]).get();var sele=document.createElement('select');for(var son in sons)
{var oe=document.createElement('option');if(sons[son].nodeName.toUpperCase()=='A'){oe.innerHTML=sons[son].innerHTML;oe.value=sons[son].href;oe.selected=false;}else{oe.innerHTML=sons[son].innerHTML;oe.value='';oe.selected=true;}
sele.appendChild(oe);}
$(bars[bar]).html('');bars[bar].appendChild(sele);$(sele).change(function(){if(this.value){window.location=this.value;}});bar_nav_overflow=1;}}}
function style_init(){if(navigator.userAgent.indexOf("MSIE")!=-1){return;}
if($.cookie('bpstyle_'+user_tag)=='wide'){$('#main_content').addClass('wide_main');}else{$('#main_content').removeClass('wide_main');}
$('#style_controls').append('<span title="click to toggle maximum width" class="tooltip_below">wide view</span>').click(function(){if($('#main_content').toggleClass('wide_main').hasClass('wide_main')){$.cookie('bpstyle_'+user_tag,'wide',{path:'/',expires:(user_in)?14:0})}else{$.cookie('bpstyle_'+user_tag,'skinny',{path:'/',expires:(user_in)?14:0})}bar_nav_overflow_chk();});}
function sidebar_init(){$('#sidebar').prepend('<ul id="sidebar_controls"></ul>');$('#sidebar_controls').prepend('<li>Hide</li>').click(function(){sidebar_collapse()});}
function sidebar_expand(){$('div.main_without_sidebar').addClass('main_with_sidebar').removeClass('main_without_sidebar');$('#sidebar').show();}
function sidebar_collapse(){$('#sidebar').hide();$('div.main_with_sidebar').addClass('main_without_sidebar').removeClass('main_with_sidebar');}
function photopage_credit(){$('div.photo_page p.photo_credit').css('width',$('div.photo_page img').attr('width')+'px');}
function fix_ie(){if($("input[type='text']").css('background-image')=='none'){$("textarea, input[type='text'], input[type='password']").addClass('ie_text');$("input[type='submit'], input[type='button']").addClass('ie_button');}}
function show_search_options(){$('#search ul li ul').show(200);}