(function(n,i,k){i.infinitescroll=function z(C,E,D){this.element=i(D);this._create(C,E)};i.infinitescroll.defaults={loading:{finished:k,finishedMsg:"<span>No more Posts.</span>",img:"http://sirgeorge.org/sg3/wp-content/themes/sg3/bin/images/loading_black.gif",msg:null,msgText:"<span>Loading content</span>",selector:null,speed:0,start:k},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:k,debug:false,behavior:k,binder:i(n),nextSelector:"#navigation a.next",navSelector:"#navigation",contentSelector:null,extraScrollPx:0,itemSelector:"#thumbs .thumb",animate:false,pathParse:k,dataType:"html",appendCallback:true,bufferPx:320,errorCallback:function(){},infid:0,pixelsFromNavToBottom:k,path:k};i.infinitescroll.prototype={_binding:function g(E){var C=this,D=C.options;D.v="2.0b2.111027";if(!!D.behavior&&this["_binding_"+D.behavior]!==k){this["_binding_"+D.behavior].call(this);return}if(E!=="bind"&&E!=="unbind"){this._debug("Binding value  "+E+" not valid");return false}if(E=="unbind"){(this.options.binder).unbind("smartscroll.infscr."+C.options.infid)}else{(this.options.binder)[E]("smartscroll.infscr."+C.options.infid,function(){C.scroll()})}this._debug("Binding",E)},_create:function s(C,G){if(!this._validate(C)){return false}var D=this.options=i.extend(true,{},i.infinitescroll.defaults,C),F=/(.*?\/\/).*?(\/.*)/,E=i(D.nextSelector).attr("href");D.contentSelector=D.contentSelector||this.element;D.loading.selector=D.loading.selector||D.contentSelector;if(!E){this._debug("Navigation selector not found");return}D.path=this._determinepath(E);D.loading.msg=i('<div id="loading"><img alt="Loading..." src="'+D.loading.img+'" /><div>'+D.loading.msgText+"</div></div>");(new Image()).src=D.loading.img;D.pixelsFromNavToBottom=i(document).height()-i(D.navSelector).offset().top;D.loading.start=D.loading.start||function(){i(D.navSelector).hide();D.loading.msg.appendTo(D.loading.selector).show(D.loading.speed,function(){beginAjax(D)})};D.loading.finished=D.loading.finished||function(){D.loading.msg.fadeOut("normal")};D.callback=function(H,I){if(!!D.behavior&&H["_callback_"+D.behavior]!==k){H["_callback_"+D.behavior].call(i(D.contentSelector)[0],I)}if(G){G.call(i(D.contentSelector)[0],I,D)}};this._setup()},_debug:function p(){if(this.options&&this.options.debug){return n.console&&console.log.call(console,arguments)}},_determinepath:function A(D){var C=this.options;if(!!C.behavior&&this["_determinepath_"+C.behavior]!==k){this["_determinepath_"+C.behavior].call(this,D);return}if(!!C.pathParse){this._debug("pathParse manual");return C.pathParse(D,this.options.state.currPage+1)}else{if(D.match(/^(.*?)\b2\b(.*?$)/)){D=D.match(/^(.*?)\b2\b(.*?$)/).slice(1)}else{if(D.match(/^(.*?)2(.*?$)/)){if(D.match(/^(.*?page=)2(\/.*|$)/)){D=D.match(/^(.*?page=)2(\/.*|$)/).slice(1);return D}D=D.match(/^(.*?)2(.*?$)/).slice(1)}else{if(D.match(/^(.*?page=)1(\/.*|$)/)){D=D.match(/^(.*?page=)1(\/.*|$)/).slice(1);return D}else{this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");C.state.isInvalidPage=true}}}}this._debug("determinePath",D);return D},_error:function u(D){var C=this.options;if(!!C.behavior&&this["_error_"+C.behavior]!==k){this["_error_"+C.behavior].call(this,D);return}if(D!=="destroy"&&D!=="end"){D="unknown"}this._debug("Error",D);if(D=="end"){this._showdonemsg()}C.state.isDone=true;C.state.currPage=1;C.state.isPaused=false;this._binding("unbind")},_loadcallback:function c(G,H){var F=this.options,J=this.options.callback,C=(F.state.isDone)?"done":(!F.appendCallback)?"no-append":"append",I;if(!!F.behavior&&this["_loadcallback_"+F.behavior]!==k){this["_loadcallback_"+F.behavior].call(this,G,H);return}switch(C){case"done":this._showdonemsg();return false;break;case"no-append":if(F.dataType=="html"){H="<div>"+H+"</div>";H=i(H).find(F.itemSelector)}break;case"append":var E=G.children();if(E.length==0){return this._error("end")}I=document.createDocumentFragment();while(G[0].firstChild){I.appendChild(G[0].firstChild)}this._debug("contentSelector",i(F.contentSelector)[0]);i(F.contentSelector)[0].appendChild(I);H=E.get();break}F.loading.finished.call(i(F.contentSelector)[0],F);if(F.animate){var D=i(n).scrollTop()+i("#loading").height()+F.extraScrollPx+"px";i("html,body").animate({scrollTop:D},800,function(){F.state.isDuringAjax=false})}if(!F.animate){F.state.isDuringAjax=false}J(this,H)},_nearbottom:function t(){var D=this.options,C=0+i(document).height()-(D.binder.scrollTop())-i(n).height();if(!!D.behavior&&this["_nearbottom_"+D.behavior]!==k){return this["_nearbottom_"+D.behavior].call(this)}this._debug("math:",C,D.pixelsFromNavToBottom);return(C-D.bufferPx<D.pixelsFromNavToBottom)},_pausing:function l(D){var C=this.options;if(!!C.behavior&&this["_pausing_"+C.behavior]!==k){this["_pausing_"+C.behavior].call(this,D);return}if(D!=="pause"&&D!=="resume"&&D!==null){this._debug("Invalid argument. Toggling pause value instead")}D=(D&&(D=="pause"||D=="resume"))?D:"toggle";switch(D){case"pause":C.state.isPaused=true;break;case"resume":C.state.isPaused=false;break;case"toggle":C.state.isPaused=!C.state.isPaused;break}this._debug("Paused",C.state.isPaused);return false},_setup:function q(){var C=this.options;if(!!C.behavior&&this["_setup_"+C.behavior]!==k){this["_setup_"+C.behavior].call(this);return}this._binding("bind");return false},_showdonemsg:function a(){var C=this.options;if(!!C.behavior&&this["_showdonemsg_"+C.behavior]!==k){this["_showdonemsg_"+C.behavior].call(this);return}C.loading.msg.find("img").hide().parent().find("div").html(C.loading.finishedMsg).animate({opacity:1},2000,function(){i(this).parent().fadeOut("normal")});C.errorCallback.call(i(C.contentSelector)[0],"done")},_validate:function v(D){for(var C in D){if(C.indexOf&&C.indexOf("Selector")>-1&&i(D[C]).length===0){this._debug("Your "+C+" found no elements.");return false}return true}},bind:function o(){this._binding("bind")},destroy:function B(){this.options.state.isDestroyed=true;return this._error("destroy")},pause:function e(){this._pausing("pause")},resume:function h(){this._pausing("resume")},retrieve:function b(I){var J=this,D=J.options,L=D.path,F,K,M,C,E,I=I||null,H=(!!I)?I:D.state.currPage;beginAjax=function G(N){N.state.currPage++;J._debug("heading into ajax",L);F=i(N.contentSelector).is("table")?i("<tbody/>"):i("<div/>");M=L.join(N.state.currPage);C=(N.dataType=="html"||N.dataType=="json")?N.dataType:"html+callback";if(N.appendCallback&&N.dataType=="html"){C+="+callback"}switch(C){case"html+callback":J._debug("Using HTML via .load() method");F.load(M+" "+N.itemSelector,null,function O(P){J._loadcallback(F,P)});break;case"html":case"json":J._debug("Using "+(C.toUpperCase())+" via $.ajax() method");i.ajax({url:M,dataType:N.dataType,complete:function O(P,Q){E=(typeof(P.isResolved)!=="undefined")?(P.isResolved()):(Q==="success"||Q==="notmodified");(E)?J._loadcallback(F,P.responseText):J._error("end")}});break}};if(!!D.behavior&&this["retrieve_"+D.behavior]!==k){this["retrieve_"+D.behavior].call(this,I);return}if(D.state.isDestroyed){this._debug("Instance is destroyed");return false}D.state.isDuringAjax=true;D.loading.start.call(i(D.contentSelector)[0],D)},scroll:function f(){var C=this.options,D=C.state;if(!!C.behavior&&this["scroll_"+C.behavior]!==k){this["scroll_"+C.behavior].call(this);return}if(D.isDuringAjax||D.isInvalidPage||D.isDone||D.isDestroyed||D.isPaused){return}if(!this._nearbottom()){return}this.retrieve()},toggle:function y(){this._pausing()},unbind:function m(){this._binding("unbind")},update:function j(C){if(i.isPlainObject(C)){this.options=i.extend(true,this.options,C)}}};i.fn.infinitescroll=function d(E,F){var D=typeof E;switch(D){case"string":var C=Array.prototype.slice.call(arguments,1);this.each(function(){var G=i.data(this,"infinitescroll");if(!G){return false}if(!i.isFunction(G[E])||E.charAt(0)==="_"){return false}G[E].apply(G,C)});break;case"object":this.each(function(){var G=i.data(this,"infinitescroll");if(G){G.update(E)}else{i.data(this,"infinitescroll",new i.infinitescroll(E,F,this))}});break}return this};var x=i.event,r;x.special.smartscroll={setup:function(){i(this).bind("scroll",x.special.smartscroll.handler)},teardown:function(){i(this).unbind("scroll",x.special.smartscroll.handler)},handler:function(F,C){var E=this,D=arguments;F.type="smartscroll";if(r){clearTimeout(r)}r=setTimeout(function(){i.event.handle.apply(E,D)},C==="execAsap"?0:100)}};i.fn.smartscroll=function(C){return C?this.bind("smartscroll",C):this.trigger("smartscroll",["execAsap"])}})(window,jQuery);(function(a){a.fn.hint=function(b){if(!b){b="blur"}return this.each(function(){var g=a(this),e=g.attr("title"),d=a(this.form),f=a(window);function c(){if(g.val()===e&&g.hasClass(b)){g.val("").removeClass(b)}}if(e){g.blur(function(){if(this.value===""){g.val(e).addClass(b)}}).focus(c).blur();d.submit(c);f.unload(c)}})}})(jQuery);jQuery.fn.Init=function(){$("a").each(function(){if(this.href.indexOf(location.hostname)===-1){$(this).attr("target","_blank")}});$("#logo").mouseenter(function(){$(".overlay",this).css("display","block")});$("#logo").mouseleave(function(){$(".overlay",this).fadeOut("fast")});$("#thumbs .thumb").mouseenter(function(){$(".overlay",this).css("display","block")});$("#thumbs .thumb").mouseleave(function(){$(".overlay",this).fadeOut("fast")});var b=$("#content");function a(){if(typeof window.history.pushState==="function"){window.history.pushState(null,null,"/")}b.hide().find("article").html("")}$("#thumbs .thumb").live("click",function(){var d=$(this).find("h1 a").attr("href");if($("html").hasClass("ie7")||$("html").hasClass("ie8")){window.location=d;return false}else{$("#content").show(0,function(){c(d);if(navigator.userAgent.match(/Mobile/i)&&navigator.userAgent.match(/Safari/i)){$("html, body").animate({scrollTop:0},"fast")}})}});$(".thumb a").click(function(d){d.preventDefault()});function c(d){if(typeof window.history.pushState==="function"){window.history.pushState(null,null,d)}b.addClass("loading").find("article").html("").load(d+"/ article",function(f,e,g){if(e==="success"){b.removeClass("loading");return true}else{if(e==="error"){alert("There was a problem loading the content.");a();return false}}})}$("#content .close").show();$("#content .close").click(function(){a();return false});$(document.documentElement).keyup(function(d){if(d.keyCode==27){a()}});if(navigator.userAgent.match(/Mobile/i)&&navigator.userAgent.match(/Safari/i)){$(".gallery .thumb").find(".overlay").remove()}else{$(".gallery .thumb").live("click",function(){var d=$(this).find("a").attr("href");if($(this).hasClass("large")){$(this).find(".overlay a").html("zoom in +");$(this).find("img").attr("width","320");$(this).find("img").attr("height","320");$(this).removeClass("large")}else{$(this).find(".overlay a").html("zoom out -");$(this).find("img").attr("src",d);$(this).find("img").attr("width","640");$(this).find("img").attr("height","640");$(this).addClass("large")}})}$("#thumbs").infinitescroll({itemSelector:"#thumbs .thumb"},function(d){$(d).Init()});$('input[title!=""]').hint();$(window).scroll(function(){if($(this).scrollTop()>100){$("#top").fadeIn()}else{$("#top").fadeOut()}});$("#top a").click(function(){$("body, html").animate({scrollTop:0},300);return false});if(navigator.userAgent.match(/Mobile/i)&&navigator.userAgent.match(/Safari/i)){$("#content").css({height:$(document).height(),position:"absolute"})}};$(document).ready().Init();function popup(b){w=window.open(b,"Share","width=600,height=400,resizable=yes");w.focus();return false};
