/* OAS_AD */
OAS_url = 'http://deliver.ads.uigc.net/RealMedia/ads/';
OAS_target = '_top';
OAS_rn = '001234567890';
OAS_rns = '1234567890';
OAS_rn = new String (Math.random()); 
OAS_rns = OAS_rn.substring (2, 11);
OAS_version = 11;

document.write('<script type="text/javascript" src="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_Page_Positions + '?' + OAS_query + '"><\/script>');

function OAS_NORMAL(pos) {
  document.write('<a href="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_Page_Positions + '!' + pos + '?' + OAS_query + '" target=' + OAS_target + '>');
  document.write('<img src="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_Page_Positions + '!' + pos + '?' + OAS_query + '" border=0></A>');
}
document.write('');


function OAS_AD(pos, width, height) {
  if (OAS_version >= 11)
    OAS_RICH(pos);
  else
    OAS_NORMAL(pos);
}

/* OAS DUMMY 
function OAS_AD(pos, width, height) {
	document.write ('<table border="0" cellpadding="0" cellspacing="0" style="background-color:#FFF3E1;border:1px solid #FFBD89;height:' + height + ';text-align:center;vertical-align:middle;width:' + width + '"><tr><td>' + pos + '</td></tr></table>');
}
*/
/*  OAS_AD Emergencia */
/*function OAS_AD(pos, width, height) {
  	document.write ('<span></span>');
}
*/

function RunFoo(CAMP, PAGE, RAND, POS, IMAGE, USER, CREAT, ANCHO, ALTO){
	document.write('<object id="'+ POS +'OBJID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ ANCHO +'" height="'+ ALTO +'"><PARAM NAME=movie VALUE="http://creativos.ads.uigc.net/RealMedia/ads/Creatives/'+ CAMP +'/'+ CREAT +'?clickTAG=http://deliver.ads.uigc.net/RealMedia/ads/click_lx.ads/'+ PAGE +'/'+ RAND +'/'+ POS +'/'+ CAMP +'/'+ IMAGE +'/'+ USER +'"><PARAM NAME=loop VALUE=true><PARAM NAME=menu VALUE=false><param NAME=wmode Value=transparent><PARAM NAME=quality VALUE=high><EMBED id="'+ POS +'OBJID" src="http://creativos.ads.uigc.net/RealMedia/ads/Creatives/'+ CAMP +'/'+ CREAT +'?clickTAG=http://deliver.ads.uigc.net/RealMedia/ads/click_lx.ads/'+ PAGE +'/'+ RAND +'/'+ POS +'/'+ CAMP +'/'+ IMAGE +'/'+ USER +'" wmode=transparent loop=true menu=false quality=medium bgcolor=#FFFFFF swLiveConnect=FALSE WIDTH="'+ ANCHO +'" HEIGHT="'+ ALTO +'" TYPE="application/x-shockwave-flash"></OBJECT>');
}

/* Encuestas */
function AbrirEncuesta(form,popup) {
	var mando = 0;
	for (i=0;i<form.respId.length;i++){
		if(form.respId[i].checked == true){ mando = 1; }
	}
	if (mando == 1){
		window.open('', popup, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=430,height=457');
	} else {
		alert('Seleccione un item');
		return false;
	} 
	return true;
}

function AbrirEncuestaSimple(form, popup) {
	window.open('', popup, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=430,height=457');
	form.submit();
	return true;
}

/* POPUP */
function Popup(url,name,width,height,resize,scroll) {
	var dialogWin = new Object();
	dialogWin.width = width;
	dialogWin.height = height;
	now = new Date();
	var millis=now.getTime();
	var mstr=""+millis;
	if (navigator.appName == "Netscape") {
		dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
		dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
		var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	} else if (document.all) {
		dialogWin.left = (screen.width - dialogWin.width) / 2;
		dialogWin.top = (screen.height - dialogWin.height) / 2;
		var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	}
window.open(url,name,attr);
}
function anteriores(){
	window.open("/shared/v2/ea/index.html","edanter_diario_lr",'width=240,height=175,directories=no,status=no,location=no,toolbar=no,scrollbars=no,resize=no,menubar=no,copyhistory=no');
}
/* Cookies */
function getCookie(nameOfCookie)
        {if (document.cookie.length > 0)
                {begin = document.cookie.indexOf(nameOfCookie + "=");
                 if (begin != -1)
                        begin += nameOfCookie.length + 1;
                 else
                        return null;
                 end = document.cookie.indexOf(";", begin);
                 if (end == -1)
                        end = document.cookie.length;
                 return unescape(document.cookie.substring(begin, end));
                 }

         return null;
         }

var nombreclarin = unescape(getCookie("UC"));
var regCookieLogin = getCookie("REG");
var controlCookieLogin = getCookie("Control");
var pd = window.location;

/* VALIDACIÓN BUSCADOR  */
function ValidarPalabraBuscador(estevalor){
	estevalor.value = estevalor.value.split('?').join(' ');
	estevalor.value = estevalor.value.split(',').join(' ');
	while(''+estevalor.value.indexOf('  ') > 0)
	  estevalor.value = estevalor.value.split('  ').join(' ');
	while(''+estevalor.value.charAt(0)==' ')
	  estevalor.value = estevalor.value.substring(1,estevalor.value.length);
	while(''+estevalor.value.charAt(estevalor.value.length-1)==' ')
	  estevalor.value = estevalor.value.substring(0,estevalor.value.length-1);
	if ((estevalor.value=="") || (estevalor.value==" ") ||  (estevalor.value=="  ") || (estevalor.value=="   ")) {
		alert("Debe ingresar una palabra para que inicie la búsqueda.");
		return false;
		}

	//var checkOK = "._-áéíóúÁÉÍÓÚçÇãÃõÕüÜàÀêÊ~`@!#$%^&*()-_=+[]{}''|\/<>,.;:\"";
	var checkOK = "._-~`@!#$%^&*()-_=+[]{}'|\/<>,.;:\"";
	var checkStr = estevalor.value;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
		if (j < checkOK.length){
			alert("Ingrese una palabra válida.");
			return false;
		}
		allNum += ch;
	}

	return true;
}

function Valida(esteform,estevalor){
	if (!ValidarPalabraBuscador(estevalor)){
		estevalor.focus();
	} else {
		if(esteform.pubId[1].checked) {
			esteform.action = 'http://www.ubbi.com/resultados.asp';
			esteform.q.value = estevalor.value
			esteform.submit();
		} else {
			esteform.action = 'http://www.servicios.clarin.com/buscador/jsp/resultados.jsp';
			esteform.submit();
		}
	}
}


/* Certifica */
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">' );
    
	//autorefresh IAB	
	if (typeof(cert_IsAutoRefresh) == 'undefined') {
		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">' );
	}

}

/* Certifica IAB */

<!--DOCUMENT CONTENT_TYPE="text/javascript"  -->

DEFAULT_REFRESH_TIME = 600000;
REFRESH_LIMIT = 600000;
var cert_IsAutoRefresh = false;

/* Funciones internas al script Certifica-IAB */
function cert_setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function cert_getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  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_deleteCookie(name, path, domain) {
  if (cert_getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function cert_RefreshInt()
{
  var now = new Date();

  cert_setCookie('autorefresh_time', now.getTime());
  location.reload();
}

function cert_IsAutoRefresh_func() {
    var now = new Date();
    var tsCookie = cert_getCookie('autorefresh_time');
  
    cert_deleteCookie('autorefresh_time');
  
    if (tsCookie) {
        var d = now.getTime() - tsCookie;
        if (d <= REFRESH_LIMIT) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
/*
 * Funciones PUBLICAS
 */

/*
 * cert_Refresh: permite hacer autorefresh de la pagina y cumplir con las normas
 *               fijadas por el IAB al respecto.
 *
 * iTime: tiempo en segundos en el cual se deberá hacer autorefresh
 *
 */
function cert_Refresh( iTime ) {
  var refreshTime;
  refreshTime = ((iTime) ? iTime*1000 : DEFAULT_REFRESH_TIME);

  cert_IsAutoRefresh = cert_IsAutoRefresh_func();
  setTimeout( 'cert_RefreshInt()', refreshTime );
}

/* tagCertificaIAB: permite registrar un pageview, y cumplir con las normas del IAB en lo relativo a los autorefresh.
   isHome: Valor 1 o 0, para indicar si la pagina marcada es el home o no (1=Home). */
function tagCertificaIAB(iSiteId, isHome){
    var now = new Date();
    var mustCount = true;
    var path;

    if (cert_IsAutoRefresh) {
        path = '/autorefresh';
        if (isHome) {
            var tsCookie = cert_getCookie('cert_hit_time');
            var d = now.getTime() - tsCookie;
            if (d < DEFAULT_REFRESH_TIME) {
                mustCount = false;
            }
        } else {
            mustCount = false;
        }
    } else {
       path = '/normal';
    }
    if (mustCount) {
       var url;
       if (isHome) {
           cert_setCookie('cert_hit_time', now.getTime());
           path = '/home' + path;
       } else {
           path = '/resto_sitio' + path;
       }
       url = 
       'http://hits.e.cl/cert/hit.dll?sitio_id=' + iSiteId + '&path=' + path;
       document.writeln( '<img src="' + url + '" width="1" height="1" border="0" alt="Certifica.com">' );
    }
}

function Galeria(ff, ss, dd, ee, ll, fid, nroid) {
	var foto;
	var epigrafe;
	var divepigrafe;
	var	src;
	var actual = 0;
	var urlLink;
	var link;
	var idfoto
	var idnro

	foto = ff;
	src = ss;
	divepigrafe = dd;
	epigrafe = ee;
	link = ll;
	urlLink = link.href;
	idfoto = fid;
	idnro = nroid;

	this.setFoto = setFoto;
	function setFoto(nn) {
		actual = nn;
		foto.src = src[actual];
		divepigrafe.innerHTML = epigrafe[actual] != '' ? epigrafe[actual] : ' ';
		link.href = urlLink.replace("[[nroFoto]]", new String(idfoto[actual]));
		idnro.innerHTML = actual + 1;
 	}

	this.sgtFoto = sgtFoto;
	function sgtFoto() {
		if (actual < src.length - 1)
			setFoto(actual + 1);
		else
			setFoto(0);
	}

	this.antFoto = antFoto;
	function antFoto() {
		if (actual > 0)
			setFoto(actual - 1);
		else
			setFoto(src.length - 1);
	}
}

function JumpUrl(combo){
	window.location=combo.options[combo.selectedIndex].value;
}

/*==========================================================================================*/

/*SOLUCION FLASH===========================================================================*/
/**
 * SWFObject v1.4.2: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = null;
			}
		}
	}
}
if (typeof window.onunload == 'function') {
	var oldunload = window.onunload;
		window.onunload = function() {
		deconcept.SWFObjectUtil.cleanupSWFs();
		oldunload();
	}
} else {
	window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
/* FIN SOLUCION FLASH===========================================================================================================*/

