function isset(a){return typeof a!="undefined"&&a!==null}function IsNonEmptyArray(a){return typeof a=="object"&&a&&a.length}function IsNum(a){switch(typeof a){case"number":return !isNaN(a);case"string":return/^[\d\.]+$/.test(a)}}function IsFunc(a){return typeof a=="function"}function ArgumentsToArray(a){return Array.prototype.slice.call(a)}function IsIE(){return typeof ieSpecific!="undefined"}function IsIE6(){return typeof ieLt7!="undefined"}function IsTheTag(a,b){return typeof a=="object"&&a&&a.nodeType==1&&(!b||a.tagName.toUpperCase()==b.toUpperCase())}function Random(b,a){b=parseInt(b);a=parseInt(a);return Math.floor(Math.random()*(a-b+1))+b}function Microtime(){return(new Date()).getTime()}function ShallowCopyOf(b){var a={};for(prop in b){a[prop]=b[prop]}return a}function LocationPath(){return location.href.substr(0,location.href.lastIndexOf("/")+1)}function IsValidEmail(a){return a.match(/^[a-z0-9]([a-z0-9\-_\.]*[a-z0-9])?@[a-z0-9\-\.]+\.[a-z]{2,8}$/i)!=null}function CancelPropagationOf(a){a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}a.returnValue=false;if(a.preventDefault){a.preventDefault()}}function OriginalEventTargetOf(a){return isset(a)&&(a.srcElement||a.originalTarget)}var previousCapsLockStates=[];function IsCapsLockOnIn(g){if(!g){return false}var a=false;var l=g.which||g.keyCode||g.charCode;var h=g.shiftKey||g.modifiers&4;var d="a".charCodeAt(0);var b="z".charCodeAt(0);var m="A".charCodeAt(0);var j="Z".charCodeAt(0);if(h){a=l>=d&&l<=b}else{a=l>=m&&l<=j}var k=(l>=d&&l<=b)||(l>=m&&l<=j);var c=false;var f=OriginalEventTargetOf(g);if(IsTheTag(f)&&f.id){if(!isset(previousCapsLockStates[f.id])){previousCapsLockStates[f.id]=a}c=previousCapsLockStates[f.id]}if(!k){a|=c}previousCapsLockStates[f.id]=a;return a}function AddChainFuncTo(b,a){return function(){var c=ArgumentsToArray(arguments);a.apply(this,c);if(IsFunc(b)){b.apply(this,c)}}}function RequestScript(url,data){var request=CreateXHRequest();if(request){var method=data?"POST":"GET";request.open(method,url,true);request.onreadystatechange=function(){if(request.readyState==4&&(request.status==200||request.status==304)){eval(request.responseText)}};if(isset(data)){request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");request.setRequestHeader("Content-Length",data.length)}request.send(data)}else{var span=document.createElement("SPAN");$hide(span);if(isset(data)){if(url.indexOf("?")==-1){url+="?"}url+="&"+data}span.innerHTML='IE workaround. <script type="text/javascript" src="'+url+'">i-e<\/script>';document.body.appendChild(span)}return request}function CreateXHRequest(){var c;try{c=new XMLHttpRequest()}catch(d){var a=new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");for(var b=0;b<a.length&&!c;b++){try{c=new ActiveXObject(a[b])}catch(d){}}}return c?c:null}function HTMLToWrappedNodes(a,b){if(a){var c=document.createElement("div");c.innerHTML=a.replace(/^\s+/,"").replace(/\s+$/,"");return(c.childNodes.length==1?c.firstChild:(b?c.childNodes:c))}else{return null}}function HTMLToNode(a){return HTMLToWrappedNodes(a,true)}function ModifyClassNameOf(b,c,a){b=$(b);if(!IsTheTag(b)){return}var d=ClassNameRegExpFor(c);if(!isset(a)||a){if(!d.test(b.className)){b.className+=" "+c}}else{b.className=b.className.replace(d," ")}}function ClassNameRegExpFor(a){return RegExp("(^|\\s)"+a+"(\\s|$)","gi")}function EscapeForString(a){return a.replace(/([\r\n'\\])/g,"\\$1")}function EmulatePseudoclassesOn(c){if(!c||!IsIE()){return}var e=c.onmousemove;c.onmousemove=function(){if(e){e()}ModifyClassNameOf(c,"hovered",true)};var b=c.onmouseout;c.onmouseout=function(){if(b){b()}ModifyClassNameOf(c,"hovered",false)};var d=c.onfocus;c.onfocus=function(){if(d){d()}ModifyClassNameOf(c,"focused",true)};var a=c.onblur;c.onblur=function(){if(a){a()}ModifyClassNameOf(c,"focused",false)}}function ClearThisEditOnFocus(b,a){if(!IsTheTag(b)){return}var c=b.onfocus;b.onfocus=function(){if(c){c()}if(b.value==a){b.value=""}else{b.select()}}}function Bookmark(b,d){if(IsTheTag(b)&&b.href){var a=b;b=a.href;d=a.title}try{window.external.AddFavorite(b,d)}catch(c){}}function SetHomePage(b,a){if(IsTheTag(b)&&b.style){try{b.style.behavior="url(#default#homepage)";a=isset(a)?a:document.location.href;b.setHomePage(a)}catch(c){}}}function DebugRecord(){if(isset(window.console)&&isset(window.console.firebug)){var a=ArgumentsToArray(arguments);console.error("DebugRecord() invoked, args: "+a.join(", "));console.trace()}}function DebugAssert(b){if(!b){var a=ArgumentsToArray(arguments);a.shift();DebugRecord.apply(this,a)}return b}function Shuffle(c){for(i=c.length-1;i>=0;i--){var a=parseInt(Math.random()*i);var b=c[i];c[i]=c[a];c[a]=b}return c}function $(){var d=[];var b=window;for(var f=0,c=arguments.length;f<c;f++){var e=arguments[f];if(typeof arguments[f]=="string"){e=document.getElementById(arguments[f])}d.push(e)}return !IsNonEmptyArray(d)||d.length>1?d:d[0]}function $hide(b,a){a=a?a:"none";return $style(b,"display",a)}function $show(b,a){a=a?a:"block";return $hide(b,a)}function HeightOf(c,b){c=$(c);if(IsNum(b)){return parseInt($style(c,"height",Math.round(b)+"px"))}else{if(IsNum(c.offsetHeight)){var a=parseInt($style(c,"borderTopWidth"))+parseInt($style(c,"borderBottomWidth"));return IsNum(a)?c.offsetHeight-a:c.offsetHeight}else{return parseInt($style(c,"height"))}}}function WidthOf(b,c){b=$(b);if(IsNum(c)){return parseInt($style(b,"width",Math.round(c)+"px"))}else{if(IsNum(b.offsetWidth)){var a=parseInt($style(b,"borderLeftWidth"))+parseInt($style(b,"borderRightWidth"));return IsNum(a)?b.offsetWidth-a:b.offsetWidth}else{return parseInt($style(b,"width"))}}}function ExpandedHeightOf(d){var e=$style(d,"height","auto");var b=$style(d,"overflow","visible");var c=$style(d,"display","block");var a=HeightOf(d);if(c!="block"){$style(d,"display",c)}if(b!="visible"){$style(d,"overflow",b)}if(!/^(auto)?$/i.test(e)){$style(d,"height",e)}return a}function $style(b,f,e){b=$(b);if(!b){return}if(isset(e)){var c=ArgumentsToArray(arguments);c.shift();if(c.length%2!=0){c.pop()}var d;var a;$each(c,function(h,g){if(g%2==0){d=h}else{a=b.style[d];b.style[d]=h;DebugAssert(b.style[d]==h,d,h)}});return a}else{if(document.defaultView&&document.defaultView.getComputedStyle){if(f.match(/[A-Z]/)){f=f.replace(/([A-Z])/g,"-$1").toLowerCase()}return document.defaultView.getComputedStyle(b,"").getPropertyValue(f)}else{if(b.currentStyle){while((i=f.indexOf("-"))!=-1){f=f.substr(0,i)+f.substr(i+1,1).toUpperCase()+f.substr(i+2)}return b.currentStyle[f]}else{return""}}}}function $each(a,c){if(IsNonEmptyArray(a)||typeof a=="string"){for(var b=0;b<a.length;b++){if(c.call(this,a[b],b)){break}}}}function GetAbsoluteXOf(b){b=$(b);var a=0;while(b){a+=b.offsetLeft;b=b.offsetParent}return a}function GetAbsoluteYOf(a){a=$(a);var b=0;while(a){b+=a.offsetTop;a=a.offsetParent}return b}function $opacity(a,b){b=parseInt(b);if(IsNum(b)){$style(a,"opacity",b/100);$style(a,"filter","alpha(opacity="+b+")")}else{b=$style(a,"opacity")*100}return IsNum(b)?parseFloat(b):100}function GetScrollX(){return self.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft)}function GetScrollY(){return self.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop)}function WindowWidth(){if(IsNum(window.innerWidth)){return window.innerWidth}else{if(document.documentElement&&IsNum(document.documentElement.clientWidth)){return document.documentElement.clientWidth}else{if(document.body){return document.body.clientWidth}}}}function WindowHeight(){if(IsNum(window.innerHeight)){return window.innerHeight}else{if(document.documentElement&&IsNum(document.documentElement.clientHeight)){return document.documentElement.clientHeight}else{if(document.body){return document.body.clientHeight}}}}function DisableSubmissionButton(a,b){a=$(a);if(!DebugAssert(a)){return}function c(d){a.disabled=!d;ModifyClassNameOf(a,"under-submission",!d)}setTimeout(function(){c(false)},100);b=IsNum(b)?b:15000;setTimeout(function(){c(true)},b)}function $get(a){var a=$(a);if(!DebugAssert(a)){return}switch(a.tagName){case"INPUT":case"TEXTAREA":return a.value;default:return a.innerHTML}}function $set(a,b){var a=$(a);if(!DebugAssert(a)){return}switch(a.tagName){case"INPUT":case"TEXTAREA":prevValue=a.value;a.value=b;break;default:prevValue=a.innerHTML;a.innerHTML=b}return prevValue}function RemoveChildrenOf(a){if(IsTheTag(a)){do{var b=a.childNodes.length;if(b){a.removeChild(a.childNodes[b-1])}}while(b)}}function FindParentOf(c,a,b){c=$(c);var d=ClassNameRegExpFor(b);while(c&&(!IsTheTag(c,a)||!c.className.match(d))){c=c.parentNode}return c}function FindChildrenOf(c,a,b){if(arguments.length==2){b=a;a=null}var e=[];c=$(c);c?c=c.firstChild:null;var d=ClassNameRegExpFor(b);while(c){if(IsTheTag(c,a)&&(!b||c.className.match(d))){e.push(c)}c=c.nextSibling}return e}function FindChildOf(e,b,d){var a=ArgumentsToArray(arguments);var c=FindChildrenOf.apply(this,a);return IsNonEmptyArray(c)?c[0]:null}function FindChildByPath(c){for(var b=1;c&&b<arguments.length;b++){var a=IsNonEmptyArray(arguments[b])?arguments[b]:[arguments[b]];a.unshift(c);c=FindChildOf.apply(this,a)}return c}function AddOnLoad(b){var a=window.addEventListener||window.attachEvent?window:document.addEventListener?document:null;if(a){if(a.addEventListener){a.addEventListener("load",b,false)}else{if(a.attachEvent){a.attachEvent("onload",b)}}}else{window.onload=AddChainFuncTo(window.onload,b)}}function RestartTimer(c,b,a){clearTimeout(c);return setTimeout(b,a)}function GetCookie(c){var d=document.cookie.indexOf(c+"=");var a=d+c.length+1;if(!d&&c!=document.cookie.substring(0,c.length)){return null}if(d==-1){return null}var b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))}function SetCookie(c,e,a,g,d,f){var b=new Date();b.setTime(b.getTime());if(a){a=a*1000*3600}var h=new Date(b.getTime()+a);document.cookie=c+"="+escape(e)+((a)?";expires="+h.toGMTString():"")+((g)?";path="+g:"")+((d)?";domain="+d:"")+((f)?";secure":"")}window.language={};function PageHeight(){return GetAbsoluteYOf("pageBottom")}var gaIFrame;function ReloadCounters(a){var c=location.href;if(a){c=c.substr(0,c.length-location.search.length)+"ctr/"+a}var b=FindChildOf(document.body,"div","counters");if(b){ReloadCountersIn(b,c)}if(!gaIFrame){gaIFrame=document.createElement("iframe");$hide(gaIFrame);document.body.appendChild(gaIFrame)}c=(a?"ctr/"+a:c);c=encodeURIComponent(c);gaIFrame.src="aif?"+c+"&title="+encodeURIComponent(document.title)}function ReloadCountersIn(c,e){if(IsTheTag(c,"img")){if(!isset(c.originalCounterTarget)){c.originalCounterTarget=c.src}var b=c.originalCounterTarget;var d="fetchimage.php?url="+encodeURIComponent(b)+"&rand="+Math.random()+"&useragent=~";if(e){d+="&referer="+encodeURIComponent(e)}if(b.indexOf("/whos.amung.us/")!=-1){d+="&host=-"}c.src=d}else{if(isset(c)){for(var a=0;a<c.childNodes.length;a++){ReloadCountersIn(c.childNodes[a],e)}}}}AddOnLoad(function(){var a=document.getElementsByTagName("*");for(var b=0;b<a.length;b++){if((IsTheTag(a[b],"input")||IsTheTag(a[b],"button"))&&a[b].disabled===true){a[b].disabled=false}}});function StartIconRefreshingLoop(){function RefreshIcon(jsonStr){var index=random(0,3);var link=$("icon_"+index);if(link){var image=link.lastChild;while(!IsTheTag(image,"img")){image=image.previousSibling}}if(link&&image){try{eval("var iconData = "+jsonStr);iconData=iconData.response[0]}catch(e){iconData=null}if(iconData){ReloadCounters("js-icon");link.href=iconData.page_url;image.src=iconData.preview_url;return true}}return false}setInterval(function(){var query="./?action=randimage&format=js&randimage[rating]=s&js[data]=json&js[callback]=";(new ScriptRequest(LocationPath()+query,RefreshIcon)).Perform()},60000)}function HookPostingFormOf(e,c){e=$(e);var d=FindChildOf(e,"infobox-add");if(FindChildOf(document.body,"div","main")){var g=FindChildByPath(d,["form",null],["div",null],["textarea",null]);if(g){ModifyClassNameOf(d,"infobox-add-line");var f=g.onfocus;g.onfocus=function(){if(typeof f=="function"){f()}ModifyClassNameOf(d,"infobox-add-line",false);g.focus()}}}else{if(c){$hide(d)}}function b(h){if(!IsTheTag(h)){return}h.onclick=function(){var j=$style(d,"display")=="block"&&d.className.indexOf("infobox-add-line")==-1;ModifyClassNameOf(d,"infobox-add-line",false);var k=j?"height opacity hideWhenDone":"show resetFollowing height opacity";SlideAs(k,d,{maxDuration:150,reverse:j,accel:true});return false}}b(FindChildByPath(e,"small-links","go-write"));var a=FindChildByPath(e,"big-links","post-btn");b(a);$show(a,"inline")}function SetUpSearchResultsPage(f,k){if(!isset(k.enabled)){k.enabled=true}k.noMoreResults=true;window.searchResPage=k;var a=function(l){k.enabled=true;k.nextButton=l;j.onclick=function(){if(k.enabled){k.enabled=false;var o=FindChildOf(l,"a");if(o){o.innerHTML="";ModifyClassNameOf(l,"ajax-waiting")}var n="./?action=search&search[phrase]="+encodeURIComponent(d)+"&search[page]="+(k.page+1)+"&search[count]="+k.count;var m=new ScriptRequest(LocationPath()+n,h);m.js_param_prefix="&format=js&js[data]=naked_html&js[callback]=";m.navigate_on_failure=true;m.Perform();return false}else{return true}}};var h=function(n){if(n){var p=HTMLToWrappedNodes(n);var l=FindChildOf(p,"pagebar");if(l){$hide(l)}for(var m=0;m<b.length;m++){$hide(b[m])}g.appendChild(p);if(window.searchResPage.noScrolling){window.searchResPage.noScrolling=false}else{p.scrollIntoView(true)}ModifyClassNameOf(p,"search-results-ajax");var o=document.createElement("h4");o.className="ajax";o.innerHTML="# "+(k.page+2);p.insertBefore(o,p.firstChild);k.page++;SetUpSearchResultsPage(p,k);ReloadCounters("js-page-"+(k.page+1));return true}else{return false}};var g=FindChildOf(document.body,"page-search");var c=FindChildByPath(g,"search","phrase","phrase");if(c){var d=c.value;f=f?f:FindChildOf(g,"search-results");var b=FindChildrenOf(f,"pagebar");if(typeof b=="object"&&b){for(var e=0;e<b.length;e++){var j=FindChildOf(b[e],"a","n");if(j){k.noMoreResults=false;a(j)}}}}}function StartAutopaging(){var a=WindowHeight()/1.5;setInterval(function(){if(window.searchResPage&&window.searchResPage.enabled&&window.searchResPage.nextButton){var b=PageHeight()-WindowHeight();if(b>0&&GetScrollY()>=b-a){window.searchResPage.noScrolling=true;window.searchResPage.nextButton.onclick()}}},1000)}function HookPicBoxLink(e,p){var s=24*90;function f(){if((p||o())&&r()){window.searchResPage.enabled=false;e.blur();Fader.Fade();$style(Fader.overlay,"backgroundColor",c(e));if(Fader.ShowBox(h())){n();return false}}l();return true}function r(){return window.searchResPage.enabled||window.searchResPage.noMoreResults}function c(x){var z="0";if(x){var A=FindChildByPath(x.parentNode,"l","rating");if(A){var y=A.className.match(/rating-(.)/);if(IsNonEmptyArray(y)){z=y[1]}}}var B={e:"red",s:"green",q:"blue"};return B[z]?B[z]:"black"}var j;var a;var g;var k=0;var m=0;function n(){if(a){a.checked=o()}}function h(){if(!j){var y=FindChildByPath(e.parentNode,"l","p");var C=FindChildByPath(e.parentNode,"l","i");var A=FindChildOf(e.parentNode,"span","id");var B;var z=FindParentOf(e,"div","item");if(z){B=FindChildOf(z,"div","post")}if(!B){B=FindChildOf(e.parentNode,"dp")}if(y&&C&&A&&B){j=q(y.href,C.href,A.innerHTML,B)}}ReloadCounters("js-picbox");n();if(g){var x=30000;t();d=setInterval(b,700);setTimeout(g.onload,x)}return j}function q(B,y,x,A){var z=document.createElement("div");z.className="picture-box";var C="fetchimage.php?url="+encodeURIComponent(y);z.innerHTML=' <img alt="" src="hitimage.php?id='+x+'" style="display: none" /> <div class="settings">   <input class="checkbox" type="checkbox" id="picbox_show_setting" />   <label for="picbox_show_setting"></label> </div> <div class="close"> <img src="images/close_24.png" alt="Close" /> </div> <div class="picture">   <img alt="Loading the picture..." src="'+C+'" /> </div> <div class="l">  <a href="'+C+'&download=1"> <img alt="Save" src="images/download_32.png" /> </a>   <a target="_blank" href="'+C+'"> <img alt="Expand" src="images/expand_32.png" /> </a>   <a target="_blank" href="'+B+'"> <img alt="Page" src="images/page_32.png" /> </a>   <a target="_blank" href="'+y+'"> <img alt="Picture" src="images/picture_32.png" /> </a> </div> <div class="post">   '+A.innerHTML+" </div>";v(z);return z}var d;function t(){clearInterval(d);d=null}function v(x){a=FindChildByPath(x,"settings",["input",null]);if(a){a.onclick=function(){o(this.checked)}}var z=FindChildByPath(x,"settings",["label",null]);if(z){z.innerHTML=window.language.picture_box_show_setting}var y=FindChildOf(x,"close");if(y){y.onclick=u}g=FindChildByPath(x,"picture",["img",null]);if(g){g.onclick=l;g.onload=function(){if(d){b();t()}}}}function b(){w();if(j){Fader.UpdateBoxPosition(j)}}function w(){if(g){var x=HeightOf(g);var y=WidthOf(g);if(x>m||y>k){m=x;k=y}else{x=m;y=k}var A=WindowHeight();A=Math.round(A*0.6);var z=WindowWidth();z=Math.round(z*0.6);if(x>A||y>z){var B=Math.min(A/x,z/y);HeightOf(g,x*B);WidthOf(g,y*B)}}}function l(){t();Fader.Unfade();window.searchResPage.enabled=!window.searchResPage.noMoreResults}function u(){if(!GetCookie("picbox[close_alert]")){alert(window.language.picture_box_close);SetCookie("picbox[close_alert]",1,s)}l()}function o(x){if(isset(x)){SetCookie("picbox[enabled_on_search]",x==true?1:0,s);return x==true}else{x=GetCookie("picbox[enabled_on_search]");return !isset(x)||x==1}}if(e){Fader.events.unfade.push(l);Fader.events.resize.push(w);e.onclick=f}return true}function HkThmb(a){var b=(location.search+"&").match(/[?&]thumbpicbox=0?&/i);if(a&&!b){return HookPicBoxLink(a)&&a.onclick()}else{return true}}function HkThmbOnMove(a){if(a){a.onmousemove=null;$style(a,"cursor","pointer");HookPicBoxLink(a,true)}}var Fader={overlay:null,boxContainer:null,events:{},faded:false,Fade:function(){if(!this.faded){this.faded=true;this.Setup();$show(this.overlay);$show(this.boxContainer);this.TriggerEvent("fade")}},Unfade:function(){if(this.faded){$hide(this.overlay);$hide(this.boxContainer);this.faded=false;this.ClearBoxes();this.TriggerEvent("unfade")}},Setup:function(){window.onscroll=AddChainFuncTo(window.onscroll,this.EventTriggerMethod("scroll"));window.onresize=AddChainFuncTo(window.onresize,this.EventTriggerMethod("resize"));this.SetupOverlay();this.TriggerEvent("setup")},SetupOverlay:function(){this.overlay=this.SetupAllPageElement(this.overlay,"fader-overlay",10000);var a=$style(this.overlay,"backgroundColor");if(!a||a==="transparent"){$style(this.overlay,"backgroundColor","black")}$opacity(this.overlay,10);this.SetupBoxContainer()},SetupBoxContainer:function(){this.boxContainer=this.SetupAllPageElement(this.boxContainer,"fader-box-container",10005)},SetupAllPageElement:function(a,b,c){if(!a){a=document.createElement("DIV");$hide(a);document.body.appendChild(a)}a.className=b;a.style.zIndex=c;a.style.position="absolute";a.style.top=0;a.style.left=0;a.style.height=Math.max(WindowHeight(),PageHeight())+"px";a.style.width="100%";a.onclick=this.EventTriggerMethod("fadedPageClick");return a},ShowBox:function(a){if(this.faded&&a){$style(a,"position",IsIE6()?"absolute":"fixed");this.boxContainer.appendChild(a);this.UpdateBoxPosition(a);return true}else{return false}},ClearBoxes:function(){RemoveChildrenOf(this.boxContainer)},UpdateBoxPositions:function(b){if(this.boxContainer&&(!b||IsIE6())){for(var a=0;a<this.boxContainer.childNodes.length;a++){this.UpdateBoxPosition(this.boxContainer.childNodes[a])}}},UpdateBoxPosition:function(d){if(d){var b=IsIE6()?GetScrollY():0;var a=b+(WindowHeight()-HeightOf(d))/2;$style(d,"top",Math.round(a)+"px");var c=(WindowWidth()-WidthOf(d))/2;$style(d,"left",Math.round(c)+"px")}},Method:function(c){var d=this[c];if(typeof d=="function"){var b=ArgumentsToArray(arguments);b.shift();var a=this;return function(){theseArgs=b.concat(ArgumentsToArray(arguments));return d.apply(a,theseArgs)}}else{return Function()}},TriggerEvent:function(b){var a=ArgumentsToArray(arguments);a.shift();var d=this.events[b];if(IsNonEmptyArray(d)){for(var c=0;c<d.length;c++){d[c].apply(this,a)}}},EventTriggerMethod:function(a){return this.Method("TriggerEvent",a)},Initialize:function(){this.SetDefaultEvents()},SetDefaultEvents:function(){this.events={setup:[],scroll:[],resize:[],fade:[],unfade:[],fadedPageClick:[]};var a=this;this.events.scroll.push(this.Method("UpdateBoxPositions",true));this.events.resize.push(this.Method("UpdateBoxPositions"));this.events.fadedPageClick.push(function(c){c=c?c:event;var b=OriginalEventTargetOf(c);if(b&&b==a.boxContainer){a.Unfade()}})}};Fader.Initialize();function ScriptRequest(a,b){this.timeout=15000;this.cancelled=true;this.url=a;this.js_param_prefix="&js=";this.post_data=null;this.navigate_on_failure=false;this.on_receive=b;this.on_end=function(){};this.on_request_failure=function(){};this.timer=null;this.object_index=null;this.callback_name=null;this.Perform=function(){this.cancelled=false;var e=this.navigate_on_failure?this.js_param_prefix:"";var d=this.url+e+encodeURIComponent(this.callback_name);this.xhrObject=RequestScript(d,this.post_data);var c=this;this.timer=setTimeout(function(){c.RequestFailed()},this.timeout)};this.Callback=function(){if(!this.cancelled){this.End();var c=this.ArgumentsToArray(arguments);if(c.length){if(!this.on_receive.apply(this,c)){c=[]}}if(!c.length){this.RequestFailed()}}};this.ArgumentsToArray=function(c){return Array.prototype.slice.call(c)};this.RequestFailed=function(){this.End();if(this.navigate_on_failure){location.href=this.url}this.call_back(this.on_request_failure)};this.End=function(){this.cancelled=true;clearTimeout(this.timer);if(typeof this.xhrObject=="object"&&this.xhrObject&&typeof this.xhrObject.abort=="function"){this.xhrObject.abort()}this.call_back(this.on_end)};this.call_back=function(c){if(typeof c=="function"){c.apply(this)}};this.AssignTempObject=function(){if(!isset(window.temp_script_request_objects)){window.temp_script_request_objects=[]}this.object_index=window.temp_script_request_objects.push(this)-1;this.callback_name="window.temp_script_request_objects["+this.object_index+"].Callback"};this.AssignTempObject()}function SlideAs(e,c,a){e=e.toLowerCase();var b=[];var d=false;var f;effectArray=e.split(/\s+/);$each(effectArray,function(h){if(/^\s*$/.test(h)){return}switch(h.match(/^([\w\d]+)/)[1]){case"show":$show(c);break;case"resetfollowing":d=true;case"hidewhendone":break;case"class":f=[h.substr(6),h.charAt(5)=="+"];default:var g=ShallowCopyOf(a);g.element=c;g.prop=h;if(d){SlidePropValueOf(c,h,0)}b.push(g)}});if(IsNonEmptyArray(b)){b[0].onDone=AddChainFuncTo(b[0].onDone,function(){if(e.indexOf("hidewhendone")!=-1){$hide(c)}if(f){ModifyClassNameOf(c,f[0],f[1])}});return Slide(b)}}function Slide(a){if(!IsNum(a.length)){a=[a]}$each(a,function(b){b.element=$(b.element);if(!DebugAssert(b.element)){b.element=null;return}SetupSlideOptions(b);$show(b.element);if(IsFunc(b.onStart)){b.onStart.call(this,b)}});SlideTimer(a)}function SetupSlideOptions(a){if(!DebugAssert(a.element&&IsNum(a.maxDuration))){return}a.prop=(a.prop||"height").toLowerCase();a.curValue=SlidePropValueOf(a.element,a.prop);a.reverse=a.reverse==true?true:false;a.accel=a.accel==true?2:(IsNum(a.accel)?a.accel:0);a.startTime=Microtime();a.endTime=Microtime()+a.maxDuration;if(!IsNum(a.updInterval)){a.updInterval=a.maxDuration>100?20:10}a.onSlide=IsFunc(a.onSlide)?a.onSlide:new Function();a.onDone=IsFunc(a.onDone)?a.onDone:new Function();if(!IsNum(a.targetValue)){a.targetValue=DefaultTargetValueFor(a)}if(a.accel!=0){a.incBy=Math.abs(a.targetValue-a.curValue)*a.updInterval/a.maxDuration}}function SlideTimer(a){var b=false;$each(a,function(f){var e=Math.round(f.curValue);var d=f.reverse?e<=0:e>=f.targetValue;e=!d&&CalcIncBy(f);var c=!IsNum(e);b|=c;if(!b){SlidePropValueOf(f.element,f.prop,e);f.onSlide.call(this,a)}});if(b){$each(a,function(c){SlidePropValueOf(c.element,c.prop,c.targetValue);c.onDone.call(this,c)})}else{setTimeout(function(){SlideTimer(a)},a[0].updInterval)}}function CalcIncBy(d){var e=d.endTime-Microtime();if(e<=0){return null}if(d.accel==0){var a=1;var b=Math.abs(d.curValue-d.targetValue);var c=b*d.updInterval/e}else{var a=d.accel*((Microtime()-d.startTime)/(d.endTime-d.startTime));var c=d.incBy}c=c*a*(d.reverse?-1:+1);d.curValue=Math.max(0,d.curValue+c);if(!d.reverse){d.curValue=Math.min(d.targetValue,d.curValue)}return d.curValue}function SlidePropValueOf(a,d,c){var b;switch(d){case"height":b=HeightOf(a,c);break;case"width":b=WidthOf(a,c);break;case"top":case"left":c=IsNum(c)?Math.round(c)+"px":null;b=$style(a,d,c);break;case"opacity":b=$opacity(a,c);break}return parseFloat(b)}function DefaultTargetValueFor(a){if(!a.reverse){switch(a.prop){case"height":return ExpandedHeightOf(a.element);case"opacity":return 100}}return 0};