 function Search(elForm)
 {
 
  if (elForm.buscar.value != "")
  {
   strForm = elForm.tipo;
   check = "";
   for (i=0;i< strForm.length ;i++)
   { 
    if (strForm[i].checked) { check = strForm[i].value };
   }

   if (check != "")
   {
    if ((check == "ref" && IsNumeric(elForm.buscar.value)) || check == "pclave")
    {
      window.location = 'consulta.asp?buscar=' + elForm.buscar.value + '&tipo=' + check ;
    }
    else
    {
      alert('parametro de busqueda incorrecto, el tipo de referencia solo admite números'); 
      return false;
    }
   }
   else { alert('Debe seleccionar un tipo de busqueda.'); return false; } 
  }
 }
 
 function Selecciona(elForm)
 { 
 
  if (elForm.tipoMaq.selectedIndex != 0)
  {
   window.location = 'consulta.asp?listado=' + elForm.tipoMaq[elForm.tipoMaq.selectedIndex].value;
  }
 
 }
function openWin(strHRE,strWID,strHEI,strTOO,strLOC,strSTA,strMEN,strSCR,strRES,strPage) 
  {
 
     var strSIZ;
     var intXPO;
     var intYPO;
  
     if ((parseInt(navigator.appVersion) >= 4 ))
     {
      intXPO = (screen.width - parseInt(strWID)) / 2;
      intYPO = (screen.height - parseInt(strHEI)) / 2;
     }   
   strSIZ ='width='+ strWID + ',height=' + strHEI + ',left=' + intXPO  + ',top=' + intYPO + ',toolbar=' + strTOO + ',location=' + strLOC + ',status=' + strSTA + ',menubar=' + strMEN + ',scrollbars=' +strSCR+ ',resizable=' + strRES;
   result = window.open(strHRE,strPage,strSIZ);
  } 
 
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
