function KeyReturn( Action, Seccion )
{
Buscar(Action, Seccion );
return false;
}

function Buscar( Action, Seccion)
{

var CodZona;
var cToken;

CodZona = document.all.IdLugar.value
// Parsear el string para traducir codigos de escape de http
// ---------------------------------------------------------
cToken = frmWord.txtSearchWord.value;
cToken = replace( cToken, "&", "%26%");

location.href= "index.asp?action=" + Action + "&CodZona=" + CodZona + "&Seccion=" + Seccion + "&Data=" + cToken;

}

function GoUrl(Action, cmb)
{
  var CodAct;
  var CodZona;

  CodAct = cmb.options[cmb.selectedIndex].value;
  CodZona = document.all.IdLugar.value
  if ( CodAct != '0' ) 1
      location.href = "index.asp?action=" + Action + "&CodZona=" + CodZona + "&seccion=codact&Data="+CodAct;
}

function replace(string,text,by)
{
  var strLength = string.length, txtLength = text.length;
  if ((strLength == 0) || (txtLength == 0))
     return string;

  var i = string.indexOf(text);
  if ((!i) && (text != string.substring(0,txtLength)))
     return string;

  if (i == -1)
     return string;

  var newstr = string.substring(0,i) + by;

  if (i+txtLength < strLength)
     newstr += replace(string.substring(i+txtLength,strLength),text,by);

return newstr;
}
