//------------------------------------------------------------------
function StrTrim(s)
{
  var i,e,v,h;
  h=s.length;
  i=0;
  while(i<h && s.charAt(i)==' ') i++;
  e=i;
  i=h-1;
  while(i>0 && s.charAt(i)==' ') i--;
  v=i;
  if (e==h) return '';
  else
    if (e<v) return s.substring(e,v+1);
    else return s;
}
//------------------------------------------------------------------
function StrToWords(s)
{
  var sv,i,h;
  s=' '+StrTrim(s);
  h=s.length;
  sv='';
  for (i=1; i<h; i++)
    if (s.charAt(i)==' ')
      {
        if (s.charAt(i-1)!=' ')
          sv=sv+s.charAt(i);
      }
    else             
      sv=sv+s.charAt(i);
  return sv;
}
//------------------------------------------------------------------
function OverFo(s)
{
  window.status=s; 
  setTimeout('window.status="'+s+'"',1);
}
//------------------------------------------------------------------
function KepMutat(img,caption,w,h)
{
  w=w+50;
  h=h+80;
  if (w>screen.width-40) w=screen.width-30;
  if (h>screen.height-80) h=screen.height-80;
  win=window.open("","win","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h+",top=20,left=20");
  win.document.open();
  win.document.write('<html><head><title>Vác Városi Kábeltelevízió Kft.</title></head>');
  win.document.write('<body>');
  win.document.write('<div align="center">');
  win.document.write('<img src="'+img+'" hspace="5" vspace="5" border="0">');
  win.document.write('</div>');
  win.document.write('<div align="center">'+caption+'</div><br>');
  win.document.write('</body>');
  win.document.write('</html>');
  win.document.close();
  win.focus();
  win.resizeTo(w+10,h+30);
  return false;
}
//------------------------------------------------------------------
function KeresEllenorzes()
{
  document.frmkeres.txtkeres.value=StrToWords(document.frmkeres.txtkeres.value);
  if (document.frmkeres.txtkeres.value.length>=0)
    return true;
  else
    return false; 
}
//------------------------------------------------------------------
