
DEFAULT_PIVOT_NAME = 'cert_Pivot';
DEFAULT_REDIRECT_TIME = 3000;
DEFAULT_PERIODIC_REDIRECT_TIME = 60000;


function hitCertifica(sitio_id,path,descr) 
{
    var size, colors, referrer, url;
    size = colors = referrer = 'otro';
    referrer = escape(document.referrer);
    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;
    url = 
       'http://prima.certifica.com/cert/hit.dll?sitio_id=' + sitio_id + '&path=' + path +
       '&referer=' + referrer + '&size=' + size + '&colors=' + colors;
    url += '&java=' + navigator.javaEnabled();
    
	if (descr)
        url += '&descr=' + escape(descr);
		document.writeln( '<img src="' + url + '" width="1" height="1" border="0" alt="Certifica.com">' );
    
		url = 'http://hits.e.cl/cert/hit.dll?sitio_id=' + sitio_id + '&path=' + path ;
		document.writeln( '<img src="' + url + '" width="1" height="1" border="0" alt="Certifica.com">' );
	
}

/* 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_getTagCertifica(iSiteId, sPath, sAppend);
}

/* Efecta 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 );
}
