// JavaScript Document

function overInfo(idImg, nombre_imagen, nombre, apellido, fecha){

//	imgOver(idImg, nombre_imagen);
	verInfo(nombre, apellido, fecha);
	
	
}

function outInfo(idImg){
//	imgOver(idImg, 'default.gif');

HTML_String ='<table width="510" border="0" cellpadding="0" cellspacing="0" class="bordeGrisFondo" align="center" >';
HTML_String +='<tr><td width="10" height="20">&nbsp;</td><td>&nbsp;</td><td width="10">&nbsp;</td></tr>';
HTML_String +='<tr><td>&nbsp;</td><td>';
HTML_String +='<table width="100%%" border="0" cellspacing="0" cellpadding="0">';
HTML_String +='<tr><td height="20">';
HTML_String +='</td></tr>';
HTML_String +='<tr><td height="20">';
HTML_String +='</td></tr></table></td>';
HTML_String +='<td>&nbsp;</td></tr>';
HTML_String +='<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table>';

if (document.getElementById) {

			document.getElementById('patient').innerHTML = HTML_String;

		}

		else if (document.layers) {

			document.layers['patient'].document.write(HTML_String);

			document.layers['patient'].document.close();

		}


}

function imgOver(id, img){

	document.images[id.name].src='_recursos/historias/'+img;
	
	HTML_String='';
	
		if (document.getElementById) {

			document.getElementById('patient').innerHTML = HTML_String;

		}

		else if (document.layers) {

			document.layers['patient'].document.write(HTML_String);

			document.layers['patient'].document.close();

		}
	
}

function verInfo(nombre, apellido, fecha){


HTML_String ='<table width="510" border="0" cellpadding="0" cellspacing="0" class="bordeGrisFondo" align="center" >';
HTML_String +='<tr><td width="10" height="20">&nbsp;</td><td>&nbsp;</td><td width="10">&nbsp;</td></tr>';
HTML_String +='<tr><td>&nbsp;</td><td>';
HTML_String +='<table width="100%%" border="0" cellspacing="0" cellpadding="0">';
HTML_String +='<tr><td height="20"><b>Historia de:</b> ';
HTML_String += nombre + ' ' + apellido;
HTML_String +='</td></tr>';
HTML_String +='<tr><td height="20"><b>Fecha de publicacion:</b> ';
HTML_String += fecha ;
HTML_String +='</td></tr></table></td>';
HTML_String +='<td>&nbsp;</td></tr>';
HTML_String +='<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table>';

//alert(HTML_String);


		if (document.getElementById) {

			document.getElementById('patient').innerHTML = HTML_String;

		}

		else if (document.layers) {

			document.layers['patient'].document.write(HTML_String);

			document.layers['patient'].document.close();

		}
	}

function validar(){
d=document.form1;
error = '';

if(d.nombre.value == '')
	error+=" - El campo nombre es obligatorio\n";
	
if(d.apellido.value == '')
	error+=" - El campo apellido es obligatorio\n";
	
if(d.direccion.value == '')
	error+=" - El campo direccion es obligatorio\n";
	
if(d.ciudad.value == '')
	error+=" - El campo ciudad es obligatorio\n";
	
	if(d.email.value=='') {
		error+= " - El campo E-mail es obligatorio\n";
	} else {
		var txt = new String(d.email.value);

		if(txt.indexOf('@') < 1 || txt.indexOf('.') < 1)
			error+= " - El campo E-mail no es correcto\n";
			
	}
	
	if(d.historia.value == '')
		error+=" - El campo historia es obligatorio\n";
	
	if(error=='')
		d.submit();
	else
		alert('Errores:\n'+error);

}

function info(es){
//	alert(es.id)

tb_btn1.style.backgroundColor="#FFFFFF" 

}