/*! AntJs 0.1.0 | http://www.antjs.com/ | License: http://www.antjs.com/license/ */
function AntJsNode(d){var c=this===window||this.hasOwnProperty("opera")?new AntJsNode:this;if(d===void 0){c.z=null}else{if(c.z=typeof d==="string"?document.getElementById(d):d,c.z===void 0){c.z=null}}return c}function AntJsList(){var b=this===window||this.hasOwnProperty("opera")?new AntJsList:this;b.z=[];return b}AntJsNode.prototype.a=function(b){return b.z1(this,function(d,f){d.z.appendChild(f.z)})};AntJsNode.prototype.ab=function(b){return b.z1(this,function(d,f){d.z.parentNode.insertBefore(f.z,d.z)})};AntJsNode.Ajax=function(r,q,p,n,m,j){var l,k="",o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");o.open(p?"POST":"GET",r,j);o.onreadystatechange=function(){j&&o.readyState===4&&(o.status===200&&n?n(o.responseText):o.status!==200&&m&&m(o.status))};if(p){q||(q=[]);q.__antjstmp=Math.random();for(l in q){q.hasOwnProperty(l)&&(k+=(k.length!==0?"&":"")+encodeURIComponent(l)+"="+encodeURIComponent(q[l]))}o.setRequestHeader("Content-type","application/x-www-form-urlencoded");o.setRequestHeader("Content-length",k.length);o.setRequestHeader("Connection","close")}o.send(p?k:null);j||(o.status===200&&n?n(o.responseText):o.status!==200&&m&&m(o.status))};AntJsNode.C=function(f,d){var g=new AntJsNode(document.createElement(f));if(d!==void 0){g.tag()==="table"?g=AntJsNode.C("div","<table>"+d+"</table>").ch().at(0):g.tag()==="tr"?g=AntJsNode.C("div","<table><tbody>"+d+"</tbody></table>").ch().at(0).ch().at(0).ch().at(0):g.z.innerHTML=d}return g};AntJsNode.prototype.ch=function(){var f=new AntJsList,d,g;if(this.z!==null){d=this.z.childNodes;for(g=0;g<d.length;g+=1){d[g].tagName!==void 0&&f.a(new AntJsNode(d[g]))}}return f};AntJsNode.prototype.cls=function(b){if(b===void 0){return this.z===null?null:this.elem().className}if(this.z!==null){this.z.className=b}return this};AntJsNode.prototype.cont=function(b){if(b===void 0){return this.z===null?null:this.z.innerHTML}if(this.z!==null){this.z.innerHTML=b}return this};AntJsNode.prototype.elem=function(){return this.z};AntJsNode.prototype.isnull=function(){return this.z===null};AntJsNode.prototype.r=function(b){if(this.z!==null&&b.z!==null){this.ab(b),this.rm(),this.z=b.z.constructor===Array?b.at(0).z:b.z}return this};AntJsNode.prototype.rm=function(){if(this.z!==null){this.z.parentNode.removeChild(this.z),this.z=null}return this};AntJsNode.prototype.tag=function(){return this.z===null?null:this.z.tagName.toLowerCase()};AntJsNode.prototype.x=function(d){var c=this;AntJsNode.Ajax(d,null,false,function(b){c.r(AntJsList.P(b))},null,true);return this};AntJsNode.prototype.xp=function(f,d){var g=this;AntJsNode.Ajax(f,d,true,function(b){g.r(AntJsList.P(b))},null,true);return this};AntJsNode.prototype.z1=function(d,c){this.z!==null&&d.z!==null&&c(d,this);return d};AntJsList.prototype.a=function(b){b.z!==null&&(this.z[this.c()]=b);return this};AntJsList.prototype.at=function(b){return b<this.c()?this.z[b]:new AntJsNode};AntJsList.prototype.c=function(){return this.z.length};AntJsList.P=function(d){var c=document.createElement("div");c.innerHTML=d;return(new AntJsNode(c)).ch()};AntJsList.prototype.z1=function(f,d){var h=this.c(),g;if(h>0&&f.z!==null){for(g=0;g<h;g+=1){d(f,this.z[g])}}return f};var _=AntJsNode,__=AntJsList;function e2(a){var b="",c;for(c=a.length-1;c>=0;c=c-1){b+="&#"+a.charCodeAt(c).toString()}return b}function e(a,b){document.write('<a href="'+e2(":otliam")+e2(a)+"&#64"+e2(b)+'">'+e2(a)+"&#64"+e2(b)+"</a>")}function post(a,g){var c=document.createElement("form"),d,b;c.style.display="none";c.setAttribute("method","post");c.setAttribute("action",a);for(d in g){if(g.hasOwnProperty(d)&&d!==null){b=document.createElement("input");b.setAttribute("type","hidden");b.setAttribute("name",d);b.setAttribute("value",g[d]);c.appendChild(b)}}document.body.appendChild(c);c.submit()}function onUpvote(b){var a=[];a.vote="up";_("linkvotes"+b).xp("/ajax/linkvote/"+b,a)}function onDownvote(b){var a=[];a.vote="down";_("linkvotes"+b).xp("/ajax/linkvote/"+b,a)}function onNotLoggedIn(){if(confirm("Du måste vara medlem och inloggad för att rösta på länkar.\n\nVill du bli medlem på Dagens Länkar? (Det är givetvis helt gratis)")){document.location.href="/blimedlem"}}function onRemove(b){if(confirm("Vill du verkligen ta bort länken?")){var a=[];a._action="removelink";a.id=b;post(document.location.href,a)}};
