(function(){var E=0;var I=41;var A=0;var F=1;var M=0.5;var N=0.025;var O=new Array();var H=0;var B=false;var K=false;jQuery.noConflict();Array.prototype.shuffle=function(){var S=this.length;while(S){var Q=Math.floor(Math.random()*S);var R=this[--S];this[S]=this[Q];this[Q]=R}return this};var L=function(Q){jQuery("#postscount").text([Q,(Q>1?" photos":" photo")].join(""))};var G=function(){if(!jQuery(".highslide-wrapper").length){return false}var Q=jQuery(".highslide-wrapper:eq(0)");jQuery(".highslide-wrapper").each(function(){Q=jQuery(this).css("z-index")>Q.css("z-index")?jQuery(this):Q});return Q};var D=function(){jQuery("#keyhelp").css("opacity",0.8).toggle()};var J=function(){jQuery(document).bind((jQuery.browser.opera?"keypress":"keydown"),function(S){var Q=S?S.keyCode:Q=event.keyCode;var T=String.fromCharCode(Q).toLowerCase();switch(T){case"s":jQuery(".highslide-wrapper:visible").length&&B?jQuery(".highslide-wrapper").hide():jQuery(".highslide-wrapper").show();break;case"w":jQuery("#header:visible").length&&B?jQuery("#header, #content, #footer, #keyhelp, .bloglink").hide():jQuery("#header, #content, #footer, .bloglink").show();break;case"d":if(G()&&B){var R=G().css("opacity")-0;if(R<F){G().css("opacity",R+N)}}break;case"e":if(B){jQuery(".highslide-wrapper").each(function(){var U=jQuery(this).css("opacity")-0;if(U<F){jQuery(this).css("opacity",U+N)}})}break;case"r":if(B){jQuery(".highslide-wrapper").css("opacity",F)}break;case"a":if(G()&&B){var R=G().css("opacity")-0;if(R>M){G().css("opacity",R-N)}}break;case"q":if(B){jQuery(".highslide-wrapper").each(function(){var U=jQuery(this).css("opacity")-0;if(U>M){jQuery(this).css("opacity",U-N)}})}break;case"n":jQuery("#next").click();break;case"h":if(B){D()}break;default:if(Q==27&&B){jQuery.each(hs.expanders,function(){this.close()})}break}})};var P=function(){jQuery(".loader img").show();var Q=["http://",tumblr_api_read.tumblelog["name"],".tumblr.com/api/read/json?type=photo&filter=text&start=",E,"&num=",I,"&callback=?"].join("");jQuery.getJSON(Q,function(R){jQuery(".loader img").hide();var S=R["posts-total"];E+=I;I=(E+I)>=S?(S%I):I;if(E<S){var T=jQuery(['<div id="next" class="wrap">',E,"<br />/",S,"<br /><br />next&nbsp;",I,"&nbsp;</div>"].join(""));T.click(function(){jQuery(this).remove();P()});T.hover(function(){jQuery(this).addClass("hoverover")},function(){jQuery(this).removeClass("hoverover")})}else{var T=jQuery('<div id="end">')}T.insertBefore(".loader");jQuery.each(R.posts,function(){var U=this["photo-caption"];var W=['<a class="link highslide" href="',this["photo-url-500"],'" title="',U,'" target="_blank" onclick="return hs.expand(this)">','<img class="thumb" src = "',this["photo-url-75"],'" />',"</a>"].join("");if(!B){W=[W,'<div class="highslide-caption">',U,"<br />",'<div id="captLink">','<a id="permalink" href="',this["url"],'">back to post</a>',"</div>","</div>"].join("")}var V=jQuery('<li class="item wrap">').append(W);V.hover(function(){jQuery(this).addClass("hoverover")},function(){jQuery(this).removeClass("hoverover")});V.insertBefore("#next ,#end")})});hs.updateAnchors()};var C=function(){jQuery(".loader img").show();var S=O[H];var R=(A-S)<I?A-S:I;var Q=["http://",tumblr_api_read.tumblelog["name"],".tumblr.com/api/read/json?type=photo&filter=text&start=",S,"&num=",R,"&callback=?"].join("");jQuery.getJSON(Q,function(T){jQuery(".loader img").hide();if(H<O.length){var U=jQuery(['<div id="next" class="wrap"><br />shuffle mode<br />next&nbsp;тЖТ<br /></div>'].join(""));U.click(function(){jQuery(this).remove();C()});U.hover(function(){jQuery(this).addClass("hoverover")},function(){jQuery(this).removeClass("hoverover")})}else{var U=jQuery('<div id="end">')}U.insertBefore(".loader");var V=T.posts.shuffle();jQuery.each(V,function(){var W=this["photo-caption"];var Y=['<a class="link highslide" href="',this["photo-url-500"],'" title="',W,'" target="_blank" onclick="return hs.expand(this)">','<img class="thumb" src = "',this["photo-url-75"],'" />',"</a>"].join("");if(!B){Y=[Y,'<div class="highslide-caption">',W,"<br />",'<div id="captLink">','<a id="permalink" href="',this["url"],'">back to post</a>',"</div>","</div>"].join("")}var X=jQuery('<li class="item wrap">').append(Y);X.hover(function(){jQuery(this).addClass("hoverover")},function(){jQuery(this).removeClass("hoverover")});X.insertBefore("#next ,#end")})});H++;hs.updateAnchors()};jQuery(function(){if(typeof (tumblr_api_read)=="undefined"){jQuery("#images").load("default.php")}else{if(jQuery.query.get("c")){B=true}if(jQuery.query.get("s")){K=true}if(jQuery.query.get("cs")||jQuery.query.get("sc")){B=true;K=true}if(B&&K){var S="collage & shuffle"}else{if(B){var S="collage"}else{if(K){var S="shuffle"}else{var S=""}}}jQuery("#postscount").show();jQuery(".defview").show();hs.numberOfImagesToPreload=5;if(B){hs.outlineType="";hs.showCredits=false;hs.enableKeyListener=false;jQuery("span.button").click(function(){D()})}else{hs.transitions=["expand","crossfade"];hs.fadeInOut=true;hs.align="center";hs.showCredits=false;hs.outlineType="glossy-dark";hs.dimmingOpacity = "0.5";if(hs.addSlideshow){hs.addSlideshow({interval:5000,repeat:false,useControls:true,fixedControls:false,overlayOptions:{opacity:0.75,position:"top right",hideOnMouseOut:true}})}}J();var R=tumblr_api_read.tumblelog["cname"]?tumblr_api_read.tumblelog["cname"]:[tumblr_api_read.tumblelog["name"],".tumblr.com"].join("");var Q=["nomarai.iraira.info/tumbview/",tumblr_api_read.tumblelog["name"]].join("");var U=['<a href="http://b.hatena.ne.jp/entry/http://',Q,'">','<img src="http://b.hatena.ne.jp/img/b_entry.gif" width="16" height="12" />',"</a>",'<a href="http://b.hatena.ne.jp/entry/http://',Q,'">','<img src="http://b.hatena.ne.jp/entry/image/http://',Q,'">',"</a>"].join("");jQuery(document).attr("title",[tumblr_api_read.tumblelog[""],"Image-Viewer",S].join(""));jQuery("#header h1").html(tumblr_api_read.tumblelog["title"]);jQuery("#header h2").html(['<a href="http://',R,'/" target="_blank">',R,"</a>"].join(""));jQuery("#header h3").html(U);jQuery("#images").append('<div class="loader"><img src = "http://dvmstream.com/preview/img/ajax-loader.gif" /></div>');L(tumblr_api_read["posts-total"]);if(tumblr_api_read.tumblelog["name"]!="undefined"){jQuery.ajax({url:"utrack.php",data:{user:tumblr_api_read.tumblelog["name"]}})}if(K){A=tumblr_api_read["posts-total"];var T=0;for(i=0;i<A;i+=I){O[T++]=i}O.shuffle();C()}else{P()}}})})();    