var s_server='ceetweb4';
var sitio_id = 'ace';
var eplrnd = ((new String(Math.random())).substring(2,8) + (((new Date()).getTime()) & 262143));
/*var adsArray = [];

function LoadAdvertising(){
	for(i=0;i<adsArray.length;i++){
		adDiv=document.getElementById('epladadvertising'+i);
		adDiv.appendChild(adsArray[i]);
	}
}

function eplAD(espacio){
	var tempad;
	var i;
	adsArray.push('<scri' + 'pt language="JavaScript1.1" type="text/javascript" src="http://ads.us.e-planning.net/eb/3/' + sitio_id + '/' + espacio + '?o=j&rnd=' + eplrnd + '"></scr' + 'ipt>');
	tempad='<div id="epladadvertising'+ (adsArray.length-1)+'"></div>';
	document.write(tempad);
	if(adsArray.length>0)
		addLoadEvent(LoadAdvertising);
}*/
var inIframe=false;var siW=self.innerWidth;var siH=self.innerHeight;var dE=document.documentElement;var dB=document.body;
var sw=(siW?siW:(dE && dE.clientWidth)?dE.clientWidth:dB?dB.clientWidth:"");
var sh=(siH?siH:(dE && dE.clientHeight)?dE.clientWidth:dB?dB.clientHeight:"");
var wh=(sw && sh) ? (sw.toString(16) + "x" + sh.toString(16)) : "";
var eplRnd=(new String(Math.random())).substring(2,8) + (((new Date()).getTime()) & 262143);
var ua=navigator.userAgent.toLowerCase();var av=navigator.appVersion.toLowerCase();
var eplB=new Object();eplB.is_mac=(ua.indexOf("mac")!=-1);
eplB.is_win=(!eplB.is_mac && ((ua.indexOf("win")!=-1)||(ua.indexOf("16bit")!=-1)));
var ieP=av.indexOf('msie');var ffP=ua.indexOf("firefox");eplB.is_o=(ua.indexOf("opera")!=-1);
eplB.is_ie=(ieP!=-1 && eplB.is_win && !eplB.is_o);eplB.is_ff=(ffP!=-1);
if (eplB.is_ie) { eplB.minV=parseFloat(av.substring(ieP+5,av.indexOf(';',ieP)));
	eplB.majV=parseInt(eplB.minV);}
if (eplB.is_ff) { if (ua.length>ffP+8) eplB.majV=parseInt(ua.substring(ffP+8));
	if (ua.length>ffP+10) eplB.minV=parseInt(ua.substring(ffP+10));}
eplB.ffOk=(eplB.is_ff&&((eplB.majV>=1&&eplB.minV>=5)||(eplB.majV>=2)));
eplB.ieOk=(eplB.is_ie&&eplB.minV>=5);var eplFV=0;var nmT=navigator.mimeTypes;
var swF='application/x-shockwave-flash';var fP=(nmT && nmT[swF])?nmT[swF].enabledPlugin:0;
var fvT;if ( fP ) { var nP=navigator.plugins;var sf="Shockwave Flash";
	if (nP[sf]!=null) fvT=nP[sf].description;
} else if (ua && ua.indexOf("MSIE")>=0 && (av.indexOf("Win")!=-1)) {
	var axo;var e;try {
		axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
		axo.AllowScriptAccess="always";fvT=axo.GetVariable("$version");
	} catch (e) {}
} if (fvT) { var fvW=fvT.split(" ");for (var i=0;i<fvW.length;++i) {
		if (isNaN(parseInt(fvW[i]))) continue;eplFV=fvW[i];}
}
function eplAD(spaceID) {
	// return;
	if (!spaceID || spaceID=='') {
		return;
	}
	var keywords="&kw1=&kw2=&kw3=&kw4=&kw5=&kw6=&kw7=&kw8=&kw9=&kw10=&kw11=&kw12=&kw13=&kw14=&kw15";
	var adU='http://ads.us.e-planning.net/eb/3/' + sitio_id + '/' + spaceID + '?o=j&rnd=' + eplrnd+'&rnd='+eplrnd+keywords;
	var iDT='<html><head><title>Ad</title><LINK rel="stylesheet" type="text/css" href="http://www.eltiempo.com/css/produccion/publicidad.css" /></head><body id="'+spaceID+'" leftmargin="0" topmargin="0">';
	//var iDT='<html><head><title>Ad</title></head><body id="'+spaceID+'" leftmargin="0" topmargin="0">';
	iDT+='<div id="eplParentContainer' + spaceID + '"></div><scr'+'ipt type="text/javascript">var inIframe=true;</scr';
	iDT+='ipt> <scr'+'ipt type="text/javascript" src="'+adU+'"></scr';
	iDT+='ipt> <scr'+'ipt>setTimeout("document.close()", 8000);</scr'+'ipt></body></html>'
	if(eplB.ieOk){document.write('<iframe id="'+spaceID+'" src="about:blank" width="1" height="0" frameborder="0" scrolling="no"></iframe>');
		document.frames[spaceID].document.write(iDT);
	} else if (eplB.ffOk) { document.write('<iframe id="'+spaceID+'" src="about:blank" width="1" height="0" frameborder="0" scrolling="no"></iframe>');
		var i=document.getElementById(spaceID);if (i!=null) i.contentDocument.write(iDT);
	} else { document.write('<scr'+'ipt type="text/javascript" src="'+adU+'"></scr'+'ipt>');}
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return [curleft,curtop];
	}
}
function detectBrowser() {
	var ie = document.all != undefined;
	var opera = window.opera != undefined;
	
	if (opera) return "opera";
	if (ie) return "ie";
	if ((window)&&(window.netscape)&&(window.netscape.security)) {
		return "firefox";
	}
	return "ie";      // Si no sabemos que navegador es, devolvemos ie.
}
function inicio(objeto) {
	if (detectBrowser()=='ie'){
		objeto.style.behavior='url(#default#homepage)';
		objeto.setHomePage('http://www.abcdelbebe.com');
	} 
	else {
		alert('Su navegador no soporta esta funcion.');
	}
}
function favoritos() {
	var browser;
	browser = detectBrowser();
	
	if (browser == "opera") alert("Para agregar esta pagina a favoritos, pulsa: [Ctrl] + [Mays] + [T]");
	else if (browser == "firefox") alert("Para agregar esta pagina a favoritos, pulsa: [Ctrl] + [ D ] ");
	else window.external.AddFavorite('http://www.abcdelbebe.com/', 'ABC del Bebe');
	
}
function setHomePage(){
	if (detectBrowser()=='ie'){
		this.style.behavior='url(#default#homepage)';
		this.setHomePage('http://www.abcdelbebe.com');
	}else{
		alert('Su navegador no soporta esta funcion');
	}
	return false;
}
function TellaFriend(destino){
	toggleFriend(this, destino); 
	return false;
}
function getElement(id) {
	return document.getElementById(id);
}

function setImmWidgetPosition(thisItem, newDiv, mode) {
	if(mode == 'topNav') {
		//topItem = thisItem;
		topItem = thisItem.parentNode;
		newDiv.style.height="130px";
		//		newDiv.style.top = '400px';
		//		newDiv.style.left = '275px';
		//buscando la posicion...
		if (self.pageYOffset){
			//todos los navegadores salvo explorer
			pos = self.pageYOffset;
		}else if (window.innerHeight){
			pos = window.pageYOffset;
		}else if (document.documentElement){
			//internet explorer
			pos = document.body.scrollTop;
			//pos = document.documentElement.scrollTop;
		}else if (document.body.scrolltop){
			pos = document.body.scrollTop;
		}

		newDiv.style.top = (pos + (screen.height/2)-200) + 'px';
		newDiv.style.left = ((screen.width/2)-200) + 'px';	
	} else if(mode == 'watchlistPageLink') {
		newDiv.style.top = (getElement('header').offsetHeight+thisItem.offsetHeight-1)+'px';
		newDiv.style.left = '0px';
	} else if(mode == 'watchButton') {
		newDiv.style.top = (getElement('header').offsetHeight+getElement('main_nav').offsetHeight+getElement('sub_nav').offsetHeight+thisItem.parentNode.offsetHeight+10)+'px';
		newDiv.style.left = thisItem.parentNode.offsetLeft+'px';
	} else if(mode == 'commentVote') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '71px';
	} else if(mode == 'reportComment') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '46px';
	} else if(mode == 'link') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (getElement('master').offsetTop)+'px';
		newDiv.style.right = '46px';
	} else {
		if (detectBrowser()=='ie'){
			coordenadas=findPos(thisItem);
			newDiv.style.top = (((coordenadas[1]+thisItem.offsetHeight-133)<150)?150:(coordenadas[1]+thisItem.offsetHeight-55))+'px';
		}else
		newDiv.style.top = (((thisItem.offsetTop+thisItem.offsetHeight-133)<150)?150:(thisItem.offsetTop+thisItem.offsetHeight-55))+'px';
		if(window.innerWidth) { anchoActual = window.innerWidth; } else { anchoActual = document.body.offsetWidth; }
		ancho = (anchoActual/2)-150;
		newDiv.style.left = ancho +'px';
	}
}

function getImmWidgetMsg(mode) {
	if(mode == 'convTracker') msg = 'You must have a free Newsvine account to use the Conversation Tracker.';
	else if(mode == 'topNav') msg = 'Existing users log in below. New users please register for a new account.';
	else if(mode == 'watchlistPageLink') msg = 'You must have a free Newsvine account to use the personalized Watchlist.';
	else if(mode == 'watchButton') msg = 'You must have a free Newsvine account to watch tags or authors.';
	else if(mode == 'contentVote') msg = 'You must have a free Newsvine account to cast votes for articles.';
	else if(mode == 'reportContent') msg = 'You must have a free Newsvine account to report content.';
	else if(mode == 'commentVote') msg = 'You must have a free Newsvine account to cast votes for comments.';
	else if(mode == 'reportComment') msg = 'You must have a free Newsvine account to report comments.';
	else msg = 'Existing users log in below. New users please register for a new account.';
	return msg;
}

function ImmWidget(mode, uid, cid, vacuna, fecha) {
	var iHTML = '';

	iHTML+='<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablaconborde">';
	iHTML+='<tr><td width="100%" valign="top">';
	iHTML+='<table width="100%" height="30" border="0" cellpadding="5" cellspacing="5" class="tablatitulowidget">';
	iHTML+='<tr><td width="71%" align="left" valign="middle" class="textotitulowidget">Fecha de Vacunaci&oacute;n</td>';
	iHTML+='<td width="29%" align="left" valign="middle" class="textotitulowidget"><div align="right"><a href="javascript:void(0);" onclick="toggleImm(this, \'topNav\'); return false;" class="typebutton">Cerrar</a></div></td></tr></table>';
	iHTML+='<table width="100%" border="0" cellpadding="3" cellspacing="1"><tr><td class="tablaloginwidget" align="center">';
	iHTML+='<div><div class="form-item"><table width= "100%" border="0" cellspacing="0" cellpadding="0" class="content"><tr>';
	iHTML+='<td align="center"> <div class="container-inline"><div class="form-item">';
	iHTML+='<select class="form-select" id="popup-day" onclick="document.getElementById(\'edit-babydob-day\').value=document.getElementById(\'popup-day\').value;" ><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23" selected="selected">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>';
	iHTML+='</div>';
	iHTML+='<div class="form-item">';
	iHTML+='<select class="form-select" id="popup-month" onclick="document.getElementById(\'edit-babydob-month\').value=document.getElementById(\'popup-month\').value;" ><option value="1">Ene</option><option value="2">Feb</option><option value="3">Mar</option><option value="4">Abr</option><option value="5">Mayo</option><option value="6">Jun</option><option value="7">Jul</option><option value="8" selected="selected">Ago</option><option value="9">Sep</option><option value="10">Oct</option><option value="11">Nov</option><option value="12">Dic</option></select>';
	iHTML+='</div>';
	iHTML+='<div class="form-item">';
	iHTML+='<select class="form-select" id="popup-year" onclick="document.getElementById(\'edit-babydob-year\').value=document.getElementById(\'popup-year\').value;" ><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007" selected="selected">2007</option><option value="2008" selected="selected">2008</option><option value="2009">2009</option><option value="2010">2010</option></select>';
	iHTML+='</div>';
	iHTML+='</div> </td></tr>';
	iHTML+='</table></div>';
	//document.getElementbyId().value=;
	/*iHTML+='<input type="hidden" name="edit[uid]" id="edit-uid" value="' + uid + '"  />';
iHTML+='<input type="hidden" name="edit[cid]" id="edit-cid" value="' + cid + '"  />';
iHTML+='<input type="hidden" name="edit[vacuna]" id="edit-vacuna" value="' + vacuna + '"  />';
iHTML+='<input type="hidden" name="edit[fecha]" id="edit-fecha" value="' + fecha + '"  />';
iHTML+='<input type="hidden" name="edit[form_id]" id="edit-form_id" value="abctools_immunizationsave"  />';*/
	iHTML+='<input type="button" value="Guardar"  class="typebutton" onclick="document.getElementById(\'abctools_immunizationsave\').submit()"/>';
	iHTML+='</div>';
	iHTML+='</td>';
	iHTML+='</tr></table></td></tr></table>';

	return iHTML;
}

function toggleImm(thisItem, mode, id, uid, cid, vacuna, fecha) {

	var divId = 'ImmWidget_'+mode+(id ? '_'+id : '');
	if(getElement(divId)) {
		getElement(divId).parentNode.removeChild(getElement(divId));
		return;
	} else {
		var newDiv = document.createElement('DIV');
		newDiv.id = divId;
		newDiv.className = 'loginWidget';
		newDiv.innerHTML = ImmWidget(mode, uid, cid, vacuna, fecha);
		newDiv.style.position="fixed";
		newDiv.style.height="140px";
		//newDiv.style.zIndex = 99999;
		//setImmWidgetPosition(thisItem, newDiv);
		getElement('masterimm').appendChild(newDiv);
		document.getElementById('edit-uid').value=uid;
		document.getElementById("edit-cid").value=cid;
		document.getElementById('edit-vacuna').value=vacuna;
		document.getElementById('edit-fecha').value=fecha;
		document.getElementById('edit-babydob-day').value=document.getElementById('popup-day').value;
		document.getElementById('edit-babydob-month').value=document.getElementById('popup-month').value;
		document.getElementById('edit-babydob-year').value=document.getElementById('popup-year').value;
	}
}
function getElement(id) {
	return document.getElementById(id);
}

function setFriendWidgetPosition(thisItem, newDiv, mode) {
	if(mode == 'topNav') {
		//topItem = thisItem;
		topItem = thisItem.parentNode;
		newDiv.style.top = '150px';
		newDiv.style.left = '330px';
	} else if(mode == 'watchlistPageLink') {
		newDiv.style.top = (getElement('header').offsetHeight+thisItem.offsetHeight-1)+'px';
		newDiv.style.left = '0px';
	} else if(mode == 'watchButton') {
		newDiv.style.top = (getElement('header').offsetHeight+getElement('main_nav').offsetHeight+getElement('sub_nav').offsetHeight+thisItem.parentNode.offsetHeight+10)+'px';
		newDiv.style.left = thisItem.parentNode.offsetLeft+'px';
	} else if(mode == 'commentVote') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '71px';
	} else if(mode == 'reportComment') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '46px';
	} else if(mode == 'link') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (getElement('master').offsetTop)+'px';
		newDiv.style.right = '46px';
	} else {
		newDiv.style.top = (thisItem.offsetTop+thisItem.offsetHeight)+'px';
		newDiv.style.left = (thisItem.offsetLeft)+'px';
	}
}

function getFriendWidgetMsg(mode) {
	if(mode == 'convTracker') msg = 'You must have a free Newsvine account to use the Conversation Tracker.';
	else if(mode == 'topNav') msg = 'Existing users log in below. New users please register for a new account.';
	else if(mode == 'watchlistPageLink') msg = 'You must have a free Newsvine account to use the personalized Watchlist.';
	else if(mode == 'watchButton') msg = 'You must have a free Newsvine account to watch tags or authors.';
	else if(mode == 'contentVote') msg = 'You must have a free Newsvine account to cast votes for articles.';
	else if(mode == 'reportContent') msg = 'You must have a free Newsvine account to report content.';
	else if(mode == 'commentVote') msg = 'You must have a free Newsvine account to cast votes for comments.';
	else if(mode == 'reportComment') msg = 'You must have a free Newsvine account to report comments.';
	else msg = 'Existing users log in below. New users please register for a new account.';
	return msg;
}

function FriendWidget(mode) {
	var iHTML = '';

	iHTML +='<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablaconborde">';
	iHTML +='<tr><td valign="top"><table width="100%" height="30" border="0" cellpadding="10" cellspacing="10" class="tablatitulowidget">';
	iHTML +='<tr class="textotitulowidget"><td align="left" valign="middle" class="textotitulowidget"><img width="49" height="38" alt="Login" src="/sites/default/themes/ABCdelBebe/images/iconos/comunidad.gif"/><span style="margin-left:15px;color:#663399;font-size:16px;font-weight:bold">Recomendar a un amigo</span></td>';
	iHTML +='<td align="left" valign="middle" class="textotitulowidget"><div align="right"><a href="javascript:void(0);" onclick="toggleFriend(this, \'topNav\'); return false;" class="typebutton">Cerrar</a></div></td></tr></table>';
	iHTML +='<table width="100%" height="152" border="0" cellpadding="3" cellspacing="1">';
	iHTML +='<tr><td class="tablaloginwidget"><form action="?q=user/amigo" method="post" id="user-sendfriend-form">';
	iHTML +='<table width= "100%" border="0" cellspacing="3" cellpadding="10"><tr><td width="140" align="left">';
	iHTML +='<label class="textointernowidget">Tu Nombre:</label></td>';
	iHTML +='<td align="left"><input type="text" maxlength="60" name="edit[name]" id="edit-name"  size="20" value="" class="form-text required" /> </td></tr>';
	iHTML +='</table>';
	iHTML +='<table width= "100%" border="0" cellspacing="3" cellpadding="10"><tr><td width="140" align="left">';
	iHTML +='<label class="textointernowidget">Tu E-Mail:</label></td>';
	iHTML +='<td align="left"><input type="text" maxlength="60" name="edit[name]" id="edit-name"  size="20" value="" class="form-text required" /> </td></tr>';
	iHTML +='</table>';
	iHTML +='<table width= "100%" border="0" cellspacing="3" cellpadding=10"><tr><td width="140" align="left">';
	iHTML +='<label class="textointernowidget">Nombre de tu amigo:</label></td>';
	iHTML +='<td align="left"><input type="text" maxlength="60" name="edit[name]" id="edit-name"  size="20" value="" class="form-text required" /> </td></tr>';
	iHTML +='</table>';
	iHTML +='<table width= "100%" border="0" cellspacing="3" cellpadding="10"><tr><td width="140" align="left">';
	iHTML +='<label class="textointernowidget">E-Mail de tu amigo:</label></td>';
	iHTML +='<td align="left"><input type="text" maxlength="60" name="edit[name]" id="edit-name"  size="20" value="" class="form-text required" /> </td></tr>';
	iHTML +='</table>';
	iHTML +='<br /><div align="right"><input type="hidden" name="edit[form_id]" id="edit-form_id" value="user_sendfriend"  /><input type="submit" name="op" value="Enviar"  class="form-submit" style="background-color:#663399;border:1px solid #663399;color:#FFFFFF;cursor:pointer;margin:2px;" /></div></form></td>';
	iHTML +='</tr></table></td></tr></table>';

	return iHTML;
}

function toggleFriend(thisItem, mode, id) {

	var divId = 'FriendWidget_'+mode+(id ? '_'+id : '');
	if(getElement(divId)) {
		getElement(divId).parentNode.removeChild(getElement(divId));
	} else {
		var newDiv = document.createElement('DIV');
		newDiv.id = divId;
		newDiv.className = 'friendWidget';
		newDiv.innerHTML = FriendWidget(mode);
		newDiv.style.zIndex = 99999;
		setFriendWidgetPosition(thisItem, newDiv, mode);
		getElement('masterfriend').appendChild(newDiv);
	}
	
}
function getElement(id) {
	return document.getElementById(id);
}

function setUpdatetWidgetPosition(thisItem, newDiv, mode) {
	topItem = thisItem;
	//topItem = thisItem.parentNode;
	//topItem = thisItem;
	//buscando la posicion...
	if (self.pageYOffset){
		//todos los navegadores salvo explorer
		pos = self.pageYOffset;
	}else if (window.innerHeight){
		pos = window.pageYOffset;
	}else if (document.documentElement){
		//internet explorer
		pos = document.body.scrollTop;
		//pos = document.documentElement.scrollTop;
	}else if (document.body.scrolltop){
		pos = document.body.scrollTop;
	}

	newDiv.style.top = (pos + (screen.height/2)-200) + 'px';
	newDiv.style.left = ((screen.width/2)-200) + 'px';	
	newDiv.style.position = 'absolute';		
	newDiv.style.top = '170px';
	newDiv.style.left = '300px';
	newDiv.style.position = 'absolute';
}


function UpdateWidget(mode, link, other) {
	var iHTML = '';

	iHTML +='<table width="420" border="0" cellpadding="0" cellspacing="0" class="tablaconborde">';
	iHTML +='<tr><td align="center" valign="top" >';
	iHTML +='<table width="100%" height="30" border="0" cellpadding="5" cellspacing="5" class="tablatitulowidget">';
	iHTML +='<tr><td width="81%" align="left" valign="middle" class="textotitulowidget">Actualiza tus datos</td>';
	iHTML +='<td width="19%" align="left" valign="middle" class="textotitulowidget"><div align="right"><a href="javascript:void(0);" onclick="toggleUpdate(this, \'topNav\'); return false;" class="typebutton">Cerrar</a></div>';
	iHTML +='</td></tr></table></td></tr><tr><td class="tablaloginwidget">';
	iHTML +='<table width="350" border="0" align="center" cellpadding="0" cellspacing="0">';
	iHTML +='<tr><td width="350">&nbsp;</td></tr>';
	iHTML +='<tr><td class="textointernowidget">Actualiza los datos de tu hijo '+other+'. De esa forma, empezar&aacute;s a recibir informaci&oacute;n  sobre la crianza y desarrollo de tu beb&eacute;, dependiendo de la etapa en  que se encuentre y tendr&aacute;s acceso a herramientas como el calendario de  vacunaci&oacute;n y mucho m&aacute;s. </td></tr>';
	iHTML +='<tr><td>&nbsp;</td></tr><tr>';
	iHTML +='<td align="center" height="28"><a href="/' + link + '" class="typebutton" style="float:none;padding:5px;">Actualizar datos</a></td></tr>';
	iHTML +='<tr><td>&nbsp;</td></tr></table></td></tr></table>';

	return iHTML;
}

function toggleUpdate(thisItem, mode, link, id, other) {
	var divId = 'UpdateWidget_'+mode+(id ? '_'+id : '');
	if(getElement(divId)) {
		getElement(divId).parentNode.removeChild(getElement(divId));
	} else {
		var newDiv = document.createElement('DIV');
		newDiv.id = divId;
		newDiv.className = 'AlertWidget';
		newDiv.innerHTML = UpdateWidget(mode, link,other);
		newDiv.style.zIndex = 99999;
		setUpdatetWidgetPosition(getElement('masterupdate'), newDiv, mode);
		getElement('master').appendChild(newDiv);
		/*  if(newDiv.getElementsByTagName('form').length > 0) {
			newDiv.getElementsByTagName('form')[0].elements.email.focus();
		}*/
	}
	
}
function getElement(id) {
	return document.getElementById(id);
}

function setLoginWidgetPosition(thisItem, newDiv, mode) {
	if(mode == 'topNav') {
		//topItem = thisItem;
		topItem = thisItem.parentNode;
		newDiv.style.top = '150px';
		newDiv.style.left = '300px';
	} else if(mode == 'watchlistPageLink') {
		newDiv.style.top = (getElement('header').offsetHeight+thisItem.offsetHeight-1)+'px';
		newDiv.style.left = '0px';
	} else if(mode == 'watchButton') {
		newDiv.style.top = (getElement('header').offsetHeight+getElement('main_nav').offsetHeight+getElement('sub_nav').offsetHeight+thisItem.parentNode.offsetHeight+10)+'px';
		newDiv.style.left = thisItem.parentNode.offsetLeft+'px';
	} else if(mode == 'commentVote') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '71px';
	} else if(mode == 'reportComment') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '46px';
	} else if(mode == 'link') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (getElement('master').offsetTop)+'px';
		newDiv.style.right = '46px';
	} else {
		if (detectBrowser()=='ie'){
			coordenadas=findPos(thisItem);
			newDiv.style.top = (((coordenadas[1]+thisItem.offsetHeight-133)<150)?150:(coordenadas[1]+thisItem.offsetHeight-133))+'px';
		}else
		newDiv.style.top = (((thisItem.offsetTop+thisItem.offsetHeight-133)<150)?150:(thisItem.offsetTop+thisItem.offsetHeight-133))+'px';
		if(window.innerWidth) { anchoActual = window.innerWidth; } else { anchoActual = document.body.offsetWidth; }
		ancho = (anchoActual/2)-200;
		newDiv.style.left = ancho +'px';
	}
}

function getLoginWidgetMsg(mode) {
	if(mode == 'convTracker') msg = 'You must have a free Newsvine account to use the Conversation Tracker.';
	else if(mode == 'topNav') msg = 'Existing users log in below. New users please register for a new account.';
	else if(mode == 'watchlistPageLink') msg = 'You must have a free Newsvine account to use the personalized Watchlist.';
	else if(mode == 'watchButton') msg = 'You must have a free Newsvine account to watch tags or authors.';
	else if(mode == 'contentVote') msg = 'You must have a free Newsvine account to cast votes for articles.';
	else if(mode == 'reportContent') msg = 'You must have a free Newsvine account to report content.';
	else if(mode == 'commentVote') msg = 'You must have a free Newsvine account to cast votes for comments.';
	else if(mode == 'reportComment') msg = 'You must have a free Newsvine account to report comments.';
	else msg = 'Existing users log in below. New users please register for a new account.';
	return msg;
}

function loginWidget(mode) {
	var iHTML = '';

	iHTML +='  <TABLE class="tablatitulowidget" cellSpacing="5" cellPadding="5" width="100%" border="0">';
	iHTML +='    <TBODY>';
	iHTML +='      <TR class="textotitulowidget">';
	iHTML +='        <TD width="38px"><img src="/sites/default/themes/ABCdelBebe/images/iconos/comunidad.gif" alt="Login" width="49" height="38" /></TD>';
	iHTML +='        <TD valign="bottom"><h2>Ingrese su cuenta de usuario</h2></TD>';
	iHTML +='        <TD><A class="typebutton" onclick="toggleLogin(this, \'topNav\'); return false;" href="javascript:void(0);">Cerrar</A></TD>';
	iHTML +='      </TR>';
	iHTML +='    </TBODY>';
	iHTML +='  </TABLE>';
	iHTML +='  <TABLE cellSpacing="1" cellPadding="3" border="0" WIDTH="100%">';
	iHTML +='    <TBODY>';
	iHTML +='      <TR>';
	iHTML +='        <TD class="tablaloginwidget"><FORM id="user-login-form" action="?q=user/login" method="post">';
	iHTML +='            <TABLE  border="0" align="center" cellPadding="3" cellSpacing="3">';
	iHTML +='              <TBODY>';
	iHTML +='                <TR>';
	iHTML +='                  <TD><LABEL>Nombre de usuario:</LABEL></TD>';
	iHTML +='                  <TD><INPUT class="form-text input_186" id="edit-name" maxLength="60" size="10" name="edit[name]" value="" />';
	iHTML +='                  </TD>';
	iHTML +='                </TR>';
	iHTML +='                <TR>';
	iHTML +='                  <TD><label>Contrase&ntilde;a:</label></TD>';
	iHTML +='                  <TD><input class="form-text input_186" id="edit-pass" type="password" size="10" name="edit[pass]" value="" /></TD>';
	iHTML +='                </TR>';
	iHTML +='                <TR>';
	iHTML +='                  <TD colspan="2"><input type="checkbox" class="form-checkbox" value="1" id="edit-remember_me" name="edit[remember_me]"/>    <label>Deseo que mi contrase&ntilde;a sea guardada en este equipo</label></TD>';
	iHTML +='                </TR>';
	iHTML +='                <TR>';
	iHTML +='                  <TD>&nbsp;</TD>';
	iHTML +='                  <TD><input class="button" type="submit" name="op" value="Iniciar sesi&oacute;n" />';
	iHTML +='                    <input id="edit-form_id" type="hidden" name="edit[form_id]" value="user_login" /></TD>';
	iHTML +='                </TR>';
	iHTML +='              </TBODY>';
	iHTML +='            </TABLE>';
	iHTML +='          </FORM>';
	iHTML +='          <TABLE cellSpacing="1" cellPadding="3" border="0" WIDTH="100%">';
	iHTML +='            <TR>';
	iHTML +='              <TD class="optionLogin"><ul>';
	iHTML +='                  <li class="bullet morado"><a title="Olvid&oacute; su clave" href="/?q=user/password">Olvid&oacute; su clave o nombre de usuario? <strong>Clic aqu&iacute;</strong></A> </li>';
	iHTML +='                  <li class="bullet morado"><a href="/registro">Quiere ser parte del Club ABC del beb&eacute;? <strong>Clic aqu&iacute;</strong></a></li>';
	iHTML +='                </ul></TD>';
	iHTML +='            </TR>';
	iHTML +='          </TABLE></TD>';
	iHTML +='      </TR>';
	iHTML +='    </TBODY>';
	iHTML +='  </TABLE>';






	return iHTML;
}

function toggleLogin(thisItem, mode, id) {

	var divId = 'loginWidget_'+mode+(id ? '_'+id : '');
	if(getElement(divId)) {
		getElement(divId).parentNode.removeChild(getElement(divId));
	} else {
		var newDiv = document.createElement('DIV');
		newDiv.id = divId;
		newDiv.className = 'loginWidget';
		newDiv.innerHTML = loginWidget(mode);
		newDiv.style.zIndex = 99999;
		setLoginWidgetPosition(thisItem, newDiv, '');
		getElement('mainContent').appendChild(newDiv);
		/*		if(newDiv.getElementsByTagName('form').length > 0) {
			newDiv.getElementsByTagName('form')[0].elements.email.focus();
		}*/
	}
	
}
function getElement(id) {
	return document.getElementById(id);
}

function setAboutWidgetPosition(thisItem, newDiv, mode) {
	if(mode == 'topNav') {
		//topItem = thisItem;
		topItem = thisItem.parentNode;
		newDiv.style.top = '650px';
		newDiv.style.left = '230px';
	} else if(mode == 'watchlistPageLink') {
		newDiv.style.top = (getElement('header').offsetHeight+thisItem.offsetHeight-1)+'px';
		newDiv.style.left = '0px';
	} else if(mode == 'watchButton') {
		newDiv.style.top = (getElement('header').offsetHeight+getElement('main_nav').offsetHeight+getElement('sub_nav').offsetHeight+thisItem.parentNode.offsetHeight+10)+'px';
		newDiv.style.left = thisItem.parentNode.offsetLeft+'px';
	} else if(mode == 'commentVote') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '71px';
	} else if(mode == 'reportComment') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (topItem.offsetTop+topItem.offsetHeight-21)+'px';
		newDiv.style.right = '46px';
	} else if(mode == 'link') {
		topItem = thisItem.parentNode.parentNode.parentNode.parentNode;
		newDiv.style.top = (getElement('master').offsetTop)+'px';
		newDiv.style.right = '46px';
	} else {
		newDiv.style.top = (thisItem.offsetTop+thisItem.offsetHeight)+'px';
		newDiv.style.left = (thisItem.offsetLeft)+'px';
	}
}

function getAboutWidgetMsg(mode) {
	if(mode == 'convTracker') msg = 'You must have a free Newsvine account to use the Conversation Tracker.';
	else if(mode == 'topNav') msg = 'Existing users log in below. New users please register for a new account.';
	else if(mode == 'watchlistPageLink') msg = 'You must have a free Newsvine account to use the personalized Watchlist.';
	else if(mode == 'watchButton') msg = 'You must have a free Newsvine account to watch tags or authors.';
	else if(mode == 'contentVote') msg = 'You must have a free Newsvine account to cast votes for articles.';
	else if(mode == 'reportContent') msg = 'You must have a free Newsvine account to report content.';
	else if(mode == 'commentVote') msg = 'You must have a free Newsvine account to cast votes for comments.';
	else if(mode == 'reportComment') msg = 'You must have a free Newsvine account to report comments.';
	else msg = 'Existing users log in below. New users please register for a new account.';
	return msg;
}

function AboutWidget(mode) {
	var iHTML = '';

	iHTML +='<table width="412" border="0" cellpadding="0" cellspacing="0" class="tablaconborde">';
	iHTML +='<tr><td valign="top"><table width="100%" height="30" border="0" cellpadding="5" cellspacing="5" class="tablatitulowidget">';
	iHTML +='<tr><td align="left" valign="middle" class="textotitulowidget">:: Cr&eacute;ditos</td>';
	iHTML +='<td align="left" valign="middle" class="textotitulowidget"><div align="right"><a href="javascript:void(0);" onclick="toggleAbout(this, \'topNav\'); return false;" class="textointernowidget">Cerrar</a></div></td></tr></table>';
	iHTML +='<table width="100%" border="0" cellpadding="3" cellspacing="1">';
	iHTML +='<tr><td valign="top" class="tablanoregwidget"> ';
	iHTML +='<table width="100%" border="0" cellspacing="3" cellpadding="3" class="tablanoregwidget">';
	iHTML +='<tr><td width="58%" class="textointernowidget"><strong>:: Gerente ABC del Beb&eacute;:</strong></td>';
	iHTML +='<td width="42%" class="textointernowidget">Edna Orosco</td></tr><tr> ';
	iHTML +='<td class="textointernowidget"><strong>:: Desarrollo de Contenidos:</strong></td>';
	iHTML +='<td class="textointernowidget">Olga Morales</td></tr>';
	iHTML +='<tr> <td colspan="2" class="textointernowidget"><strong>:: Dise&ntilde;o por CEET:</strong></td>';
	iHTML +='</tr><tr><td class="textointernowidget"><strong>Gerente Portales de Informaci&oacute;n:</strong></td>';
	iHTML +='<td class="textointernowidget">Juan Felipe Casta&ntilde;o</td></tr>';
	iHTML +='<tr> <td class="textointernowidget"><strong>Productor:</strong></td><td class="textointernowidget">Kristina Acevedo</td>';
	iHTML +='</tr><tr> <td class="textointernowidget"><strong>Dise&ntilde;ador: </strong></td>';
	iHTML +='<td class="textointernowidget">Ana Mar&iacute;a Pi&ntilde;eros </td>';
	iHTML +='</tr><tr> <td class="textointernowidget"><strong>:: Desarrollo:</strong></td>';
	iHTML +='<td class="textointernowidget">OpenIT Solutions</td>';
	iHTML +='</tr><tr> <td class="textointernowidget"><strong>:: Plataforma:</strong></td>';
	iHTML +='<td class="textointernowidget">Drupal 4.7</td>';
	iHTML +='</tr></table></td></tr></table></td></tr></table>';

	return iHTML;
}

function toggleAbout(thisItem, mode, id) {

	var divId = 'AboutWidget_'+mode+(id ? '_'+id : '');
	if(getElement(divId)) {
		getElement(divId).parentNode.removeChild(getElement(divId));
	} else {
		var newDiv = document.createElement('DIV');
		newDiv.id = divId;
		newDiv.className = 'LoginWidget';
		newDiv.innerHTML = AboutWidget(mode);
		newDiv.style.zIndex = 99999;
		setAboutWidgetPosition(thisItem, newDiv, mode);
		getElement('masteracerca').appendChild(newDiv);
		/*		if(newDiv.getElementsByTagName('form').length > 0) {
			newDiv.getElementsByTagName('form')[0].elements.email.focus();
		}*/
	}
	
}
function emparejardivs(divs,offset) {
	offset=offset?offset:0;
	if(divs instanceof Array){
		var divsarray= new Array(divs.length);
		if (document.getElementById) {
			for (i=0;i<divs.length;i++){ 
				divsarray[i]=document.getElementById(divs[i]);
			}
		} else if (document.all) {
			for (i=0;i<divs.length;i++){ 
				divsarray[i]=document.all[divs[i]];
			}
		}
		var max_size= 0;
		for (i=0;i<divsarray.length;i++){ 
			if(divsarray[i].offsetHeight>max_size){
				max_size=divsarray[i].offsetHeight;
			}
		}
		for (i=0;i<divs.length;i++){
			if(divsarray[i].offsetHeight!=max_size){
				divsarray[i].style.height = (max_size + offset)+ "px";
			}
		}
	}
}
function openWindow(height,width,url,title){
	ventana=window.open(url,null,"status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,height="+height+",width="+width+',top='+((screen.height/2)-(" + al / 2 + "))+',left='+((screen.width/2)-(" + an / 2 + "))+'" + "');
	ventana.focus();
}