Knot=function(){return{loadPage:function(B){var A=Array.prototype.slice.call(arguments,1).join("&");Request.get(A,function(C,D){DOM(B).html(D)})}}}();DOM=window.DOM=function(B,A){return new DOM.prototype.init(B,A)};var replaceHtml=function(){var A=navigator.userAgent.toLowerCase();if(/msie/.test(A)&&!/opera/.test(A)){return function(D,C){var B=typeof D==="string"?document.getElementById(D):D;B.innerHTML=C;return B}}return function(D,C){var B=typeof D==="string"?document.getElementById(D):D;var E=B.cloneNode(false);E.innerHTML=C;B.parentNode.replaceChild(E,B);return E}}();DOM.html=function(D,B,A){if(B==undefined){return D.innerHTML}var C=replaceHtml(D,B);return C};DOM.create=function(D,A,E){var B=E||window,F=B.document,G=F.createElement(D);for(var C in A){if(A[C]){G.setAttribute(C,A[C])}}return G};DOM.prototype={init:function(A,B){var C=A||document;if(C.nodeType){this[0]=C;this.length=1;return this}else{if(typeof C=="string"){this[0]=document.getElementById(C);this.length=1;return this}else{if(C.constructor==Array){this.length=0;Array.prototype.push.apply(this,C);return this}}}return this},html:function(A){return this.each(function(B){DOM.html(B,A,false)})},tags:function(){var B=[],A=Array.prototype.slice.call(arguments);this.each(function(D){if(D&&D.nodeType==1){for(var F=0;F<A.length;F++){var E=D.getElementsByTagName(A[F]);for(var C=0;C<E.length;C++){B.push(E[C])}}}});return DOM(B)},findByName:function(B){var A=[];this.each(function(E){if(E&&E.nodeType==1){var D=E.getElementsByName(B);for(var C=0;C<D.length;C++){A.push(D[C])}}});return DOM(A)},walkTo:function(A,B){var C=[],A=A.toUpperCase()||null;this.each(function(E){do{var D=E[B];if(!D){break}if(A&&A!=D.nodeName.toUpperCase()){E=D}else{C.push(D);break}}while(E)});return DOM(C)},each:function(B){for(var A=0;A<this.length;A++){B(this[A])}return this},parent:function(A){return this.walkTo(A,"parentNode")},prev:function(A){return this.walkTo(A,"previousSibling")},next:function(A){return this.walkTo(A,"nextSibling")},attr:function(A,B){return this.each(function(C){C[A]=B})},css:function(B,A){return this.each(function(C){C.style[B]=A})},addClass:function(A){return this.attr("className",A)},removeClass:function(A){return this.each(function(B){B.className=B.className.replace(A,"")})},toggleClass:function(A){return this.each(function(B){B.className=B.className.match(A)?B.className.replace(A,""):B.className+" "+A})}};DOM.prototype.init.prototype=DOM.prototype;Event=function(){var A=function(B){return function(C){B.call(this,window.event||C)}};return{addEvent:function(E,D,C){if(E.addEventListener){E.addEventListener(D,A(C),false)}else{if(E.attachEvent){E.attachEvent("on"+D,A(C))}else{var B=E["on"+D]||null;E["on"+D]=function(F){if(B){B.apply(this,arguments)}A(C).apply(this,arguments)}}}},addMultipleEvents:function(C,B){for(type in B){Event.addEvent(C,type,B[type])}},getTarget:function(C){var B=C.target||C.srcElement;return(B&&3==B.nodeType)?B.parentNode:B},getMousePosition:function(B){if(B.pageX||B.pageY){return{x:B.pageX,y:B.pageY}}else{if(B.clientX||B.clientY){return{x:B.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:B.clientY+document.body.scrollTop+document.documentElement.scrollTop}}}return{}},getRelativeMousePosition:function(E){var D=Event.getTarget(E),C=Event.getElementLocation(E),B=Event.getMousePosition(E);return{x:B.x-C.x,y:B.y-C.y}},getElementLocation:function(D){var C={x:0,y:0},B=D;while(D.offsetParent){C.x+=D.offsetLeft;C.y+=D.offsetTop;D=D.offsetParent}return C},kill:function(B){Event.preventDefault(B);Event.preventBubble(B);return false},preventDefault:function(B){B.cancelBubble=true;if(B.preventDefault){B.preventDefault()}return false},preventBubble:function(B){B.returnValue=false;if(B.stopPropagation){B.stopPropagation()}return false}}}();Form=function(){var A={},B=0;return{hijack:function(C){C.guid=C.guid||B++;if(!A[C.guid]){C.options={action:C.action,target:C.getAttribute("target"),onsubmit:C.onsubmit,enctype:C.enctype,method:C.method||"get"};(function(){var E=C.onsubmit||function(){return true};C.onsubmit=function(F){F=window.event||F;if(Form.submit(C,F)){return E(F)}return false};var D=C.onclick||function(){return true};C.onclick=function(F){F=window.event||F;if(Form.detectSubmit(C,F)){return D(F)}return false}})()}},validate:function(G){var F=true,C=Form.getFields(G);for(var E=0;E<C.length;E++){var I=C[E],H=I.value+"";Form.unmark(I);if(I.type=="file"){var D=I.getAttribute("accept")+"";if(!I.fileTypes&&D){I.fileTypes=new RegExp(".("+D.replace(/\s*,\s*/g,"|")+")$","i")}if(!H.match(I.fileTypes)){Form.mark(I);F=false}}if(I.getAttribute("ref")=="required"&&(!/.+/.test(I.value)||(I.type=="checkbox"&&I.checked!=true))){Form.mark(I);F=false}}return F},mark:function(C){DOM(C).addClass("required").parent("td").prev("th").addClass("required")},unmark:function(C){DOM(C).removeClass("required").parent("td").prev("th").removeClass("required")},submit:function(C){return Form.validate(C)},detectSubmit:function(D,F){var E=Event.getTarget(F),C=F.charCode||F.keyCode;if(C==13){Event.kill(F);if(String(E.nodeName).match(/input/i)){return Form.submit(D)}}return true},getFields:function(D){var C=["input","select","textarea"],E=DOM(D);return E.tags.apply(E,C)},serialize:function(E){var C=Form.getFields(E),F=[];for(var D=0;D<C.length;D++){F.push(C[D].name+"="+escape(C[D].value))}return F.join("&")},watch:function(){var E=600;if(document&&document.getElementsByTagName){var D=document.getElementsByTagName("form"),C=0;for(var F=0;F<D.length;F++){var G=D[F];if(G.$hijack!==true){Form.hijack(G);G.$hijack=true;C++}}if(D.length>0&&D.length>=C){E=4000}}setTimeout(Form.watch,E);return this}}}();Form.watch();Rating=function(){var B={};var D=function(G){var L=G,F=null,J=A(L.getAttribute("ref")),N=J.timeout||1500,O=J.max||5;var H=C(L);var I=H.max.offsetWidth/O;Event.addMultipleEvents(L,{mousemove:function(Q){var P=K(Q);E();H.current.style.display="none";H.user.style.display="block";H.user.style.width=(M(P.x)*I)+"px"},click:function(R){var Q=K(R);var P=M(Q.x)+"";H.current.className="rating_on stars"+P.replace(".","_");if(J.url){L.innerHTML="Saving...";Request.get(J.url+P,function(){L.parentNode&&L.parentNode.removeChild(L);if(J.oncomplete){(new Function(J.oncomplete))()}})}},mouseout:function(P){F=setTimeout(function(){H.user.style.display="none";H.current.style.display="block"},N)}});function M(P){var Q=P/I;if(Q>=O){Q=O}if(J.snap){var R=Q%1;R=Math.max(R,J.snap);Q=R==J.snap?parseInt(Q)+R:Math.ceil(Q)}return Q>=O?O:Q}function E(){if(F){clearTimeout(F);F=null}}function K(R){var P=Event.getMousePosition(R),S=Event.getElementLocation(L),Q={x:P.x-S.x,y:P.y-S.y};return Q}};var C=function(H){var F={};for(var E=0;E<H.childNodes.length;E++){var I=H.childNodes[E];if(I.nodeType==1){var G=I.getAttribute("ref");switch(G){case"max":F.max=I;break;case"current":F.current=I;break;case"user":F.user=I;break}}}return F};var A=function(F){var E={};F.replace(/(\S+?):([^;]+)/ig,function(I,G,H){E[G]=H});return E};return{init:function(E){return new D(E)},listen:function(){Event.addEvent(document,"mousemove",function(G){var F=Event.getTarget(G);if(E(F)===true){return }E(F.parentNode);return true});return this;function E(G){if(!G||G.nodeType!=1){return }if(G.$rating===true){return true}var F=G.getAttribute("name")+"";if(F.toLowerCase()=="rating"){if(Rating.init(G) instanceof D){G.$rating=true;return true}}return false}}}}().listen();Request=function(){var proto={namespace:"request"},unique_id=0,interval=13,waiting=[],threads=100,processing=0,timeout=0,loaded={},loading={},no_cache=true;var queue=function(o){waiting.push(o);if(processing<threads){next()}};var next=function(){var xml;if(processing<threads&&waiting.length>0){processing++;xml=request(waiting.shift())}if(timeout>0){xml.markFailed=setTimeout(function(){failed(xml)},timeout)}};var request=function(opts){var xml;if(!/.+/.test(opts.url)){return failed(null,opts)}xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(opts.method,opts.url,true);xml.setRequestHeader("X-Requested-With","XMLHttpRequest");for(name in opts.headers){xml.setRequestHeader(name,opts.headers[name])}track(xml,opts);try{xml.send(opts.data)}catch(e){}return xml};var track=function(request,o){var requestDone=false,request;function onReadyState(){if(!requestDone&&request&&request.readyState==4){requestDone=true;complete(request,o);request=null}else{if(requestDone===false){setTimeout(onReadyState,interval)}}}onReadyState()};var complete=function(request,o){var data=request.responseText,json={};processing--;if(/^\s*<!/.test(data)){if(o.callback){o.callback({},"no content")}return }if(/^\s*\{/.test(data)){try{json=eval("("+data+")")||{}}catch(e){json={}}}if(o.callback){o.callback(json,data)}};var failed=function(req,opts){processing--;if(req){req.abort()}next()};proto.get=function(url,callback){var headers={},method="GET";return proto.request(url,"",callback,method,headers)};proto.post=function(url,params,callback){var headers={"Content-Type":"application/x-www-form-urlencoded"},method="POST";return proto.request(url,params,callback,method,headers)};proto.request=function(url,params,callback,method,headers){var headers=headers||{},data;headers["X-Requested-Response"]="json";return queue({url:url,data:data,callback:callback,headers:headers,method:method})};proto.countActiveRequests=function(){return processing||0};proto.isLoaded=function(url){return loaded[url]===true};proto.isLoading=function(url){return loading[url]===true};return proto}();function toggleBookmark(){if(document.getElementById("bookmark").style.display=="block"){document.getElementById("bookmark").style.display="none"}else{document.getElementById("bookmark").style.display="block"}};
