var coid = 1;
var scoid = 1;

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 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>");
}

function writeFooter() {
  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><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><FONT color=\"#6699cc\" face=\"Arial,Helvetica,sans-serif\" size=\"1\"> | </FONT><A href=\"http://www.esmas.com/negocios\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">negocios</FONT></A></FONT><BR><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/vida\" target=\"_top\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\"><FONT size=\"1\" color=\"#333333\" face=\"Arial,Helvetica,sans-serif\">vida y salud</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\" <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>');
}




