Paperli=window.Paperli||{};Paperli.FRAME_NUMBER=Paperli.FRAME_NUMBER||0;Paperli.PaperFrame=function(){var f,d,b=1,c,a=this;function e(h){var i=0;var g=0;if(h.offsetParent){do{i+=h.offsetLeft;g+=h.offsetTop}while(h=h.offsetParent)}return{left:i,top:g}}return{Show:function(g){var h,i=g.domain||"http://paper.li",k=g.lang||"en",l="sr-paper-frame-"+(++Paperli.FRAME_NUMBER),j=i+"/"+g.pid+"?ifrm=true&lang="+k+"&loc="+encodeURIComponent(document.location.href);if(g.slim){j+="&slim=true"}document.write('<iframe id="'+l+'" src="'+j+'" width="100%" height="800" scrolling="no" frameBorder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0"></iframe>');Paperli.PaperFrame.ReceiveMessage(function(p){var o=Number(p.data.replace(/.*if_height=(\d+)(?:&|$)/,"$1"));var n=p.data.replace(/.*scroll=(top|bottom)(?:&|$)/,"$1");var q=document.getElementById(l);if(!isNaN(o)&&o>0&&o!==h){q.height=h=o}if(n&&n=="top"){var m=e(q);a.scrollTo(0,m.top)}},i)},PostMessage:function(g,i,h){if(!i){return}h=h||parent;if(a.postMessage){h.postMessage(g,i.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))}else{if(i){h.location=i.replace(/#.*$/,"")+"#"+(+new Date)+(b++)+"&"+g}}},ReceiveMessage:function(h,g){if(a.postMessage){if(h){c=function(i){if((typeof g==="string"&&i.origin!==g)||(Object.prototype.toString.call(g)==="[object Function]"&&g(i.origin)===!1)){return !1}h(i)}}if(a.addEventListener){a[h?"addEventListener":"removeEventListener"]("message",c,!1)}else{a[h?"attachEvent":"detachEvent"]("onmessage",c)}}else{f&&clearInterval(f);f=null;if(h){f=setInterval(function(){var j=document.location.hash,i=/^#?\d+&/;if(j!==d&&i.test(j)){d=j;h({data:j.replace(i,"")})}},100)}}}}}();
