function search (key) {
        key=escape(key);
	window.open("http://buscador.terra.com.pe/default.asp?lpv=1&ca=l&loc=searchbox&query="+ key,"buscadorlycos","toolbar=1,location=1,directories=1,menuBar=1,scrollbars=1,resizable=1");
}

document.writeln('<LINK REL="STYLESHEET" TYPE="text/css" HREF="http://www.terra.com.pe/includes/js/estilocabecera.css">');

document.write('<table border="0" cellpadding="0" width="100%" height="51" cellspacing="0" background="http://www.terra.com.pe/img/bg_cabecera2_linea.gif">');
document.write('<tr>');
document.write('<td width="14"><img src="http://www.terra.com.pe/img/transp.gif" width="14" height="1" border="0"></td>');
document.write('<td width="93" valign=top>');
document.write('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="9" border="0"><br>');
document.write('<a href="http://www.terra.com.pe" target="_top"><img src="http://www.terra.com.pe/img/terra.gif" width="93" height="27" border="0" alt=\"Terra\"></a><br>');
document.write('</td>');
document.write('<td width="100%"></td>');
document.write('<td width="135" valign=top>');
document.write('<form name=\"canales\">');
document.write('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="14" border="0"><br>');
document.writeln('<select name=\"opcion\" onChange=\"top.location=document.canales.opcion.options[this.form.opcion.selectedIndex].value" class="combocabpe">');
for (i=0; i<arraycanales.length; i+=3) {
	if (arraycanales[i+1] == "") {
		document.write('<option value="">');
	} else {
		document.write('<option value=' + arraycanales[i+1] + '>');
	}
document.write(arraycanales[i]);
}
document.writeln('</select>');
document.write('<script language="JavaScript">');
document.write('<!-- ');
document.write('document.canales.opcion.selectedIndex = 0;');
document.write('//-->');
document.write('</script>');

		

document.write('</td></form><form action=\"javascript:search(document.buscar.Claus.value)\" method=\"POST\" name=\"buscar\">');
document.write('<td width="6"><img src="http://www.terra.com.pe/img/transp.gif" width="6" height="1" border="0"></td>');
document.write('<td width="142" valign=top>');
document.write('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="14" border="0"><br>');

		if (navigator.appName == "Microsoft Internet Explorer")
		{document.write('<input type=\"text\" name=\"Claus\" class=\"captioncabpe\" value=\"Buscar en Internet\" onfocus=\"if(this.value==\'Buscar en Internet\') {this.value=\'\';}\" onblur=\"if(this.value==\'\') {this.value=\'Buscar en Internet\';}\" style=\"width: 142px;\">')}
		else
		{document.write('<input type=\"text\" name=\"Claus\" class=\"captioncabpe\" value=\"Buscar en Internet\" onfocus=\"if(this.value==\'Buscar en Internet\') {this.value=\'\';}\" onblur=\"if(this.value==\'\') {this.value=\'Buscar en Internet\';}\" style=\"width: 142px;\">')}

document.write('</td>');
document.write('<td width="5"><img src="http://www.terra.com.pe/img/transp.gif" width="5" height="1" border="0"></td>');
document.write('<td width="35" valign=top>');
document.write('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="12" border="0"><br>');
document.write('<input type="image" src="http://www.terra.com.pe/img/lupita_int.gif" align="absmiddle" width="35" height="24" border="0"><br>');
document.write('</td></form>');
document.write('<td width="28"><img src="http://www.terra.com.pe/img/transp.gif" width="28" height="1" border="0"></td>');
document.write('</tr>');
document.write('</table>');



/* 
  Copyright 2007 - Certifica.com 
  $Id: certifica.js 1918 2007-06-20 14:06:07Z leus $
*/

//CERTIFICA.COM : CODIGO DE certifica.js

DEFAULT_PIVOT_NAME = 'cert_Pivot';
DEFAULT_REDIRECT_TIME = 3000;
DEFAULT_PERIODIC_REDIRECT_TIME = 60000;
DEFAULT_ORIGIN_COOKIE_NAME = 'cert_Origin';

var cert_CustomCounters = null;
var cert_CustomAttributes = null;
var cert_ReferrerParms = null;
var cert_customSearch = false;

function cert_normalizePath(sPath)
{
    var sProtocol = cert_getProtocol();
    var sRet = 'home/default';
    var regexSlashes = /\/\/+/g;
    var regexInvalid = /[^A-Z0-9_.\/]/gi;
    var aDefaultPages = [
        'index.html', 'index.htm', 'index.asp', 'index.php',
        'default.asp', 'index.cfm'
    ];

    sPath = unescape(sPath);
    if (sPath && sPath.length > 0 &&
        (sProtocol == 'http:' || sProtocol == 'https:')) {
        sPath = sPath.replace(regexInvalid, '');
        // Si es un directorio, se agrega una pagina por defecto
        if (sPath.charAt(sPath.length - 1) == '/') {
            sPath += aDefaultPages[0];
        }
        sPath = sPath.replace(regexSlashes, '/');

        var aParts = sPath.split('/');
        var aElems = new Array();
        for (var i = 0; i < aParts.length; i++) {
            if (aParts[i] && aParts[i] != '') {
                aElems.push(aParts[i]);
            }
        }

        if (aElems.length == 0) {
            aElems.push('home');
            aElems.push('default');
        }

        if (aElems.length == 1) {
            aElems.unshift('home');
        }

        for (var i = 0; i < aDefaultPages.length; i++) {
            if (aElems[aElems.length - 1] == aDefaultPages[i]) {
                aElems[aElems.length - 1] = 'default';
                break;
            }
        }
        sRet = aElems.join('/');
    }
    return sRet;
}

function cert_qVal(sValue) 
{
    var pos = String(document.location).indexOf('?');
    if (pos != -1) {
       var query = String(document.location).substring(pos+1);
       var vars = query.split("&");
       for (var i=0; i < vars.length; i++) {
          var pair = vars[i].split("=");
          if (pair[0] == sValue)
             return pair[1];
       }       
    }
    return null;  
}

function cert_getCookie(sName) {
  var dc = document.cookie;
  var prefix = sName + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function cert_setCookie(sName, sValue, dtExpires, sPath, sDomain, bSecure) {
  document.cookie = sName + "=" + escape(sValue) +
      ((dtExpires) ? "; expires=" + dtExpires.toGMTString() : "") +
      ((sPath) ? "; path=" + sPath : "") +
      ((sDomain) ? "; domain=" + sDomain : "") +
      ((bSecure) ? "; secure" : "");
}

function cert_getReferrer()
{
   var referrer = document.referrer;
   if (self.cert_getReferrer14) {
      referrer = cert_getReferrer14();
	} else {
/*@cc_on
  @if(@_jscript_version >= 5 )
   try { 
      if ( self != top ) referrer = top.document.referrer;
   } catch(e) {};
  @end
  @*/
  }

  if (referrer) {
	  if (cert_customSearch) {
		var re = new RegExp('(https?:\/\/[^/]*)\/?.*$');
		referrer = referrer.replace(re, '$1/buscInterno');
	  }
	  referrer = cert_appendExtraReferrerParms(referrer);
  }
  return referrer;
}

/* Obtiene el tipo de protocolo del documento actual. */
function cert_getProtocol()
{
    if (window && window.location && window.location.protocol)
        return window.location.protocol;
    return null;
}
 
/* Crea una cookie con el contenido del referrer para evaluarlo
  en el paso final, si es necesario. */
function cert_setOrigin()
{
	var c = cert_getCookie(DEFAULT_ORIGIN_COOKIE_NAME);
	if (!c) {
		var l = cert_getReferrer();
		if (l) {
			var re = new RegExp('https?:\/\/([^\/]+)');
			var m = re.exec(l);
			if (m) {
				var m2 = re.exec(document.location);
				if (m2) {
					if (m[1] != m2[1]) {
						c = m[1];
					}
				}
			}
		}
		if (!c) {
			c = 'directo';
		}
		cert_setCookie(DEFAULT_ORIGIN_COOKIE_NAME, c);
	} 
}

function cert_getFlashVersion()
{
	var flashVersion = -1;
	if (navigator.plugins && navigator.plugins.length) {
		var objFlash = navigator.plugins["Shockwave Flash"];
		if (objFlash) {
			if (objFlash.description) {
				flashDesc = objFlash.description;
				flashVersion = flashDesc.charAt(flashDesc.indexOf('.')-1);
			}
		}

		if (navigator.plugins["Shockwave Flash 2.0"]) {
			flashVersion = 2;
		}
	} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin) {
			flashVersion = 0; // no detectada!
		}
	}

	/*@cc_on
	for(var i = 10; i > 0; i--) {
		try {
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			flashVersion = i;
			break;
		} catch(e){}
	}	
	@*/
	return flashVersion;
}

/* Crea la URL para obtener un pageview de Certifica. */
/* Sólo necesita los parámetros iSiteId y sPath       */
function cert_getURL(iSiteId, sPath, sAppend) 
{
    var size, colors, referrer, url;
    size = colors = referrer = 'otro';
    var o = cert_qVal('url_origen');
    var proto = cert_getProtocol();
    if (proto != 'https:')
        proto = 'http:';
    
    if (o != null && o != '')
       referrer = o;
    else 
       referrer = escape(cert_getReferrer());
    if ( window.screen.width ) size = window.screen.width;
    if ( window.screen.colorDepth ) colors = window.screen.colorDepth;
    else if ( window.screen.pixelDepth ) colors = window.screen.pixelDepth;
	if (sPath == 'url')
		sPath = cert_normalizePath(sPath);
    url = 
       proto + '//hits.e.cl/cert/hit.dll?sitio_id=' + iSiteId + '&path=' + sPath +
       '&referer=' + referrer + '&size=' + size + '&colors=' + colors;
    url += '&java=' + navigator.javaEnabled() + '&flash=' + cert_getFlashVersion();
    if (sAppend)
        url += sAppend;
    return url;    
}

function cert_addExtraReferrerParm(sName, sValue)
{
	if (!cert_ReferrerParms) {
		cert_ReferrerParms = new Object();
	}

	cert_ReferrerParms[sName] = sValue;
}

function cert_appendExtraReferrerParms(sReferrer)
{
	if (cert_ReferrerParms && sReferrer) {
		var sAppend = '';
		for (var n in cert_ReferrerParms) {
			sAppend += n + '=' + cert_ReferrerParms[n] + '&';
		}
		if (sAppend) {
			if (sReferrer.indexOf('?') != -1) {
				sReferrer += '&' + sAppend;
			} else {
				sReferrer += '?' + sAppend;
			}
		}
	}
	return sReferrer;
}

function cert_addCustomAttribute(sType, sValue)
{
	if (!cert_CustomAttributes) {
		cert_CustomAttributes = new Object();
	}

	cert_CustomAttributes[sType] = sValue;
}


function cert_addCustomCounter(sType, iValue)
{
	if (iValue && iValue > 0) {
		if (!cert_CustomCounters) {
			cert_CustomCounters = new Object();
		}

		if (cert_CustomCounters[sType]) {
			cert_CustomCounters[sType] += iValue;
		} else {
			cert_CustomCounters[sType] = iValue;
		}
	}
}


function cert_getCustomTags()
{
	var sRet = '';
	var ct_atrib = '', ct_acum = '';
	if (cert_CustomAttributes) {
		ct_atrib = 'ct_atrib=';
		for (var i in cert_CustomAttributes) {
			ct_atrib += i + ':' + cert_CustomAttributes[i] + ';';
		}
	}

	if (cert_CustomCounters) {
		ct_acum = 'ct_acum=';
		for (var i in cert_CustomCounters) {
			ct_acum += i + ':' + cert_CustomCounters[i] + ';';
		}
	}

	if (ct_atrib || ct_acum) {
		if (ct_atrib) {
			sRet += '&' + ct_atrib;
		}
		if (ct_acum) {
			sRet += '&' + ct_acum;
		}
	}
	return sRet;
}


/* Crea la URL para un sitio con e-Commerce. */
function cert_getURL_eCommerce(iSiteId, sPath, sAmount)
{
	var sOrigin = null;

	if ((sOrigin = cert_getCookie(DEFAULT_ORIGIN_COOKIE_NAME))) {
		cert_addCustomAttribute('origin', sOrigin);
	}

	if (sAmount) {
		cert_addCustomCounter('money', sAmount);
	}

	var sAppend = cert_getCustomTags();

	return cert_getURL(iSiteId, sPath, sAppend);
}


/* Crea la URL para un sitio con Search Engine interno. */
function cert_getURL_CustomSearch(iSiteId, sPath, sSearchString)
{
	cert_customSearch = true;
	cert_addExtraReferrerParm('q', sSearchString);

	return cert_getURL(iSiteId, sPath);
}

/* Efectua un hit en certifica usando una imagen pivote. */
function cert_registerHit(iSiteId, sPath, sPivotName) 
{
   var sAppend = '&cert_cachebuster=' + (1 + Math.floor (Math.random() * 10000));
   if ( !sPivotName )
      sPivotName = DEFAULT_PIVOT_NAME;
   if ( document.images )
      if ( document.images[sPivotName] )
         document.images[sPivotName].src = cert_getURL(iSiteId, sPath, sAppend);
}

/* Efectúa una redirección marcando la ruta de salida */
function cert_registerHitAndRedirect( sURL, iSiteId, sPath, sPivotName ) 
{
   cert_registerHit( iSiteId, sPath, sPivotName );
   setTimeout( "location.href = '" + sURL + "'", DEFAULT_REDIRECT_TIME );
}

/* Abre una nueva ventana, marcando el hit */
function cert_registerHitAndOpenWindow( sURL, iSiteId, sPath, sPivotName, sName, sFeatures, bReplace )
{
   cert_registerHit( iSiteId, sPath, sPivotName );
   if (!sName)
      sName = 'Downloads';
   if (!sFeatures)
      sFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no, scrollbars=no,resizable=no,width=425,height=510,screenX=20,screenY=20';
   window.open( sURL, 
      sName, 
      sFeatures, 
      bReplace 
   );
   return false;
}

/* Marca el hit y reemplaza/abre una URL en el frame 'sName' */
function cert_registerHitAndReplaceOtherFrame( sURL, sName, iSiteId, sPath, sPivotName ) 
{
   cert_registerHitAndOpenWindow( sURL, iSiteId, sPath, sPivotName, sName, 0, true );
}

/* Marca el hit y reemplaza/abre una URL en el frame 'sName' */
function cert_registerHitAndReplaceThisFrame( sURL, iSiteId, sPath, sPivotName ) 
{
   cert_registerHitAndRedirect( sURL, iSiteId, sPath, sPivotName );
}

/* Marca el hit y baja un archivo */
function cert_registerHitAndDownloadFile( sURL, iSiteId, sPath, sPivotName ) 
{
   cert_registerHitAndRedirect( sURL, iSiteId, sPath, sPivotName );
}

function cert_getAnchor(sUrl)
{
    return '<img src="' + sUrl + '" width="1" height="1" border="0" alt="Certifica.com">';
}

/* Marca un hit en la página actual */
function tagCertifica(iSiteId, sPath) 
{
    document.writeln(cert_getAnchor(cert_getURL(iSiteId, sPath)));
}

/* Marca un hit en la página actual, usando eCommerce */
function tagCertifica_eCommerce(iSiteId, sPath, iAmount) 
{
    document.writeln(cert_getAnchor(cert_getURL_eCommerce(iSiteId, sPath, iAmount)));
}

/* Marca un hit en la página actual, agregando parametros de Search Engines internos */
function tagCertifica_CustomSearch(iSiteId, sPath, sSearchString) 
{
    document.writeln(cert_getAnchor(cert_getURL_CustomSearch(iSiteId, sPath, sSearchString)));
}
/* Marca un registro cada iTime milisegundos.  */
function cert_registerPeriodicHit( iSiteId, sPath, sPivotName, iTime ) 
{
   if ( !sPivotName )
      sPivotName = DEFAULT_PIVOT_NAME;
   if ( !iTime )
      iTime = DEFAULT_PERIODIC_REDIRECT_TIME;

   cert_registerHit( iSiteId, sPath, sPivotName );
   setTimeout( 'cert_registerPeriodicHit( ' + iSiteId + ', "' + sPath + '", "' + sPivotName + '", ' + iTime + ')', iTime );
}

cert_setOrigin();

// FIN certifica.JS

//CERTIFICA.COM : CODIGO DE certifica-js14.js
/* 
  Copyright 2004 - Certifica.com 
  $Id: certifica-js14.js,v 1.4 2004/10/27 20:12:21 leus Exp $
*/
	function cert_getReferrer14(){
	   var referrer = document.referrer;
	   try { 
		  if ( self != top ) 
			 referrer = top.document.referrer;
	   } catch(e) {
		  referrer = document.referrer;
	   }
	   return referrer;
	}

//FIN certifica-js14.js


//CERTIFICA.COM : CABECERA TERRA

/* Se busca una cadena y se elimina */

function cert_depura_ruta(v_ruta_buscada ,v_rutacompleta, v_dato) 
{
	  v_url2=v_dato.toLowerCase();
      v_posicion=v_url2.lastIndexOf(v_ruta_buscada);
      v_dato="/"+v_url2.substring(v_posicion+v_ruta_buscada.length,v_url2.length);
      v_datoback=v_dato;
      v_dato2=v_dato.charAt(v_dato.length-1);
      v_cadena="/";
      v_otracadena="|";
      v_contador2=0;
      while (v_datoback.indexOf(v_cadena) > -1) 
      {  v_dato3=v_datoback.indexOf(v_cadena);
         v_datoback=v_datoback.substring(0,v_dato3)+v_otracadena+v_datoback.substring(v_dato3+1,v_datoback.length);
         v_contador2=v_contador2+1;
       }
       if (v_dato2 == '/')
       { v_dato=v_dato+"home/";
       }
	   return v_dato;

}

/*Se utiliza para hacer consistencia de las secciones y validar ciertas excepciones de nombres
que deben aparecer en los reportes con otros nombres.  También se elimina la palabra SHARED.
Las subsecciones de deportes se envían a la sección DEPORTES
*/

function cert_terra_secciones(v_rutacompleta, v_dato) 
{
 var v_datoback, v_cadena, v_dato3, v_dato2, v_otracadena , v_url2=v_dato;
 var v_contador2 , v_posicion , v_return;
   if (v_rutacompleta.indexOf("/shared/") > 0)
    { v_dato = cert_depura_ruta("/shared/" ,v_rutacompleta, v_url2) 
      v_return = v_dato;
      if ((v_rutacompleta.indexOf("/ligaseuropeas/") > 0) || (v_rutacompleta.indexOf("/tenis/") > 0) || (v_rutacompleta.indexOf("/formula12006/") > 0) || (v_rutacompleta.indexOf("/formula1/") > 0) || (v_rutacompleta.indexOf("/formula12005/") > 0) || (v_rutacompleta.indexOf("/sudamericana2005/") > 0) || (v_rutacompleta.indexOf("/mundialsub202005/") > 0) || (v_rutacompleta.indexOf("/basquet2006/") > 0) || (v_rutacompleta.indexOf("/olimpiadas2000/") > 0) || (v_rutacompleta.indexOf("/copaamerica2004/") > 0) || (v_rutacompleta.indexOf("/libertadores2006/") > 0) || (v_rutacompleta.indexOf("/eurocopa2004/") > 0) || (v_rutacompleta.indexOf("/copaamerica2007/") > 0) || (v_rutacompleta.indexOf("/libertadores2007/") > 0) || (v_rutacompleta.indexOf("/formula12007/") > 0) || (v_rutacompleta.indexOf("/panamericanos2007/") > 0) || (v_rutacompleta.indexOf("/mundialsub20/") > 0) || (v_rutacompleta.indexOf("/mundialsub17/") > 0) || (v_rutacompleta.indexOf("/copasudamericana2007/") > 0) || (v_rutacompleta.indexOf("/futbollatino/") > 0) || (v_rutacompleta.indexOf("/eliminatorias2010/") > 0) || (v_rutacompleta.indexOf("/mundialdeclubes07/") > 0) || (v_rutacompleta.indexOf("/libertadores2008/") > 0) || (v_rutacompleta.indexOf("/formula12008/") > 0) || (v_rutacompleta.indexOf("/eurocopa2008/")> 0) || (v_rutacompleta.indexOf("/sudamericana2008/") > 0) || (v_rutacompleta.indexOf("/ligaseuropeas0809/") > 0)	)
      {
		v_return = "/deportes"+v_dato;
      }
	  if(v_rutacompleta.indexOf("/pekin2008/") > 0){
		v_return = "/olimpiadas_v6/olimpiadas_v6"+v_dato;
		//vcertifica_sitio=24741;
	  }
	  if(v_rutacompleta.indexOf("/webgames/") > 0){
		v_dato=cert_depura_ruta("/webgames/" ,v_rutacompleta, v_url2)
		v_return = "/webgames/cap"+v_dato;		
	  }
	  
    }
    else if (v_rutacompleta.indexOf("/global/") > 0)
     {v_return = "/noticias"+v_dato;
     }
     else if (v_rutacompleta.indexOf("/thegirl2005/") > 0)
     {v_return = "/thegirl"+v_dato;
     }
     else if (v_rutacompleta.indexOf("/webgames/") > 0)
     {//v_return = "/games/juegos_web"+v_dato;
	 v_dato=cert_depura_ruta("/webgames/" ,v_rutacompleta, v_url2)
	 v_return = "/juegos_web/cap"+v_dato;
     }
     else if (v_rutacompleta.indexOf("/juegos/") > 0)
     {//v_return = "/games/juegos_clasicos"+v_dato;
	 v_dato=cert_depura_ruta("/webgames/" ,v_rutacompleta, v_url2)
	 v_return = "/juegos_clasicos/cap"+v_dato;
     }
     else if (v_rutacompleta.indexOf("/bienestar/") > 0)
     {
       v_return = "/bienestar_femenino"+v_dato;
     }
	else if (rutacompleta.indexOf("/php/galeria/") > 0)
     { v_dato = cert_depura_ruta("/php/galeria/" ,v_rutacompleta, v_url2) 
       v_return = "/entretenimiento/php-galeria"+v_dato;
     }
	else if (rutacompleta.indexOf("/discovirtual/") > 0)
     { v_dato = cert_depura_ruta("/discovirtual/" ,v_rutacompleta, v_url2) 
       v_return = "/isp/discovirtual"+v_dato;
     }
	else if (rutacompleta.indexOf("/fotolog/") > 0)
     { v_dato = cert_depura_ruta("/fotolog/" ,v_rutacompleta, v_url2) 
       v_return = "/fotolog"+v_dato;
     }
	else if (rutacompleta.indexOf("/album/") > 0)
     { v_dato = cert_depura_ruta("/album/" ,v_rutacompleta, v_url2) 
       v_return = "/album"+v_dato;
     }
	else if (rutacompleta.indexOf("/registro/") > 0)
     { v_dato = cert_depura_ruta("/registro/" ,v_rutacompleta, v_url2) 
       v_return = "/registro"+v_dato;
     }
	else if (rutacompleta.indexOf("/tureportero/") > 0)
     { v_dato = cert_depura_ruta("/tureportero/" ,v_rutacompleta, v_url2) 
       v_return = "/tureportero"+v_dato;
     }
    else if (v_rutacompleta.indexOf("/saludybelleza/") > 0)
     {  v_dato = cert_depura_ruta("/saludybelleza/" ,v_rutacompleta, v_url2) 
		v_return = "/dietas_belleza"+v_dato;
     }
    else if ((v_rutacompleta.indexOf("/ligaseuropeas/") > 0) || (v_rutacompleta.indexOf("/tenis/") > 0) || (v_rutacompleta.indexOf("/formula12006/") > 0) || (v_rutacompleta.indexOf("/formula1/") > 0) || (v_rutacompleta.indexOf("/formula12005/") > 0) || (v_rutacompleta.indexOf("/sudamericana2005/") > 0) || (v_rutacompleta.indexOf("/mundialsub202005/") > 0) || (v_rutacompleta.indexOf("/basquet2006/") > 0) || (v_rutacompleta.indexOf("/olimpiadas2000/") > 0) || (v_rutacompleta.indexOf("/copaamerica2004/") > 0) || (v_rutacompleta.indexOf("/libertadores2006/") > 0) || (v_rutacompleta.indexOf("/eurocopa2004/") > 0) || (v_rutacompleta.indexOf("/copaamerica2007/") > 0) || (v_rutacompleta.indexOf("/libertadores2007/") > 0) || (v_rutacompleta.indexOf("/formula12007/") > 0) || (v_rutacompleta.indexOf("/panamericanos2007/") > 0) || (v_rutacompleta.indexOf("/mundialsub20/") > 0) || (v_rutacompleta.indexOf("/mundialsub17/") > 0) || (v_rutacompleta.indexOf("/copasudamericana2007/") > 0) || (v_rutacompleta.indexOf("/futbollatino/") > 0) || (v_rutacompleta.indexOf("/eliminatorias2010/") > 0) || (v_rutacompleta.indexOf("/pekin2008/") > 0) || (v_rutacompleta.indexOf("/mundialdeclubes07/") > 0) || (v_rutacompleta.indexOf("/libertadores2008/") > 0) || (v_rutacompleta.indexOf("/formula12008/") > 0)  || (v_rutacompleta.indexOf("/eurocopa2008/")> 0) || (v_rutacompleta.indexOf("/sudamericana2008/") > 0)  || (v_rutacompleta.indexOf("/ligaseuropeas0809/") > 0) )
      {v_return = "/deportes"+v_dato;
      }else if (v_rutacompleta.indexOf("/error.shtml") > 0)
     {  
		v_return = "/error"+v_dato;
     }
	  
    else {

     v_datoback=v_dato;
      v_dato2=v_dato.charAt(v_dato.length-1);
      v_cadena="/";
      v_otracadena="|";
      while (v_datoback.indexOf(v_cadena) > -1) 
      {  v_dato3=v_datoback.indexOf(v_cadena);
         v_datoback=v_datoback.substring(0,v_dato3)+v_otracadena+v_datoback.substring(v_dato3+1,v_datoback.length);     
      }
      if (v_dato2 == '/')
       { v_dato=v_dato+"home/";
       }

    v_return = v_dato;
      }
return v_return;
}


//CERTIFICA.COM : CABECERA TERRA

/* Definición de variables*/
dominio=document.domain;
url=document.location.pathname;
rutacompleta=document.location.href;
dato=url;

nuevo_id = false;		

/* Definición de variables para pruebas 
dominio="www.pe.terra.com";
url="/shared/tecnologia/";
rutacompleta="http://www.pe.terra.com/shared/tecnologia/";
document.writeln("<b>Dominio Utilizado:</b>      "+dominio+"<br>");
document.writeln("<b>Pathname:</b>      "+url+"<br>");
document.writeln("<b>Ruta completa o href: </b>"+rutacompleta+"<br>");
dato=url;
*/

//Se valida si la página está cargada en uno de los 3 dominios principales
//Se valida si la página está cargada en uno de los 3 dominios principales
if (dominio=="terra.com.pe" || dominio=="www.terra.com.pe" || dominio=="www.pe.terra.com" || dominio=="contenidos.terra.com.pe" )
 { //Validación de secciones tomando en cuenta las excepciones (ej:bienestar,saludybelleza y se elimina el SHARED
  vcertifica_path = cert_terra_secciones(rutacompleta, url);
  if(vcertifica_path.indexOf("olimpiadas_v6") > 0){
	vcertifica_sitio=24741;
  }else{	
	if(vcertifica_path.indexOf("webgames") > 0||vcertifica_path.indexOf("juegos") > 0)
	{
		vcertifica_sitio="";	 //NO CUENTA PORQUE EL HTML YA TIENE LO NUEVOS TAGS 2009-03-03
		nuevo_id = true;		
	}
	else
	{
		vcertifica_sitio=18873;
	}	
  }
 }
else //Se valida si la página está en algún subdominio de TERRA y se carga el tráfico a una ruta, pudiendo redirigirlo a otra cuenta Metric
	{ 
	datoback=dato;
	dato2=dato.charAt(dato.length-1);
	cadena="/";
	otracadena="|";
	contador=0;
	contador2=0;
	while (datoback.indexOf(cadena) > -1) 
		{  dato3=datoback.indexOf(cadena);
		   datoback=datoback.substring(0,dato3)+otracadena+datoback.substring(dato3+1,datoback.length);
		   contador2=contador2+1;
		}
	if (dato2 == '/')
		{ dato=dato+"home/";
		}

	if (rutacompleta.indexOf("clientes.terra.com.pe") > 0)	
	{   vcertifica_path="/otras_secciones/clientes.terra"+dato;
		vcertifica_sitio=18873;
	}    
	else if (rutacompleta.indexOf("antivirusonline.terra.com.pe") > 0)
	{	vcertifica_path="/isp/antivirusonline"+dato;
		vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("filtro.terra.com.pe") > 0)
	{	  vcertifica_path="/isp/filtro"+dato;
	      vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("discovirtual.terra.com.pe") > 0)
	{	  vcertifica_path="/isp/discovirtual"+dato;
	      vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("pe.invertia.com") > 0)
	{	  vcertifica_path="/invertia"+dato;
	      vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("yamanejo.terra.com.pe") > 0)
	{	vcertifica_path="/yamanejo"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("seguridad.terra.com.pe") > 0)
	{	vcertifica_path="/seguridad"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("atraeme.terra.com.pe") > 0)
	{	vcertifica_path="/atraeme"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("diccionario.terra.com.pe") > 0)
	{	vcertifica_path="/diccionario"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("fotolog.terra.com.pe") > 0)
	{	vcertifica_path="/fotolog"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("miramifoto.terra.com.pe") > 0)
	{	vcertifica_path="/miramifoto"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("postulante.terra.com.pe") > 0)
	{	vcertifica_path="/postulante"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("antivirus.terra.com.pe") > 0)
	{	vcertifica_path="/antivirus"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("conectadisney.terra.com.pe") > 0)
	{	vcertifica_path="/conectadisney"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("extranet.terra.com.pe") > 0)
	{	vcertifica_path="/extranet"+dato;

	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("www.rumbo.com.pe") > 0)
	{	vcertifica_path="/rumbo"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("buscador.terra.com.pe") > 0)
	{	vcertifica_path="/buscador"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("tiempo.terra.com.pe") > 0)
	{	vcertifica_path="/tiempo"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("secure.iquiero.com.com.pe") > 0)
	{	vcertifica_path="/iquiero"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("comprasenusa.pe.terra.com.com.pe") > 0)
	{	vcertifica_path="/compras_en_usa"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("correoweb.terra.com.pe") > 0)
	{	vcertifica_path="/correo_web"+dato;
	    vcertifica_sitio=26018;
	}
	else if (rutacompleta.indexOf("portadamail.terra.com.pe") > 0)
	{	vcertifica_path="/correo_web/terramail"+dato;
		vcertifica_sitio=26018;
	}
	else if (rutacompleta.indexOf("correo.terra.com.pe") > 0)
	{	vcertifica_path="/correo_gratuito"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("sms.terra.com.pe") > 0)
	{	vcertifica_path="/sms"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("postales.pe.terra.com.com.pe") > 0)
	{	vcertifica_path="/postales"+dato;
	    vcertifica_sitio=18873;
	}
	else if ((rutacompleta.indexOf("cine.terra.com.pe") > 0) || (rutacompleta.indexOf("cartelera.com.pe") > 0) || (rutacompleta.indexOf("cineperu.com.pe") > 0) || (rutacompleta.indexOf("cines.com.pe") > 0) || (rutacompleta.indexOf("cine.com.pe ") > 0) )
	{ vcertifica_path="/cine"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("habla.chat-pe.terra.com.pe") > 0)
	{	vcertifica_path="/chat"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("habla02.chat-pe.terra.com.pe") > 0)
	{	vcertifica_path="/chat"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("terra.pe.laborum.com") > 0)
	{	vcertifica_path="/empleo"+dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("data.terra.com.pe") > 0)
	{	vcertifica_path=dato;
	    vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("habla03.chat-pe.terra.com.pe") > 0)
	{	vcertifica_path="/chat"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("habla01.chat-pe.terra.com.pe") > 0)
	{	vcertifica_path="/chat"+dato;
	     vcertifica_sitio=18873;
	 }
	else if (rutacompleta.indexOf("download.terra.com.pe") > 0)
	{	vcertifica_path="/download"+dato;
	     vcertifica_sitio=18873;
    }
	else if (rutacompleta.indexOf("terra-latinoamerica.softonic.com#pe") > 0)
	{	vcertifica_path="/download"+dato;
	     vcertifica_sitio=18873;
	 }
	else if (rutacompleta.indexOf("t-controla.terra.com.pe") > 0)
	{	vcertifica_path="/t_controla"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("t-responde.terra.com.pe") > 0)
	{	vcertifica_path="/t_responde"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("radio1160.terra.com.pe") > 0)
	{	vcertifica_path="/radio1160"+dato;
	     vcertifica_sitio=18873;
	 }
	else if (rutacompleta.indexOf("correoweb.bonus.com.pe") > 0)
	{	vcertifica_path="/correobonus"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("inmuebles.terra.com.pe") > 0)
	{	vcertifica_path="/inmuebles"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("almasgemelas.terra.com.pe") > 0)
	{	vcertifica_path="/almasgemelas"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("datamovil.terra.com.pe") > 0)
	{	vcertifica_path="/datamovil"+dato;
	     vcertifica_sitio=18873;
	 }
	else if (rutacompleta.indexOf("premiumcablenet.terra.com.pe") > 0)
	{	vcertifica_path="/premiumcablenet"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("videoblog") > 0)
	{	vcertifica_path="/videoblog"+dato;
	     vcertifica_sitio=24040;
		 nuevo_id = true;		
	}
	else if (rutacompleta.indexOf("siempredigna") > 0)
	{	vcertifica_path="/blog_siempre_digna/blo"+dato;
	     vcertifica_sitio=26009;
		 nuevo_id = true;		
	}
	else if (rutacompleta.indexOf("henryspencer") > 0)
	{	
		vcertifica_path="/blog_la_habitacion_de_henry_spencer/cap"+dato;
	    vcertifica_sitio=24040;
		nuevo_id = true;		
		//vcertifica_path="/blog/henryspencer"+dato;
		//vcertifica_sitio=18873;
	}	
	else if (rutacompleta.indexOf("1diacon") > 0)
	{	vcertifica_path="/1diacon.blog.terra.com.pe"+dato;
	     vcertifica_sitio=24040;
		 nuevo_id = true;		
	}
	else if (rutacompleta.indexOf("letrasdeemergencia") > 0)
	{	vcertifica_path="/letrasdeemergencia.blog.terra.com.pe"+dato;
	     vcertifica_sitio=106706;
		 nuevo_id = true;		
	}	
	else if (rutacompleta.indexOf("brunoblog") > 0)
	{	vcertifica_path="/brunoblog.blog.terra.com.pe"+dato;
	     vcertifica_sitio=24040;
		 nuevo_id = true;		
	}	
	else if (rutacompleta.indexOf("blog.terra.com.pe") > 0)
	
	{ 
	
	blog_posicion = rutacompleta.lastIndexOf("blog.terra.com.pe"); 
	
	blog_seccion="/"+rutacompleta.substring(7,blog_posicion-1);
	
	//vcertifica_path = "/blog"+blog_seccion+"/paginas_internas";
	//vcertifica_path = blog_seccion+"/paginas_internas";
	vcertifica_path = blog_seccion +"/" + dato;
	
	
	vcertifica_sitio=26017;
	nuevo_id = true;		
	
	}
	
	else if (rutacompleta.indexOf("error.shtml") > 0)
	{       vcertifica_path="/error"+dato;
	        vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("tecnotrash") > 0)
	{	 vcertifica_path="/tecnologia/"+dominio+dato;
	     vcertifica_sitio=18873;
	}	
	else if (rutacompleta.indexOf("tusvideos.terra.com.pe") > 0)
	{	vcertifica_path="/tusvideos"+dato;
	     vcertifica_sitio=18873;
    }
	else if (rutacompleta.indexOf("gaia.terra.com.pe") > 0)
	{	 vcertifica_path="/gaia"+dato;
	     vcertifica_sitio=18873;
	}
	else if (rutacompleta.indexOf("bloodzone") > 0)
	{	 vcertifica_path="";
	     vcertifica_sitio="";
	}	
	else   //Se envía el tráfico a "Otras Secciones" tomando el dominio y la ruta depurada.
	{	vcertifica_path="/otras_secciones/"+dominio+dato;
	    vcertifica_sitio=18873;		 
	}
}


if(vcertifica_path.indexOf("noticias")>-1&&vcertifica_path.indexOf("bbc")>-1)
{
	if(vcertifica_path.indexOf("index")>-1||vcertifica_path.indexOf("home")>-1)
	{	vcertifica_path="/cap" + cert_depura_ruta("/noticias/bbc/" ,rutacompleta, dato)		
	}
	else
	{	vcertifica_path="/not" + cert_depura_ruta("/noticias/bbc/" ,rutacompleta, dato)		
	}
	vcertifica_sitio=25968;	
	nuevo_id = true;		
}

nuevo_tag = false;
terra_info_service = "PubPE";
terra_info_channel = "";
terra_stats_idCrtfc = "";
terra_info_channeldetail = "";
terra_info_type = "";
terra_info_id = "";

if(vcertifica_path.indexOf("salud")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.salud";
	terra_stats_idCrtfc = "24030";
	terra_info_type = "cap";
	terra_info_id = vcertifica_path.replace("\/salud\/",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
	
	if(terra_info_id.indexOf("home")>-1)
		document.write('<img src="http://hits.e.cl/cert/hit.dll?sitio_id=24030&amp;path=/cap/home&amp;referer=&amp;size=1024&amp;colors=32&amp;java=true&amp;flash=9" alt="Certifica.com" border="0" width="1" height="1">');
}

if(vcertifica_path.indexOf("libertadores2008")>-1)
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.futbol";
	terra_stats_idCrtfc = "25971";
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/libertadores2008",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
}

if(vcertifica_path.indexOf("sudamericana2008")>-1)
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.futbol";
	terra_stats_idCrtfc = "25972";
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/sudamericana2008",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
}

if(vcertifica_path.indexOf("ligaseuropeas0809")>-1)
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.futbol";
	terra_stats_idCrtfc = "25973";
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/ligaseuropeas0809",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
}

if(vcertifica_path.indexOf("eliminatorias2010")>-1)
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.futbol";
	terra_stats_idCrtfc = "25974";
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/eliminatorias2010",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
}

if(vcertifica_path.indexOf("tenis")>-1) 
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.tenis";
	terra_stats_idCrtfc = "25982";
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/tenis",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
}

if(vcertifica_path.indexOf("formula12008")>-1) 
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.automovilismo";
	terra_stats_idCrtfc = "25985";
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/formula12008",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index porque el menu lo hace accesible
}

if(vcertifica_path.indexOf("doloresdelirio")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.musica";	
	terra_stats_idCrtfc = "25991";	
	terra_info_type = "cap";	
		
	terra_info_id = dato.replace("\/doloresdelirio\/",""); 
	terra_info_id = terra_info_id.replace("index.php","home"); 
	//El home tiene su propio tag
}

if(vcertifica_path.indexOf("ezioneyra")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.blogeditoriales";
	terra_info_channeldetail = "blog_hace_algo_mientras_tanto";
	terra_stats_idCrtfc = "25969";	
	terra_info_type = "blog";	
		
	terra_info_id = vcertifica_path.replace("\/ezioneyra\/",""); 		
}

rutatop = document.referrer;
if(rutatop.indexOf("softonic")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.tecnologia";	
	terra_stats_idCrtfc = "25960";	
	terra_info_type = "cap";	
		
	ult_car=dato.charAt(dato.length-1);
	if (ult_car == '/')
	{ dato=dato+"home";
	}
	
	terra_info_id = dato; 		
}

//otros especiales de deportes
if(vcertifica_path.indexOf("deportes")>-1&&nuevo_tag==false&&nuevo_id==false)
{
	nuevo_tag = true; 
	terra_info_channel = "pe.deportes.deportes";
	terra_info_channeldetail = "otros_especiales";		
	terra_stats_idCrtfc = "24021";	
	
	if(vcertifica_path.indexOf("galerias")>-1) 	
		terra_info_type = "gal";
	else if(vcertifica_path.indexOf("interna")>-1||vcertifica_path.indexOf("ultimas")>-1)
		terra_info_type = "not";
	else  
		terra_info_type = "cap";
	
	terra_info_id = vcertifica_path.replace("\/deportes\/",""); //no se usa "dato.replace("\/salud\/","")" porque el vcertifica_path ya tiene el "shared" depurado
	terra_info_id = terra_info_id.replace("home\/","home"); //se incluye el home 
	terra_info_id = terra_info_id.replace("index.htm","home"); // tambien el index en caso el menu lo haga accesible
}

rutatop = document.referrer;
if(rutatop.indexOf("compras")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.productosyservicios.compras";	
	terra_info_channeldetail = "rosatel.com";
	terra_stats_idCrtfc = "26032";	
	terra_info_type = "cap";	
		
	ult_car=dato.charAt(dato.length-1);
	if (ult_car == '/')
	{ dato=dato+"home";
	}
	
	terra_info_id = dato; 		
}

if(vcertifica_path.indexOf("wordpress")>-1&&dominio.indexOf("contenidos.terra.com.pe")>-1)
{
	nuevo_tag = true;
	terra_info_service = "OtroPE";
	terra_info_channel = "pe.entretenimiento.anime";	
	terra_stats_idCrtfc = "106290";	
	terra_info_type = "cap";	
		
	terra_info_id = vcertifica_path.replace("\/wordpress\/","");
	terra_info_id = terra_info_id.replace("home\/","home");
}

if(dominio.indexOf("futbolperu")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.deportes.blogeditoriales";
	terra_info_channeldetail = "blog_futbol_peru";
	terra_stats_idCrtfc = "106706";
	terra_info_type = "blo";		
	
	terra_info_id = vcertifica_path.replace("\/futbolperu\/",""); 	
}

if(dominio.indexOf("terrarezas")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.blogeditoriales";
	terra_info_channeldetail = "blog_terrarezas";
	terra_stats_idCrtfc = "25969"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/terrarezas\/",""); 		
}

if(vcertifica_path.indexOf("horoscopo")>-1&&dominio.indexOf("www.pe.terra.com")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.horoscopo";
	terra_info_channeldetail = "www.pe.terra.com";
	terra_stats_idCrtfc = "26010"; 
	terra_info_type = "cap";
		
	terra_info_id = vcertifica_path.replace("horoscopo\/",""); 		
	terra_info_id = terra_info_id.replace("home\/","home")
}

if(dominio.indexOf("elrayoverde")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.blogeditoriales";
	terra_info_channeldetail = "blog_el_rayo_verde";
	terra_stats_idCrtfc = "24040"; 
	terra_info_type = "blo";
	terra_info_id = vcertifica_path.replace("\/elrayoverde\/",""); 		
}

if(dominio.indexOf("alestedelima")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.blogeditoriales";
	terra_info_channeldetail = "blog_al_este_de_lima";
	terra_stats_idCrtfc = "24040"; 
	terra_info_type = "blo";
	terra_info_id = vcertifica_path.replace("\/alestedelima\/",""); 		
}

if(dominio.indexOf("todofutbol")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.deportes.blogeditoriales";
	terra_info_channeldetail = "blog_todo_futbol";
	terra_stats_idCrtfc = "106706"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/todofutbol\/",""); 		
}

if(dominio.indexOf("desdelabutacadeneto")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.deportes.blogeditoriales";
	terra_info_channeldetail = "blog_desde_la_butaca_de_neto";
	terra_stats_idCrtfc = "106706"; 
	terra_info_type = "blo";
	terra_info_id = vcertifica_path.replace("\/desdelabutacadeneto\/",""); 		
}

if(dominio.indexOf("miscajonesdeadentro")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.blogeditoriales";
	terra_info_channeldetail = "blog_mis_cajones_de_adentro";
	terra_stats_idCrtfc = "26009"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/miscajonesdeadentro\/",""); 		
}

if(dominio.indexOf("amigasdem")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.blogeditoriales";
	terra_info_channeldetail = "blog_amigas_de_m";
	terra_stats_idCrtfc = "26009"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/amigasdem\/",""); 		
}

if(dominio.indexOf("trigoatomico")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.blogeditoriales";
	terra_info_channeldetail = "blog_trigo_atomico";
	terra_stats_idCrtfc = "25969"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/trigoatomico\/",""); 		
}

if(dominio.indexOf("lapolillacarnivora")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.blogeditoriales";
	terra_info_channeldetail = "blog_polilla_carnivora";
	terra_stats_idCrtfc = "24040"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/lapolillacarnivora\/",""); 		
}

if(dominio.indexOf("thegonzofiles")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.blogeditoriales";
	terra_info_channeldetail = "blog_the_gonzo_files";
	terra_stats_idCrtfc = "26009"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/thegonzofiles\/",""); 		
}

if(dominio.indexOf("guitarrazos")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.blogeditoriales";
	terra_info_channeldetail = "blog_guitarrazos";
	terra_stats_idCrtfc = "24040"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/guitarrazos\/",""); 		
}

if(dominio.indexOf("ideasparasermasempleable")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.blogeditoriales";
	terra_info_channeldetail = "blog_ideas_para_ser_mas_empleable";
	terra_stats_idCrtfc = "26009"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/ideasparasermasempleable\/",""); 		
}

if(dominio.indexOf("mundohob.com")>-1||dominio.indexOf("mundohobbie.com")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.anime.mundohob";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "107301"; 
	terra_info_type = "cap";		
	
	terra_info_id = dato;
}

if(dominio.indexOf("salpicondepolloparaelalma")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.blogeditoriales";
	terra_info_channeldetail = "blog_salpicon_de_pollo";
	terra_stats_idCrtfc = "26009"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/salpicondepolloparaelalma\/",""); 		
}

if(dominio.indexOf("entrepelotas")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.deportes.blogeditoriales";
	terra_info_channeldetail = "blog_entre_pelotas";
	terra_stats_idCrtfc = "106706"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/entrepelotas\/",""); 		
}

if(dominio.indexOf("mutatismutandis")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.blogeditoriales";
	terra_info_channeldetail = "blog_mutatis_mutandis";
	terra_stats_idCrtfc = "25969"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/mutatismutandis\/",""); 		
}

if(dominio.indexOf("gambatero")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.blogeditoriales";
	terra_info_channeldetail = "blog_gambatero";
	terra_stats_idCrtfc = "25969"; 
	terra_info_type = "blo";

	terra_info_id = vcertifica_path.replace("\/gambatero\/",""); 		
}

if(dominio.indexOf("gamersofperu")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.games";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "106579"; 
	terra_info_type = "cap";
		
	terra_info_id = dato; 		
}

if(dominio.indexOf("electroblog")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.blogeditoriales";
	terra_info_channeldetail = "blog_electroblog";
	terra_stats_idCrtfc = "24040"; 
	terra_info_type = "blo";
	terra_info_id = vcertifica_path.replace("\/electroblog\/",""); 		
}

if(dominio.indexOf("rest.com")>-1||dominio.indexOf("rest.terra.com")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.gourmet";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "200404"; 
	terra_info_type = "cap";
		
	terra_info_id = dato; 		
}

if(dominio.indexOf("tuparada.com")>-1||dominio.indexOf("tuparada.com")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.postales";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "26006"; 
	terra_info_type = "cap";
		
	terra_info_id = dato; 		
}



if(vcertifica_path.indexOf("comidaperu")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.gourmet";
	terra_stats_idCrtfc = "26011";
	terra_info_type = "cap";
	terra_info_id = dato.replace("\/comidaperu\/",""); //Dado que es el dominio data.terra.com.pe entonces se usa "dato" directamente
	terra_info_id = terra_info_id.replace("home\/","home"); //incluye el home 
	
	if(terra_info_id.indexOf("home")>-1)
		terra_info_channeldetail = "portada";
	if(terra_info_id.indexOf("recetas")>-1)
		terra_info_channeldetail = "las_recetas_del_chef";
	if(terra_info_id.indexOf("zonab")>-1)
		terra_info_channeldetail = "zona_bar";
	if(terra_info_id.indexOf("conabu")>-1)
		terra_info_channeldetail = "consejos_de_la_abuela";
	if(terra_info_id.indexOf("gdia")>-1)
		terra_info_channeldetail = "cocina_al_dia";
	if(terra_info_id.indexOf("calorias")>-1)
		terra_info_channeldetail = "ponte_en_forma";
	if(terra_info_id.indexOf("cheff")>-1)
		terra_info_channeldetail = "herramientas_del_chef";
	if(terra_info_id.indexOf("zonag")>-1)
		terra_info_channeldetail = "zona_gourmet";
	if(terra_info_id.indexOf("comest")>-1)
		terra_info_channeldetail = "comiendo_con_estilo";
	if(terra_info_id.indexOf("qcomo")>-1)
		terra_info_channeldetail = "que_estoy_comiendo";
	if(terra_info_id.indexOf("escuelas")>-1)
		terra_info_channeldetail = "escuelas_de_gastronomia";
}

if(vcertifica_path.indexOf("tecnologia")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.tecnologia";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "24031"; 
	terra_info_type = "cap";
		
	terra_info_id = vcertifica_path.replace("tecnologia\/",""); 		
	terra_info_id = terra_info_id.replace("home\/","home")
}

if(dominio.indexOf("perumarcial")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.deportes.blogeditoriales";
	terra_info_channeldetail = "blog_peru_marcial";
	terra_stats_idCrtfc = "106706"; 
	terra_info_type = "blo";
		
	terra_info_id = vcertifica_path.replace("\/perumarcial\/",""); 		
}

if(dominio.indexOf("zonademetal")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.blogeditoriales";
	terra_info_channeldetail = "blog_zona_de_metal";
	terra_stats_idCrtfc = "24040"; 
	terra_info_type = "blo";
	terra_info_id = vcertifica_path.replace("\/zonademetal\/",""); 		
}

if(nuevo_tag)
{
	document.write('\n<script language="JavaScript" type="text/javascript">\n');
	document.write('<!-- \n');
	document.write('var terra_info_service = "' + terra_info_service + '";\n');
	document.write('var terra_info_channel = "' + terra_info_channel + '";\n');
	document.write('var terra_stats_idCrtfc = ' + terra_stats_idCrtfc + ';\n');
	document.write('var terra_info_channeldetail = "' + terra_info_channeldetail + '";\n');
	document.write('var terra_info_type = "' + terra_info_type + '";\n');
	document.write('var terra_info_id = "' + terra_info_id + '";\n');

	document.write('//-->\n');
	document.write('</script>\n');

	document.write('<script type="text/javascript" charset="iso-8859-1" language="javascript" src="http://s1.trrsf.com/metrics/js/pe/content.js"></script>\n');
	document.write('<script type="text/javascript">if(typeof terra_stats_metrics=="undefined"){var terra_stats_metrics=function(){window.setTimeout("terra_stats_metrics()",500);}}terra_stats_metrics();</script>\n');


}
else
{

	if(vcertifica_sitio!=''){
		terra_info_service = "PubPE";
		terra_info_channel = "pe.portada.portada";
		terra_stats_idCrtfc = "18873";
		terra_info_channeldetail = "otrocontenido";
		terra_info_type = "pag";
		terra_info_id = vcertifica_path;

		document.write('\n<script language="JavaScript" type="text/javascript">\n');
		document.write('<!-- \n');
		document.write('var terra_info_service = "' + terra_info_service + '";\n');
		document.write('var terra_info_channel = "' + terra_info_channel + '";\n');
		document.write('var terra_stats_idCrtfc = ' + terra_stats_idCrtfc + ';\n');
		document.write('var terra_info_channeldetail = "' + terra_info_channeldetail + '";\n');
		document.write('var terra_info_type = "' + terra_info_type + '";\n');
		document.write('var terra_info_id = "' + terra_info_id + '";\n');

		document.write('//-->\n');
		document.write('</script>\n');

		document.write('<script type="text/javascript" charset="iso-8859-1" language="javascript" src="http://s1.trrsf.com/metrics/js/pe/content.js"></script>\n');
		document.write('<script type="text/javascript">if(typeof terra_stats_metrics=="undefined"){var terra_stats_metrics=function(){window.setTimeout("terra_stats_metrics()",500);}}terra_stats_metrics();</script>\n');

		
		
	
	}
}
/* Para pruebas
document.writeln("<br><br>");
document.writeln("<b>Sitio id Obtenido:</b>      "+vcertifica_sitio);
document.writeln("<br>");
document.writeln("<b>Ruta Obtenida:</b>      "+vcertifica_path);
*/
//SITIO_ID DE TERRA : 18873
