var 
$_D=document,
$_W=window,
$_BASE=$_W.location.protocol+'//'+$_W.location.host+'/',
$_B=new function(){
var b=navigator.userAgent;
this.op=(/opera/i.test(b));this.ff=(/firefox/i.test(b));this.gc=(/chrome/i.test(b));this.sf=(!this.gc&&/safari/i.test(b));this.ie=(/msie/i.test(b)&&!this.op);this.webkit=(/WebKit/i.test(b));this.gecko=(!this.webkit&&/Gecko/i.test(b));this.presto=(this.op);this.v=parseFloat(this.ie&&b.replace(/^.*?MSIE\s([\d\.]+).*?$/,'$1')
||this.ff&&b.replace(/^.*?firefox\/([\d]+\.[\d]+).*?$/i,'$1')
||this.gc&&b.replace(/^.*?Chrome\/([\d]+\.[\d]+).*?$/i,'$1')
||navigator.appVersion
)
},
$Load=new function()
{
var 
_aCfg={
v:'0.002',ns:'main',lc:'ru',js:['core/corebase', 'core/corext'],css:[],set:[]};
(function(n,a,i){
try{
n=$_D.getElementById('x_cfg');
if(n&&n.onclick)
{
a=n.onclick();
n.onclick=null
}
if(a)
{
if(a.js)_aCfg.js=_aCfg.js.concat(a.js);
if(a.css)_aCfg.css=_aCfg.css.concat(a.css);
if(a.v)_aCfg.v=a.v;
if(a.ns)_aCfg.ns=a.ns;
if(a.lc)_aCfg.lc=a.lc;
if(a.set)_aCfg.set=_aCfg.set.concat(a.set)
}
}catch(ex){}
i=$_D.cookie;
i.match(/^(.*?)x_NS=([\w\d_-]*);?(.*?)$/)&&(_aCfg.ns=RegExp.$2);
i.match(/^(.*?)x_LC=([\w\d_-]*);?(.*?)$/)&&(_aCfg.lc=RegExp.$2);
i.match(/^(.*?)x_VX=([\d\.]*);?(.*?)$/)&&(_aCfg.v=RegExp.$2);
i=location.search;
i.match(/^(.*?)[\?\&\#]NS=([\w\d_-]*)&?(.*?)$/)&&(_aCfg.ns=RegExp.$2);
i.match(/^(.*?)[\?\&\#]LC=([\w\d_-]*)&?(.*?)$/)&&(_aCfg.lc=RegExp.$2);
i.match(/^(.*?)[\?\&\#]VX=([\d\.]*)&?(.*?)$/)&&(_aCfg.v=RegExp.$2);
a=i=n=undefined
})();
$_NS=_aCfg.ns;
$_LC=_aCfg.lc;
var 
th=this,
_bLoad=0,
_aLdJs={},
_aLdCss={},
_aCbs=_aCfg.set||[],
_aJss=[],
_pfx=function(f)
{
if(0!=f.indexOf('http://')||0==f.indexOf($_BASE))
f=((-1!=f.indexOf('{ns}:'))&&f.replace('{ns}:',_aCfg.ns+'/')
||(-1!=f.indexOf('{lc}:'))&&f.replace('{lc}:','lc/' + _aCfg.lc + '/')
||f)+'?'+_aCfg.v;
return f
},
_get_head=function(h)
{
h=$_D.getElementsByTagName('head');
if((!h||!(h=h[0]))&&!_bLoad)
{
$_D.write('<head><title></title></head>');
h=_get_head()
}
return h
},
__js=function(f,h,s)
{
f=_pfx(_aJss.shift());
h=_get_head();
s=$_D.createElement('script');
h.insertBefore(s,h.firstChild);
s.type='text/javascript';
s.language='javascript';
(s.setAttribute)?s.setAttribute('src',f):s.src=f;
f=h=s=undefined
},
_js=function(f)
{
_aJss.push(f);
setTimeout(__js,10)
},
_css=function(f,h,l)
{
f=_pfx(f);
h=_get_head();
l=$_D.createElement('link');
h.insertBefore(l,h.firstChild);
l.type='text/css';
l.rel='stylesheet';
(l.setAttribute)?l.setAttribute('href',f):l.href=f;
f=h=l=undefined
};
this._ald=function(i)
{
while(i=_aCfg.js.shift())
i&&!_aLdJs[i]&&(_aLdJs[i]=1)
&&$_D.write('<script type="text/javascript" language="javascript" src="js/'+_pfx(i+'.js')+'"></script>');
while(i=_aCfg.css.shift())
i&&!_aLdCss[i]&&(_aLdCss[i]=1)
&&$_D.write('<link rel="stylesheet" type="text/css" href="css/'+_pfx(i+'.css')+'"/>');
};
this.js=function(f)
{
if('string'==typeof f&&f&&!_aLdJs[f])
{
_aLdJs[f]=1;
_js('js/'+f+'.js')
}
};
this.css=function(f)
{
if('string'==typeof f&&f&&!_aLdCss[f])
{
_aLdCss[f]=1;
_css('css/'+f+'.css')
}
};
this.set=function(f)
{
if('function'==typeof f)
(_bLoad)?f():_aCbs.push(f)
};
$_W.onload=function(f)
{
while(f=_aCbs.shift())
try{
f()
}catch(e){}
_bLoad=1;
$_W.onload=_aCbs=f=null
};
};
$Load._ald();
