var onstart=function(){(new Image).src="/style/img/imagebg.png"}();var LOOPZY={search:{searchInputElement:null,searchSuggestionsElement:null,previousSearchString:"",actualSearchString:"",selected:-1,data:null,maxElements:20,load:function(A){if((this.searchInputElement=document.getElementById(A))===null){return }this.searchSuggestionsElement=document.createElement("div");this.searchSuggestionsElement.setAttribute("id","searchsuggestions");document.body.appendChild(this.searchSuggestionsElement);var B=LOOPZY.helpers.findElementPosition(this.searchInputElement);this.searchSuggestionsElement.style.left=B[0]+"px";this.searchSuggestionsElement.style.top=this.searchInputElement.offsetHeight+1+B[1]+"px";this.searchSuggestionsElement.style.width=this.searchInputElement.offsetWidth-2+"px";LOOPZY.helpers.addEvent(this.searchInputElement,"keyup",LOOPZY.search.inputKeyUpHandler);try{file;this.maxElements=4}catch(C){}},inputKeyUpHandler:function(B){var A=LOOPZY.search;if(A.searchSuggestionsElement.style.display=="block"){if(B.keyCode==40){A.selected=(A.selected+1)==A.searchSuggestionsElement.childNodes.length?A.selected:A.selected+1;A.searchSugestionsRemapSelection();return }if(B.keyCode==38){A.selected=(A.selected-1)<-1?A.selected:A.selected-1;A.searchSugestionsRemapSelection();return }}if(A.searchInputElement.value.length==0){A.searchSuggestionsElement.style.display="none";A.selected=-1}else{if(A.data!==null){A.displaySearchSuggestionsElement()}if(A.searchInputElement.value[0]!==A.previousSearchString){A.previousSearchString=A.searchInputElement.value[0];LOOPZY.ajax.send("/public/ajax.php?do=3&search="+A.previousSearchString,A.ajaxResponseHandler)}}},ajaxResponseHandler:function(A){try{LOOPZY.search.data=YAHOO.lang.JSON.parse(A.responseText);LOOPZY.search.displaySearchSuggestionsElement()}catch(B){}},displaySearchSuggestionsElement:function(A){var E=LOOPZY.search;E.searchSuggestionsElement.innerHTML="";E.searchSuggestionsElement.style.display="block";var D=new RegExp("^"+E.searchInputElement.value,"i");try{var B=0;for(var C in E.data.files){if(E.data.files[C].file.match(D)){E.searchSuggestionsElement.innerHTML+='<div><a href="/search/?s='+E.data.files[C].file+'" title="Search">'+E.data.files[C].file+'</a> : <a href="/v/'+E.data.files[C].url+'" class="dl" title="Direct Link">view</a></div>';if((++B)==LOOPZY.search.maxElements){break}}}if(E.searchSuggestionsElement.innerHTML===""){E.searchSuggestionsElement.style.display="none";E.selected=-1}}catch(F){}},searchSugestionsRemapSelection:function(){var C=LOOPZY.search,A=C.searchSuggestionsElement.childNodes;for(var B in A){A[B].className=""}if(C.selected!=-1){A[C.selected].className="selected";C.searchInputElement.value=A[C.selected].childNodes[0].innerHTML}else{C.searchInputElement.value=C.previousSearchString}}},comments:{data:null,element:null,html:new Array(),load:function(A){if((this.element=document.getElementById(A))===null){return }LOOPZY.ajax.send("/public/ajax.php?do=1",this.ajaxResponseHandler)},ajaxResponseHandler:function(A){try{LOOPZY.comments.data=YAHOO.lang.JSON.parse(A.responseText);LOOPZY.comments.show()}catch(B){LOOPZY.comments.element.innerHTML=B}},show:function(){var C,A,B=true;for(A=0;this.data[A];A++){this.html[A]='<div class="comment" id="inside-comment"><span><a href="/view/'+this.data[A].fileid+'">&ldquo;'+this.data[A].comment+'&rdquo;</a></span><div class="author">'+this.data[A].author+', <a href="/view/'+this.data[A].fileid+'">'+this.data[A].filename+"</a></div></div>"}A=0;C=function(){if(B){LOOPZY.comments.element.innerHTML=LOOPZY.comments.html[A];LOOPZY.fade.into(LOOPZY.comments.element.childNodes[0]);B=false}else{LOOPZY.fade.out(LOOPZY.comments.element.childNodes[0]);A=(A+1)%LOOPZY.comments.html.length;B=true}setTimeout(C,B?800:4000)};C()}},thumbs:{thumb:null,load:function(A){if((this.thumb=document.getElementById(A))===null){return }this.addEvents(LOOPZY.helpers.getElementsByClass(A,"img"))},addEvents:function(A){for(i=0;i<A.length;i++){if(document.addEventListener){A[i].addEventListener("mouseover",this.mouseOver,false)}}},mouseOver:function(){var A=LOOPZY.helpers.findElementPosition(this);LOOPZY.thumbs.thumb.innerHTML='<a href="'+this.parentNode+'" onmouseout="LOOPZY.thumbs.mouseOut()"><img src="'+this.src+'"></a>';LOOPZY.thumbs.thumb.style.left=A[0]-31+"px";LOOPZY.thumbs.thumb.style.top=A[1]-26+"px";LOOPZY.thumbs.thumb.style.display="block"},mouseOut:function(){LOOPZY.thumbs.thumb.style.display="none"}},ajax:{newHTTPObject:function(){try{return new XMLHttpRequest()}catch(A){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(A){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(A){return false}}}},send:function(C,B){var A=this.newHTTPObject();if(A.readyState==4||A.readyState==0){A.onreadystatechange=function(){if(A.readyState==4){B(A)}};A.open("GET",C,true);A.send(null)}}},fresh:{expand:{isExpanded:new Array(),click:function(B,A){var C=document.getElementById(B);var A=document.getElementById(A);if(this.isExpanded[B]){C.style.display="none";this.isExpanded[B]=false;A.src="/style/img/fresh/plus.png"}else{A.src="/style/img/fresh/minus.png";C.style.display="block";this.isExpanded[B]=true}}}},helpers:{getElementsByClass:function(D,C){var B=document.getElementsByTagName(C==null?"*":C);var A=[];for(i=0;i<B.length;i++){if(B[i].className.match(D)){A.push(B[i])}}return A},findElementPosition:function(A){var B=curtop=0;if(A.offsetParent){do{B+=A.offsetLeft;curtop+=A.offsetTop}while(A=A.offsetParent)}return[B,curtop]},cssBrowserSelector:function(){var A=navigator.userAgent.toLowerCase(),C=function(D){return A.indexOf(D)!=-1},B=document.getElementsByTagName("html")[0];B.className=(!(/opera|webtv/i.test(A))&&/msie (\d)/.test(A))?("ie ie"+RegExp.$1):C("gecko/")?"gecko":C("opera/9")?"opera opera9":/opera (\d)/.test(A)?"opera opera"+RegExp.$1:C("konqueror")?"konqueror":C("applewebkit/")?"webkit safari":C("mozilla/")?"gecko":""}(),addEvent:function(B,D,C,A){if(D==="domload"){this.addDOMLoadEvent(C)}else{if(/msie/i.test(navigator.userAgent)){B.attachEvent("on"+D,C)}else{B.addEventListener(D,C,A?true:false)}}},removeEvent:function(B,D,C,A){if(/msie/i.test(navigator.userAgent)){B.detachEvent("on"+D,C)}else{B.removeEventListener(D,C,A?true:false)}},addDOMLoadEvent:(function(){var load_events=[],load_timer,script,done,exec,old_onload,init=function(){done=true;clearInterval(load_timer);while(exec=load_events.shift()){exec()}if(script){script.onreadystatechange=""}};return function(func){if(done){return func()}if(!load_events[0]){if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);
/*@cc_on @*/
/*@if (@_win32 || @_win64)
         document.write("<script id=__ie_onload defer src=//0><\/scr"+"ipt>");
         script = document.getElementById("__ie_onload");
         script.onreadystatechange = function() {
             if (this.readyState == "complete")
                 init(); // call the onload handler
         };
     /*@end @*/
}if(/WebKit/i.test(navigator.userAgent)){load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init()}},10)}old_onload=window.onload;window.onload=function(){init();if(old_onload){old_onload()}}}load_events.push(func)}})()},fade:{ie:/msie/i.test(navigator.userAgent),into:function(B){var C,A=0,D=B;D.style.display="block";C=function(E){if(A!=1.1){if(LOOPZY.fade.ie){D.style.filter="alpha(opacity="+(A*100)+")"}else{D.style.opacity=A}A=Math.round((A+0.1)*10)/10;setTimeout(C,60)}};C()},out:function(B){var C,A=1,D=B;C=function(){if(A!=-0.1){if(LOOPZY.fade.ie){D.style.filter="alpha(opacity="+(A*100)+")"}else{D.style.opacity=A}A=Math.round((A-0.1)*10)/10;setTimeout(C,60)}else{D.style.display="none"}};C()}}};LOOPZY.helpers.addEvent(window,"domload",function(){LOOPZY.comments.load("new-comments")});LOOPZY.helpers.addEvent(window,"domload",function(){LOOPZY.thumbs.load("thumb")});LOOPZY.helpers.addEvent(window,"load",function(){LOOPZY.search.load("searchinput")});