   re = /doc=(\d+)*(.*)/;
   var m = re.exec(location) || 0;
   var doc_id= m[1] || 0;
   pril_id=m[2] || '';   

re = /banner=(\d+)/; 
   var m = re.exec(location) || 0;
   var banner_id = m[1] || 0;

   var hit = new Array;
function move_art_tools(){
var text=g('hypersearch').innerHTML;

}

   function setCalendar(){
    try{
    document.getElementById("calendar_container").style.width = ( document.body.clientWidth<1100 ? '100%' : '85%');
      }
      catch(e) {}
   }


function setfavorite(url, description)
{
try
  {
   window.external.addFavorite(url, description);
  }
catch(e) {alert('Èñïîëüçóéòå Âàø áðàóçåð');}
}


function setfavorite2(siteurl,sitename) {
        var name = navigator.appName;
        var useragent = navigator.userAgent;
        var version = parseInt(navigator.appVersion);
        var needtoknow = 1;
        if ( useragent.indexOf("MSIE") != -1) {
                        var index = navigator.userAgent.indexOf("MSIE ");
                        if ( index != -1 ) {
                                version = parseInt(navigator.userAgent.substring(index+5,index+6));
                        }
                        if ( version > 4) {
                                window.external.AddFavorite(siteurl,sitename);
                                needtoknow = 0;
                        }
        }
        if ( needtoknow != 0) {
         window.location='/bookmarks';
        }
}


function g(id){
return document.getElementById(id)
}

function switchTab(block_name, number, total)
{
  for (i = 0; i < total; i++)
  {
   if (i == number)
    {
     g(block_name+'_'+String(i)).style.display=''; g('tab_' + block_name+'_'+String(i)).className='sel';}
   else
   {g(block_name+'_'+String(i)).style.display='none'; g('tab_' + block_name + '_' + String(i)).className='';};
  }
}


function switchMenuTop(razdel)
{
menutop= ['today','pril','news','foto','forum','about','archive'];
  //alert(menutop.length);
  for (i = 0; i < menutop.length; i++)
  {
     clas='';
     if (menutop[i] == razdel)
       clas='sel';

     try {
     g('menu_top_'+ menutop[i]).className=clas;
     }
      catch(e) {};
  }
}


function switchInRightBlockOLD(block, razdel)
{
  massiv=eval(block+'_array');
  for (i = 0; i < massiv.length; i++)
  {
     if (massiv[i] == block+'_'+razdel)
       {g(massiv[i]).style.display=''; g('tab_'+massiv[i]).className='sel';}
      else
       {g(massiv[i]).style.display='none'; g('tab_'+massiv[i]).className='';};
  }
}



function openWin2(id) {
    myWin= open(id);
}

function getTopDoc(){
    var str='http://www.ng.ru/gettop/'+doc_id;
    document.getElementById("hit_container").innerHTML=str;
}

function toggleElement(id) {
    e = document.getElementById(id);
    if (e.style.display) {
        e.style.display = '';
        return true;
    } else {
        e.style.display = 'none';
        return false;
    }
}


function Activz2(numz, nameblock, allbl)
{
x=allbl-1;

for (i=0; i<=x; i++)
{
nz='tab_'+nameblock+'_'+String(i);
nb=nameblock+'_'+String(i);
document.getElementById(nz).className="";
document.getElementById(nb).style.display='none';
document.getElementById("rightb2_"+nameblock).style.display='block';
}

document.getElementById('tab_'+nameblock+'_'+numz).className="activ";
document.getElementById(nameblock+'_'+numz).style.display='block';

if (numz==x) {document.getElementById("rightb2_"+nameblock).style.display='none';}
}


function fillCalendar(id){
     document.getElementById(id).innerHTML = '\
     <table class=calendar border=0 cellspacing=0 cellpadding=0>\
      <tr valign=top>\
       <td><div class=years id='+id+'_year></div></td>\
       <td><div class=months id='+id+'_month></div></td>\
       <td>\
        <div id='+id+'_day></div>\
        <div id='+id+'_event class=event></div>\
       </td>\
      </tr>\
     </table>\
     ';

     var max_year = 2006;
     var max_month = new Array();
    for(y=start_year; y<=end_year;y++){
           _year = eval('y'+String(y));
   	    max_month[y] = _year.length-1;
     }

this.putMonth = function (id, y, m){
      var s='';
      for(i=1;i<=12;i++){
      try{
      _year=eval('y'+String(y));
      }
      catch(e) {_year=new Array();}
s += '<div ' + ( dms=_year[i] == null ? 'class=no' : (i==m?'class=cur':'onClick="parent.putMonth(\''+id+'\', '+y+','+i+')"'))+ '>&nbsp;' + month_rome[i-1]+'&nbsp;</div>';
}
document.getElementById(id+"_month").innerHTML=s;
s = '<table class=days width=100% border=0 cellspacing=0 cellpadding=0><tr class=dof><td>ÎÌ</td><td>ÁÐ</td><td>ßÏ</td><td>ÂÐ</td><td>ÎÐ</td><td>ßÀ</td><td>Áß</td></tr><tr valign=top>';
i=0; d=0;

var cd = new Date(y, m-1, 1);
var curWDay = (cd.getDay()==0 ? 7 : cd.getDay());
var curStrDate=todayYear+"-"+ format2(todayMonth)+'-'+format2(todayDay);

while(d<getDaysNumber(y,m)){
i++;
if(curWDay>i){
s += '<td>&nbsp;</td>'
}else{
d++;
cd = new Date(y, m-1, d); 
dss=_year[m].toString(); 
try{
}
catch(e){};
dse=dss.indexOf(';'+d.toString()+';')>-1?true:false;
str_date=y+'-'+format2(m)+'-'+format2(d);
s += '<td><div '+( str_date == curStrDate ? ' class=cur ' : ((cd.getDay() == 0 || cd.getDay() == 6) ? ' class=holiday ' : ''))+'>'+(dse?'<a href=/'+str_date+'/issue.html>'+d+'</a>' : d )+'</div></td>'+(cd.getDay() == 0 ? '</tr><tr>' : '' );
}
}
document.getElementById(id+"_day").innerHTML=s+'</tr></table>';

try{
_mm=eval('mm'+String(y));
_text =_mm[m] ? _mm[m]: '';
document.getElementById(id+"_event").innerHTML=_text;
}
catch(e){};

document.getElementById(id+"_day").innerHTML=s+'</tr></table>';
}

this.putYear = function(id, curYear){
   var s='';
   for(y=max_year;y>=start_year;y--){
       s += '<div '+( y == curYear ? 'class=cur':'onClick="parent.putYear(\''+id+'\', '+y+')"' )+'>'+y+'</div>';
   }
   document.getElementById(id+"_year").innerHTML=s+'';
   document.getElementById(id+"_event").innerHTML='';
   putMonth(id, curYear, max_month[curYear]);
}
     this.putYear(id, todayYear);
     //this.putYear(id, max_year);
     //alert(todayMonth+ "    " );
     //this.putMonth(id, max_year, max_month[max_year]);
     //alert(todayYear);
     this.putMonth(id, todayYear, todayMonth);

}

function Im(num, url, title) {
    this.id= num;
    this.url= url;
    this.title= title;
    //this.image= image;
}


function switchImage(offset,gid) {
_cur_im=eval('cur_im'+gid);
_max_im=eval('max_im'+gid);
_mImages=eval('mImages'+gid);
if ((_cur_im<_max_im && offset>0) || (_cur_im>1 && offset<0)){
_cur_im = _cur_im + offset;
eval('cur_im'+gid+'='+_cur_im+';');

g('curIm'+gid).src = imagessite + _mImages[_cur_im].url;
g('curImTitle'+gid).innerHTML = _mImages[_cur_im].title;
g('curImNum'+gid).innerHTML = _cur_im;
if (_cur_im == 1) g('im_back'+gid).src = 'http://stanislavsky.ng.ru/i/m_back_na.gif'
   else g('im_back'+gid).src = 'http://stanislavsky.ng.ru/i/m_back.gif';
if (_cur_im == _max_im) {g('im_fwd'+gid).src = 'http://stanislavsky.ng.ru/i/m_fwd_na.gif';g('last_message'+gid).style.display='';}
   else g('im_fwd'+gid).src='http://stanislavsky.ng.ru/i/m_fwd.gif';
}
//alert(_cur_im + ' ' + _max_im);
}


document.domain = "ng.ru";
var iframe_hidden = true;
function showIFrame() {
                if (iframe_hidden) {
                        if (document.getElementById('hsLoading') != null)
                                document.getElementById('hsLoading').style.display = "none";
                }
        }
        setTimeout("showIFrame()", 20000);

function toggle_visibility (e){
var hsdiv = document.getElementById('hsDivIFrame');
hsdiv.style.display = (hsdiv.style.display == 'none')?'':'none';
}

