
(function($){$.fn.kwicks=function(options){var defaults={isVertical:false,sticky:false,defaultKwick:0,event:'mouseover',spacing:0,duration:500};var o=$.extend(defaults,options);var WoH=(o.isVertical?'height':'width');var LoT=(o.isVertical?'top':'left');return this.each(function(){container=$(this);var kwicks=container.children('li');var normWoH=kwicks.eq(0).css(WoH).replace(/px/,'');if(!o.max){o.max=(normWoH*kwicks.size())-(o.min*(kwicks.size()-1));}else{o.min=((normWoH*kwicks.size())-o.max)/(kwicks.size()-1);}
if(o.isVertical){container.css({width:kwicks.eq(0).css('width'),height:(normWoH*kwicks.size())+(o.spacing*(kwicks.size()-1))+'px'});}else{container.css({width:(normWoH*kwicks.size())+(o.spacing*(kwicks.size()-1))+'px',height:kwicks.eq(0).css('height')});}
var preCalcLoTs=[];for(i=0;i<kwicks.size();i++){preCalcLoTs[i]=[];for(j=1;j<kwicks.size()-1;j++){if(i==j){preCalcLoTs[i][j]=o.isVertical?j*o.min+(j*o.spacing):j*o.min+(j*o.spacing);}else{preCalcLoTs[i][j]=(j<=i?(j*o.min):(j-1)*o.min+o.max)+(j*o.spacing);}}}
kwicks.each(function(i){var kwick=$(this);if(i===0){kwick.css(LoT,'0px');}
else if(i==kwicks.size()-1){kwick.css(o.isVertical?'bottom':'right','0px');}
else{if(o.sticky){kwick.css(LoT,preCalcLoTs[o.defaultKwick][i]);}else{kwick.css(LoT,(i*normWoH)+(i*o.spacing));}}
if(o.sticky){if(o.defaultKwick==i){kwick.css(WoH,o.max+'px');kwick.addClass('active');}else{kwick.css(WoH,o.min+'px');}}
kwick.css({margin:0,position:'absolute'});kwick.bind(o.event,function(){var prevWoHs=[];var prevLoTs=[];kwicks.stop().removeClass('active');for(j=0;j<kwicks.size();j++){prevWoHs[j]=kwicks.eq(j).css(WoH).replace(/px/,'');prevLoTs[j]=kwicks.eq(j).css(LoT).replace(/px/,'');}
var aniObj={};aniObj[WoH]=o.max;var maxDif=o.max-prevWoHs[i];var prevWoHsMaxDifRatio=prevWoHs[i]/maxDif;kwick.addClass('active').animate(aniObj,{step:function(now){var percentage=maxDif!=0?now/maxDif-prevWoHsMaxDifRatio:1;kwicks.each(function(j){if(j!=i){kwicks.eq(j).css(WoH,prevWoHs[j]-((prevWoHs[j]-o.min)*percentage)+'px');}
if(j>0&&j<kwicks.size()-1){kwicks.eq(j).css(LoT,prevLoTs[j]-((prevLoTs[j]-preCalcLoTs[i][j])*percentage)+'px');}});},duration:o.duration,easing:o.easing});});});if(!o.sticky){container.bind("mouseleave",function(){var prevWoHs=[];var prevLoTs=[];kwicks.removeClass('active').stop();for(i=0;i<kwicks.size();i++){prevWoHs[i]=kwicks.eq(i).css(WoH).replace(/px/,'');prevLoTs[i]=kwicks.eq(i).css(LoT).replace(/px/,'');}
var aniObj={};aniObj[WoH]=normWoH;var normDif=normWoH-prevWoHs[0];kwicks.eq(0).animate(aniObj,{step:function(now){var percentage=normDif!=0?(now-prevWoHs[0])/normDif:1;for(i=1;i<kwicks.size();i++){kwicks.eq(i).css(WoH,prevWoHs[i]-((prevWoHs[i]-normWoH)*percentage)+'px');if(i<kwicks.size()-1){kwicks.eq(i).css(LoT,prevLoTs[i]-((prevLoTs[i]-((i*normWoH)+(i*o.spacing)))*percentage)+'px');}}},duration:o.duration,easing:o.easing});});}});};})(jQuery);function my_kwicks(){$('.kwicks').kwicks({duration:300,max:200,spacing:0});}
$(document).ready(function(){my_kwicks();});function posTop(){return typeof window.pageYOffset!='undefined'?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;}
function posLeft(){return typeof window.pageXOffset!='undefined'?window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0;}
function ajax_lightbox(postId){var ajaxRequest;var lightbox=document.getElementById('lightbox');$('#lightbox').html("<a onclick='hideLightbox("+posLeft()+","+posTop()+")' style='display:block;width:100%;height:100%;cursor:default;z-index:1001;'></a>").css({display:"inherit"});window.scroll(173,0);$('#lightbox_loading').css({display:"inherit"});$.ajax({type:"GET",data:"postId="+postId+"&windowXPosition="+posLeft()+"&windowYPosition="+posTop(),url:"http://theneverstill.com/ajax/slideshow_lightbox.php",dataType:"text",success:function(text){if($('#lightbox').css("display")==="inherit"){$('#lightbox_loading').css({display:"none"});$('#lightbox_window').css({display:"inherit"});$('#lightbox_contents').html(text).css({display:"inherit"});}}});};function ajax_tags(postId){$('#lightbox').html("<a onclick='hideLightbox("+posLeft()+","+posTop()+")' style='display:block;width:100%;height:100%;cursor:default;z-index:1001;'></a>").css({display:"inherit"});window.scroll(173,0);$('#lightbox_loading').css({display:"inherit"});$.ajax({type:"GET",data:"postId="+postId,url:"http://theneverstill.com/ajax/lightbox_tags.php",dataType:"text",success:function(text){if($('#lightbox').css("display")==="inherit"){$('#lightbox_loading').css({display:"none"});$('#lightbox_window').css({display:"inherit"});$('#lightbox_contents').html(text).css({display:"inherit"});}}});};function ajax_subscribe(postId){$('#lightbox').html("<a onclick='hideLightbox("+posLeft()+","+posTop()+")' style='display:block;width:100%;height:100%;cursor:default;z-index:1001;'></a>").css({display:"inherit"});window.scroll(173,0);$('#lightbox_loading').css({display:"inherit"});$.ajax({type:"GET",data:"postId="+postId,url:"http://theneverstill.com/ajax/lightbox_subscribe.php",dataType:"text",success:function(text){if($('#lightbox').css("display")==="inherit"){$('#lightbox_loading').css({display:"none"});$('#lightbox_window').css({display:"inherit"});$('#lightbox_contents').html(text).css({display:"inherit"});}}});};function ajax_share(postId){$('#lightbox').html("<a onclick='hideLightbox("+posLeft()+","+posTop()+")' style='display:block;width:100%;height:100%;cursor:default;z-index:1001;'></a>").css({display:"inherit"});window.scroll(173,0);$('#lightbox_loading').css({display:"inherit"});$.ajax({type:"GET",data:"postId="+postId,url:"http://theneverstill.com/ajax/lightbox_share.php",dataType:"text",success:function(text){if($('#lightbox').css("display")==="inherit"){$('#lightbox_loading').css({display:"none"});$('#lightbox_window').css({display:"inherit"});$('#lightbox_contents').html(text).css({display:"inherit"});}}});};function ajax_comments(postId){$('#lightbox').html("<a onclick='hideLightbox("+posLeft()+","+posTop()+")' style='display:block;width:100%;height:100%;cursor:default;z-index:1001;'></a>").css({display:"inherit"});window.scroll(173,0);$('#lightbox_window').css({display:"inherit"});if($('#lightbox_comments').hasClass('loaded')){$('#lightbox_comments').css({display:"inherit"});}
else{$('#lightbox_comments').css({backgroundImage:"url(http://theneverstill.com/images/loading_circle.gif) no-repeat center;",minHeight:"100px",display:"inherit"}).addClass('loaded');$.ajax({type:"GET",url:"http://theneverstill.com/ajax/lightbox_comments.php",dataType:"html",success:function(html){$('#lightbox_comments').html(html);}});}};function spreadIn(id)
{$('#'+id+'Left').stop(true).animate({left:"40px",opacity:1.0},175,'linear');$('#'+id+'Right').stop(true).animate({right:"40px",opacity:1.0},175,'linear');}
function spreadOut(id)
{$('#'+id+'Left').animate({left:"32px",opacity:0.75},175,'linear');$('#'+id+'Right').animate({right:"32px",opacity:0.75},175,'linear');}
function jiggleLeft(id)
{$('#'+id).stop(true).animate({marginLeft:"0px",marginRight:"10px"},100,'linear');$('#'+id).animate({marginLeft:"5px",marginRight:"5px"},100,'linear');}
function jiggleRight(id)
{$('#'+id).animate({marginRight:"0px",marginLeft:"10px"},100,'linear');$('#'+id).animate({marginRight:"5px",marginLeft:"5px"},100,'linear');}
$('#slider_tab').stop(true).hover(function(){$(this).stop(true).animate({marginTop:"0px"},250,'linear');},function(){$(this).stop(true).animate({marginTop:"-65px"},250,'linear');});function showImage(id)
{$('#'+id).stop(true).animate({opacity:0},0);}
function hideImage(id)
{$('#'+id).stop(true).animate({opacity:0.30},0);}
window.onload=Slider_EnableButtons;function Slider_EnableButtons(){$('#slider_nextButton').click(function(){Slider_CreatePage("previous",Slider_GetCurrentPost()+1);$('.slider_nextPage').animate({left:"0px"},300,'linear');$('.slider_currentPage').animate({left:"-902px"},300,'linear');$('#slider_nextButton').remove();$('#slider_previousButton').remove();setTimeout(function(){$('#slider_currentPost').width((Slider_GetCurrentPost()+1));$('#slider_page'+(Slider_GetCurrentPost()-2)).remove();$('#slider_page'+(Slider_GetCurrentPost()-1)).removeClass('slider_currentPage').addClass('slider_previousPage').html(Slider_CreateBlankPage());$('#slider_page'+Slider_GetCurrentPost()).removeClass('slider_nextPage').addClass('slider_currentPage');$('#slider_slideArea').append('<ul id="slider_page'+(Slider_GetCurrentPost()+1)+'" class="slider_nextPage">'+Slider_CreateBlankPage()+'</ul>');$('#slider_tabTop').html('<p>Showing '+((Slider_GetCurrentPost()-1)*Slider_GetPostsPerPage()+1)+'-'+Math.floor((Slider_GetCurrentPost()*Slider_GetPostsPerPage()),$('#slider_totalPosts').width())+' of '+$('#slider_totalPosts').width()+' Posts</p>');if($('#slider_nextButtonLi').length===1){$('#slider_nextArea').html($('#slider_nextButtonLi').html());$('#slider_previousArea').html($('#slider_previousButtonLi').html());$('#slider_nextButtonLi').remove();$('#slider_previousButtonLi').remove();Slider_EnableButtons();}},300);return false;}).hover(function(){$(this).css({backgroundPosition:"-32px 0px"});},function(){$(this).css({backgroundPosition:"0px 0px"});}).mousedown(function(){$(this).css({backgroundPosition:"-64px 0px"});});$('#slider_previousButton').click(function(){Slider_CreatePage("next",Slider_GetCurrentPost()-1);$('.slider_previousPage').animate({left:"0px"},300,'linear');$('.slider_currentPage').animate({left:"902px"},300,'linear');$('#slider_nextButton').remove();$('#slider_previousButton').remove();setTimeout(function(){$('#slider_currentPost').width((Slider_GetCurrentPost()-1));$('#slider_page'+(Slider_GetCurrentPost()+2)).remove();$('#slider_page'+(Slider_GetCurrentPost()+1)).removeClass('slider_currentPage').addClass('slider_nextPage').html(Slider_CreateBlankPage());$('#slider_page'+Slider_GetCurrentPost()).removeClass('slider_previousPage').addClass('slider_currentPage');$('#slider_slideArea').append('<ul id="slider_page'+(Slider_GetCurrentPost()-1)+'" class="slider_previousPage">'+Slider_CreateBlankPage()+'</ul>');$('#slider_tabTop').html('<p>Showing '+((Slider_GetCurrentPost()-1)*Slider_GetPostsPerPage()+1)+'-'+(Slider_GetCurrentPost()*Slider_GetPostsPerPage())+' of '+$('#slider_totalPosts').width()+' Posts</p>');if($('#slider_nextButtonLi').length===1){$('#slider_nextArea').html($('#slider_nextButtonLi').html());$('#slider_previousArea').html($('#slider_previousButtonLi').html());$('#slider_nextButtonLi').remove();$('#slider_previousButtonLi').remove();Slider_EnableButtons();}},300);return false;}).hover(function(){$(this).css({backgroundPosition:"-32px 0px"});},function(){$(this).css({backgroundPosition:"0px 0px"});}).mousedown(function(){$(this).css({backgroundPosition:"-64px 0px"});});}
function Slider_getPageSliderPosition(){return parseInt(document.getElementById('slider_slideArea').style.marginLeft,10);}
function Slider_CreateBlankPage(){return'<li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postCenter"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li>';}
function Slider_GetCurrentPost(){return($('#slider_currentPost').width());}
function Slider_GetPostsPerPage(){if($('#slider_slideArea').height()===185){return 3;}
else if($('#slider_slideArea').height()===557){return 9;}}
function Slider_CreatePage(desiredPage,sliderNextPageNumber){$.ajax({type:"GET",data:"sliderNextPageNumber="+sliderNextPageNumber+"&postsPerPage="+Slider_GetPostsPerPage(),url:"http://theneverstill.com/ajax/slider/create_page.php",dataType:"html",success:function(html){$('#slider_page'+sliderNextPageNumber).html(html);if(desiredPage==='next'){Slider_CreateNextPage();}
else{Slider_CreatePreviousPage();}}});}
function Slider_CreateNextPage(){if($('#slider_page'+(Slider_GetCurrentPost()+1)).length===1){$('#slider_nextArea').html($('#slider_nextButtonLi').html());$('#slider_previousArea').html($('#slider_previousButtonLi').html());$('#slider_nextButtonLi').remove();$('#slider_previousButtonLi').remove();Slider_EnableButtons();}}
function Slider_CreatePreviousPage(){if($('#slider_page'+(Slider_GetCurrentPost()-1)).length===1){$('#slider_nextArea').html($('#slider_nextButtonLi').html());$('#slider_previousArea').html($('#slider_previousButtonLi').html());$('#slider_nextButtonLi').remove();$('#slider_previousButtonLi').remove();Slider_EnableButtons();}}
function Slider_ChangePostsPerPage(postsPerPage,slider_totalPosts){if(postsPerPage===3)
{$('#slider').height(185+"px");$('#slider_previousArea').height(185+"px").css({paddingTop:'77px'});$('#slider_viewArea').height(185+"px");$('#slider_slideArea').height(185+"px");$('#slider_nextArea').height(185+"px").css({paddingTop:'77px'});$('#slider_slideArea').html('<ul id="slider-page-1"><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postCenter"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li></ul>').css({width:'902px',marginLeft:'0px'});$('#slider_tabTop').html('<p>Showing 1-3 of '+slider_totalPosts+' Posts</p>');$('#slider_tabBottom').html('<p><br />Show &nbsp; <a title = "View 3 Posts per Page">3</a> | <a class="slider_tabLinkUnderline" onclick = "Slider_ChangePostsPerPage(9,'+slider_totalPosts+')" title = "View 9 Posts per Page">9</a> &nbsp; Posts per Page</p>');$('#slider_tab').stop(true).css({marginTop:"-65px"});$('#slider_previousButton').css({backgroundPosition:"-96px 0px",cursor:'default'});if(-Slider_getPageSliderPosition()<=((Math.ceil($('#slider_totalPosts').width()/Slider_GetPostsPerPage())-2)*902))
{$('#slider_nextButton').css({backgroundPosition:"0px 0px",cursor:'pointer'});}
else{$('#slider_nextButton').css({backgroundPosition:"-96px 0px",cursor:'default'});}}
else if(postsPerPage===9)
{$('#slider').height(557+"px");$('#slider_previousArea').css({height:'557px',paddingTop:'263px'});$('#slider_viewArea').height(557+"px");$('#slider_slideArea').height(557+"px");$('#slider_nextArea').css({height:'557px',paddingTop:'263px'});$('#slider_slideArea').html('<ul id="slider-page-1"><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postCenter"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postCenter"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postCenter"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li><li class="slider_postSide"><div class="slider_postLoading"></div><div class="slider_postTitleBox"></div></li></ul>').css({width:'902px',marginLeft:'0px'});$('#slider_tabTop').html('<p>Showing 1-9 of '+slider_totalPosts+' Posts</p>');$('#slider_tabBottom').html('<p><br />Show &nbsp; <a class="slider_tabLinkUnderline" onclick = "Slider_ChangePostsPerPage(3,'+slider_totalPosts+')" title = "View 3 Posts per Page">3</a> | <a title = "View 9 Posts per Page">9</a> &nbsp; Posts per Page</p>');$('#slider_tab').stop(true).css({marginTop:"-65px"});$('#slider_previousButton').css({backgroundPosition:"-96px 0px",cursor:'default'});if(-Slider_getPageSliderPosition()<=((Math.ceil($('#slider_totalPosts').width()/Slider_GetPostsPerPage())-2)*902))
{$('#slider_nextButton').css({backgroundPosition:"0px 0px",cursor:'pointer'});}
else{$('#slider_nextButton').css({backgroundPosition:"-96px 0px",cursor:'default'});}}
$.ajax({type:"GET",data:"sliderNextPageNumber=1&postsPerPage="+postsPerPage,url:"http://theneverstill.com/ajax/slider/create_page.php",dataType:"text",success:function(text){$('#slider_page1').html(text);}});}
function hideLightbox(windowXPosition,windowYPosition)
{window.scroll(windowXPosition,windowYPosition);$('#lightbox').css({display:"none"});$('#lightbox_loading').css({display:"none"});$('#lightbox_window').css({display:"none"});$('#lightbox_contents').css({display:"none"});$('#lightbox_comments').css({display:"none"});}
function Slideshow_ChooseSlide(slideshow_desiredSlide){if(slideshow_desiredSlide!=='continue'){clearInterval(slideshow_autoChange);}
else{slideshow_desiredSlide='next';}
if($('#slideshow_chooseSlideArea_highlight').css('marginLeft').replace("px","")%30===0){var slideshow_currentSlide=($('#slideshow_chooseSlideArea_highlight').css('marginLeft').replace("px","")/30)+1;if(slideshow_desiredSlide==="next"){if(slideshow_currentSlide===5){slideshow_desiredSlide=1;}
else{slideshow_desiredSlide=slideshow_currentSlide+1;}}
else if(slideshow_desiredSlide==="previous"){if(slideshow_currentSlide===1){slideshow_desiredSlide=5;}
else{slideshow_desiredSlide=slideshow_currentSlide-1;}}
if(slideshow_desiredSlide!==slideshow_currentSlide){$('#slideshow_slide'+slideshow_currentSlide).animate({opacity:0},525,'linear',function(){$(this).css({display:"none"})});$('#slideshow_slide'+slideshow_desiredSlide).css({display:"inherit"}).animate({opacity:1},525,'linear');if(slideshow_desiredSlide<slideshow_currentSlide){$('#slideshow_chooseSlideArea_highlight').animate({marginLeft:((slideshow_desiredSlide-1)*30-10)+"px"},175,'linear').animate({marginLeft:((slideshow_desiredSlide-1)*30+5)+"px"},175,'linear').animate({marginLeft:((slideshow_desiredSlide-1)*30)+"px"},175,'linear');}
else if(slideshow_desiredSlide>slideshow_currentSlide){$('#slideshow_chooseSlideArea_highlight').animate({marginLeft:((slideshow_desiredSlide-1)*30+10)+"px"},175,'linear').animate({marginLeft:((slideshow_desiredSlide-1)*30-5)+"px"},175,'linear').animate({marginLeft:((slideshow_desiredSlide-1)*30)+"px"},175,'linear');}}}}
