
jQuery.fn.labelify=function(settings){settings=jQuery.extend({text:"title",labelledClass:""},settings);var lookups={title:function(input){return $(input).attr("title");},label:function(input){return $("label[for="+input.id+"]").text();}};var lookup;var jQuery_labellified_elements=$(this);return $(this).each(function(){if(typeof settings.text==="string"){lookup=lookups[settings.text];}else{lookup=settings.text;};if(typeof lookup!=="function"){return;}
var lookupval=lookup(this);if(!lookupval){return;}
$(this).data("label",lookup(this).replace(/\n/g,''));$(this).focus(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(settings.labelledClass);}}).blur(function(){if(this.value===this.defaultValue){this.value=$(this).data("label");$(this).addClass(settings.labelledClass);}});var removeValuesOnExit=function(){jQuery_labellified_elements.each(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(settings.labelledClass);}})};$(this).parents("form").submit(removeValuesOnExit);$(window).unload(removeValuesOnExit);if(this.value!==this.defaultValue){return;}
this.value=$(this).data("label");$(this).addClass(settings.labelledClass);});};;(function($){$.fn.infinitescroll=function(options){var opts=$.extend({},$.fn.infinitescroll.defaults,options),props=$.fn.infinitescroll,relurl=/(.*?\/\/).*?(\/.*)/;path=$(opts.nextSelector).attr("href");if(null==path){path="invalid";}
path=path.match(relurl)?path.match(relurl)[2]:path;opts.contentSelector=opts.contentSelector||this;$.fn.infinitescroll.loadingMsg=$('<div id="infscr-loading" style="text-align: center;">'+opts.loadingText+'</div>');if(null!=path.match("page")){path=path.split("page");path[0]=path[0]+"page/";path[1]="/";}else{props.isInvalidPage=true;}
$(document).ajaxError(function(e,xhr,opt){if(404==xhr.status){props.isDone=true;}});$(window).scroll(function(){infscrSetup(path,opts,props);});return this;}
function isNearBottom(){var alltheway=$(document).height(),scrolling=$(window).scrollTop()+$(window).height()+20;return(scrolling>alltheway);}
function infscrSetup(path,opts,props){if(props.isDuringAjax||props.isInvalidPage||props.isDone)return;if(isNearBottom()){props.isDuringAjax=true;props.loadingMsg.appendTo(opts.contentSelector).show();props.currPage++;analyticsPath=path.join(props.currPage);$("<div/>").attr("id","infscr-page-"+props.currPage).attr("class","infscr-pages").appendTo(opts.contentSelector).load(path.join(props.currPage)+" "+opts.itemSelector,null,function(){if(props.isDone){props.loadingMsg.fadeOut("fast");$("#footer p:last").html(opts.donetext).fadeIn("slow");}else{props.loadingMsg.fadeOut("fast");}
opts.callback.call();props.isDuringAjax=false;});}}
$.extend($.fn.infinitescroll,{defaults:{debug:false,nextSelector:"",loadingText:"",donetext:"",navSelector:"",contentSelector:null,itemSelector:"",callback:function(){}},currPage:1,currDOMChunk:null,isDuringAjax:false,isInvalidPage:false,isDone:false});})(jQuery);(function($){$.fn.vertigro=function($max,$div){return this.filter('textarea').each(function(){var grow=function(e){if($max&&$div){if($(this).val().length>$max&&e.which!=8)
return false;$('#'+$div).html($max-$(this).val().length);}
if(this.clientHeight<this.scrollHeight)
$(this).height(this.scrollHeight
+(parseInt($(this).css('lineHeight').replace(/px$/,''))||20)
+'px');};$(this).css('overflow','hidden').keydown(grow).keyup(grow).change(grow);});};})(jQuery);jQuery.fn.imageScale=function(options){var defaults={scale:0.9,attr:{x:"data-width",y:"data-height"},container:{x:$(window).width(),y:$(window).height()},speed:100},options=$.extend({},defaults,options),max={x:parseInt(options.container.x*options.scale),y:parseInt(options.container.y*options.scale)};return this.each(function(){var $img=$(this),nat={x:$img.attr(options.attr.x),y:$img.attr(options.attr.y)},newHeight=max.x/(nat.x/nat.y),dimensions;if((nat.x>max.x)||(nat.y>max.y)){dimensions={"width":(newHeight>max.y)?"auto":max.x,"height":(newHeight>max.y)?max.y:"auto"};}else{dimensions={"width":"auto","height":"auto"};}
$img.css(dimensions);});}
if(top!=self){top.location.replace(self.location);}
var settings={focus:false,keyboardScrolling:false,imageSelector:"img:not(.static)",$page:$("html, body")};$(function(){$(settings.imageSelector).imageScale();$(window).resize(function(){$(settings.imageSelector).imageScale();});$(":text, input.email, input.url").labelify({labelledClass:"entering"});$("textarea").vertigro();$("#photos input[type='submit']").live("click",function(){commentSubmit($(this));return false;});$("#photos img").live("click",function(){$(this).annotate();});$("#header div p.intro").slidingPanel();$("#searchform input").keydown(function(e){if(13==e.keyCode){$(this).parents("form").submit();return false;}});$("#scroll a").click(function(){return scrollPhotos.go(($(this).attr("id")=="down")?1:-1);});$(".blogPost a[href='#comments']").live("click",function(){$(this).blur().slideToggle().parent().next().slideToggle();return false;});$("#photos").infinitescroll({navSelector:"#footer #navigationLinks",nextSelector:"#footer #navigationLinks a:last",itemSelector:".unit",loadingText:"Loading more photos",donetext:"No more photos",callback:function(){$(settings.imageSelector).imageScale();if(!settings.keyboardScrolling)scrollPhotos.go(1);settings.keyboardScrolling=false;_gaq.push(["_trackPageview",analyticsPath+"?method=AJAX"]);}});$(document).keydown(function(event){if(settings.focus)return true;switch(event.keyCode||event.which){case 74:return scrollPhotos.go(-1);case 75:return scrollPhotos.go(1);case 32:case 73:scrollPhotos.nearestImage(0).click();return false;}});$(":input, a").blur(function(){settings.focus=false;}).focus(function(){settings.focus=true;});});function commentSubmit($button){$button.addClass("commentSubmitting");var $mostRecent=$button.parents(".commentsContainer").children(".yourComment"),$noComment=$button.parents(".commentsContainer").children(".noComment"),author=$button.siblings(".author").val(),email=$button.siblings(".email").val(),url=$button.siblings(".url").val(),comment=$button.siblings(".comment").val(),ID=$button.siblings(".comment_post_ID").val();$.post("http://quis.cc/wp-comments-post-ajax.php",{author:author,email:email,url:url,comment:comment,comment_post_ID:ID},function(response){$(".error").hide(200);if("success"==response){$noComment.hide("slow");$mostRecent.before("<p class=\"incoming\"><span class=\"commentAuthor\">"+author+" says:</span> "+comment);}else{$mostRecent.after("<p class=\"error\">"+response+"</p>");$button.removeClass("commentSubmitting");}
$(".incoming").show("slow",function(){$button.removeClass("commentSubmitting");});});return false;}