function open_window ( url, width, height ) 
{
  var twidth = width;
  var theight = height;
  var scrollbars = 0;

  if(twidth > screen.width - 80)
  {
    twidth = screen.width - 80;
    scrollbars = 1;
  }
  if(theight > screen.height - 80)
  {
    theight = screen.height - 80;
    scrollbars = 1;
  }

  var pos_x = (screen.width - twidth - 10)/2;
  var pos_y = (screen.height - theight - 29)/2;
   
  if(typeof(source_window) == "undefined" || source_window.closed)  
    source_window = window.open( url,'source_window','menubar=0,toolbar=0,location=0,scrollbars=' + scrollbars + ',screenX='+pos_x+',screenY='+pos_y+',left='+pos_x+',top='+pos_y+',width='+twidth+',height='+theight+',resizable=0');  
  else source_window.location.href = url;
  
	source_window.focus();
}

function op ( url, height )
{
  open_window ( url, 600, 600 );
}

function oo ( url, i_height )
{
	open_window ( url, 640, i_height );
}

var s_opened = '';

function Ukaz ( s )
{
	if ( s_opened == s ) return;
	else if ( s_opened != '' ) Skry ( s_opened );

	var o_obj = document.getElementById ( 'menu_' + s );

	if ( o_obj == null ) return;

	var o_hra = document.getElementById ( 'flash_hra' );

	if ( o_hra != null ) o_hra.style.visibility = 'hidden';

	o_obj.style.zIndex = 1000;
	o_obj.style.display = 'block';

	s_opened = s;
}

function Skry ( s )
{
	var o_obj = document.getElementById ( 'menu_' + s );

	if ( o_obj == null ) return;

	o_obj.style.display = 'none';

        var o_hra = document.getElementById ( 'flash_hra' );

        if ( o_hra != null ) o_hra.style.visibility = 'visible';

	s_opened = '';
}
