function m(a,b){var c=document.getElementById("m"+a);if(c.style.display=="inline"){if(c.style.display="none",b)b.style.color=""}else if(c.style.display="inline",b)b.style.color="red"}function sbox(a){var b=document.getElementById("sbox");b.innerHTML=b.innerHTML;var c=createRequestObject();if(c)c.open("get",a),c.onreadystatechange=function(){if(c.readyState==4)b.innerHTML=c.responseText},c.send(null);a=getPageCoords();b.style.top=parseInt(a[2]+(a[0]-500)/2)+"px";b.style.display="block"}function createRequestObject(){try{return new XMLHttpRequest}catch(a){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){return null}}}}function boxclose(){var a=document.getElementById("sbox");a.innerHTML="";a.style.display="none"}function go(a){var b=document.getElementById("myFlash");b.SetVariable("player:jsUrl",a);b.SetVariable("player:jsPlay","")}function showLogin(){document.getElementById("box").style.display="block";document.getElementById("close").style.display="block"}function hideLogin(){document.getElementById("box").style.display="none";document.getElementById("close").style.display="none"}function video(a,b){var c=document.getElementsByTagName("body")[0],e=getPageCoords(),f=document.createElement("div");f.id="shadow";f.style.height=e[1]+14+"px";f.className="on";c.insertBefore(f,c.firstChild);c=parseInt(e[2]+e[0]/2/2);document.getElementById("video").innerHTML='<object id="'+b+'" type="application/x-shockwave-flash" data="player.swf" width="240" height="196" style="border:solid 2px #EEE;position:absolute;left:50%;margin-left:-120px;top:'+c+'px;z-index:10000"><param name="movie" value="player.swf"><param name="bgcolor" value="#000000"><param name="allowfullscreen" value="true"><param name="flashvars" value="file='+a+"&skin=player/style.xml&provider=http&stretching=fill&controlbar=over&autostart=true&id="+b+'"><img src="images/no_flash.gif" style="cursor:pointer" onclick="clearbox()" alt=""></object>'}function playerReady(a){a=document.getElementById(a.id);a.addViewListener("stop","clearbox");a.addControllerListener("stop","clearbox")}function clearbox(){document.getElementById("video").innerHTML="";closeBox()}function showBox(a){var b=document.getElementsByTagName("body")[0],c=getPageCoords(),e=document.createElement("div");e.id="shadow";e.style.height=c[1]+14+"px";e.className="on";b.insertBefore(e,b.firstChild);var f=document.createElement("div");f.id="loading";f.style.top=parseInt(c[2]+(c[0]-55)/2)+"px";f.onclick=function(){closeBox()};e.appendChild(f);var g=new Image;g.onload=function(){var b=document.createElement("div"),h,j,d=document.createElement("img");d.src=a.href;d.title="Нажмите на картинку чтобы закрыть";h=document.documentElement.clientWidth;j=document.documentElement.clientHeight;if(navigator.appName=="Netscape")h=window.innerWidth,j=window.innerHeight;d.width=g.width>h-40?h-50:g.width;d.height=g.height*d.width/g.width;if(d.height>j-40)h=d.height,d.height=j-50,d.width=d.height*d.width/h;b.id="litebox";b.style.width=d.width+10+"px";b.style.marginTop=parseInt(c[2]+(c[0]-d.height-10)/2)+"px";d.onclick=function(){closeBox()};e.removeChild(f);b.appendChild(d);e.appendChild(b);return!1};g.src=a.href}function getPageCoords(){var a=[0,0,0];if(window.innerHeight)a[0]=window.innerHeight,a[2]=window.pageYOffset;else if(document.documentElement&&document.documentElement.clientHeight!=0)a[0]=document.documentElement.clientHeight,a[2]=document.documentElement.scrollTop;else if(document.body)a[0]=document.body.clientHeight,a[2]=document.body.scrollTop;a[1]=document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight;a[1]<a[0]&&(a[1]=a[0]);return a}function closeBox(){var a=document.getElementsByTagName("body")[0],b=document.getElementById("litebox");if(b)b.style.display="none";if(b=document.getElementById("shadow"))b.style.display="none";a.removeChild(b);document.onkeypress="";return!1}function initLitebox(){if(document.getElementsByTagName){var a=document.getElementsByTagName("a");i=0;for(len=a.length;i<len;i++){var b=a[i];if(b.getAttribute("href")&&b.getAttribute("rel")=="lbox")b.onclick=function(){showBox(this);return!1}}b=null}}function addLoadEvent(a){var b=window.onload;window.onload=typeof window.onload!="function"?a:function(){b();a()}}addLoadEvent(initLitebox);document.onkeydown=nav;function nav(a){if(document.getElementById){if(window.event)a=window.event;if(a.ctrlKey){var b=null;switch(a.keyCode?a.keyCode:a.which?a.which:null){case 37:b=document.getElementById("prev");break;case 39:b=document.getElementById("next")}if(b&&b.href)document.location=b.href}}};
