var menu_sel='', btn_sel='', prvsel='';

function swi(name) {
  if (document.images[menu_sel]) document.images[menu_sel].src='images/dot0.gif';
  if (document.images[name]) document.images[name].src='images/dot1.gif';
}

function sel(id) {
  if (document.getElementById(menu_sel)) document.getElementById(menu_sel).className='';
  if (document.getElementById(id)) document.getElementById(id).className='sel';
  swi(id);
  menu_sel=id;
}

function btn(id) {
  if (document.getElementById(btn_sel)) document.getElementById(btn_sel).className='';
  if (document.getElementById(id)) document.getElementById(id).className='sel';
  btn_sel=id;
}

function wcr(obj) {
  obj.style.cursor='progress';
  document.body.style.cursor='progress';
}

function empty_if(obj,str) {
  if (obj.value==str) obj.value='';
}

function restore_if(obj,str) {
  if (obj.value=='') obj.value=str;
}

function grabText(obj,targt) {
  s=(!document.all)?obj.getSelection():document.selection.createRange().text;
  if (s!='') {
    if (targt && targt.value) targt.value = s;
  }
}

//var dot0 = new Image; dot0.src='images/dot0.gif';
//var dot1 = new Image; dot1.src='images/dot1.gif';
var im0 = new Image; im0.src='images/menu1.gif';
var im1 = new Image; im1.src='images/menu2a.gif';
var im2 = new Image; im2.src='images/menu2b.gif';
var im3 = new Image; im3.src='images/menu2slp.gif';
var im4 = new Image; im4.src='images/mbutr.gif';


