
var alltheboxe,curBox,nextBox,prevBox;jQuery(document).ready(function($){alltheboxes=$("li.block");firstBox=alltheboxes.filter(':first');curBox=alltheboxes.filter(':first');nextBox=curBox.nextAll('li.block:first');prevBox=alltheboxes.filter(':last');alltheboxes.bind('nova.scrollto',function(){$(this).trigger('nova.setCurrent');$.scrollTo(curBox,3500,{axis:'x'});return false;}).bind('nova.setCurrent',function(){curBox.removeClass('current prev next');curBox=$(this);curBox.addClass('current');nextBox.removeClass('next');nextBox=curBox.nextAll('li.block:first');if(nextBox.length==0){nextBox=alltheboxes.filter(':first');}
prevBox.removeClass('prev');prevBox=curBox.prevAll('li.block:first');if(prevBox.length==0){prevBox=alltheboxes.filter(':last');}
nextBox.addClass('next');prevBox.addClass('prev');});$(window).scroll(function(e){var scrollLeft=$(window).scrollLeft();var leftMostItem=$(alltheboxes[0]);alltheboxes.each(function(){var p=$(this).position();if(p.left>scrollLeft){return false;}
leftMostItem=$(this);});leftMostItem.trigger('nova.setCurrent');});$('#NavNext').click(function(){nextBox.trigger('nova.scrollto');});$('#NavPrev').click(function(){prevBox.trigger('nova.scrollto');});$('#NavStart').click(function(){$.scrollTo(0,3500,{axis:'x'});});$.scrollTo(0,0,{axis:'x'});function checkKey(e){switch(e.keyCode){case 37:prevBox.trigger('nova.scrollto');return false;break;case 39:nextBox.trigger('nova.scrollto');return false;break;default:}}
if($.browser.mozilla){$(document).keypress(checkKey);}else{$(document).keydown(checkKey);}
$('.sidebarlinkLI').find('a.sidelink').click(function(){$.scrollTo($("h2:contains('"+$(this).attr('id')+"')"),3500,{axis:'x'});return false;});var DSW=$.cookie('DailyStory_Welcome');if(DSW===null){$.cookie('DailyStory_Welcome','firstvisit');GB_show();return false;}
if(DSW='visited'){$.cookie('DailyStory_Welcome','visited');return false;}});function StoryGoToLeft(){prevBox.trigger('nova.scrollto');}
function StoryGoToRight(){nextBox.trigger('nova.scrollto');}
$(document).ready(function(){$(document).pngFix();$('#NavNext').tipsy({gravity:'e',fade:true});$('#NavPrev').tipsy({gravity:'w',fade:true});$('#NavStart').tipsy({gravity:'n',fade:true});$('#NavIndex').tipsy({gravity:'n',fade:true});$('.sidelink').tipsy({gravity:'w',fade:true});$('.post-edit-link').tipsy({gravity:'w',fade:true});$('.archivelink').tipsy({gravity:'e',fade:true});$('.external').tipsy({gravity:'s',fade:true});});$('#randombutton').click(function(){window.open('http://dailystory.ideaprison.com/?random');return false;});