function di(file)
{  window.open("download.php?file="+file,"","toolbar=no,width=836,height=760, directories=no,status=no, scrollbars=yes, resizable=yes, menubar=no");
return false;
}

function wrt(str){ document.open(); document.write(str); document.close(); }

function encodeUTF(str)
{
  strenc="";

  for(j=0; j<str.length; j++)
  {
     aa=(str.charCodeAt(j)-848);
     if(str.charCodeAt(j) >1000) strenc=strenc+"%"+(aa.toString(16)).toUpperCase();
     else strenc=strenc+str.charAt(j);
  }
  return strenc;
}

function chkwd()
{
  s='';
  if(document.forms.keylist.kwds.length)
  {
    for(i=0; i<document.forms.keylist.kwds.length; i++)
     if(document.forms.keylist.kwds[i].checked==true)
     { s=s+document.forms.keylist.kwds[i].value+' ';
       document.forms.keylist.kwds[i].checked=false;
     }

    if(s=='')
    {	alert("Выберите хотя бы одно ключевое слова для поиска.");    	return false;
    }
    else
    {
    	document.forms.keylist.search.value=s;
    	document.forms.keylist.submit();
    }
  }
  else return false;
}

function ChClr()
{
    var h = "0123456789ABCDEF";
	var bar = document.getElementById ('bar');
    if (bar) bar.style.backgroundColor = '#' + h.charAt (Math.floor(Math.random()*12)) + h.charAt (Math.floor(Math.random()*16))+ h.charAt (Math.floor(Math.random()*12)) + h.charAt (Math.floor(Math.random()*16))+ h.charAt (Math.floor(Math.random()*12)) + h.charAt (Math.floor(Math.random()*16));
}

