if(!window.ODKL){ODKL={};}if(!ODKL.P){ODKL.P={share_host:"www.odnoklassniki.ru",w:600,h:420,l:(screen.width/2)-(300),t:(screen.height/2)-(210),requests:null};}if(!ODKL.Share){ODKL.Share=function(f){if(f.tagName.toLowerCase()!="a"){return;}if(f.className.toLowerCase().indexOf("odkl-klass-oc")>-1){ODKL.ShareOC(f);return;}var g=1000;var b=f.className?f.className.toLowerCase():null;if(b){if(b.indexOf("odkl-klass-stat")>-1){g="1";}else{if(b.indexOf("odkl-klass")>-1){g="0";}}}var c=b&&b.indexOf("odkl-current")>-1?window.location.href:f.href;var d="http://"+ODKL.P.share_host+"/dk?st.cmd=addShare&st.s="+g+"&st._surl="+encodeURIComponent(c);var a=window.open("","_blank","top="+ODKL.P.t+",left="+ODKL.P.l+",width="+ODKL.P.w+",height="+ODKL.P.h+",resizable=1");var e='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="ru" xml:lang="ru" xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><title>Одноклассники.ru</title></head><body style="margin:0;padding:0;"><div style="width:100%;padding:17px 0;text-align:center;background-color:#F93;color:white;font:normal 14px/16px verdana">Происходит загрузка...</div></body></html>';a.document.write(e);a.location.href=d;};}if(!ODKL.ShareOC){ODKL.ShareOC=function(g){var e=g.getElementsByTagName("span");var b;if(!e||e.length==0){return;}b=e[0];var a=g.className?g.className.toLowerCase():null;var d=a&&a.indexOf("odkl-current")>-1?window.location.href:g.href;d=encodeURIComponent(d);var f="http://"+ODKL.P.share_host+"/dk?st.cmd=extOneClickLike&drt=0&uid="+b.id+"&ref="+d;var c=document.createElement("script");c.type="text/javascript";b.appendChild(c);c.src=f;};}if(!ODKL.showComments){ODKL.showComments=function(d,c){if(d==null){return;}var b=document.getElementById(d);if(b==null){return;}b.style.position="relative";var f=document.createElement("span");var a=d+"C";f.id=a;b.appendChild(f);f.className="odkl-oc-comment-form";f.innerHTML=c;if(navigator.userAgent.indexOf("MSIE")>-1){if(navigator.userAgent.indexOf("7.0")||navigator.userAgent.indexOf("6.0")){f.style.height="81px";}f.style.width="192px";}ODKL.positionComments(f);f.style.visibility="visible";var e=f.getElementsByTagName("textarea");if(!window.opera&&e&&e.length>0){e[0].focus();}};}if(!ODKL.postComment){ODKL.postComment=function(d,c){var e=c.parentNode;var a=e.parentNode;var f=a.id;var j=e.getElementsByTagName("textarea");if(j){var g=j[0].value;if(g){g=encodeURI(g);var b=ODKL.createMessageContainer(f,a,true);var i="http://"+ODKL.P.share_host+"/dk?st.cmd=extOneClickLike&drt=1&uid="+f+"&ocsid="+d+"&occmnt="+g;var h=document.createElement("script");h.type="text/javascript";b.appendChild(h);h.src=i;}}return false;};}if(!ODKL.hideComment){ODKL.hideComment=function(c){if(c){var b=c.parentNode;if(b.className=="odkl-oc-msg-anchor"){b=b.parentNode;}var a=b.parentNode;a.removeChild(b);ODKL.touchContainer(a);}return false;};}if(!ODKL.touchContainer){ODKL.touchContainer=function(a){if(!window.opera||!a){return;}a.style.position="absolute";window.setTimeout(function(){a.style.position="relative";},10);};}if(!ODKL.createMessageContainer){ODKL.createMessageContainer=function(c,e,a){var d;if(a){d=document.createElement("span");d.className="odkl-oc-msg-anchor";e.parentNode.insertBefore(d,e);}else{d=e;}var f=document.createElement("span");var b=c+"M";f.id=b;d.appendChild(f);f.className="odkl-oc-cmnt-hidden";return f;};}if(!ODKL.showMessage){ODKL.showMessage=function(b,d,f){var a=document.getElementById(b);var c=b+"M";var g=document.getElementById(c);if(!g&&d){g=ODKL.createMessageContainer(b,a.parentNode,true);g.className="odkl-oc-cmnt-err";g.innerHTML=f;ODKL.positionMessage(g,false,a.parentNode);g.style.visibility="visible";}else{g.className=d?"odkl-oc-cmnt-err":"odkl-oc-cmnt-ok";var e=document.getElementById(b+"C");if(e!=null){g.innerHTML=f;if(d){ODKL.positionMessage(g,e,a);}else{a.removeChild(e);ODKL.touchContainer(a);ODKL.positionMessage(g,false,a);}g.style.visibility="visible";}}window.setTimeout("ODKL.hideMessage('"+c+"');",3000);};}if(!ODKL.hideMessage){ODKL.hideMessage=function(a){if(!a){return false;}var c=document.getElementById(a);if(c){c.style.display="none";var b=c.parentNode;b.removeChild(c);ODKL.touchContainer(b);}return false;};}if(!ODKL.positionMessage){ODKL.positionMessage=function(l,q,b){if(ODKL.lastMsg){window.setTimeout("ODKL.hideMessage('"+ODKL.lastMsg.id+"');",500);}ODKL.lastMsg=l;var o=ODKL.getDistances(l);var g=240;var e=l.offsetHeight;var p="-"+b.offsetWidth+"px";var n;var a;var d;var k;var f=navigator.userAgent;if(navigator.userAgent.indexOf("Firefox")>-1){n="7px";a="40px";d="100px";k="133px";}else{if(navigator.userAgent.indexOf("Chrome")>-1){n="22px";a="22px";d="115px";k="117px";}else{if(navigator.userAgent.indexOf("MSIE")>-1){a="22px";k="116px";if(document.documentMode){if(document.documentMode==5){n="8px";d="100px";}else{if(document.documentMode==8){d="120px";n="23px";}else{d="100px";n="23px";}}}else{n="23px";d="100px";}}else{if(navigator.userAgent.indexOf("Opera")>-1){n="23px";a="5px";d="115px";k="98px";}else{if(navigator.userAgent.indexOf("Safari")>-1){n="24px";a="24px";d="115px";k="117px";}else{n="10px";a="22px";d="108px";k="120px";}}}}}if(!q){var m=ODKL.getPositionFlag(o,g,e);ODKL.assignDefaultPosition(l,m,n,p,a,"0px");return;}var c=ODKL.getDistances(q);if(c.top<o.top){o.top=c.top-e;}if(c.bottom<o.bottom){o.bottom=c.bottom-e;}if(c.left<o.left){o.left=c.left;}else{if(c.right>o.right){o.right=c.right;}}var i=ODKL.getAbsPosition(q.parentNode);var h=(i.y-c.top)>0;var m=ODKL.getPositionFlag(o,g,e,h);var j=false;switch(m){case 1:case 10:case 11:case 20:case 30:j=h;break;default:j=!h;}if(j){ODKL.assignDefaultPosition(l,m,d,p,k,"0px");}else{ODKL.assignDefaultPosition(l,m,n,p,a,"0px");}};}if(!ODKL.positionComments){ODKL.positionComments=function(e){var c=ODKL.getDistances(e.parentNode);if(!c){e.style.bottom="27px";e.style.left="0px";}var b=210;var a=100;var d=ODKL.getPositionFlag(c,b,a);ODKL.assignDefaultPosition(e,d,"25px","0px","27px","0px");};}if(!ODKL.assignDefaultPosition){ODKL.assignDefaultPosition=function(f,c,e,b,a,d){switch(c){case 2:case 3:f.style.left=d;f.style.top=e;f.style.right="auto";f.style.bottom="auto";break;case 22:f.style.right=b;f.style.top=e;f.style.left="auto";f.style.bottom="auto";break;case 20:case 30:f.style.right=b;f.style.bottom=a;f.style.left="auto";f.style.top="auto";break;case 1:case 11:case 10:default:f.style.left=d;f.style.bottom=a;f.style.right="auto";f.style.top="auto";}};}if(!ODKL.getPositionFlag){ODKL.getPositionFlag=function(a,d,c,f){var e=0;var b=0;if(a.right&&d<a.right){e=1;}else{if(a.left&&d<a.left){e=20;}}if(f){if(a.top&&c<a.top){b=10;}else{if(a.bottom&&c<a.bottom){b=2;}}}else{if(a.bottom&&c<a.bottom){b=2;}else{if(a.top&&c<a.top){b=10;}}}return e+b;};}if(!ODKL.getDistances){ODKL.getDistances=function(d){var f=ODKL.getAbsPosition(d);var e;var a;if(window.innerWidth){e=window.innerWidth,a=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientWidth!=0){e=document.documentElement.clientWidth,a=document.documentElement.clientHeight;}else{e=document.body.offsetWidth,a=document.body.offsetHeight;}}var b=new Object();b.left=f.x;b.top=f.y;b.right=e-f.x-d.offsetWidth;b.bottom=a-f.y-d.offsetHeight;return b;};}if(!ODKL.getAbsPosition){ODKL.getAbsPosition=function(a){var d=new Object();d.x=0;d.y=0;if(a==null){return d;}if(a.getBoundingClientRect){var b=a.getBoundingClientRect();d.x=b.left;d.y=b.top;}else{while(a!=null&&a!=document.body){d.x+=a.offsetLeft;d.y+=a.offsetTop;a=a.offsetParent;}d.x-=document.body.scrollLeft;d.y-=document.body.scrollTop;}return d;};}if(!ODKL.updateCountForVoted){ODKL.updateCountForVoted=function(d,e,c){if(d==null||e==null){return;}var b=document.getElementById(d);if(b==null){return;}if(isNaN(e)||e<0){b.parentNode.className="odkl-klass-stat";b.innerHTML="0";}else{var a=b.parentNode;var f=document.createElement("span");a.parentNode.insertBefore(f,a);a.style.display="none";a.parentNode.removeChild(a);f.id=d;f.className="odkl-klass-oc-voted";f.innerHTML=c;}};}if(!ODKL.updateCountOC){ODKL.updateCountOC=function(c,e,a){if(!a||a=="0"){var b=document.getElementById(c);var d=b?b.parentNode:null;if(d!=null){d.className="odkl-klass-stat";}}ODKL.updateCount(c,e);};}if(!ODKL.updateCount){ODKL.updateCount=function(b,c){if(b==null||c==null){return;}var a=document.getElementById(b);if(a==null){return;}if(isNaN(c)||c<0){a.innerHTML="0";}else{a.innerHTML=c;}};}if(!ODKL.getStatNodes){ODKL.getStatNodes=function(d){if(document.getElementsByClassName){return document.getElementsByClassName(d);}if(document.getElementsByTagName){var c=document.getElementsByTagName("a");var a=new Array();for(var b=0;b<c.length;b++){var e=c[b].className;if(e&&e.toLowerCase().indexOf(d)>-1){a.push(c[b]);}}return a;}return null;};}if(!ODKL.initBtn){ODKL.initBtn=function(g,c,o){var f="http://"+ODKL.P.share_host+"/dk?st.cmd="+g+"&uid=";var k=ODKL.getStatNodes(c);if(k==null){return;}for(var j=0;j<k.length;j++){var n=k[j];var h=n.className?n.className.toLowerCase():null;var d=h&&h.indexOf("odkl-current")>-1?window.location.href:n.href;if(d==null){continue;}var e=n.getElementsByTagName("span");var b;if(e&&e.length>0){b=e[0];}else{b=document.createElement("span");n.appendChild(b);b.innerHTML="0";}b.id=o+j;var l=f+b.id+"&ref="+encodeURIComponent(d);var m=document.createElement("script");m.type="text/javascript";b.appendChild(m);m.src=l;}};}if(!ODKL.init){ODKL.init=function(){if(ODKL.P.initialized){return;}ODKL.P.initialized=true;ODKL.initBtn("extLike","odkl-klass-stat","odklcnt");ODKL.initBtn("extOneClickLike","odkl-klass-oc","odkloc");};}
