"use strict";document.oncontextmenu=function(){return false};if(window.attachEvent){window.onunload=function(){var b=document.getElementsByTagName("*"),c=b.length,d,a;while(c){c-=1;d=b[c];for(a in d){d=null}}window.onresize=window.onunload=null}}(function(){var b=document.getElementById("search_input"),a="SEARCH";b.onfocus=b.onblur=function(c){var d=b.value;c=c||window.event;c=c.type==="focus";if(c&&d===a){b.value=""}else{if(!c&&!d){b.value=a}}}}());(function(){var b=window.location.href,a=document.getElementById("nav").getElementsByTagName("a"),c=a.length;while(c){c-=1;if(a[c].href===b){a[c].id="current_page";break}}}());var proportionalizer=(function(){var a={normal:function(b,d){var c=b.length;while(c){c-=1;b[c].style.paddingLeft=b[c].style.paddingRight=d}},no_edges:function(b,c){a.normal(b,c);b[b.length-1].style.paddingLeft=b[0].style.paddingRight=0}};return function(f,h){var c=f.getElementsByTagName("li"),b=f.offsetWidth,e=c.length,g=2,d;while(e){e-=1;d=g+c[e].offsetWidth;if(d>b){break}else{g=d}}e=c.length*2;e-=h?0:2;g=(b-g)/e+"px";h=h?"normal":"no_edges";a[h](c,g)}}());(function(a){var d=document.getElementById("nav"),c=d.getElementsByTagName("ul"),b=c.length;while(b){b-=1;a(c[b],true)}}(proportionalizer));function set_opacity(a,b){a.style.opacity=b;a.style.filer="alpha(opacity="+b*100+")"}function fancypants(m,r,o,u){var t=3000,w=1000,c=175,i=Math.ceil,e=Math.floor,h=Math.random,s=m.offsetWidth,v=m.offsetHeight,y=u.length,d=0,f=r*o,l=i(s/r),x=i(v/o),g=[],j=[],q=0,p=function(z){z+=1;return z===y?0:z},k=function(){d=p(d);return u[p(d)]},a=function(){var A=k(),z=f;q=0;m.style.backgroundImage="url("+u[d]+")";g=j;j=[];while(z){z-=1;g[z].style.backgroundImage="url("+A+")";g[z].style.width=g[z].style.height=0;set_opacity(g[z],0)}setTimeout(n,t)},n=function(){var z=e(h()*g.length);j[j.length]=g[z];g.splice(z,1);b(j[j.length-1]);if(g.length){setTimeout(n,c)}},b=function(C){var B=Math.cos,A=Math.PI,D=+new Date(),z=D+w,E=setInterval(function(){var G=+new Date(),F=G>z?1:(D-G)/w;G=(1-B(F*A))/2;set_opacity(C,G);C.style.width=G*l+"px";C.style.height=G*x+"px";if(F===1){clearInterval(E);q+=1;if(q===f){a()}}},40)};(function(){var z=m.style.backgroundImage;z=z.substring(4,z.length-1);if(z!==u[0]){u.unshift(z);y+=1}}());(function(){var C=o,F=u[p(d)],B="opacity:0;width:0;height:0;background-image:url("+F+");background-position:-",E,D,A,z;while(C){E=r;C-=1;z=e(C*x)+"px";while(E){E-=1;A=e(E*l)+"px";D=document.createElement("span");D.style.cssText=B+A+" -"+z+";left:"+A+";top:"+z;g[g.length]=D;m.appendChild(D)}}}());setTimeout(n,t)}if(document.getElementById("fancypants")){fancypants(document.getElementById("fancypants"),4,4,["media/images/fancypants/FancyPants-2.jpg","media/images/fancypants/FancyPants-3.jpg"])}if(document.getElementById("current_page")||document.getElementById("search_hdr")){(function(){var h=document.createElement("div"),g=document.getElementById("hdr"),a=document.getElementById("current_page"),d=window.location.search,c;if(d){c=d.substring(1)}else{c=a.href.split("/");c=c[c.length-1]||c[c.length-2];c="c="+c}h.id="gallery_nav";var f=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"),e=function(){if(f.readyState===4){if(f.status<400){h.innerHTML=f.responseText;g.parentNode.insertBefore(h,g);if(!h.getElementsByTagName("p").length){b(h)}}}else{setTimeout(e,0)}};var b=function(k){var q=document.getElementById("ftr"),y=document.getElementById("gallery_nav_scroller"),l=document.getElementById("gallery_nav_imgs"),r=l.getElementsByTagName("img"),m=document.getElementById("gallery_nav_left"),z=document.getElementById("gallery_nav_right"),i=m.style,s=z.style;var n,j=function(C){var B=C?-1:1;B*=5;n=setInterval(function(){y.scrollLeft+=B;w()},40)},v=function(){y.scrollLeft=o.offsetLeft-200},w=function(){var B=y.offsetWidth+y.scrollLeft===y.scrollWidth;i.display=y.scrollLeft?"block":"none";s.display=B?"none":"block";if(s.display==="none"||i.display==="none"){clearInterval(n)}};m.onmousedown=z.onmousedown=function(B){B=B||window.event;B=B.target||B.srcElement;j(B.id==="gallery_nav_left")};m.onmouseup=z.onmouseup=m.onmouseout=z.onmouseout=function(){clearInterval(n)};window.onresize=function(){v();w()};var t=document.createElement("div"),A="current_img",o=r[0],x=function(C){var B=document.createElement("img");B.src=C.replace("sm.jpg","lg.jpg");t.innerHTML="";t.appendChild(B)},u=function(B){o.id="";o=B;B.id=A;x(B.src)};o.id=A;x(o.src);t.id="gallery_big_img";k.onclick=function(B){B=B||window.event;B=B.target||B.srcElement;if(B.className==="gallery_nav_img"){u(B)}};var p=document.getElementById("search_input");p.onkeydown=function(B){B=B||window.event;B.cancelBubble=true;if(B.stopPropagation){B.stopPropagation()}};document.onkeydown=function(B){B=B||window.event;B=B.keyCode;if(B===37||B===39){B=B===37?"previousSibling":"nextSibling";B=o[B];if(B){u(B);v();w()}return false}};l.style.width=(r.length*r[0].offsetWidth)+"px";q.parentNode.insertBefore(t,q);window.onresize()};f.open("POST","http://www.alanbisson.com/includes/img.php",true);f.setRequestHeader("Content-type","application/x-www-form-urlencoded");f.send(c);e()}())};
