function getwindowwidth()      // Определение внутренней ширины окна браузера
{
	if(navigator.appName.indexOf('Netscape')!=-1)
	{
			return window.innerWidth-20;
	}
	else if(navigator.appName.indexOf('Internet')!=-1)
	{
			return document.body.clientWidth;
	}
	self.resizeTo(screen.width,screen.height-25);
	self.moveTo(0,0);
	return getwindowwidth = screen.width-10;
}

var more_content=new Array();
more_content[1]='Весь сайт';
more_content[2]='Путеводитель';
more_content[3]='В событиях';
more_content[4]='в Яндексе';
more_content[12]='Новости';
more_content[22]='Блоги';
more_content[32]='Форум';

function more_over(item_id) 
{
	item_id=item_id.toString();
	document.getElementById('more_item'+item_id).style.background='url(img/more/more2up.gif) no-repeat 4px 3px';
	var item_col=item_id.charAt(0);
	document.getElementById('more_item'+item_col).style.background='url(img/more/more2down.gif) no-repeat 4px 3px';
}

function more_out(item_id) 
{
	item_id=item_id.toString();
	document.getElementById('more_item'+item_id).style.background='';
	var item_col=item_id.charAt(0);
	document.getElementById('more_item'+item_col).style.background='';
}

function more_click(item_id) 
{
	item_id=item_id.toString();
	item_col=item_id.charAt(0);
	document.getElementById('more_item'+item_col).innerHTML=more_content[item_id];
	document.getElementById('a'+item_id).innerHTML=more_content[item_col];
	var temp=more_content[item_col];
	more_content[item_col]=more_content[item_id];
	more_content[item_id]=temp;
}

function more_open() 
{
//	document.getElementById('pointer_global').style.display='none';
	more_move('down');
}

function more_close() 
{
	more_move('up');
	for (var i=1;i<=4;i++) 
		document.getElementById('global_inset'+i).innerHTML=more_content[i];
//	global_inset(item_col);
}

var more_i=0;
function more_move(direct)
{
        if (direct=='down')
        {
                if (more_i<=77)
                        { document.getElementById('more').style.top=more_i+'px'; more_i+=5; setTimeout('more_move("down")',1); }
                else
                        { document.getElementById('more').style.top='77px'; more_i=77; }
        }
        else
        {
                if (more_i>=0)
                        { document.getElementById('more').style.top=more_i+'px'; more_i-=5; setTimeout('more_move("up")',1); }
                else
                        { document.getElementById('more').style.top='0px'; more_i=0; document.getElementById('pointer_global').style.display='block'; }
        }
}


function second_left()
{
        var screen=getwindowwidth();
        document.getElementById('navigator_hidden').style.left=screen/2+160+'px';
        document.getElementById('second_guide_also').style.left=screen/2+120+'px';
}

// saf=second_also_flag; sac - second_also_choice
var saf=0;

function show_second_guide_also()
{
        if (saf==0)
        {
        document.getElementById('second_guide_also').style.display='block';
        saf=1;
        }
        else
        {
        document.getElementById('second_guide_also').style.display='none';
        saf=0;
        }
}

// sac - second_also_choice
/*
function sac(obj)
{
        document.getElementById('second_guide_also_choice').innerHTML=obj.innerHTML;
        document.getElementById('second_guide_also').style.display='none';
        saf=0;
}
*/
function sac(obj,tag)
{
  var tag_inp=document.getElementById("search_tag")
  tag=tag||'';
  tag_inp.value=tag;
//    alert(tag_inp.value)
  document.getElementById('second_guide_also_choice').innerHTML=obj.innerHTML;
  document.getElementById('second_guide_also').style.display='none';
  saf=0;
}


function show_navigator()
{
        document.getElementById('navigator_hidden').style.display='block';
        document.getElementById('second_guide_also').style.display='none';
        saf=0;
}

function close_navigator()
{
        document.getElementById('navigator_hidden').style.display='none';
}