function setlang( lang, actid, page ) {
  switch(actid)
  {
  	case 1:
  		faction = "setsearchconditions";
  	break;
  	case 2:
  		faction = "dosearch";
  	break;
  	case 3:
  		faction = "gotopage";
  	break;
  }
  
  if (document.all["Message"].style.visibility != "visible") {
  document.forms[0].action = "search.php?action="+faction+"&page="+page+"&lang="+lang;
  //alert(document.forms[0].action);
  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 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 _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 printpr() {
  var PROMPT = 1;
  var OLECMDID = 7;
  var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  WebBrowser1.ExecWB(OLECMDID, PROMPT);
  WebBrowser1.outerHTML = "";
};

