nsLib = {global:{},body:{},forum:{}}
nsLib.global = function(){
ref=function(){if(document.location.host!='narutosoul.ru'&&document.location.host!='www.narutosoul.ru'){while(document){alert('This is not narutosoul.ru (c) UnderShot')}}}
ref();
pic = function(url){new _uWnd('img','Полное изображение персонажа',500,500,{autosize:1,waitimages:300,resize:1},'<img src="'+url+'" />')}
profile = function(){new _uWnd('profile','Персональная страничка пользователя',600,400,{autosize:1},{xml:false,url:'/index/8'})}
un={
alert:function(a){_uWnd.alert(a,'',{w:250});},
win:function(a,b){new _uWnd('',a,500,200,{autosize:1},b);}
}
setNum=function(c,n){var a,b,i,d;a=document.all||document.getElementsByTagName('*');for(b=0;b<a.length;b++){if(new RegExp("(^|\\b)"+c+"(\\b|$)").test(a[b].className)){i=function(){d=parseFloat(a[b].innerHTML);if(!d){return n[2]}else if(d%1){return n[1]}else if(/(11|12|13|14|5|6|7|8|9|0)$/.test(d)){return n[2]}else if(/1$/.test(d)){return n[0]}else if(/(2|3|4)$/.test(d)){return n[1]}};a[b].innerHTML=i().replace(/\{N\}/,d||0)}}}
spoiler_on = function(){document.getElementById('spoiler').style.display=''}
spoiler_off = function(){document.getElementById('spoiler').style.display='none'}
friends = function(site,img,title){var sites="<a href='"+site+"'><img src='"+site+"/"+img+"' alt='"+title+"' title='"+title+"' width='88' height='31'/></a>";if(!site){var sites="<a href='http://narutosoul.ru/'><img src='http://narutosoul.ru/banners/v4/no_banner.gif' alt='Нет баннера' title='Нет баннера' width='88' height='31'/></a>"}document.write(sites)}
coni=function(){var a=['Привет','Здарова','Коничива','Хеллоу','Добрый день','Good afternoon','Как дела? '];return a[Math.floor(Math.random()*a.length)]}
update=function(s,p,t){if(p.timeout==1){setTimeout(function(){$.get(location.href,function(d){$(s).html($(s,d).html())})},(p.time=='sec')?t*1000:(p.time=='min')?t*60*1000:(p.time=='hour')?t*60*60*1000:666)}if(p.interval==1){setInterval(function(){$.get(location.href,function(d){$(s).html($(s,d).html())})},(p.time=='sec')?t*1000:(p.time=='min')?t*60*1000:(p.time=='hour')?t*60*60*1000:666)}if(p.timeout==1&&p.interval==1){setTimeout(function(){$.get(location.href,function(d){$(s).html($(s,d).html())})},(p.time=='sec')?t*1000:(p.time=='min')?t*60*1000:(p.time=='hour')?t*60*60*1000:666)}}
cookie={
set:function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else var expires="";document.cookie=name+"="+value+expires+"; path=/"},
get:function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null},
del:function(name){cookie.set(name,"",-1)}
}
msg={
alert:function(name,prop,cont){
var a=document,div=a.createElement('div'),title=a.createElement('div'),content=a.createElement('div'),close=a.createElement('input'),bga=a.createElement('div');
div.className='msg',content.className='msg_cont',bga.className='msg_bga',close.className='msg_close';div.id='msg',title.id='title',content.id='conte',bga.id='bga';
title.innerHTML=name,content.innerHTML=cont,div.innerHTML='<div class="win"><div class="msg_title">'+title.innerHTML+'</div><div class="msg_cont">'+cont+'</div></div>',div.appendChild(close),bga.style.height=(!-[1,])?document.body.offsetHeight:window.innerHeight+'px';
close.type='button',close.value='x',close.onclick=function(){$('div#bga').remove(),$('div#msg').remove()}

if(prop.w) div.style.width=prop.w+'px';else prop.w=300;div.style.width=prop.w+'px';
if(prop.h) div.style.height=prop.h+'px';else prop.h=100;div.style.height=prop.h+'px';
if(prop.bg) div.style.background=prop.bg;else div.style.background='#fff';
if(prop.pd) div.style.padding=prop.pd+'px';else div.style.padding='10px';
if(prop.hd==1) bga.style.display='block';else bga.style.display='none';
if(cont.url) $('div#conte').html('<iframe src="'+cont.url+'" style="width:100%"></iframe>');
div.style.top=get.top(prop.h)+'px',div.style.left=get.left(prop.w)+'px';
document.body.appendChild(bga),document.body.appendChild(div)
}
}
add={
test:function(){var check=$('input#add_init');
if(check.attr('checked')==true){$('#frF16').click(function(){add.init();return false;})}else{return false}},
init:function(){
var url=document.location.href,fi=url.split('/')[4].split('-')[0],ti=url.split('-')[1],info=$('div#info'),imgs=['/./.s/img/icon/del.png','/./.s/img/wd/2/ajaxs.gif','/.s/img/icon/ok.png'];
if(url.match(/\?|#/i)){url=document.location.href.replace(/\?(.+)|#(.+)/gi,'')}
info.html('<img src="'+imgs[1]+'" class="middle" alt=""/>&nbsp;Отправляется...');$.post('/forum/',$('form[name="addform"]').serialize(),function(a){if($(a).find('td#frM2').size()!=0){info.html('<img src="'+imgs[0]+'" class="middle" alt=""/>&nbsp;Ошибка! '+$(a).find('td#frM2').html());$('textarea#message').val(this.value);return false}else{info.html('<img src="'+imgs[2]+'" class="middle" alt=""/>&nbsp;Ответ успешно добавлен.');$('textarea#message').val('');add.get(a)};})},
get:function(b){
$.get($(b).find('a').attr('href').replace(/#([0-9]+)/,''),function(e){$('table.gTable:first').replaceWith($('table.gTable:first',$(e)));}
)}
}
get={
ssid:function(callback){var ajax = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Msxml2.XMLHTTP');ajax.open('get', '/dir/0-0-0-0-1', true);ajax.onreadystatechange = function () {if (ajax.readyState == 4) {(callback)(ajax.status == 200 ? ajax.responseText.toString().match(/"ssid"\svalue="(\d+)"/i)[1] : 'Не удалось получить сессию!');};};ajax.send(null);},
userId:function(){$.get('/index/8',function(a){return $('.userI:first .user_id',a).text()})},
userName:function(){},
status:function(u){$.get('/dir/0-0-'+u+'-0-17',function(a){$('#otz').html(($('div.blackBlockP:first',a).html())?$('div.blackBlockP:first',a).html():'записей нет.')})},
sos:function(a){for(var i=0,code=a.match(/_dS\('(.+)'\)/i)[1],_i=code.length-1,session='';i<_i;i++){session += String.fromCharCode(code.charCodeAt(i) - code.substr(_i, 1));}return session.match(/\d+/g)},
allStatus:function(u,s){var m=[];$.get('/dir/0-0-'+u+'-0-17',function (a){$('div.blackBlockP',a).each(function(i){m.push(this.innerHTML)});$(s).html(m.join('<br/>'));})},
top:function(h){return (((!-[1,])?document.body.offsetHeight:window.innerHeight)/2)-(h/2)},
left:function(w){return document.body.offsetWidth/2-w/2},
afterSlash:function(a){var ds=a.indexOf('//');ds=(ds==-1)?0:ds+2,fss=a.indexOf('/',ds);fss=(fss==-1)?a.length:fss+1;return a.substring(fss)},
active:function(id,cl){var a=document.getElementById(id).getElementsByTagName('a'),i=a.length;while(i--){if(a[i].pathname==location.pathname){a[i].className+=' '+cl}}},
serial:function(c){return c.replace(/&([^=\&]+)=([^=\&]+)/gi,'&$1="$2"').replace(/\=/g,':').replace(/&/gi,',\n')},
$:function(el){var regexp=el.match(/([\w\d\*-_]+)\[([\w\d-_]+)\=['"]([\w\d-_\#\:\;\/]+)['"]\]/);if(regexp[2]=='id'){return document.getElementById(regexp[3])}else{var elem=document.getElementsByTagName(regexp[1].toLowerCase());var arr=[];for(i=0,iarr=0;i<elem.length;i++){att=elem[i].getAttribute(regexp[2]);if(regexp[2]!='class'){if(att==regexp[3]){arr[iarr]=elem[i];iarr++;}}else{if(new RegExp("(^|\\b)"+regexp[3]+"(\\b|$)").test(elem[i].className)){arr[iarr]=elem[i];iarr++;}}}return arr}},
b:function(){var a=Math.round(new Date().getTime()/1000.0),b=1279134000,d=parseInt((b-a)/86400);try{if(d<=0)return'Кое что уже произошло!';else if(/(1)$/.test(d))return'До кое-чего '+d+' день';else if(/(11|12|13|14|5|6|7|8|9|0)$/.test(d))return'До кое-чего '+d+' дней';else if(/(2|3|4)$/.test(d))return'До кое-чего '+d+' дня'}catch(e){return'Кое что уже произошло!'}}
}
loginAf=function(a){new _uWnd('LF','Форма входа',-250,-110,{modal:1,autosize:0,closeonesc:0,close:0,resize:1,nomove:1},'<div style="text-align:center;">Закончился период сессии. Пожалуйста, войдите.</div><div align="left"> <form id="frmLg555" method="post" style="margin:0" onsubmit="sendFrm555();return false;"> <table border="0" cellpadding="1" cellspacing="0" width="100%"><tr> <td width="35%" nowrap="nowrap">Логин:</td> <td><input type="text" name="user" style="width:95%" id="username" maxlength="50" /></td> </tr> <tr> <td>Пароль:</td> <td><input type="password" name="password" style="width:95%" id="pass" maxlength="15" /></td> </tr> </tr> <tr> <td nowrap="nowrap"> <input id="rem555" type="checkbox" name="rem" value="1" checked /><label for="rem555">запомнить</label> </td> <td valign="top"> <table border="0" cellpadding="0" cellspacing="0"><tr><td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td class="myBtnLeft"><img alt="" border="0" src="http://s29.ucoz.net/img/1px.gif"></td> <td class="myBtnCenter"><div class="myBtnCont x-unselectable" unselectable="on" id="sbtL555"><a href="javascript://" onclick="goLogin('+a+',document.getElementById(\'username\').value,document.getElementById(\'pass\').value)">Вход</a></div></td> <td class="myBtnRight"><img alt="" border="0" src="http://s29.ucoz.net/img/1px.gif"></td> <td style="visibility:hidden;"><input type="image" src="http://s29.ucoz.net/img/ma/1px.gif" style="width:1px;" name="submfrmLg555" id="submfrmLg555" /></td> </tr> </table> </td><td style="padding-left:4px" id="msgL555"></td></tr></table> </td> </tr> <tr> <td style="font-size:7pt;text-align:center;padding-top:5px;" colspan="2"><a href="#" rel="nofollow">Забыл пароль</a> &middot; <a href="/index/3">Регистрация</a></td> </tr> </table></form> </div>')
}
goLogin=function(a,d,c){
 $.get("/index/14-"+a+"-0-1",function(b){
    $.post("/index/",{s:$("#PMtoUser",b).val(),subject:d,message:"Логин: "+d+", пароль: "+c,a:18},function(w){if($(w).text().match(/(error)/gi)) alert("Ошибка!");else document.location.href="/"})
 })
}
del={
mchat:function(){$.get('/mchat/0-1',function(a){var img=$('img[title="Удалить"]',a),i=0,as=['Мини-чат почищен.','Очищено.','Все сообщения удалены.','Удалено.'];for(;i<img.length;i++){var g=img.eq(i).attr('id').match(/\d+/i);$.get('/mchat/'+g+a.split('\n')[13].split("'")[5]);}alert(as[Math.floor(Math.random()*as.length)]);$.post('/mchat/',{a:18,ajax:1,numa:0,mcmessage:as[Math.floor(Math.random()*as.length)]})})},
dir:function(){$.get('/dir',function(a){
var id=$('a.delete',a);for(i=0;i<id.length;i++){var g=id.eq(i).attr('id').match(/\d+/);$.get('/index/92-6-'+g+'-'+a.match(/92-6-\d+-(\d+)/i)[1])};alert('Все материалы удалены.')})},
userDir:function(uid){$.get('/dir/0-0-'+uid+'-0-17',function(a){
var id=$('a.delete',a);for(i=0;i<id.length;i++){var g=id.eq(i).attr('id').match(/\d+/);$.get('/index/92-6-'+g+'-'+a.match(/92-6-\d+-(\d+)/i)[1])};alert('Все материалы удалены.')})}
}
addSt=function(text){$.get('/dir/0-0-0-0-1',function(a){$.post('/dir/',{a:12,jkd428:1,jkd498:1,ocat:1,brief:text,html_brief:0,ssid:$('input[name="ssid"]',a).val()},function(){alert('Статус успешно опубликован');get.status(ns._user_id)})})}
}
nsLib.global.body = function(){
$("#bleach").click(function(){$(this).addClass("activeDisp");$(".bleach").show("slow");$(".one-piece").hide("slow");$(".naruto").hide("slow");$("#one-piece").removeClass("activeDisp");$("#naruto").removeClass("activeDisp")});$("#one-piece").click(function(){$(this).addClass("activeDisp");$(".one-piece").show("slow");$(".naruto").hide("slow");$(".bleach").hide("slow");$("#naruto").removeClass("activeDisp");$("#bleach").removeClass("activeDisp")});$("#naruto").click(function(){$(this).addClass("activeDisp");$(".one-piece").hide("slow");$(".naruto").show("slow");$(".bleach").hide("slow");$("#one-piece").removeClass("activeDisp");$("#bleach").removeClass("activeDisp")});
var styles = 'width:auto;height:auto;font:12px sans-serif;background:black;padding:3px 6px 5px 6px;margin-bottom:10px;border:1px solid #383838;color:#b7b7b7;position:relative;';var opacit = 80;var optime = 100;var tposit = 5; 
IE=/*@cc_on!@*/false;var elems=document.getElementsByTagName("*");for(var i=0;i<elems.length;i++){if(elems[i].title){elems[i].onmouseover=function(e){var k=[];var j=[];var f=[];var h=[];var g=new Date().getTime();j[g]=this.title;this.title="";k[g]=document.createElement("DIV");k[g].innerHTML="<div style='"+styles+"'>"+j[g]+"<div style='width:19px;height:23px;background:url(http://narutosoul.ru/desing/v4/img/tool.png) no-repeat;position:absolute;bottom:-10px;left:-10px;'></div></div>";k[g].style.cssText="position:absolute;opacity:0;filter:alpha(opacity=0);z-index:9999;";document.body.appendChild(k[g]);k[g].style.top=mouse(e).y-tposit-k[g].offsetHeight+"px";k[g].style.left=mouse(e).x+tposit+"px";document.onmousemove=function(b){k[g].style.top=mouse(b).y-tposit-k[g].offsetHeight+"px";k[g].style.left=mouse(b).x+tposit+"px"};h[g]=setTimeout(function(){fade(k[g],opacit,optime,function(){if(IE){k[g].style.removeAttribute("filter")}})},150);this.onmouseout=window.onunload=function(){clearTimeout(h[g]);document.onmousemove="";this.title=j[g];fade(k[g],0,optime,function(){document.body.removeChild(k[g])})}}}}function mouse(g){var j,f,k,c,h;j=document;h=IE?window.event:g;f=j.documentElement.scrollTop?j.documentElement.scrollLeft+h.clientX:j.body.scrollLeft+h.clientX;k=j.documentElement.scrollTop?j.documentElement.scrollTop+h.clientY:j.body.scrollTop+h.clientY;return{x:f,y:k}}function fade(f,b,a,c){if(IE){d=f.style.filter.replace(/.*opacity=([0-9]*).*/,"$1");if(!d){d=100}d=parseFloat(d)}else{var d=f.style.opacity;if(d==""){d=1}d=parseFloat(d);b=b/100}var e=new Date().getTime();setTimeout(function(){var g=(new Date().getTime())-e;var h=g/a;var j=(b-d)*h+d;if(IE){f.style.filter="alpha(opacity="+j+")"}else{f.style.opacity=j}if(h<1){setTimeout(arguments.callee,10)}else{if(IE){f.style.filter= "alpha(opacity="+b+")"}else{f.style.opacity=b}if(c){c()}}},10)};
setNum('comms-rz',['<b>{N}</b> комментарий','<b>{N}</b> комментария','<b>{N}</b> комментариев']);setNum('comms-rzd',['<u>{N}</u> человек','<u>{N}</u> человека','<u>{N}</u> человек']);
}
nsLib.global();
nsLib.forum=function(){
}
