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('<table border="0" cellpadding="0" width="530" height="44" cellspacing="0" background="http://www.terra.com.pe/img/franja-nar.gif">');
document.writeln('<form action="javascript:search(document.buscar.Claus.value)" method="POST" name="buscar">');
document.writeln('<tr>');
document.writeln('<td width="14"><img src="http://www.terra.com.pe/img/transp.gif" width="14" height="1" border="0"></td>');
document.writeln('<td width="93" valign=top>');
document.writeln('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="9" border="0"><br>');
document.writeln('<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"></a><br>');
document.writeln('</td>');
document.writeln('<td width="130"><img src="http://www.terra.com.pe/img/transp.gif" width="130" height="1" border="0"></td>');
document.writeln('<td width="152" valign=top>');
document.writeln('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="13" 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="font-family: verdana; width: 100%; font-size: 10px; height: 20px; border: 1px solid #808080;"><br>')}
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="font-family: verdana; width: 100%; height: 20px; border: 1px solid #808080;"><br>')}
document.writeln('</td>');
document.writeln('<td width="5"><img src="http://www.terra.com.pe/img/transp.gif" width="5" height="1" border="0"></td>');
document.writeln('<td width="86" valign=top>');
document.writeln('<img src="http://www.terra.com.pe/img/transp.gif" width="1" height="13" border="0"><br>');
document.writeln('<input type="image" src="http://www.terra.com.pe/img/google.gif" width="86" height="22" border="0"><br>');
document.writeln('</td>');
document.writeln('<td width="50"><img src="http://www.terra.com.pe/img/transp.gif" width="50" height="1" border="0"></td>');
document.writeln('</tr>');
document.writeln('</form>');
document.writeln('</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("/pekin2008/") > 0) || (v_rutacompleta.indexOf("/mundialdeclubes07/") > 0) || (v_rutacompleta.indexOf("/libertadores2008/") > 0))
      {v_return = "/deportes"+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;
     }
     else if (v_rutacompleta.indexOf("/juegos/") > 0)
     {v_return = "/games/juegos_clasicos"+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("/mujer/") > 0)
     {  v_dato = cert_depura_ruta("/mujer/" ,v_rutacompleta, v_url2) 
		v_return = "/entrechicas/mujer"+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_return = "/deportes"+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;


/* 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
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);
  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("tureportero") > 0)	
	{	
		vcertifica_path="/srv"+dato.replace("\/tureportero","");
	     vcertifica_sitio=25967;
	}
	else 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=26018;
	}
	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||rutacompleta.indexOf("habla04.chat-pe.terra.com.pe") > 0||rutacompleta.indexOf("habla05.chat-pe.terra.com.pe") > 0||rutacompleta.indexOf("habla06.chat-pe.terra.com.pe") > 0||rutacompleta.indexOf(".chat-") > 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=26018;
	}
	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("blog.terra.com.pe") > 0)
	{	vcertifica_path="/blog"+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   //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;		 
	}
}


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("chat")>-1)
{
	nuevo_tag = true; 
	terra_info_channel = "pe.comunidad.chat";
	terra_stats_idCrtfc = "24033";
	terra_info_type = "cap";
	terra_info_id = dato; //Dado que es el dominio habla.chat-pe.terra.com.pe entonces se usa "dato" directamente
	
	if(vcertifica_path.indexOf("amor") > 0)
		terra_info_channeldetail = "amor";
	if(vcertifica_path.indexOf("religion") > 0)
		terra_info_channeldetail = "religion";
	if(vcertifica_path.indexOf("esoterismo") > 0)
		terra_info_channeldetail = "esoterismo";
	if(vcertifica_path.indexOf("deportes") > 0)
		terra_info_channeldetail = "deportes";
	if(vcertifica_path.indexOf("actualidad") > 0)
		terra_info_channeldetail = "actualidad";
	if(vcertifica_path.indexOf("sexo") > 0)
		terra_info_channeldetail = "sexo";
	if(vcertifica_path.indexOf("tecnologia") > 0)
		terra_info_channeldetail = "tecnologia";
	if(vcertifica_path.indexOf("turismo") > 0)
		terra_info_channeldetail = "turismo";
	if(vcertifica_path.indexOf("romance") > 0)
		terra_info_channeldetail = "romance";
	if(vcertifica_path.indexOf("edades") > 0)
		terra_info_channeldetail = "edades";
	if(vcertifica_path.indexOf("entretenimiento") > 0)
		terra_info_channeldetail = "entretenimiento";
	if(vcertifica_path.indexOf("ciudades") > 0)
		terra_info_channeldetail = "ciudades";
	if(vcertifica_path.indexOf("portada") > 0)
		terra_info_channeldetail = "portada";
	
	//No aplica "home"
}


if(vcertifica_path.indexOf("newsletter")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.productosyservicios.newsletter";
	terra_stats_idCrtfc = "26019";
	terra_info_type = "cap";
	terra_info_id = dato.replace("\/newsletter\/","");	
	//OBS: El home tiene su propio tag
}

if(vcertifica_path.indexOf("atencioncliente")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.productosyservicios.atencionalcliente";
	terra_stats_idCrtfc = "26023";
	terra_info_type = "cap";
	
	if(vcertifica_path.indexOf("home")>-1)
		terra_info_id = "home"; //incluimos el home porque "dato" no lo contiene ya que el site está en dominio principal (En dominio principal "dato" no incluye "home"
	else 
		terra_info_id = dato.replace("\/atencioncliente\/","");
}

if(vcertifica_path.indexOf("terramovil")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.productosyservicios.terramovil";
	terra_stats_idCrtfc = "26021";
	terra_info_type = "cap";
	
	terra_info_id = dato.replace("\/terramovil\/","");		
	//OBS: Los home tiene su propio tag
}


if(vcertifica_path.indexOf("invertia")>-1)
{
	nuevo_tag = false; //SE ETIQUETO REGIONALMENTE, POR ESO SE QUITA EL TAG
	terra_info_channel = "pe.noticias.economia";
	terra_stats_idCrtfc = "24024";
	terra_info_type = "cap";
	terra_info_id = dato; //Dado que es el dominio pe.invertia.com entonces se usa "dato" directamente	
	
	if(vcertifica_path.indexOf("invertia/home") > -1)
		terra_info_channeldetail = "portada";	
	else if(vcertifica_path.indexOf("divisas") > -1)
	{	terra_info_channeldetail = "mercados/divisas";
		terra_info_id = dato.replace("\/mercados\/divisas","");
	}
	else if(vcertifica_path.indexOf("indices") > -1)
	{	terra_info_channeldetail = "mercados/bolsas";	
		terra_info_id = dato.replace("\/mercados\/indices","");
	}
	else if(vcertifica_path.indexOf("acciones") > -1)	
	{	terra_info_channeldetail = "mercados/acciones";	
		terra_info_id = dato.replace("\/mercados\/acciones","");		
	}
	else if(vcertifica_path.indexOf("commodities") > -1)
	{	terra_info_channeldetail = "mercados/commodities";
		terra_info_id = dato.replace("\/mercados\/commodities","");
	}
	else if(vcertifica_path.indexOf("bonos") > -1)
	{   terra_info_channeldetail = "mercados/bonos_usa";	
		terra_info_id = dato.replace("\/mercados\/bonos","");		
	}
	else if(vcertifica_path.indexOf("fondos") > -1)
	{   terra_info_channeldetail = "mercados/fondos";
		terra_info_id = dato.replace("\/mercados\/fondos","");		
	}
	else if(vcertifica_path.indexOf("mercados") > -1)
	{	terra_info_channeldetail = "mercados";
		terra_info_id = dato.replace("\/mercados","");
	}
	else if(vcertifica_path.indexOf("foros") > -1)
	{	terra_info_channeldetail = "foros";	
		terra_info_id = dato.replace("\/foros","");
	}
	else if(vcertifica_path.indexOf("recomendaciones") > -1)
	{	terra_info_channeldetail = "servicios/acciones_mas_recomendadas";
		terra_info_id = dato.replace("\/herramientas\/recomendaciones","");		
	}
	else if(vcertifica_path.indexOf("cartera") > -1)
	{	terra_info_channeldetail = "servicios/cartera_de_acciones";
		terra_info_id = dato.replace("\/cartera","");		
	}
	else if(vcertifica_path.indexOf("alarmas") > -1)
	{	terra_info_channeldetail = "servicios/alertas_por_mail";
		terra_info_id = dato.replace("\/alarmas","");		
	}
	else if(vcertifica_path.indexOf("conversor") > -1)
	{	terra_info_channeldetail = "servicios/conversor_de_divisas";
		terra_info_id = dato.replace("\/herramientas\/calculadoras","");		
	}
	else if(vcertifica_path.indexOf("juego") > -1&&vcertifica_path.indexOf("especial") > -1)
	{	terra_info_channeldetail = "servicios/juego_especial_de_invertia";	
		terra_info_id = dato.replace("\/juego\/especial","");		
	}
	else if(vcertifica_path.indexOf("juego") > -1)
	{	terra_info_channeldetail = "servicios/juego_de_la_bolsa";	
		terra_info_id = dato.replace("\/juego","");		
	}
	else if(vcertifica_path.indexOf("registro") > -1)
	{	terra_info_channeldetail = "servicios/datos_personales";
		terra_info_id = dato.replace("\/servicios","");		
	}
	else if(vcertifica_path.indexOf("glosarioTerminos") > -1)
		terra_info_channeldetail = "servicios/glosario_terminos_financieros";
	else if(vcertifica_path.indexOf("servicios") > -1)
	{	terra_info_channeldetail = "servicios";
		terra_info_id = dato.replace("\/servicios","");			
	}
	else if(vcertifica_path.indexOf("empresas") > -1)
	{	terra_info_channeldetail = "empresas";
		terra_info_id = dato.replace("\/empresas","");			
	}
	else if(vcertifica_path.indexOf("noticias") > -1)
	{	terra_info_channeldetail = "noticias";
		terra_info_id = dato.replace("\/noticias","");			
		
		if(vcertifica_path.indexOf("home") > -1)
			terra_info_type = "cap";
		else 
			terra_info_type = "not";
	}
	else if(vcertifica_path.indexOf("buscar") > -1)
		terra_info_channeldetail = "busqueda";
	else if(vcertifica_path.indexOf("galerias") > -1)
	{	terra_info_channeldetail = "galerias";
		terra_info_type = "gal";
		terra_info_id = dato.replace("\/herramientas\/galerias","");			
	}
	else if(vcertifica_path.indexOf("economia") > -1)
	{   terra_info_channeldetail = "economia";
		terra_info_id = dato.replace("\/economia","");			
	}	
	else if(vcertifica_path.indexOf("ticker") > -1)
	{	terra_info_channeldetail = "ticker";	
		terra_info_id = dato.replace("\/herramientas\/ticker","");			
	}
	else if(vcertifica_path.indexOf("glosarioFormulas") > -1)
		terra_info_channeldetail = "servicios/glosario_formulas";	
	else if(vcertifica_path.indexOf("aprendermas") > -1)
	{   terra_info_channeldetail = "aprendermas";
		terra_info_id = dato.replace("\/aprendermas","");			
	}
	else if(vcertifica_path.indexOf("ahorro") > -1)
	{	terra_info_channeldetail = "servicios/ahorro";
		terra_info_id = dato.replace("\/herramientas\/calculadoras","");		
	}
	else if(vcertifica_path.indexOf("credito") > -1)
	{	terra_info_channeldetail = "servicios/credito";	
		terra_info_id = dato.replace("\/herramientas\/calculadoras","");		
	}
	else if(vcertifica_path.indexOf("plazo") > -1)
	{	terra_info_channeldetail = "servicios/plazo";
		terra_info_id = dato.replace("\/herramientas\/calculadoras","");		
	}
		
	terra_info_id = terra_info_id.replace("home\/","home"); //incluye el home 
	
	//Llamada para conteo cuando la página no se refresca sino sólo una sección (galeria de fotos)
	/*
	document.write('\n<script language="JavaScript" type="text/javascript">\n');
	document.write('<!-- \n');
	document.write('if(typeof terra_stats_regTraffic!="undefined"){terra_stats_regTraffic();}');
	document.write('//-->\n');
	document.write('</script>\n');
	*/
	
	vcertifica_path = ""; //SE ETIQUETO REGIONALMENTE, POR ESO SE QUITA EL TAG
	
}

if(vcertifica_path.indexOf("cine")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.cine";
	terra_info_channeldetail = "";		
		
	terra_stats_idCrtfc = "24023";
	terra_info_type = "esp";	

	terra_info_id = vcertifica_path.replace("\/cine\/","");
	terra_info_id = terra_info_id.replace("home\/","home");
	terra_info_id = terra_info_id.replace("index.html","home");
	
}

if(vcertifica_path.indexOf("autos")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.autos";
	terra_info_channeldetail = "noticias";		
		
	terra_stats_idCrtfc = "24028";
	terra_info_type = "not";	

	terra_info_id = vcertifica_path.replace("\/autos\/","");
	terra_info_id = terra_info_id.replace("noticias\/","");
	terra_info_id = terra_info_id.replace("noticias_bmw\/","");
	
}

//articulos antiguos de games
if(vcertifica_path.indexOf("games")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.games";		
	terra_stats_idCrtfc = "24025";
	terra_info_type = "not";	

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

if(vcertifica_path.indexOf("gastronomia")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.gourmet";
	terra_info_channeldetail = "gastronomia";
		
	terra_stats_idCrtfc = "26011";
	terra_info_type = "cap";	

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

if(vcertifica_path.indexOf("cabinas")>-1)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.noticias";		
	terra_stats_idCrtfc = "25956";
	terra_info_type = "cap";		 

	detail_extra1 = "";	
	detail_extra2 = "";	
	if(vcertifica_path.indexOf("tecsup")>-1)
	{	
		detail_extra1 = "tecsup";
		detail_extra2 = "/tecsup";
	}
	if(vcertifica_path.indexOf("_ant")>-1)
	{	
		detail_extra1 = "_ant";
		detail_extra2 = "/_ant";
	}
	if(vcertifica_path.indexOf("_backup")>-1)
	{	
		detail_extra1 = "_backup";
		detail_extra2 = "/_backup";
	}
	
	if(vcertifica_path.indexOf("cabinastrujillo")>-1)
	{	
		terra_info_channeldetail = "cabinas/trujillo" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinastrujillo" + detail_extra1 + "\/","");	
	}
	else if(vcertifica_path.indexOf("cabinaslima")>-1)
	{	
		terra_info_channeldetail = "cabinas/lima" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinaslima" + detail_extra1 + "\/","");	
	}	
	else if(vcertifica_path.indexOf("cabinashuancayo")>-1)
	{	
		terra_info_channeldetail = "cabinas/huancayo" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinashuancayo" + detail_extra1 + "\/","");	
	}	
	else if(vcertifica_path.indexOf("cabinaspiura")>-1)
	{	
		terra_info_channeldetail = "cabinas/piura" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinaspiura" + detail_extra1 + "\/","");		
	}	
	else if(vcertifica_path.indexOf("cabinasaqp")>-1)
	{	
		terra_info_channeldetail = "cabinas/aqp" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinasaqp" + detail_extra1 + "\/","");	
	}	
	else if(vcertifica_path.indexOf("cabinaschiclayo")>-1)
	{	
		terra_info_channeldetail = "cabinas/chiclayo" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinaschiclayo" + detail_extra1 + "\/","");	
	}	
	else if(vcertifica_path.indexOf("cabinascusco")>-1)
	{	
		terra_info_channeldetail = "cabinas/cusco" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinascusco" + detail_extra1 + "\/","");	
	}		
	else if(vcertifica_path.indexOf("cabinasmoquegua")>-1)
	{	
		terra_info_channeldetail = "cabinas/moquegua" + detail_extra2;
		terra_info_id = vcertifica_path.replace("\/cabinasmoquegua" + detail_extra1 + "\/","");		
	}		
	else 
	{
		terra_info_channeldetail = "cabinas";
		terra_info_id = vcertifica_path;	
	}	
	  
}

if(vcertifica_path.indexOf("casaycolor")>-1) 
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.casaycolor";
	terra_info_channeldetail = "casaycolor";
	terra_stats_idCrtfc = "26007";	
	terra_info_type = "cap";
	terra_info_id = vcertifica_path.replace("\/casaycolor",""); 
	//terra_info_id = terra_info_id.replace("home\/","home"); 
	//el home tiene su propio tag
}

if(vcertifica_path.indexOf("navidad")>-1) 
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.vidayestilo";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "26007";	
	terra_info_type = "esp";
	terra_info_id = vcertifica_path; 
	terra_info_id = terra_info_id.replace("home\/","home"); //incluye el home 
}

if(vcertifica_path.indexOf("estasociedad")>-1) 
{
	nuevo_tag = true;
	terra_info_channel = "pe.entretenimiento.entretenimiento";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "24022";	
	terra_info_type = "esp";
	terra_info_id = vcertifica_path; 
	terra_info_id = terra_info_id.replace("home\/","home"); //incluye el home 
}

if(vcertifica_path.indexOf("blog")>-1&&nuevo_tag==false) 
{
	nuevo_tag = true;
	terra_info_channel = "pe.comunidad.blog";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "26017";	
	terra_info_type = "srv";
	terra_info_id = vcertifica_path.replace("\/blog",""); 
	terra_info_id = terra_info_id.replace("home\/","home"); //incluye el home 
	terra_info_id = terra_info_id.replace("otras_secciones\/",""); //incluye el home 	
}

if(vcertifica_path.indexOf("tusvideos")>-1&&nuevo_tag==false) 
{
	nuevo_tag = true;
	terra_info_channel = "pe.comunidad.videos";
	terra_info_channeldetail = "";
	terra_stats_idCrtfc = "24038";	
	terra_info_type = "srv";
	terra_info_id = vcertifica_path.replace("\/tusvideos",""); 
	terra_info_id = terra_info_id.replace("home\/","home"); //incluye el home 
	terra_info_id = terra_info_id.replace("otras_secciones\/",""); //incluye el home 	
}

if(vcertifica_path.indexOf("fotolog")>-1)
{
	nuevo_tag = false; //SE ETIQUETO REGIONALMENTE, POR ESO SE QUITA EL TAG
	vcertifica_path = ""; //SE ETIQUETO REGIONALMENTE, POR ESO SE QUITA EL TAG
}

if(vcertifica_path.indexOf("\/mujer")>-1&&nuevo_tag==false)
{
	nuevo_tag = true;
	terra_info_channel = "pe.vidayestilo.entrechicas";
	terra_info_channeldetail = "";
		
	terra_stats_idCrtfc = "202426";
	terra_info_type = "cap";	

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

if(vcertifica_sitio==25967)
{
	nuevo_tag = true;
	terra_info_channel = "pe.noticias.tureportero";
	terra_info_channeldetail = "";		
	terra_stats_idCrtfc = "25967";
	terra_info_type = "cap";
	terra_info_id = vcertifica_path;	
}

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://rtsmoc.terra.com.mx/js/metrics_begin.js"></script>\n');
	document.write('<script type="text/javascript" charset="iso-8859-1" language="javascript" src="http://rtsmoc.terra.com.mx/js/metrics_end.js"></script>\n');

}
else
{
	if(vcertifica_path!="")
	{
		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://rtsmoc.terra.com.mx/js/metrics_begin.js"></script>\n');
		document.write('<script type="text/javascript" charset="iso-8859-1" language="javascript" src="http://rtsmoc.terra.com.mx/js/metrics_end.js"></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
