// de utilitario.htm
var radio_selection="m";
// de index
var navegador;

// *****************funciones******************

function abreWin(txt) {
// argumento: '../directorio/archivo.htm#marcador'
	window.showHelp(txt)
}
//************* de medicos.asp*****************
function customize(a,b,c) {    
	var d = "apc/physframe.asp?";
//	var d = "http://geverre/mibiopsiaweb/apc/physframe.asp?";
	d = d + "idMed=" + a + "&";
	d = d + "Apellido_=" + c + "&";
	d = d + "Nombre_=" + b;
	var option="fullscreen=1, status=no, scrollbars=auto"
    var win4 = window.open(d, "push", option);
}
//*********************************************
function customizegpo(a,b,c) {    
	var d = "apc/gpoframe.asp?";
	d = d + "idMed=" + a + "&";
	d = d + "Apellido_=" + c + "&";
	d = d + "Nombre_=" + b;
	var option="fullscreen=1, status=no, scrollbars=auto"
    var win4 = window.open(d, "push", option);
}
//*********************************************
function resolution(){
//Ubicado en <BODY onload="resolution()"> de index

if (navigator.appName == "Netscape") {
  	alert("Este sitio no está diseñado para Netscape. Puede encontrar malfuncionamientos derivados de esto.");
	}

}
//***********************************************
// Ubicar el cursor en el primer campo de un formulario
function placeFocus() {
   if (document.forms.length > 0) {
	var field = document.forms[0];
	for (i = 0; i < field.length; i++) {
		if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
			document.forms[0].elements[i].focus();
			break;
         	}
      	}
   }
}
//************************************************
function selad(){
   if (window.event.ctrlKey) {
        if (window.event.keyCode==11) { // k key
	     if (window.event.shiftKey) {
		window.open("apc/sel_admin.htm","popup","toolbar=no, location=no, status=no, scrollbars=no, directories=no, menubar=no, height=150, width=200, resizable=no");
             }
        }
   }
}

//*************************************************
function redir(fedit){
//  var checkOK = "ABCDEFGHIJKLMÑNOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyzáéíóú0123456789_";
  var checkOK = "1234567890";
  var checkStr = fedit.idPub.value;
  var allValid = true;

  if (fedit.idPub.value == "") {
    alert("Escriba un valor para el campo \"cédula\".");
    fedit.idPub.focus();
    return (false);
  }
//***********************
  for (i = 0;  i < checkStr.length;  i++) {
    ch = checkStr.charAt(i);
    if (ch === " ") {
	  alert("No espacios en el campo \"cédula\".");
	  fedit.idPub.focus();
	  return (false);
	 } 
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length) {
      allValid = false;
      break;
    }
  }
  if (!allValid) {
    alert("Escriba sólo dígitos en el campo \"cédula\".");
    fedit.idPub.focus();
    return (false);
  }

//***********************  
  if (fedit.pw.value == "") {
    alert("Escriba un valor para el campo \"clave\".");
    fedit.idPub.focus();
    return (false);

}
  if(radio_selection=="p"){
	fedit.action="registro/pwchangep.asp";
  }
return (true);
}

//*******************************
//pone el foco en el primer elemento del formulario
function placeFocus(){
	document.forms[0].elements[0].focus();
}

//********************************
//controla el acceso al listado general de pacientes
function vf(){
if(document.forms[0].pw.value=="coledoco"){
   document.forms[0].pw.value="";
   window.open("admin.asp","","location=no, directories=no");
   return false;
}else{
   return false;
}
}
//*************favoritos**************
function favoritos() {
  if (navigator.appName=="Netscape") {
     alert("Para agregar www.mibiopsia.com a Marcadores pulse Control + D");
}
  else {
     window.external.AddFavorite('http://www.mibiopsia.com','Lab. Essenfeld');
}
}
//********************************************

function mailThisUrl() {
u = window.location;
m = "Pienso que pudiera interesarle...";
window.location = "mailto:"+"?subject="+m+"&body="+document.title+" "+u;
}
//********************************************
