<!--
//--------------Proceso para precarga de imagenes
function preloadImages(imagenes)
{
for(loop = 0; loop < imagenes.length; loop++)
{
var imagen = new Image();
imagen.src = imagenes[loop];
}
}

//--------------Funcion para cambio entre imagenes
function swapimagen(nomimg, srcimg) 
{
	document.images[nomimg].src=srcimg
}

// Funciones para colorear fondo de celda en barras
  function mouseOn(obj,Nuevo) {
    if (!obj.contains(event.fromElement)) {
	  obj.style.cursor = 'hand';
	  obj.bgColor = Nuevo;
	}
  }
  
  
  function mouseOff(obj,Original) {
	if (!obj.contains(event.toElement)) {
	  obj.style.cursor = 'default';
	  obj.bgColor = Original;
	}
  }


function change_color(Objeto) {
	obj = "document.all."+Objeto+".style.color='000000'";
		eval(obj);
}

// Funcion para agregar a favoritos
var bookmarkurl="http://www.docmedical.com/"
var bookmarktitle="DocMedical - Recursos en línea para Profesionales de la Salud"
function addbookmark()
{
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

// Funcion para abrir ventana popup
function popup(url,barra,scroll,ancho,alto) {
	ventana=window.open(url,"envio","screenx=0,screeny=0,toolbar=" + barra + ",width=" + (ancho+30) + ",height=" + (alto+30) +",directories=no,status=no,scrollbars=" + scroll + ",resize=no,menubar=no");ventana.focus();
}




function EnviarRecomendar() {
  	var Campo1 = "NombreRecomendado";
  	var CampoTexto1 = "Nombre";
  	var Campo2 = "EmailRecomendado";
  	var CampoTexto2 = "Email";
	var Nombre = document.all[ "NombreRecomendado"].value;
	var Email = document.all[Campo2].value;

	if (Validar_CampoNoNulo(Campo1, CampoTexto1) && Validar_Email(Campo2, CampoTexto2))
	{
		document.all[Campo1].value="";
		document.all[Campo2].value="";
		window.open("/recomendar/recomendar.asp?Nombre="+Nombre+"&Email="+Email,"Recomendacion","toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=220");
		
	}

	

}

function Validar_CampoNoNulo(Campo, NombreCampo){
  	
  	var cadena = "Debe ingresar un valor no nulo en " + NombreCampo;
  	var campoid = document.getElementById(Campo)
	var campovalor = campoid.value;
	
	if (campovalor != "")
		{ return true; }
	else
		{alert(cadena);
		campoid.focus();
		return false;}

}


function ValidarRecomendar(){
	var Camp1="nombre_origen";
	var Camp2="nombre_destino";
	var Camp3="Su Nombre y Apellido";
	var Camp4="Nombre y Apellido destinatario";
	var emailorigen = "email_origen"
	var emaildestino = "email_destino"
	if (Validar_CampoNoNulo(Camp1, Camp3) && Validar_Email(emailorigen) &&  Validar_CampoNoNulo(Camp2, Camp4)&& Validar_Email2(emaildestino))
		{return true;}
	else
		{return false;}
}


function Validar_Email(EmailCampo){
  var Email = document.getElementById(EmailCampo)
  var cadena = "Dirección de correo " + Email.value + " es no válida: " + Email.value + "\n" +
               "Por favor, introduzca la dirección correcta";
  if( Email.value.indexOf('@',0) <= 0  || Email.value.indexOf(',',0) != -1
   || Email.value.indexOf(' ',0) != -1 || Email.value.indexOf('/',0) != -1
   || Email.value.indexOf(';',0) != -1 || Email.value.indexOf('<',0) != -1
   || Email.value.indexOf('>',0) != -1 || Email.value.indexOf('*',0) != -1
   || Email.value.indexOf('|',0) != -1 || Email.value.indexOf('`',0) != -1
   || Email.value.indexOf('&',0) != -1 || Email.value.indexOf('$',0) != -1
   || Email.value.indexOf('!',0) != -1 || Email.value.indexOf('"',0) != -1
   || Email.value.indexOf(':',0) != -1 )
     { alert(cadena); Email.focus(); return false;}
  else return true;
  }

function Validar_Email2(EmailCampo){
  var Email = document.getElementById(EmailCampo)
  var cadena = "Dirección de correo " + Email.value + " es no válida: " + Email.value + "\n" +
               "Por favor, introduzca la dirección correcta";
  if( Email.value.indexOf('@',0) <= 0  || Email.value.indexOf(',',0) != -1
   || Email.value.indexOf(' ',0) != -1 || Email.value.indexOf('/',0) != -1
   || Email.value.indexOf(';',0) != -1 || Email.value.indexOf('<',0) != -1
   || Email.value.indexOf('>',0) != -1 || Email.value.indexOf('*',0) != -1
   || Email.value.indexOf('|',0) != -1 || Email.value.indexOf('`',0) != -1
   || Email.value.indexOf('&',0) != -1 || Email.value.indexOf('$',0) != -1
   || Email.value.indexOf('!',0) != -1 || Email.value.indexOf('"',0) != -1
   || Email.value.indexOf(':',0) != -1 )
     { alert(cadena); Email.focus(); return false;}
  else return true;
  }
  
function Validar_Contacto() {
	var Camp1="Nombre";
	var Camp2="Email";
	var Camp3="Asunto";
	var Camp4="Mensaje";
	if (Validar_CampoNoNulo(Camp1, Camp1) && Validar_Email(Camp2, Camp2) &&
		Validar_CampoNoNulo(Camp3, Camp3) && Validar_CampoNoNulo(Camp4, Camp4))
		{return true;}
	else
		{return false;}
  }
  
  
//--------------Para esconder los tablones si es necesario----------------

var moduloAudioRel=true;
var moduloAlertas=true;
var moduloFotosRelacionadas = true;
var moduloNotRelacionadas= true;  
var modulOpinion=true;
  
function esconderTablones(){
	//Para esconder las Alertas
	if (moduloAlertas==false) document.getElementById('alertas').style.display='none';
	//Para esconder el audio relacionado
	if (moduloAudioRel==false) document.getElementById('tablon_audio_rel').style.display='none';
	//para esconder el tablon opinion
	if (modulOpinion===false) document.getElementById('tablon_opinion').style.display='none';
	//Para esconder el tablon noticias relacionadas y fotos relacionadas
	if (moduloNotRelacionadas==false && moduloFotosRelacionadas==false) {
		document.getElementById('tablon_relacionadas').style.display ='none';
	} else {
		if (moduloNotRelacionadas==false) document.getElementById('tablon_not_rel').style.display='none';
		if (moduloFotosRelacionadas==false) document.getElementById('tablon_fotos_rel').style.display='none';
	}
}  

//------------------para el pop up de las imagenes-------------------------

var ventana
var cont=0
var titulopordefecto = "Radio Dos"
function afoto(cual,titulo){
	if(cont==1){ventana.close();ventana=null}
	if(titulo==null){titulo=titulopordefecto}
	ventana=window.open('','ventana','resizable=yes,scrollbars=0,status=0,width=50,height=50')
	ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="0"  status="0" onUnload="opener.cont=0"><div align="center"><a href="javascript:this.close()"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)" style="border:none"></a></div>')
	ventana.document.close()
	cont++
}
function redimensionar(ancho, alto){
	ventana.resizeTo(ancho+5,alto+80)
	ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2) 
}


//-->
