function setlang( lang, actid, page ) {
  switch(actid)
  {
  	case 0:
  		faction = "setparams";
  	break;
  	case 1:
  		faction = "setsearchconditions";
  	break;
  	case 2:
  		faction = "dosearch";
  	break;
  	case 3:
  		faction = "gotopage";
  	break;
  	case 4:
  		faction = "viewpatents";
  	break;
  	case 5:
  		faction = "gotopatentpage";
  	break;
  }
  
  if (document.all["Message"].style.visibility != "visible") {
  document.forms[0].action = "search.php?action="+faction+"&page="+page+"&lang="+lang;

  document.forms[0].submit();
  }
}

function DoSubmit(act) {
  document.all["Message"].style.visibility = "visible";
  document.all["MainTable"].style.visibility = "hidden";
  window.scrollTo(0,0);
  document.forms[0].action = "search.php?action="+act;
  document.forms[0].submit();
}

function dosel(chk) {
  for (i=0; i<ff.length; i++)
    if (ff.elements[i].type == "checkbox")
      ff.elements[i].checked = chk
}

function ata( s ) {
  if (_active != null)
    with (_active) {
      focus();value += s;focus();
    }
}

function clf(idx) {
  with (document.forms[0].elements["qe"+idx]) {
    focus();
    value="";
 }
}

var _active = null, _accessed = "x";

function ma(edt,idx) {
  _active = edt;
  r = new RegExp("x"+idx+"x", "");
  if (_accessed.search(r) == -1) {
    _accessed += idx+"x";
  }
}

function clrall() {
  for (i = 0; i < ff.length; i++)
    if (ff.elements[i].type == "text")
      ff.elements[i].value="";
}

function _movelb() {
  with (document.all.LogicBar.style) {
    posTop = 150 + document.body.scrollTop;
    posRight = 30;
  }
}

function goto( page ) {
  document.forms[0].action = "search.php?action=gotopage&page="+page;
  document.forms[0].submit();
};

function JumpTo(page, direct) {
	var x = Number(document.forms[0].elements["newpos"].value);
	n = 1;
	if ( direct == "back" ) n = page - x;		
	else
	if ( direct == "fwd" ) n = page + x;		
	else
	if ( direct == "to" ) n = x;

	document.forms[0].action = "search.php?action=gotopage&page="+n;
    document.forms[0].submit();
}

function FormAct(act) {
  document.forms[0].action = "search.php?action="+act;
  document.forms[0].submit();
};

/*
function refresh_revoke_interval()
{
	
}
*/
