<!-- Begin
/*
Script Main
© SiempreSaludables.com (http://www.SiempreSaludables.com/)
Si quiere utilizar este script en su web site
debe darle crédito y colocar un enlace a
SiempreSaludables.com en la misma pagina en que
lo utiliza y comunicárnoslo
*/

if (window != top) top.location.href = location.href;

myAd = new Banner(10,400,60,"Visite a nuestro patrocinante",0,0);
//myAd.Ad("/pics/botones/b_policlinica.gif","/clinicas/16/policlinica.shtml",null,"Policlínica Maturín C. A.");
//myAd.Ad("/pics/botones/b_cemca.gif","/clinicas/16/cemca.shtml",null,"Centro de Especialidades Médicas");
//myAd.Ad("/pics/botones/ss_boton_b.gif","/directorio/inscribirse.shtml",null,"Inscríbase en nuestro Directorio");
//myAd.Ad("/pics/botones/b_isamica.gif","/clinicas/16/isamica.shtml",null,"Isamica");
//myAd.Ad("/pics/botones/b_bioinergy.gif","http://bioinergy.com/","_blank","Visite a nuestro patrocinante");
//myAd.Ad("/pics/botones/b_chacin.gif","http://www.laboratorioclinicochacin.com/","_blank","Visite a nuestro patrocinante");
//myAd.Ad("/pics/botones/aqui.gif","/nosotros/anunciar.shtml",null,"Inscríbase en nuestro Directorio");

myAd.Ad("/pics/botones/b_bac.png","http://bacinergy.com/","_blank","Visite a nuestro patrocinante");
myAd.Ad("/pics/botones/b_sophos.png","http://sophosconsultores.com/","_blank","Visite a nuestro patrocinante");
myAd.Ad("/pics/botones/b_luces_consulting.png","http://lucesconsulting.com/","_blank","Visite a nuestro patrocinante");
myAd.Ad("/pics/botones/b_cfo.jpg","http://controldeflotasoriente.com/","_blank","Visite a nuestro patrocinante");
myAd.Ad("/pics/botones/b_bac.png","http://bacinergy.com/","_blank","Visite a nuestro patrocinante");

function Banner(refreshTime, width, height, altText, start, random){
	this.objName = "bannerAd" + (Banner.count++);
	eval(this.objName + "=this");
	if (!refreshTime) this.refreshTime = 5000; else this.refreshTime = refreshTime*1000;
	if (!width) this.width = 460; else this.width = width;
	if (!height) this.height = 68; else this.height = height;
	if (random == null) this.random = 1; else this.random = random;
	this.altText = altText;
	this.ads = [];
	if (start) this.currentAd = start-1; else start = null;
	this.mySize = 0;

	this.Ad = function(src, href, target, mouseover) {
		var tempImage = new Image();
		tempImage.src = src;
		this.ads[this.mySize] = new Object();
		var ad = this.ads[this.mySize];
		ad.src = src;
		if (typeof(target) == "undefined" || target == null) ad.target = "_self"; else ad.target = target;
		ad.href = href;
		ad.mouseover = mouseover;
		this.mySize++;
	}

	this.link = function(){
		var	ad = this.ads[this.currentAd];
		if (ad.target == "_self"){
			location.href = ad.href;
		}
		else if (ad.target == "_blank" || ad.target == "_new"){
			open(ad.href,this.objName + "Win");
		}
		else top.frames[ad.target].location.href = ad.href;
	}

	this.showStatus = function(){
		var ad = this.ads[this.currentAd];
		if (ad.mouseover) status = ad.mouseover;
		else status = ad.href;
	}

	this.randomAd = function(){
		var n;
		do { n = Math.floor(Math.random() * (this.mySize)); } 
		while(n == this.currentAd);
		this.currentAd = n;
	}

	this.output = function(){
		var tempCode = "";
		if (this.mySize > 1){
			if (this.currentAd == null) this.randomAd();
			if (this.currentAd >= this.mySize) this.currentAd = this.mySize - 1;
			tempCode = '<a class="pix" href="javascript:'+this.objName+'.link();"';
			tempCode += ' onMouseOver="' + this.objName + '.showStatus(); return true"';
			tempCode += ' onMouseOut="status=\'\';return true">';
			tempCode += '<img src="' + this.ads[this.currentAd].src + '" width="' + this.width;
			tempCode += '" name="' + this.objName + 'Img" height="' + this.height + '" ';
			if (this.altText) tempCode += 'alt="'+this.altText + '" ';
			tempCode += 'border="0" hspace="5"></a>';
			document.write(tempCode);
			this.nextAd();
		} else document.write("Error: two banners must be defined for the script to work.");
	}

	this.newAd = function(){
		if (!this.random){	
			this.currentAd++;
			if (this.currentAd >= this.mySize)
			   this.currentAd = 0;
		}
		else {
			this.randomAd();
		}
		this.nextAd();
	}

	this.nextAd = function(){
		document.images[this.objName+ 'Img'].src = this.ads[this.currentAd].src;
		setTimeout(this.objName+'.newAd()',this.refreshTime)
	}
}
Banner.count = 0;


var saludo;
hoy();
function hoy() {
now = new Date();
var CurHour = now.getHours();
now = null;
if ( (CurHour >= 6) && (CurHour < 12) ) {
	saludo = "Buenos&nbsp;d&iacute;as";
	ampm = " A.M.";}
else if ( (CurHour >= 12) && (CurHour < 18) ) {
	saludo = "Buenas&nbsp;tardes";
	ampm = " P.M.";
	CurHour = CurHour - 12;}
else if ( (CurHour >= 18) && (CurHour <= 24) ) {
	saludo = "Buenas&nbsp;noches";
	ampm = " P.M.";
	CurHour = CurHour - 12;}
else if ( CurHour < 6 ) {
	saludo = "Buenas&nbsp;noches";
	ampm = " A.M.";}
// saludo += ", disfrute su visita";
}

/* ***** CALENDARIO *******
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
*/
weekday = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
monthnames = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
iniciopub = new Date("December 15, 1999");
mesinglsh = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var linkcount=0;
monthdays = new Array(31,28,31,30,31,30,31,31,30,31,30,31)
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) || (thisyear % 400 == 0)) 	monthdays[1]++;
yearout = String(thisyear);
// yearout = yearout.substr(0,1) + "." + yearout.substr(1,3);
mostrar = true;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
function ecrb_cal() {
document.write('<table CLASS="calendario" cellspacing="1" cellpadding="1" align="center">');
document.write("<tr class='hoy'><td>D</td><td>L</td><td>M</td><td>M</td><td>J</td><td>V</td><td>S</td></tr>");
document.write('<tr>');
for (s=0;s<startspaces;s++) {
document.write('<td class="dia">&nbsp;</td>');}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
hoy = new Date(mesinglsh[thismonth] + " " + count + ", " +  thisyear);
if (count == thisdate) 
	imprime = "<td class='hoy'>";
else 
	imprime = "<td class='dia'>";
/*
if ((hoy.getDay() == 3) && (count <= monthdays[thismonth])) {
	var dias_desde = Math.floor((hoy - iniciopub) / (24 * 60 * 60 * 1000));
	if ( ((dias_desde / 14) - Math.floor(dias_desde / 14)) == 0 ) {
		if (count == thisdate) {
			imprime = "<td class='ezn-pub-hoy'>"; }
		else {
			imprime = "<td class='ezn-pub'>";
		}
	}
}
*/
if ((hoy.getDay() == 5) && (mostrar)) {
//	if (thismonth == 0 && count == 11 ) {
	mostrar = false;
	if (count == thisdate) {
		imprime = "<td class='ezn-pub-hoy'>"; }
	else {
		imprime = "<td class='ezn-pub'>";
	}
//	}
}
if (count <= monthdays[thismonth]) { document.write(imprime + count);}
else { document.write(imprime + "&nbsp;");}
document.write("</td>");
count++;}
document.write("</tr>");
if ((count < monthdays[thismonth]) && (b == 7)) 
	document.write('<tr>'); 
startspaces=0;}
document.write("</table>");
document.write('<FONT COLOR="#CCCCFF"><ACRONYM ITLE="Subscribase gratis a su Ezine Mercurio introduciendo su dirrecci&oacute;n de e-mail al tope de la p&aacute;gina">Edición de Ezine</ACRONYM></FONT><BR><SPAN ID="clock"></SPAN>');
//	document.write('<SPAN ID="clock"></SPAN>');
}

/* **** HORA ***** */
 var MS=navigator.appVersion.indexOf("MSIE")
 window.isIE4 = (MS>0) && (parseInt(navigator.appVersion) >= 4)
function lead0(val) {
	return val<10 ? "0"+val.toString() : val
}
function buildTime() {
	var time = new Date()
	var ampm = " AM"
	var h=time.getHours()
	if (h > 12) {h = h - 12; ampm = " PM";}  
	return h+":"+lead0(time.getMinutes())+":"+ lead0(time.getSeconds()) + ampm
}
function tick() {
	document.all.clock.innerText = buildTime()
}    
window.onload = new Function("if (window.isIE4) setInterval('tick()',1000)")

function musica() {
if ((!window.popUp) || (popUp.closed)) {
if(navigator.userAgent.indexOf("MSIE") != -1){
popUp = window.open ('/misc/music.html','Musica',
'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width=295,height=50');
popUp.document.close();}
else{
popUp = window.open ('/sound/fondo.mid','Musica',
'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,width=140,height=70');
popUp.document.close();}}
}

function wrtNum (desde, hasta) {
	for (var i = desde; i <= hasta; i++) {
		document.write('<OPTION VALUE="' + i + '">' + ((i < 10 && hasta >= 10) ? (hasta == 59 ? '0' + i : '&nbsp;' + i) :  i) );
	}
}

function chkSel(campo1, msg) {
temp2 = campo1.selectedIndex;
if (temp2 == 0) {
	alert("Por favor indique\n" + msg);
	campo1.focus();
	clckcnt = 0;
	return false;}
else
	return true;
}

function CheckName(campo, mnsj) {
	// developed by willmaster.com
	// modified by Helios C H
	s_name = campo.value;
	s_name = IsItPresent(campo, mnsj);
	if(! s_name) {
		clckcnt = 0;
		return false;}
	var i = s_name.indexOf('  ',0);
	while(i > -1) {
		s_name = s_name.substring(0,(i + 1)) + 
			s_name.substring((i + 2),s_name.length);
		i = s_name.indexOf('  ',0);	}
	s_name = s_name.toLowerCase();
	var s = new String(s_name.substring(0,1));
	s = s.toUpperCase();
	s_name = s + s_name.substring(1,s_name.length);
	i = s_name.indexOf(' ',0);
	if(i == (s_name.length - 1)) i = -1;
	var ts = new String("");
	var j = 0;
	while(i > -1) 	{
		i++;
		j = i + 1;
		s = s_name.substring(i,j);
		s = s.toUpperCase();
		ts = '';
		if(i > 0) ts = s_name.substring(0,i);
		s_name = ts + s + s_name.substring(j,s_name.length);
		i = s_name.indexOf(' ',j);
		if(i == (s_name.length - 1)) i = -1;	}
	campo.value = s_name;
	return true;
}

clckcnt = 0;
function clckcntr() {
// developed by willmaster.com
clckcnt++;
if(clckcnt > 1) {
	if(clckcnt > 2) { return false; }
	alert('Procesando...\n\n' + '     Gracias por su paciencia.');
	return false;}
return true;}

function clearDefault(el) {
	if (el.defaultValue==el.value) el.value = ""
}

function IsItPresentSmpl(campo, explanation) {
	// developed by willmaster.com
	// modified by Helios C H
	s = campo.value;
	s = StripSpacesFromEnds(s);
	if(s.length) return s;
	alert('Por favor escriba\n' + explanation + '.');
	campo.focus();
	clckcnt = 0;
	return '';
}

function IsItPresent(campo, explanation) {
	// developed by willmaster.com
	// modified by Helios C H
	s = campo.value;
	s = StripSpacesFromEnds(s);
	if(s.length && s != campo.defaultValue) return s;
	alert('Por favor escriba\n' + explanation + '.');
	campo.focus();
	clckcnt = 0;
	return '';
}

function StripSpacesFromEnds(s) {
	// developed by willmaster.com
	while((s.indexOf(' ',0) == 0) && (s.length > 1)) 	{
		s = s.substring(1,s.length);
	}
	while((s.lastIndexOf(' ') == (s.length - 1)) && (s.length > 1)) 	{
		s = s.substring(0,(s.length - 1));
	}
	if((s.indexOf(' ',0) == 0) && (s.length == 1)) s = '';
	return s;
}

function CheckEmail(campo, descrip) {
	// developed by willmaster.com
	// modified by Helios C H
	if (!descrip) descrip = 'Su dirección de e-mail';
//	s_email = campo.value;
	s_email = IsItPresent(campo, descrip);
	if(! s_email) {
		clckcnt = 0;
		return false;}
	s_email = s_email.toLowerCase();
	var i = s_email.indexOf(' ',0);
	while(i > -1) {
		s_email = s_email.substring(0,i) + s_email.substring((i + 1),s_email.length);
		i = s_email.indexOf(' ',0);
	}
	campo.value = s_email;
	if((s_email.length < 6) || (s_email.indexOf('@',0) < 1) || (s_email.lastIndexOf('@') != s_email.indexOf('@',0)) || (s_email.lastIndexOf('@') > (s_email.length - 5)) || (s_email.lastIndexOf('.') > (s_email.length - 3)) || (s_email.lastIndexOf('.') < (s_email.length - 4)) || (s_email.indexOf('..',0) > -1) || (s_email.indexOf('@.',0) > -1) || (s_email.indexOf('.@',0) > -1) || (s_email.indexOf(',',0) > -1)) {
		alert('La dirección de e-mail\n"' + s_email + '"\nno es valida.');
		clckcnt = 0;
		campo.focus();
		return false;
	}
	var xx = s_email.substr(s_email.lastIndexOf('@'),18);
	if ((xx == "@SiempreSaludables.net") || (xx == "@SiempreSaludables.com") || (xx == "@SiempreSaludables.org")) {
		alert("Por favor escriba\nsu dirección de e-mail\nno la nuestra");
		clckcnt = 0;
//		campo.value = "";
		campo.focus();
		return false;
	}
	return true;
}

function cont_pub() {
document.write('<DIV ALIGN="center"><TABLE WIDTH="80%" BORDER="0" CELLSPACING="0" CELLPADDING="6" ALIGN="center" CLASS="sdnavtbl"><TR><TD ALIGN="center">La informaci&oacute;n contenida aqu&iacute; no pretende sustituir la atenci&oacute;n de un profesional de la salud, y se ofrece solo con fines de informar. Le invitamos a conocer nuestra <A HREF=\"/nosotros/disclaimer.shtml\">Limitación de Responsabilidad</A></TD></TR></TABLE></DIV><P>Si desea publicar un art&iacute;culo en esta secci&oacute;n comun&iacute;quese con nosotros <A href="/nosotros/feedback.shtml">aqu&iacute;</A> mismo.</P>');
}

function inscrb_dir() {
document.write('<P><A HREF=\"/directorio/inscribirse.shtml\">Inscr&iacute;base</A> en el directorio y disfrute de los <A HREF=\"/nosotros/faq.shtml#benef\">beneficios</A> que le brinda un anuncio en este sitio.</P>');
}

function checkTlf(campo, explanation) {
	checkString = campo.value;
	checkString = StripSpacesFromEnds(checkString);
	newString = "";
	newTlf = "";
	for (i = 0; i < checkString.length; i++) {
		ch = checkString.substring(i, i+1);
		if ((ch >= "0" && ch <= "9") || (ch == ".") || (ch == ",")) {
			newString += ch;
			newTlf += ch;
		}
		if ((ch == "-") || (ch == "(") || (ch == ")") || (ch == " ")) {
			newTlf += ch;
		}
	}
	newString = parseFloat(newString);
	if (isNaN(newString) || (newTlf.length < 7)) {
		alert('Por favor escriba\n' + explanation + '.');
		campo.focus();
		clckcnt = 0;
		return false; }
	else {
		newTlf = StripSpacesFromEnds(newTlf);
		campo.value = newTlf;
		return true;
	}
} // checkTlf

function abrirPopUp(archivo,ventana,ancho,alto,menu,barra) { 
var opciones="menubar=" + menu + ",toolbar=no,location=no,directories=no,status=no,scrollbars=" + barra + ",resizable=yes,copyhistory=no,width=" +  ancho + ",height=" + alto;
PopUp = window.open (archivo,ventana,opciones); 
PopUp.document.close();
} 

function revSrch(qbusca) {
	var qps = true;
	var temp;
	temp = IsItPresent (qbusca, "lo que desea encontrar");
	if (!temp) qps = false; 
	if (qbusca.value == "Buscar en SiempreSaludables.com") {
		alert("por favor escriba\nlo que desea encontrar");
		clckcnt = 0;
		qps = false;
		qbusca.focus();
	}
	return qps;
}

function cualDoc (archvs, dire) {
	var hasta = archvs.length;
	var ultsl = dire.lastIndexOf('/');
	var ultp = dire.lastIndexOf('.');
	var nmbr = dire.substr(ultsl + 1, ultp - ultsl - 1);
	for (var x = 0; x <= hasta - 1; x++) {
		if (archvs[x] == nmbr) return x;
	}
}

function navMenuBot (archvs, dscrps, dire) {
	var hasta = archvs.length;
	var ultp = dire.lastIndexOf('/');
	var nmbr = dire.substr(ultp + 1,13);
	var este = cualDoc (archvs, dire);
	for (var sl = 0; sl <= hasta - 1; sl++) {
		document.write('<OPTION ');
		if (este == sl) document.write("SELECTED ");
		document.write('VALUE="' + archvs[sl]  + ".shtml" + '">' + dscrps[sl]);
	}
}

function wrtPrevNxt (archvs, dire, cual) {
	var hasta = archvs.length - 1;
	var este = cualDoc (archvs, dire);
	if (cual == 1 || cual == -1){
		if ((este < hasta && cual == 1) || (este !=  0 && cual == -1)) document.write('<A CLASS="urh"HREF="' +  archvs[(cual == 1 ? este + 1 : este - 1)] + '.shtml"><FONT STYLE="font-size: 1.5em" TITLE="Anterior">&laquo;</FONT></A>');  // <<
		else document.write('&laquo;');
	}
	else if (cual == 2 || cual == -2) {
		if (((este != 0 && cual == 2) || (este < hasta && cual == -2)) && este) document.write('<A CLASS="urh"HREF="' +  archvs[(cual == 2 ? este - 1 : este + 1)] + '.shtml"><FONT STYLE="font-size: 1.5em" TITLE="Siguiente">&raquo;</FONT></A>');  // >>
		else document.write('&raquo;');
	}
}

//  End -->
