function writeStyle() {
document.write("<style>");document.write("a { text-decoration: none; }");document.write(".main { background-color: #99cc33; }");document.write(".whitetext { font: 13px Arial; color: white;}");document.write(".blacktext { font: 13px Arial; color: black; }");document.write(".whitetitle { font: 12px Verdana; color: white; font-weight: normal;}");document.write(".featuretitle { font: bold 24px Arial; color: white; font-weight: bold;}");document.write(".footer {	color: #333333; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 10px;}");document.write(".footer2 { color: #999999; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 10px; }");document.write(".servicios { color: white; font-family: Arial; font-size: 10px; }");document.write("</style>");document.write("<link href='http://i.esmas.com/img/style.css' rel='styleSheet' type='text/css'>");
}

function getCookie() { 
	if (document.cookie.length > 0) { 
		begin = document.cookie.indexOf("esmasstats="); 
		if (begin != -1) { 
			begin += 11; 
			(document.cookie.indexOf(";", begin) != -1)? end = document.cookie.indexOf(";", begin) : end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end));
		} 
	}
	return null; 
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
 function sitejump()
 {jump = document.fma1.site.options[document.fma1.site.selectedIndex].value;
 if (jump != 0){
     if (jump == "directoa") {         window.open('http://pjw02.esmas.com/directoa/sitio/frm_index.htm','_blank','height=587,width=400,menubar=0,resizable=0,scrollbars=0, status=0,titlebar=0,toolbar=0,left=0,top=0');     }     else { 	    parent.location="http://" + jump; 	} } else { 	return(false); } } function clearform(which){ if (which.value=="buscar") which.value='' }

function writeHeader(banners) {
	if (banners==1)	{
	     document.write("<table bgcolor=black border=0 width=750 cellspacing=0 cellpadding=0><tr><td>");
		 //Banner 1
		 document.write("<SCR"+"IPT language=\"JavaScript1.1\" "+
		 " SRC=\"http://ads.esmas.com/js.ng/Params.richmedia=no&site=ninos&canal=ninoshome&adsize=468x60&tile=1\">");
		 document.write("</SCR"+"IPT>");
		 document.write("<NOSCR"+"IPT>");
		 document.write("<IMG SRC=\"http://ads.esmas.com/image.ng/Params.richmedia=no&site=ninos&canal=ninoshome&adsize=468x60&tile=1\" target=\"_blank\"></A>");
		 document.write("</NOSCR"+"IPT>");		 		 
		 document.write("</td><td>");
		 //Banner 2
		 document.write("<SCR"+"IPT language=\"JavaScript1.1\" "+
		 " SRC=\"http://ads.esmas.com/js.ng/Params.richmedia=no&site=ninos&canal=ninoshome&adsize=120x60&tile=2\">");
		 document.write("</SCR"+"IPT>");
		 document.write("<NOSCR"+"IPT>");
		 document.write("<IMG SRC=\"http://ads.esmas.com/image.ng/Params.richmedia=no&site=ninos&canal=ninoshome&adsize=120x60&tile=2\" target=\"_blank\"></A>");
		 document.write("</NOSCR"+"IPT>");		 		 
		 document.write("</td><td>");
		 //Banner 3
		 document.write("<SCR"+"IPT language=\"JavaScript1.1\" "+
		 " SRC=\"http://ads.esmas.com/js.ng/Params.richmedia=no&site=ninos&canal=ninoshome&adsize=120x60&tile=3\">");
		 document.write("</SCR"+"IPT>");
		 document.write("<NOSCR"+"IPT>");
		 document.write("<IMG SRC=\"http://ads.esmas.com/image.ng/Params.richmedia=no&site=ninos&canal=ninoshome&adsize=120x60&tile=3\" target=\"_blank\"></A>");
		 document.write("</NOSCR"+"IPT>");		 		 
		 document.write("</td></tr></table><br>");
	}
	document.write("		<table border='0' cellpadding='0' cellspacing='0' width='100%' bgcolor='#000000'><tr><td>		<table border='0' cellpadding='0' cellspacing='0' width='760'>			<tr>				<td width='132' rowspan='2' align='right' valign='top'><img height='89' width='132' src=\"http://i.esmas.com/img/logo_c09_pleca.gif\" usemap=\"#logo_esmas\" border=0><map name='logo_esmas'><area href=\"http://www.esmas.com/bsp/esmas/hmp.jsp\" coords='46,49,28' shape='circle' target=\"_top\"></map></td>				<td colspan='6' valign='bottom' align='left'><!--Empieza servicios-->					<table width='618' border='0' cellspacing='0' cellpadding='0' bgcolor='#666666' height='29'>						<tr>							<td width='420' valign='top' bgcolor='#666666'>								<table width='100%' border='0' cellspacing='0' cellpadding='0'>									<tr bgcolor='black' height='5'>										<td height='5' bgcolor='#666666'><img src=\"http://i.esmas.com/img/spacer.gif\" width='10' height='5'></td>									</tr>									<tr align='right' valign='top'>										<td bgcolor='#666666'>  <table border='0' cellspacing='0' cellpadding='0' height='19' bgcolor='#333333'>    <tr>       <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='javascript:void(null);' onmousedown=\"window.open('http://pjw02.esmas.com/directoa/sitio/frm_index.htm','_blank','height=587,width=400,menubar=0,resizable=0,scrollbars=0, status=0,titlebar=0,toolbar=0,left=0,top=0')\" class='sevicios'>directo         a...</a></td><td width='5'><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>      <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='http://www.esmas.com/e-mail' class='sevicios'>e-mail</a></td>      <td><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>      <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='http://www.esmas.com/chat' class='sevicios'>chat</a></td>      <td><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>      <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='http://www.esmas.com/compras' class='sevicios'>compras</a></td>      <td><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>      <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='http://www.esmas.com/otrosservicios' class='sevicios'>otros servicios</a></td>      <td><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>      <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='http://www.esmas.com/ayuda' class='sevicios'>ayuda</a></td>      <td><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>      <td><img src='http://i.esmas.com/img/servicio_left.gif' width='5' height='19'></td>      <td><a href='http://www.esmas.com/registro' class='sevicios'>registro</a></td>      <td ><img src='http://i.esmas.com/img/servicio_right.gif' width='5' height='19'></td>    </tr>  </table>										</td>									</tr>								</table>							</td>							<td width='175' valign='middle' align='center'>                            <form action=\"http://busqueda.esmas.com/NASApp/buscador/buscainterna.jsp\" name=\"fma1\" target=\"_parent\"><!--img src=\"http://i.esmas.com/img/buscar.gif\" width='46' height='19' align='absmiddle'-->                             <input type='text' name='q' size='10' maxlength='40' class='search' value='buscar' onFocus=\"clearform(this)\">                             <input type='image' src=\"http://i.esmas.com/img/buscar_boton.gif\" width='21' height='19' align='absmiddle' border='0'></td>							<td width='6' valign='top' bgcolor='#666666' background=\"http://i.esmas.com/img/s_fondo_lder.gif\"><img src=\"http://i.esmas.com/img/s_esq_der.gif\" width='6' height='5'></td>							<td width='6' valign='top' bgcolor='#666666' background=\"http://i.esmas.com/img/s_fondo_lizq.gif\"><img src=\"http://i.esmas.com/img/s_esq_izq.gif\" width='6' height='5'></td>							<td width='115' valign='middle' bgcolor='#666666' align='center'>							   <select name='site' onChange=\"sitejump();\" class='combo' size='1'>									<option value='0'>Otros sitios									<option value='www.esmas.com/clubamerica'>Club Am&eacute;rica									<option value='directoa'>Directo A...									<option value='www.esmas.com'>EsMas.com									<option value='www.esmas.com/estadioazteca'>Estadio Azteca									<option value='www.esmas.com/fonovisa'>Fonovisa									<option value='www.redplastica.com'>Red Pl&aacute;stica									<option value='www.esmas.com/sky'>SKY									<option value='www.esmas.com/skytel'>Skytel									<option value='www.esmas.com/televisa'>Televisa									<option value='www.tuayudasicuenta.com'>TuAyudaS&iacute;Cuenta								</select>						   </td>							</form>						</tr>					</table>					<!--Termina Servicios-->				</td>			</tr>			<tr>				<td width='179' valign='bottom'><img height='60' width='179' src=\"http://i.esmas.com/img/c09_pleca.gif\"></td>				<td width='139' valign='bottom'><img height='60' width='139' src=\"http://i.esmas.com/img/hdr_01.gif\"></td>				<td width='19' valign='bottom'><img height='60' width='19' src=\"http://i.esmas.com/img/hdr_01.gif\"></td>				<td width='139' valign='bottom' align='center'>					<table border='0' cellpadding='0' cellspacing='0' width='139' height='40'>						<tr height='50'>							<td width='10' bgcolor='#003366' height='50'><img height='10' width='10' src=\"http://i.esmas.com/img/spacer10.gif\"></td>							<td width='112' bgcolor='#003366' height='50' align='center' valign='middle'><img height='10' width='10' src=\"http://i.esmas.com/img/spacer10.gif\"></td>						</tr>					</table>				</td>				<td width='20' valign='bottom'><img height='60' width='20' src=\"http://i.esmas.com/img/hdr_01.gif\"></td>				<td width='132' valign='bottom' align='left' bgcolor='black'>					<table border='0' cellpadding='0' cellspacing='0' width='122' height='40'>             		<tr height='50'>              			<td width='10' bgcolor='#003366' height='50'><img height='10' width='10' src=\"http://i.esmas.com/img/spacer10.gif\"></td>             			<td width='112' bgcolor='#003366' height='50' align='center' valign='middle'><img height='10' width='10' src=\"http://i.esmas.com/img/spacer10.gif\"></td>             		</tr>					</table>				</td>			</tr>		</table>		</td></tr></table>");
}



function writeFooter() {
  document.write("<br>");	
  document.write("<TABLE width=\"608\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"white\"><TR><TD width=\"132\" align=\"right\"></TD><TD width=\"19\" align=\"left\" valign=\"middle\"></TD><TD width=\"457\" align=\"left\" valign=\"middle\"></TD></TR><TR><TD width=\"132\" align=\"right\"><A href=\"http://www.esmas.com/\" target=\"_top\"><IMG src=\"http://i.esmas.com/img/logo_legal.gif\" width=\"49\" height=\"40\" border=\"0\"></A></TD><TD valign=\"middle\" align=\"left\" width=\"19\"> </TD><TD valign=\"middle\" align=\"left\" width=\"457\"><IMG src=\"http://i.esmas.com/img/legal.gif\" width=\"457\" height=\"27\"></TD></TR><TR><TD width=\"132\" align=\"right\"></TD><TD valign=\"middle\" align=\"left\" width=\"19\"></TD><TD valign=\"middle\" align=\"center\" width=\"457\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><BR></FONT><A href=\"http://www.esmas.com/\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">p&aacute;gina               principal</FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/noticierostelevisa\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">noticias</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/opinion\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">opini&oacute;n</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><A href=\"http://www.esmas.com/deportes\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">deportes</FONT></A><BR><A href=\"http://www.esmas.com/negocios\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">negocios</FONT></A></FONT><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/espectaculos\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">espect&aacute;culos</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/tecnologia\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">tecnolog&iacute;a</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/vida\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">vida</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/cultura\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">cultura</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://ninos.esmas.com/home\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">ni&ntilde;os</FONT></FONT></A><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><A href=\"http://www.esmas.com/salud\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">salud</FONT></A><BR><BR><A href=\"http://www.esmas.com/e-mail\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">e-mail</FONT></A>    <A href=\"http://www.esmas.com/chat\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">chat</FONT></A>    <A href=\"http://www.esmas.com/compras\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">compras</FONT></A>    <A href=\"http://www.esmas.com/otrosservicios\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">otros servicios</FONT></A>    <A href=\"http://www.esmas.com/ayuda\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">ayuda</FONT></A>    <A href=\"http://www.esmas.com/registro\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">mi cuenta</FONT></A></FONT><BR></TD></TR><TR><TD width=\"132\"> </TD><TD width=\"19\"> </TD><TD valign=\"top\" align=\"center\" width=\"457\"><BR><A href=\"http://www.esmas.com/escribenos\" target=\"_top\"><FONT color=\"#999999\" face=\"Arial,Helvetica,sans-serif\" size=\"1\">escr&iacute;benos</FONT></A><FONT color=\"#999999\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> : <A href=\"http://www.esmas.com/conveniousuario\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">convenio del               usuario</FONT></A> : <A href=\"http://www.esmas.com/politicaprivacidad\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">pol&iacute;tica de privacidad</FONT></A> : <A href=\"http://www.esmas.com/datosempresa\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">datos de la empresa</FONT></A> : <A href=\"http://www.esmas.com/ventas\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">an&uacute;nciate</FONT></A></FONT><BR><BR></TD></TR></TABLE>");

  	var nd = new Date ();
	var la_cookie = null;
	var domain = "";
	var siten = "esmas";
	if(location.href.indexOf("esmas.com")>-1) {
		domain = "domain=.esmas.com"
	}
	else {
		if(location.href.indexOf("yahoo.net")>-1) siten = "nyahoo";
		if(location.href.indexOf("segundamano.com")>-1) siten = "nsegundamano";
		if(location.href.indexOf("esmascompras.com")>-1) siten = "nesmascompras";
		if(location.href.indexOf("metroscubicos.com")>-1) siten = "nmetroscubicos";
		if(location.href.indexOf("asegurateya.com")>-1) siten = "nasegurateya";
		if(location.href.indexOf("despegar.com")>-1) siten = "ndespegar";
		if(location.href.indexOf("autocosmos.com")>-1) siten = "nautocosmos";
		if(location.href.indexOf("buongiorno.com")>-1) siten = "nbuongiorno";
		if(location.href.indexOf("occ.com")>-1) { siten = "nocc";domain = "domain=.occ.com.mx"; }
		if(location.href.indexOf("mercadolibre.com")>-1) siten = "nmercadolibre";
		if(location.href.indexOf("televisaestudios.com")>-1) siten = "ntelevisaestudios";
		if(location.href.indexOf("chabelo.com")>-1) siten = "nchabelo";
		if(location.href.indexOf("tarabu.com")>-1) siten = "ntarabu";
	}
	if(navigator.cookieEnabled) {
		la_cookie = getCookie();
		if(!la_cookie) {
			document.cookie = "esmasstats="+(nd.getYear()+"").substring(2,4)+(((nd.getMonth()+1)<10)?"0":"")+(nd.getMonth()+1)+((nd.getDate()<10)?"0":"")+nd.getDate()+((nd.getHours()<10)?"0":"")+nd.getHours()+((nd.getMinutes()<10)?"0":"")+nd.getMinutes()+((nd.getSeconds()<10)?"0":"")+nd.getSeconds()+"-"+(Math.random()*1000000000000000000)+"-"+Math.round(Math.random()*100000000)+"; expires=Fri, 31 Jan 2020 23:59:59 GMT; path=/; " + domain;
			(getCookie())? la_cookie=getCookie() : la_cookie = "NO~COOKIE~ENABLED";
		}	
	}
	else {
		la_cookie = "NO~COOKIE~ENABLED";
	}
	var ref = document.referrer.replace(/\|/gi,',');
	var loc = location.href.replace(/\|/gi,',');
	var res = 'http://stats.esmas.com/stats/collectornew.cgi?'+loc+'|'+ref+'|'+siten+'|S000|'+nd.getTime()+'|'+la_cookie+'|'+navigator.cookieEnabled+'|'+(navigator.javaEnabled());
	(window.screen)? res += '|'+screen.width+'x'+screen.height+'|'+screen.colorDepth : res+='||';
	document.write('<div><IMG SRC="'+res+'" WIDTH=1 HEIGHT=1 BORDER=0></div>');

}

function writeBanner(sct,sub,w,h,pos) {

if (sub=="hmp")
{
sub="";
}

document.write("<A HREF='http://ad.doubleclick.net/jump/" + sct + ".esmas.com/" + sub + ";sz=" + w + "x" + h + ";tile=" + pos + ";ord=588201?' TARGET=\"_new\">");
document.write("<IMG lowsrc=\"http://i.esmas.com/img/spacer.gif\" SRC='http://ad.doubleclick.net/ad/" + sct + ".esmas.com/" + sub + ";sz=" + w + "x" + h + ";tile=" + pos + ";ord=588201?' height=" + h + " width=" + w + " border=0 border =0></A>");
}
