
function move_line ( from, to )
{
  for(x = 0;x<(from.length);x++)
  {
    if(from.options[x].selected)
    {
      with(to)
      {
        options[options.length] = new Option(from.options[x].text,from.options[x].value);
      }
      from.options[x] = null;
      x = -1;
    }
  }
  return true;
}  
  
function concat_ids ( sel )
{
  out = "";
  for(x = 0;x<(sel.length);x++)
  {
    out += sel.options[x].value;
    if ( x <(sel.length-1) )
    {
     out += ":";
    }
  }
  return out;
}

function move_vert ( dir, sel )
{
  txt = "";
  val = 0;
  step = -1;
  for(x = 0;x<(sel.length);x++)
  {
    if( sel.options[x].selected )
    {
      if ( x == 0 && dir != "down" )
      {
        return true;
      }
      if ( x == sel.length-1 && dir == "down" )
      {
        return true;
      }
      if ( dir == "down" ) step = 1;
      txt = sel.options[x].text;
      val = sel.options[x].value;
      sel.options[x].text = sel.options[x+step].text
      sel.options[x].value = sel.options[x+step].value
      sel.options[x+step].text = txt;
      sel.options[x+step].value = val;
      sel.options[x+step].selected = true;
      return true;
    }
  }
  return true;
}

function clear_sel ( sel )
{
  for(x = 0;x<(sel.length);x++)
  {
    sel[x].checked = false;
  }
}

function List_Go(href)
{
	window.location.href = href;
}

function size_info_window() {
	window.resizeTo(600,400);
}

function close_info_window_reload() {
	if (opener == null) {
		self.close();
	} else
	{
		opener.location.reload();
		opener.focus();
		self.close();
	}
}

function bvd_check_all ( formname, checkname, is_checked )
{
	var el_collection = eval("document.forms." + formname + ".elements");
	for (c=0;c<el_collection.length;c++)
	{
		if (el_collection[c].name == checkname)
		{
			el_collection[c].checked=is_checked;
		}
	}
}
