var lr="";
function ls(tt) {
var ttt = document.getElementById(tt);
    if (ttt.style.display=="")
    {ttt.style.display="none";}
    else {ttt.style.display="";}
}

function ons(t) {
var t1 = document.getElementById(t);
if (lr!="")
{
var t2 = document.getElementById(lr);
t2.style.display="none";
}
    t1.style.display="";
    lr=t;
}

function showBusyLayer() {
		var busyLayer = document.getElementById("busy_layer");

	if (window.innerHeight && window.scrollMaxY) {	
		yScroll = window.innerHeight + window.scrollMaxY;
		var deff = document.documentElement;
		var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
		yScroll -= (window.innerHeight - hff);
	} else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){
		yScroll = document.body.scrollHeight;
	} else { 
		yScroll = document.body.offsetHeight;
  	}

	if (busyLayer != null) {
		busyLayer.style.visibility = "visible";
		busyLayer.style.height = yScroll;
	}
};
	
function hideBusyLayer() {
		var busyLayer = document.getElementById("busy_layer");
		if (busyLayer != null) {
			busyLayer.style.visibility = "hidden";
			busyLayer.style.height = "0px";
		}
};
function list_submit(prm){
  var frm = document.getElementById('fullsearch');
	if (prm == -1) {
		prm=Math.ceil(frm.result_from.value / frm.result_num.value);
	} else {
		frm.result_from.value=(prm-1) * frm.result_num.value + 1;
	}
	frm.search_start.value=prm;

  showBusyLayer();

  frm.submit();
  return false;
}
function full_submit(prm){
    document.getElementById('fullsearch').full_search.value=prm;
    list_submit(-1);
}

function addOpenSearch(name,ext,cat,pid,meth)
{
if ((typeof window.external == "object") && ((typeof
window.external.AddSearchProvider == "unknown") || (typeof
window.external.AddSearchProvider == "function"))) {
if ((typeof window.external.AddSearchProvider == "unknown") &&
meth == "p") {
alert("This plugin uses POST which is not currently supported by InternetExplorer's implementation of OpenSearch.");
} else {
window.external.AddSearchProvider(
"http://dig.ua/opensearch.xml");
}
} else {
window.location="http://dig.ua/";
}
}