var dr={filter:function(b){var e=b.href;var d=false;var a=new Array(".pdf",".doc",".docx");for(var c=0;c<a.length;c++){if((e.toLowerCase().indexOf(a[c]))>-1){d=true}}if(d){return(true)}else{return(false)}},returnUrl:function(b){var a="";if(b.indexOf("http")>-1||b.indexOf("https")>-1){a=b}else{if(b.indexOf("/")==0){a=document.location.protocol+"://"+document.location.hostname+b}else{if(b.indexOf("/")==-1){a=document.location.protocol+"://"+document.location.hostname+document.location.pathname+b}else{a=b}}}return a},addButton:function(g,a){var i="http://media.readspeaker.com/images/buttons/listen_icons/icon_12px.gif";var d=document.createElement("img");d.setAttribute("src",i);var e="Öppna detta dokument med ReadSpeaker docReader";var c="sv_se";d.setAttribute("alt",e);d.setAttribute("title",e);d.style.border="0px";var f=document.createElement("a");var h="http://docreader.readspeaker.com/docreader/?bp=ptol%3D2.2&cid=bowda&lang=sv_se&glang=REPLACE_GLANG&url=REPLACE_URL";h=h.replace("REPLACE_URL",escape(a));h=h.replace("REPLACE_GLANG",c);f.setAttribute("href",h);thescript="window.open(this.href); return false;";f.setAttribute("onclick",thescript);f.style.margin="0 0 0 4px";f.onclick=new Function(thescript);f.setAttribute("target","_blank");f.appendChild(d);var b=document.createDocumentFragment();b.appendChild(f);g.parentNode.insertBefore(b,g.nextSibling)},start:function(){var d=document.getElementsByTagName("A");var e=new Array();for(var b=0;b<d.length;b++){e[b]=d[b]}for(var c=0;c<e.length;c++){if(dr.filter(e[c])){var a=dr.returnUrl(e[c].href);if(a!=""){dr.addButton(e[c],a)}}}}};if($&&$(document).ready){$(document).ready(function(){dr.start()})}else{setTimeout("dr.start();",1000)};
