;var AdminFile='/admin.php';;;function center_div()
{this.divname='';this.divobj='';}
center_div.prototype.move_div=function()
{try
{this.divobj=document.getElementById(this.divname);}
catch(e)
{return;}
var my_width=0;var my_height=0;if(typeof(window.innerWidth)=='number')
{my_width=window.innerWidth;my_height=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{my_width=document.documentElement.clientWidth;my_height=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{my_width=document.body.clientWidth;my_height=document.body.clientHeight;}
this.divobj.style.position='absolute';this.divobj.style.display='block';this.divobj.style.zIndex=99;var divheight=parseInt(this.divobj.style.Height);var divwidth=parseInt(this.divobj.style.Width);divheight=divheight?divheight:200;divwidth=divwidth?divwidth:200;var scrolly=this.getYscroll();var scrollx=this.getXscroll();var setX=(my_width-divwidth)/2+scrollx;var setY=(my_height-divheight)/2+scrolly;setX=(setX<0)?0:setX;setY=(setY<0)?0:setY;this.divobj.style.left=setX+"px";this.divobj.style.top=setY+"px";}
center_div.prototype.hide_div=function()
{try
{if(!this.divobj)
{return;}
else
{this.divobj.style.display='none';}}
catch(e)
{return;}}
center_div.prototype.getYscroll=function()
{var scrollY=0;if(document.documentElement&&document.documentElement.scrollTop)
{scrollY=document.documentElement.scrollTop;}
else if(document.body&&document.body.scrollTop)
{scrollY=document.body.scrollTop;}
else if(window.pageYOffset)
{scrollY=window.pageYOffset;}
else if(window.scrollY)
{scrollY=window.scrollY;}
return scrollY;}
center_div.prototype.getXscroll=function()
{var scrollX=0;if(document.documentElement&&document.documentElement.scrollLeft)
{scrollX=document.documentElement.scrollLeft;}
else if(document.body&&document.body.scrollLeft)
{scrollX=document.body.scrollLeft;}
else if(window.pageXOffset)
{scrollX=window.pageXOffset;}
else if(window.scrollX)
{scrollX=window.scrollX;}
return scrollX;}
function Sack(file){this.AjaxFailedAlert="Ваш браузер не поддерживает расширенные возможности управления сайтом, мы настоятельно рекомендуем сменить браузер.\n";this.requestFile=file;this.method="POST";this.URLString="";this.encodeURIString=true;this.execute=false;this.loading_fired=0;this.centerdiv=null;this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onShow=function(message)
{if(!this.loading_fired)
{this.loading_fired=1;if(message)
{document.getElementById('loading-layer-text').innerHTML=message;}
this.centerdiv=new center_div();this.centerdiv.divname='loading-layer';this.centerdiv.move_div();}
return;};this.onHide=function()
{try
{if(this.centerdiv&&this.centerdiv.divobj)
{this.centerdiv.hide_div();}}
catch(e)
{}
this.loading_fired=0;return;};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(err){this.xmlhttp=null;}}
if(!this.xmlhttp&&typeof XMLHttpRequest!="undefined")
this.xmlhttp=new XMLHttpRequest();if(!this.xmlhttp){this.failed=true;}};this.setVar=function(name,value){if(this.URLString.length<3){this.URLString=name+"="+value;}else{this.URLString+="&"+name+"="+value;}}
this.encVar=function(name,value){var varString=encodeURIComponent(name)+"="+encodeURIComponent(value);return varString;}
this.encodeURLString=function(string){varArray=string.split('&');for(i=0;i<varArray.length;i++){urlVars=varArray[i].split('=');if(urlVars[0].indexOf('amp;')!=-1){urlVars[0]=urlVars[0].substring(4);}
varArray[i]=this.encVar(urlVars[0],urlVars[1]);}
return varArray.join('&');}
this.runResponse=function(){eval(this.response);}
this.runAJAX=function(urlstring){this.responseStatus=new Array(2);if(this.failed&&this.AjaxFailedAlert){alert(this.AjaxFailedAlert);}else{if(urlstring){if(this.URLString.length){this.URLString=this.URLString+"&"+urlstring;}else{this.URLString=urlstring;}}
if(this.encodeURIString){var timeval=new Date().getTime();this.URLString=this.encodeURLString(this.URLString);this.setVar("rndval",timeval);}
if(this.element){this.elementObj=document.getElementById(this.element);}
if(this.xmlhttp){var self=this;if(this.method=="GET"){var totalurlstring=this.requestFile+"?"+this.URLString;this.xmlhttp.open(this.method,totalurlstring,true);}else{this.xmlhttp.open(this.method,this.requestFile,true);}
if(this.method=="POST"){try{this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')}catch(e){}}
this.xmlhttp.send(this.URLString);this.xmlhttp.onreadystatechange=function(){switch(self.xmlhttp.readyState){case 1:self.onLoading();break;case 2:self.onLoaded();break;case 3:self.onInteractive();break;case 4:self.response=self.xmlhttp.responseText;self.responseXML=self.xmlhttp.responseXML;self.responseStatus[0]=self.xmlhttp.status;self.responseStatus[1]=self.xmlhttp.statusText;self.onCompletion();if(self.execute){self.runResponse();}
if(self.elementObj){var elemNodeName=self.elementObj.nodeName;elemNodeName.toLowerCase();if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea"){self.elementObj.value=self.response;}else{self.elementObj.innerHTML=self.response;}}
self.URLString="";self.onHide();break;}};}}};this.createAJAX();};;function enableTooltips(id){var links,i,h;if(!document.getElementById||!document.getElementsByTagName)return;h=document.createElement("span");h.id="btc";h.setAttribute("id","btc");h.style.position="absolute";document.getElementsByTagName("body")[0].appendChild(h);if(id==null)links=document.getElementsByTagName("img");else links=document.getElementsByName(id);for(i=0;i<links.length;i++){Prepare(links[i]);}}
function Prepare(el){var tooltip,t,b,s,l;t=el.getAttribute("title");if(t==null||t.length==0)t="Нету";el.removeAttribute("title");tooltip=CreateEl("span","tooltip");s=CreateEl("b","top");s.setAttribute("align","left");s.appendChild(document.createTextNode("Подсказка:"));tooltip.appendChild(s);b=CreateEl("span","bottom");b.setAttribute("align","left");b.appendChild(document.createTextNode(t));tooltip.appendChild(b);setOpacity(tooltip);el.tooltip=tooltip;el.onmouseover=showTooltip;el.onmouseout=hideTooltip;el.onmousemove=Locate;}
function showTooltip(e){document.getElementById("btc").appendChild(this.tooltip);Locate(e);}
function hideTooltip(e){var d=document.getElementById("btc");if(d.childNodes.length>0)d.removeChild(d.firstChild);}
function setOpacity(el){el.style.filter="alpha(opacity:85)";el.style.KHTMLOpacity="0.85";el.style.MozOpacity="0.85";el.style.opacity="0.85";}
function CreateEl(t,c){var x=document.createElement(t);x.className=c;x.style.display="block";return(x);}
function Locate(e){var posx=0,posy=0;if(e==null)e=window.event;if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}
else if(e.clientX||e.clientY){if(document.documentElement.scrollTop){posx=e.clientX+document.documentElement.scrollLeft;posy=e.clientY+document.documentElement.scrollTop;}
else{posx=e.clientX+document.body.scrollLeft;posy=e.clientY+document.body.scrollTop;}}
document.getElementById("btc").style.top=(posy+10)+"px";document.getElementById("btc").style.left=(posx-20)+"px";};window.onload=function(){enableTooltips("config_help")};;;function box_div()
{this.divname='';this.divobj='';}
box_div.prototype.move_div=function()
{try
{this.divobj=document.getElementById(this.divname);}
catch(e)
{return;}
var my_width=0;var my_height=0;if(typeof(window.innerWidth)=='number')
{my_width=window.innerWidth;my_height=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))
{my_width=document.documentElement.clientWidth;my_height=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight))
{my_width=document.body.clientWidth;my_height=document.body.clientHeight;}
this.divobj.style.position='absolute';this.divobj.style.display='block';this.divobj.style.zIndex=99;var divheight=parseInt(this.divobj.style.Height);var divwidth=parseInt(this.divobj.style.Width);divheight=divheight?divheight:200;divwidth=divwidth?divwidth:200;var scrolly=this.getYscroll();var scrollx=this.getXscroll();var setX=(my_width-divwidth)/2+scrollx;var setY=(my_height-divheight)/2+scrolly;setX=(setX<0)?0:setX;setY=(setY<0)?0:setY;this.divobj.style.left=setX+"px";this.divobj.style.top=setY+"px";}
box_div.prototype.hide_div=function()
{try
{if(!this.divobj)
{return;}
else
{this.divobj.style.display='none';}}
catch(e)
{return;}}
box_div.prototype.getYscroll=function()
{var scrollY=0;if(document.documentElement&&document.documentElement.scrollTop)
{scrollY=document.documentElement.scrollTop;}
else if(document.body&&document.body.scrollTop)
{scrollY=document.body.scrollTop;}
else if(window.pageYOffset)
{scrollY=window.pageYOffset;}
else if(window.scrollY)
{scrollY=window.scrollY;}
return scrollY;}
box_div.prototype.getXscroll=function()
{var scrollX=0;if(document.documentElement&&document.documentElement.scrollLeft)
{scrollX=document.documentElement.scrollLeft;}
else if(document.body&&document.body.scrollLeft)
{scrollX=document.body.scrollLeft;}
else if(window.pageXOffset)
{scrollX=window.pageXOffset;}
else if(window.scrollX)
{scrollX=window.scrollX;}
return scrollX;}
var centerdiv;function messbox(title,message,buttons)
{var btn='';for(var i in buttons)
{if(buttons[i]=='close')
{btn=btn+'<input style="border: 1px solid;"  type=button onclick="messbox_close()"  value='+i+'>&nbsp;';}
else
{btn=btn+'<input style="border: 1px solid;" type=button onclick="location.href=\''+buttons[i]+'\'"  value='+i+'>&nbsp;';}}
document.getElementById('message-layer-text').innerHTML=message+'<br><br>'+btn;document.getElementById('message-layer-title').innerHTML=title;centerdiv=new box_div();centerdiv.divname='message-layer';centerdiv.move_div();}
function messbox_close()
{centerdiv.hide_div();};;function GetCommentForm(mod,pid,sid,cid){var divs=document.getElementsByTagName('div');for(var i=0;i<divs.length;i++)
{if(/\bcom/.exec(divs[i].id))
divs[i].innerHTML='';}
var comm_ajax=new Sack();comm_ajax.onShow('');var varsString="";comm_ajax.setVar("name",mod);comm_ajax.setVar("file","ajax_comm");comm_ajax.setVar("pid",pid);comm_ajax.setVar("sid",sid);comm_ajax.setVar("a","true");comm_ajax.requestFile="/modules.php";comm_ajax.method='GET';comm_ajax.element=cid;comm_ajax.runAJAX(varsString);}
function ShowOrHide(d1,d2){if(d1!='')DoDiv(d1);if(d2!='')DoDiv(d2);}
function DoDiv(id){var item=null;if(document.getElementById){item=document.getElementById(id);}else if(document.all){item=document.all[id];}else if(document.layers){item=document.layers[id];}
if(!item){}
else if(item.style){if(item.style.display=="none"){item.style.display="";}
else{item.style.display="none";}}else{item.visibility="show";}}
function zoom(event,full){var x=event.clientX+document.body.scrollLeft;var y=event.clientY+document.body.scrollTop;if(full){var elementid='icon-zoom';}else{{var elementid='icon-in';}}
document.getElementById(elementid).style.display='';document.getElementById(elementid).style.left=x+8+'px';document.getElementById(elementid).style.top=y-10+'px';}
function unzoom(full){if(full){var elementid='icon-zoom';}else{{var elementid='icon-in';}}
document.getElementById(elementid).style.display='none';}
function news_del(id)
{var btns=new Array();btns['Да']=AdminFile+'?mod=News&amp;op=News_remove&amp;ok=1&amp;news_id='+id;btns['Нет']='close';messbox('Confirm','Вы уверены<br>что хотите удалить<br>эту новость?',btns)}
function Reload()
{uniq=new Date();uniq="&"+uniq.getTime();var img=document.getElementById('kapcha_img');newImage=img.src;index=newImage.indexOf("&",0);if(index>0)
{newImage=newImage.substr(0,index);}
img.src=newImage+uniq;};
