﻿var hasFlash=function(){var a=6;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');if(window.hasFlash!=null)return window.hasFlash}if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;return parseInt(b.charAt(b.indexOf(".")-1))>=a}return false}();String.prototype.normalize=function(){return this.replace(/\s+/g," ")};if(Array.prototype.push==null){Array.prototype.push=function(){var i=0,a=this.length,b=arguments.length;while(i<b){this[a++]=arguments[i++]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(a,b){var c=[];var d,e;if(!a)a=window;if(!b)b=[];for(var i=0;i<b.length;i++){c[i]="b["+i+"]"}e="a.__applyTemp__("+c.join(",")+");";a.__applyTemp__=this;d=eval(e);a.__applyTemp__=null;return d}}function named(a){return new named.Arguments(a)}named.Arguments=function(a){this.oArgs=a};named.Arguments.prototype.constructor=named.Arguments;named.extract=function(a,b){var c,d;var i=a.length;while(i--){d=a[i];if(d!=null&&d.constructor!=null&&d.constructor==named.Arguments){c=a[i].oArgs;break}}if(c==null)return;for(e in c)if(b[e]!=null)b[e](c[e]);return};var parseSelector=function(){var a=/^([^#.>`]*)(#|\.|\>|\`)(.+)$/;function r(s,t){var u=s.split(/\s*\,\s*/);var v=[];for(var i=0;i<u.length;i++)v=v.concat(b(u[i],t));return v}function b(c,d,e){c=c.normalize().replace(" ","`");var f=c.match(a);var g,h,i,j,k,n;var l=[];if(f==null)f=[c,c];if(f[1]=="")f[1]="*";if(e==null)e="`";if(d==null)d=document;switch(f[2]){case "#":k=f[3].match(a);if(k==null)k=[null,f[3]];g=document.getElementById(k[1]);if(g==null||(f[1]!="*"&&!o(g,f[1])))return l;if(k.length==2){l.push(g);return l}return b(k[3],g,k[2]);case ".":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;k=f[3].match(a);if(k!=null){if(g.className==null||g.className.match("(\\s|^)"+k[1]+"(\\s|$)")==null)continue;j=b(k[3],g,k[2]);l=l.concat(j)}else if(g.className!=null&&g.className.match("(\\s|^)"+f[3]+"(\\s|$)")!=null)l.push(g)}return l;case ">":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;j=b(f[3],g,">");l=l.concat(j)}return l;case "`":h=m(d,f[1]);for(i=0,n=h.length;i<n;i++){g=h[i];j=b(f[3],g,"`");l=l.concat(j)}return l;default:if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;l.push(g)}return l}}function m(d,o){if(o=="*"&&d.all!=null)return d.all;return d.getElementsByTagName(o)}function o(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}return r}();var sIFR=function(){var a="http://www.w3.org/1999/xhtml";var b=false;var c=false;var d;var ah=[];var al=document;var ak=al.documentElement;var am=window;var au=al.addEventListener;var av=am.addEventListener;var f=function(){var g=navigator.userAgent.toLowerCase();var f={a:g.indexOf("applewebkit")>-1,b:g.indexOf("safari")>-1,c:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,d:g.indexOf("opera")>-1,e:al.contentType!=null&&al.contentType.indexOf("xml")>-1,f:true,g:true,h:null,i:null,j:null,k:null};f.l=f.a||f.c;f.m=!f.a&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(f.m&&g.match(/.*gecko\/(\d{8}).*/))f.j=new Number(g.match(/.*gecko\/(\d{8}).*/)[1]);f.n=g.indexOf("msie")>-1&&!f.d&&!f.l&&!f.m;f.o=f.n&&g.match(/.*mac.*/)!=null;if(f.d&&g.match(/.*opera(\s|\/)(\d+\.\d+)/))f.i=new Number(g.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]);if(f.n||(f.d&&f.i<7.6))f.g=false;if(f.a&&g.match(/.*applewebkit\/(\d+).*/))f.k=new Number(g.match(/.*applewebkit\/(\d+).*/)[1]);if(am.hasFlash&&(!f.n||f.o)){var aj=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;f.h=parseInt(aj.charAt(aj.indexOf(".")-1))}if(g.match(/.*(windows|mac).*/)==null||f.o||f.c||(f.d&&(g.match(/.*mac.*/)!=null||f.i<7.6))||(f.b&&f.h<7)||(!f.b&&f.a&&f.k<312)||(f.m&&f.j<20020523))f.f=false;if(!f.o&&!f.m&&al.createElementNS)try{al.createElementNS(a,"i").innerHTML=""}catch(e){f.e=true}f.p=f.c||(f.a&&f.k<312);return f}();function at(){return{bIsWebKit:f.a,bIsSafari:f.b,bIsKonq:f.c,bIsOpera:f.d,bIsXML:f.e,bHasTransparencySupport:f.f,bUseDOM:f.g,nFlashVersion:f.h,nOperaVersion:f.i,nGeckoBuildDate:f.j,nWebKitVersion:f.k,bIsKHTML:f.l,bIsGecko:f.m,bIsIE:f.n,bIsIEMac:f.o,bUseInnerHTMLHack:f.p}}if(am.hasFlash==false||!al.getElementsByTagName||!al.getElementById||(f.e&&(f.p||f.n)))return{UA:at()};function af(e){if((!k.bAutoInit&&(am.event||e)!=null)||!l(e))return;b=true;for(var i=0,h=ah.length;i<h;i++)j.apply(null,ah[i]);ah=[]}var k=af;function l(e){if(c==false||k.bIsDisabled==true||((f.e&&f.m||f.l)&&e==null&&b==false)||(al.body==null||al.getElementsByTagName("body").length==0))return false;return true}function m(n){if(f.n)return n.replace(new RegExp("%\d{0}","g"),"%25");return n.replace(new RegExp("%(?!\d)","g"),"%25")}function as(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}function o(p,q,r,s,t){var u="";var v=p.firstChild;var w,x,y,z;if(s==null)s=0;if(t==null)t="";while(v){if(v.nodeType==3){z=v.nodeValue.replace("<","&lt;");switch(r){case "lower":u+=z.toLowerCase();break;case "upper":u+=z.toUpperCase();break;default:u+=z}}else if(v.nodeType==1){if(as(v,"a")&&!v.getAttribute("href")==false){if(v.getAttribute("target"))t+="&sifr_url_"+s+"_target="+v.getAttribute("target");t+="&sifr_url_"+s+"="+m(v.getAttribute("href")).replace(/&/g,"%26");u+='<a href="asfunction:_root.launchURL,'+s+'">';s++}else if(as(v,"br"))u+="<br/>";if(v.hasChildNodes()){y=o(v,null,r,s,t);u+=y.u;s=y.s;t=y.t}if(as(v,"a"))u+="</a>"}w=v;v=v.nextSibling;if(q!=null){x=w.parentNode.removeChild(w);q.appendChild(x)}}return{"u":u,"s":s,"t":t}}function A(B){if(al.createElementNS&&f.g)return al.createElementNS(a,B);return al.createElement(B)}function C(D,E,z){var p=A("param");p.setAttribute("name",E);p.setAttribute("value",z);D.appendChild(p)}function F(p,G){var H=p.className;if(H==null)H=G;else H=H.normalize()+(H==""?"":" ")+G;p.className=H}function aq(ar){var a=ak;if(k.bHideBrowserText==false)a=al.getElementsByTagName("body")[0];if((k.bHideBrowserText==false||ar)&&a)if(a.className==null||a.className.match(/\bsIFR\-hasFlash\b/)==null)F(a, "sIFR-hasFlash")}function j(I,J,K,L,M,N,O,P,Q,R,S,r,T){if(!l())return ah.push(arguments);aq();named.extract(arguments,{sSelector:function(ap){I=ap},sFlashSrc:function(ap){J=ap},sColor:function(ap){K=ap},sLinkColor:function(ap){L=ap},sHoverColor:function(ap){M=ap},sBgColor:function(ap){N=ap},nPaddingTop:function(ap){O=ap},nPaddingRight:function(ap){P=ap},nPaddingBottom:function(ap){Q=ap},nPaddingLeft:function(ap){R=ap},sFlashVars:function(ap){S=ap},sCase:function(ap){r=ap},sWmode:function(ap){T=ap}});var U=parseSelector(I);if(U.length==0)return false;if(S!=null)S="&"+S.normalize();else S="";if(K!=null)S+="&textcolor="+K;if(M!=null)S+="&hovercolor="+M;if(M!=null||L!=null)S+="&linkcolor="+(L||K);if(O==null)O=0;if(P==null)P=0;if(Q==null)Q=0;if(R==null)R=0;if(N==null)N="#FFFFFF";if(T=="transparent")if(!f.f)T="opaque";else N="transparent";if(T==null)T="";var p,V,W,X,Y,Z,aa,ab,ac;var ad=null;for(var i=0,h=U.length;i<h;i++){p=U[i];if(p.className!=null&&p.className.match(/\bsIFR\-replaced\b/)!=null)continue;V=p.offsetWidth-R-P;W=p.offsetHeight-O-Q;aa=A("span");aa.className="sIFR-alternate";ac=o(p,aa,r);Z="txt="+m(ac.u).replace(/\+/g,"%2B").replace(/&/g,"%26").replace(/\"/g, "%22").normalize() + S + "&w=" + V + "&h=" + W + ac.t;F(p,"sIFR-replaced");if(ad==null||!f.g){if(!f.g){if(!f.n)p.innerHTML=['<embed class="sIFR-flash" type="application/x-shockwave-flash" src="',J,'" quality="best" wmode="',T,'" bgcolor="',N,'" flashvars="',Z,'" width="',V,'" height="',W,'" sifr="true"></embed>'].join("");else p.innerHTML=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" sifr="true" width="',V,'" height="',W,'" class="sIFR-flash"><param name="movie" value="',J,"?",Z,'"></param><param name="quality" value="best"></param><param name="wmode" value="',T,'"></param><param name="bgcolor" value="',N,'"></param> </object>'].join('')}else{if(f.d){ab=A("object");ab.setAttribute("data",J);C(ab,"quality","best");C(ab,"wmode",T);C(ab,"bgcolor",N)}else{ab=A("embed");ab.setAttribute("src",J);ab.setAttribute("quality","best");ab.setAttribute("flashvars",Z);ab.setAttribute("wmode",T);ab.setAttribute("bgcolor",N)}ab.setAttribute("sifr","true");ab.setAttribute("type","application/x-shockwave-flash");ab.className="sIFR-flash";if(!f.l||!f.e)ad=ab.cloneNode(true)}}else ab=ad.cloneNode(true);if(f.g){if(f.d)C(ab,"flashvars",Z);else ab.setAttribute("flashvars",Z);ab.setAttribute("width",V);ab.setAttribute("height",W);ab.style.width=V+"px";ab.style.height=W+"px";p.appendChild(ab)}p.appendChild(aa);if(f.p)p.innerHTML+=""}if(f.n&&k.bFixFragIdBug)setTimeout(function(){al.title=d},0)}function ai(){d=al.title}function ae(){if(k.bIsDisabled==true)return;c=true;if(k.bHideBrowserText)aq(true);if(am.attachEvent)am.attachEvent("onload",af);else if(!f.c&&(al.addEventListener||am.addEventListener)){if(f.a&&f.k>=132&&am.addEventListener)am.addEventListener("load",function(){setTimeout("sIFR({})",1)},false);else{if(al.addEventListener)al.addEventListener("load",af,false);if(am.addEventListener)am.addEventListener("load",af,false)}}else if(typeof am.onload=="function"){var ag=am.onload;am.onload=function(){ag();af()}}else am.onload=af;if(!f.n||am.location.hash=="")k.bFixFragIdBug=false;else ai()}k.UA=at();k.bAutoInit=true;k.bFixFragIdBug=true;k.replaceElement=j;k.updateDocumentTitle=ai;k.appendToClassName=F;k.setup=ae;k.debug=function(){aq(true)};k.debug.replaceNow=function(){ae();k()};k.bIsDisabled=false;k.bHideBrowserText=true;return k}();

if(typeof sIFR == "function" && !sIFR.UA.bIsIEMac){
	sIFR.setup();
};


if(typeof sIFR=="function")(function(){var j=document;var h=j.documentElement;sIFR.removeDecoyClasses=function(){function a(b){if(b&&b.className!=null)b.className=b.className.replace(/\bsIFR-hasFlash\b/,"")}return function(){a(h);a(j.getElementsByTagName("body")[0])}}();sIFR.preferenceManager={storage:{sCookieId:"sifr",set:function(a){var b=new Date();b.setFullYear(b.getFullYear()+3);j.cookie=[this.sCookieId,"=",a,";expires=",b.toGMTString(),";path=/"].join("")},get:function(){var a=j.cookie.match(new RegExp(";?"+this.sCookieId+"=([^;]+);?"));if(a!=null&&a[1]=="false")return false;else return true},reset:function(){var a=new Date();a.setFullYear(a.getFullYear()-1);j.cookie=[this.sCookieId,"=true;expires=",a.toGMTString(),";path=/"].join("")}},disable:function(){this.storage.set(false)},enable:function(){this.storage.set(true)},test:function(){return this.storage.get()}};if(sIFR.preferenceManager.test()==false){sIFR.bIsDisabled=true;sIFR.removeDecoyClasses()}sIFR.rollback=function(){function a(b){var c,d,e,f,g,h;var l=parseSelector(b);var i=l.length-1;var m=false;while(i>=0){c=l[i];l.length--;d=c.parentNode;if(c.getAttribute("sifr")=="true"){h=0;while(h<d.childNodes.length){c=d.childNodes[h];if(c.className=="sIFR-alternate"){e=c;h++;continue}d.removeChild(c)}if(e!=null){f=e.firstChild;while(f!=null){g=f.nextSibling;d.appendChild(e.removeChild(f));f=g}d.removeChild(e)}if(!sIFR.UA.bIsXML&&sIFR.UA.bUseInnerHTMLHack)d.innerHTML+="";d.className=d.className.replace(/\bsIFR\-replaced\b/,"")};m=true;i--}return m}return function(k){named.extract(arguments,{sSelector:function(a){k=a}});if(k==null)k="";else k+=">";sIFR.removeDecoyClasses();sIFR.bHideBrowserText=false;if(a(k+"embed")==false)a(k+"object")}}()})()
function 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)).split("\n");} 
function setCookie (name, value, expires, path) {
   var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "");
   document.cookie = curCookie;
}
usuario = getCookie("eltiempopuntocom");
//Declaro las variables
if(usuario != undefined)
{
  var loginUsuario = usuario[0];
  var nombreUsuario = usuario[1];
  var apellidosUsuario = usuario[2];
  /*Se comenta para detectar donde se utiliza esta variable y se asigna un id inexistente
  var idUsuario = usuario[3];*/
  var idUsuario = 999999999999;
  var emailUsuario = usuario[4];
  var sexoUsuario = usuario[6];
  var paisUsuario = usuario[7];
  var edadUsuario = usuario[8];
  var profesionUsuario = usuario[9];
}
else
{
  var loginUsuario = "";
  var nombreUsuario = "";
  var apellidosUsuario = "";
  var idUsuario = "";
  var emailUsuario = "";
  var sexoUsuario = "";
  var paisUsuario = "";
  var edadUsuario = "";
  var profesionUsuario = "";
}
function salirRegistro() {
   var expires = 0;
   var path = '/';
   var domain = '';
   var domain = '.eltiempo.com';
   //var curCookie = 'eltiempopuntocom' + "=" + escape('') + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "")+((domain) ? "; domain=" + domain: "");
   //document.cookie = curCookie;
   if (document.location.href.indexOf("zonadeusuario") >= 0)
       document.location = "/";
   else if(document.location.href.indexOf("registro") >= 0)
       document.location = "/";
   else if (document.location.href.indexOf('#') >= 0) // Se mira si tiene un ancla y se quita
       document.location = document.location.href.substring(0,document.location.href.indexOf('#'));
   else
       document.location = document.location;       
}

function salirRegistroSesion() {
   incluirObjeto("CERRAR_SESION",salirRegistro);
   //salirRegistro();
}

/**FUNCIONES EPLANNING**/

 

var inIframe=false;var siW=self.innerWidth;var siH=self.innerHeight;var dE=document.documentElement;var dB=document.body;

var sw=(siW?siW:(dE && dE.clientWidth)?dE.clientWidth:dB?dB.clientWidth:"");

var sh=(siH?siH:(dE && dE.clientHeight)?dE.clientWidth:dB?dB.clientHeight:"");

var wh=(sw && sh) ? (sw.toString(16) + "x" + sh.toString(16)) : "";

var eplRnd=(new String(Math.random())).substring(2,8) + (((new Date()).getTime()) & 262143);

var ua=navigator.userAgent.toLowerCase();var av=navigator.appVersion.toLowerCase();

var eplB=new Object();eplB.is_mac=(ua.indexOf("mac")!=-1);

eplB.is_win=(!eplB.is_mac && ((ua.indexOf("win")!=-1)||(ua.indexOf("16bit")!=-1)));

var ieP=av.indexOf('msie');var ffP=ua.indexOf("firefox");eplB.is_o=(ua.indexOf("opera")!=-1);

eplB.is_ie=(ieP!=-1 && eplB.is_win && !eplB.is_o);eplB.is_ff=(ffP!=-1);

if (eplB.is_ie) { eplB.minV=parseFloat(av.substring(ieP+5,av.indexOf(';',ieP)));

eplB.majV=parseInt(eplB.minV);}

if (eplB.is_ff) { if (ua.length>ffP+8) eplB.majV=parseInt(ua.substring(ffP+8));

if (ua.length>ffP+10) eplB.minV=parseInt(ua.substring(ffP+10));}

eplB.ffOk=(eplB.is_ff&&((eplB.majV>=1&&eplB.minV>=5)||(eplB.majV>=2)));

eplB.ieOk=(eplB.is_ie&&eplB.minV>=5);var eplFV=0;var nmT=navigator.mimeTypes;

var swF='application/x-shockwave-flash';var fP=(nmT && nmT[swF])?nmT[swF].enabledPlugin:0;

var fvT;if ( fP ) { var nP=navigator.plugins;var sf="Shockwave Flash";

    if (nP[sf]!=null) fvT=nP[sf].description;

} else if (ua && ua.indexOf("MSIE")>=0 && (av.indexOf("Win")!=-1)) {

    var axo;var e;try {

        axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");

     axo.AllowScriptAccess="always";fvT=axo.GetVariable("$version");

    } catch (e) {}

} if (fvT) { var fvW=fvT.split(" ");for (var i=0;i<fvW.length;++i) {

     if (isNaN(parseInt(fvW[i]))) continue;eplFV=fvW[i];}

}

function eplAD(spaceID) {
   
   //return;  
   if (!spaceID || spaceID=='') {
      return;
   }
   var keywords="&kw1=&kw2=&kw3=&kw4=&kw5=&kw6=&kw7=&kw8=&kw9=&kw10=&kw11=&kw12=&kw13=&kw14=&kw15";

    var adU='http://ads.us.e-planning.net/eb/3/c1e/'+spaceID+'?o=j&fv='+eplFV+'&rnd='+eplRnd+keywords;

    var iDT='<html><head><title>Ad</title><LINK rel="stylesheet" type="text/css"  href="http://www.eltiempo.com/css/produccion/publicidad.css" /></head><body id="'+spaceID+'" leftmargin="0" topmargin="0">';

    //var iDT='<html><head><title>Ad</title></head><body id="'+spaceID+'" leftmargin="0" topmargin="0">';

    iDT+='<div id="eplParentContainer' + spaceID + '"></div><scr'+'ipt type="text/javascript">var inIframe=true;</scr';

    iDT+='ipt> <scr'+'ipt type="text/javascript" src="'+adU+'"></scr';

    iDT+='ipt> <scr'+'ipt>setTimeout("document.close()", 8000);</scr'+'ipt></body></html>' 

    if(eplB.ieOk){document.write('<iframe id="'+spaceID+'" src="about:blank" width="1" height="0" frameborder="0" scrolling="no"></iframe>');

     document.frames[spaceID].document.write(iDT);

    } else if (eplB.ffOk) { document.write('<iframe id="'+spaceID+'" src="about:blank" width="1" height="0" frameborder="0" scrolling="no"></iframe>');

        var i=document.getElementById(spaceID);if (i!=null) i.contentDocument.write(iDT);

    } else { document.write('<scr'+'ipt type="text/javascript" src="'+adU+'"></scr'+'ipt>');}

}


/*** PRUEBA EPLAD V4  BELLUI***/

var eplDoc = document; var eplLL = false;
var eS1 = 'us.img.e-planning.net';var eplArgs = { sV:"http://ads.us.e-planning.net/",vV:"4",sI:"42be" };
function eplCheckStart(eA) {
	if (document.epl) {
		var e = document.epl;
		if (e.eplReady()) {
			return true;
		} else {
			e.eplInit(eA ? eA : eplArgs);
			return e.eplReady();		
		}
	} else {
		if (eplLL) return false;
		if (!document.body) return false; var eS2; var dc = document.cookie; var ci = dc.indexOf("EPLSERVER=");
		if (ci != -1) {
			ci += 10; var ce = dc.indexOf(';', ci);
			if (ce == -1) ce = dc.length;
			eS2 = dc.substring(ci, ce);
		}
		
		var eIF = document.createElement('IFRAME');
		eIF.src = 'about:blank'; eIF.id = 'epl4iframe'; eIF.name = 'epl4iframe';
		eIF.width=0; eIF.height=0; eIF.style.width='0px'; eIF.style.height='0px';
		eIF.style.display='none'; document.body.appendChild(eIF);
		
		var eIFD = eIF.contentDocument ? eIF.contentDocument : eIF.document;
		eIFD.open();eIFD.write('<html><head><title>e-planning</title><scri'+'pt>inIframe=true</scri'+'pt></head><body></body><html>');eIFD.close();
		var s = eIFD.createElement('SCRIPT'); s.src = 'http://'+ (eS2?eS2:eS1) +'/layers/epl-40.js';
		eIFD.body.appendChild(s);
		if (!eS2) {
			var ss = eIFD.createElement('SCRIPT');
			ss.src = 'http://ads.us.e-planning.net/egc/4/7d6'
			eIFD.body.appendChild(ss);
		}
		eplLL = true;return eplCheckStart(eA);
	}
}

function eplSetAd(eID, t, tout, maxads) {
	if (eplCheckStart(eplArgs)) {
		document.epl.eplPushAd(eID, t, tout, maxads);
	} else {
		var efu = 'eplSetAd("'+eID+'", '+t+', '+tout+ (maxads ? ', '+maxads : '') + ');';
		setTimeout(efu, 250);	
	}
}

function eplAD4(eID, t, tout, maxads) {
	document.write('<div id="eplAdDiv'+eID+'"></div>');eplSetAd(eID, t?t:1, tout?tout:0, maxads);
}


 

/**FIN FUNCIONES EPLANNING**/



function tabPauta(idTab)
 {
   if ($("#tabHome").hasClass("activo-tabs"))
     { 
	   $("#pautaTabs").slideUp("slow");
	   $("#tabHome").removeClass("activo-tabs");
	   $("#tabHome").addClass("no-activo");
	   
	 }
	 else{	     
	    $("#pautaTabs").slideDown("slow");
		$("#tabHome").removeClass("no-activo");
		$("#tabHome").addClass("activo-tabs");
	    
	 }
 }

function AbrirCerrarNube()
{
    if ($("#nube").hasClass("vinculo-especial"))
     { 
	   $("#palabras-nube").slideDown("slow");
	   $("#nube").removeClass("vinculo-especial");
	   $("#nube").addClass("vinculo-especial-abierto");
	 }
	 else{	     
	    $("#palabras-nube").slideUp("slow");
	    $("#nube").removeClass("vinculo-especial-abierto");
		$("#nube").addClass("vinculo-especial");
      }
}
 
var arregloMedias = new Array(10);

function generarVideoJS(video, divHTML, tipoReproduccion, ancho, alto,urlImagen) {
   
   
   if (tipoReproduccion == 'audio' && !ancho && !alto) {
        alto = 20;
        altoVideo = 20;
    }else {
        altoVideo = alto + 20;
	}
	var playlistArray;
    playlistArray = new Array();
    playlistArray[0] = "";
    playlistArray[1] = "";
    if (tipoReproduccion == 'audio')
       var s3 = new SWFObject("/reproductores/audio/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,ancho,24,"7");    
    else
       var s3 = new SWFObject("/reproductores/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,ancho,altoVideo,"7");
    if(tipoReproduccion == 'audio')   {
       s3.addParam("allowfullscreen","false");   
       
    }   
	s3.addParam("swLiveConnect","true");
	s3.addVariable("width",ancho);	
   	s3.addVariable("height",alto);
   	s3.addVariable("displaywidth" , ancho);
	s3.addVariable("displayheight" , alto);
	s3.addVariable("file", video);
	s3.addParam("wmode","transparent"); 
  	  
	if(tipoReproduccion == 'video'){
	  s3.addParam("allowfullscreen","true");
	  s3.addVariable("showdigits" , "total");
	  s3.addVariable("image" ,urlImagen);
	  s3.addVariable("searchbar" , "false");
	  s3.addVariable("showstop" , "false");
   }
	   
	s3.write(divHTML);
}

var fileRec;
var idDivRec;
var tipoRec;
var urlimgRec;

function cargarVariablesVideoJS (file_rec , reproductorVideoRel, video,url_imagen) {
    fileRec = file_rec;
    idDivRec = reproductorVideoRel;
    tipoRec = video;
    urlimgRec=url_imagen;    
}

var tituloPagina;
var seccionPrincipal;
var seccionSecundaria;

function generarPageViewVideo(swf) {
    tituloPagina = arregloMedias[swf][1];
    seccionPrincipal = arregloMedias[swf][2];
    seccionSecundaria = arregloMedias[swf][3];
    generarPageView(tituloPagina,seccionPrincipal,seccionSecundaria);
}

function getUpdate(typ,pr1,pr2,swf) {
  if(typ == 'state') {
     obj = thisMovie(swf).itemData(0);
     if (!arregloMedias[swf]) {
         arregloMedias[swf] = new Array(4);
         arregloMedias[swf][0] = 0;
     }
     if (pr1 == 2) {
         arregloMedias[swf][0] = 1;
         generarPageViewVideo(swf);
     }else if (pr1 == 3) {
         arregloMedias[swf][0] = 0;
     }
  }
}


function thisMovie(swf) {
    if(navigator.appName.indexOf("Microsoft") != -1) {
        return window[swf];
    } else {
        return document[swf];
    }
}
if(typeof sIFR == "function"){
   

// This is the preferred "named argument" syntax
	sIFR.replaceElement(named({sSelector:".seccion", sFlashSrc:"/css/produccion/lutz.swf", sColor:"#000000", sLinkColor:"#000000", sBgColor:"#000000", sHoverColor:"#000000", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"}));
};

var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
}

function abrir()
{
	d=document.getElementById('menu_versiones');
	d.style.display='block';
	AssignPosition(document.getElementById('menu_versiones'));
}

function cerrar()
{

	d=document.getElementById('menu_versiones').style.display='none';	
}

function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
(function($){
	$.fn.superfish = function(o){
		var $sf = this,
			defaults = {
			hoverClass	: 'sfHover',
			pathClass	: 'overideThisToUse',
			delay		: 800,
			/*animation	: {opacity:'show'},*/
			speed		: 'normal'
		},
			over = function(){
				clearTimeout(this.sfTimer);
				clearTimeout($sf[0].sfTimer);
				$(this)
				.showSuperfishUl()
				.siblings()
				.hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this);
				if ( !$$.is('.'+o.bcClass) ) {
					this.sfTimer=setTimeout(function(){
						$$.hideSuperfishUl();
						if (!$('.'+o.hoverClass,$sf).length) { 
							over.call($currents.hideSuperfishUl());
						}
					},o.delay);
				}		
			};
		$.fn.extend({
			hideSuperfishUl : function(){
				return this
					.removeClass(o.hoverClass)
					.find('ul:visible')
						.hide()
					.end();
			},
			showSuperfishUl : function(){
				return this
					.addClass(o.hoverClass)
					.find('>ul:hidden')
						/*.animate(o.animation,o.speed)*/
						.show()
					.end();
			},
			applySuperfishHovers : function(){
				return this[($.fn.hoverIntent) ? 'hoverIntent' : 'hover'](over,out);
			}
		});
		o = $.extend({bcClass:'sfbreadcrumb'},defaults,o || {});
		var $currents = $('li:has(ul)',this).filter('.'+o.pathClass);
		if ($currents.length) {
			$currents.each(function(){
				$(this).removeClass(o.pathClass).addClass(o.hoverClass+' '+o.bcClass);
			});
		}
		var $sfHovAr=$('li:has(ul)',this)
			.applySuperfishHovers(over,out)
			.find('a').each(function(){
				var $a = $(this), $li = $a.parents('li');
				$a.focus(function(){
					over.call($li);
					return false;
				}).blur(function(){
					$li.removeClass(o.hoverClass);
				});
			})
			.end()
			.not('.'+o.bcClass)
				.hideSuperfishUl()
			.end();
		$(window).unload(function(){
			$sfHovAr.unbind('mouseover').unbind('mouseout');
		});
		return this.addClass('superfish').blur(function(){
			out.call(this);
		});
	};
})(jQuery);
var persistclose=0;
var startX=25;
var startY=25;
var verticalpos="fromtop";

/**
 * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget.
 * @requires jQuery v1.2 or above
 *
 * http://gmarwaha.com/jquery/jcarousellite/
 *
 * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.0.1
 * Note: Requires jquery 1.2 or above from version 1.0.1
 */
(function($) {                                          // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) {
    o = $.extend({
        btnPrev: null,
        btnNext: null,
        btnGo: null,
        mouseWheel: false,
        auto: null,

        speed: 200,
        easing: null,

        vertical: false,
        circular: true,
        visible: 3,
        start: 0,
        scroll: 1,

        beforeStart: null,
        afterEnd: null
    }, o || {});

    return this.each(function() {                           // Returns the element collection. Chainable.

        var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width";
        var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;

        if(o.circular) {
            ul.prepend(tLi.slice(tl-v-1+1).clone())
              .append(tLi.slice(0,v).clone());
            o.start += v;
        }

        var li = $("li", ul), itemLength = li.size(), curr = o.start;
        div.css("visibility", "visible");

        li.css({overflow: "hidden", float: o.vertical ? "none" : "left"});
        ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
        div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"});

        var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
        var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
        var divSize = liSize * v;                           // size of entire div(total length for just the visible items)

        li.css({width: li.width(), height: li.height()});
        ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));

        div.css(sizeCss, divSize+"px");                     // Width of the DIV. length of visible images

        if(o.btnPrev)
            $(o.btnPrev).click(function() {
                return go(curr-o.scroll);
            });

        if(o.btnNext)
            $(o.btnNext).click(function() {
                return go(curr+o.scroll);
            });

        if(o.btnGo)
            $.each(o.btnGo, function(i, val) {
                $(val).click(function() {
                    return go(o.circular ? o.visible+i : i);
                });
            });

        if(o.mouseWheel && div.mousewheel)
            div.mousewheel(function(e, d) {
                return d>0 ? go(curr-o.scroll) : go(curr+o.scroll);
            });

        if(o.auto)
            setInterval(function() {
                go(curr+o.scroll);
                 cambiar(0);
            }, o.auto+o.speed);

        function vis() {
             return li.slice(curr).slice(0,v);
        };

        function go(to) {
            if(!running) {

                if(o.beforeStart)
                    o.beforeStart.call(this, vis());

                if(o.circular) {            // If circular we are in first or last, then goto the other end
                    if(to<=o.start-v-1) {           // If first, then goto last
                        ul.css(animCss, -((itemLength-(v*2))*liSize)+"px");
                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
                        curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll;
                    } else if(to>=itemLength-v+1) { // If last, then goto first
                        ul.css(animCss, -( (v) * liSize ) + "px" );
                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements.
                        curr = to==itemLength-v+1 ? v+1 : v+o.scroll;
                    } else curr = to;
                } else {                    // If non-circular and to points to first or last, we just return.
                    if(to<0 || to>itemLength-v) return;
                    else curr = to;
                }                           // If neither overrides it, the curr will still be "to" and we can proceed.

                running = true;

                ul.animate(
                    animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
                    function() {
                        if(o.afterEnd)
                            o.afterEnd.call(this, vis());
                        running = false;
                    }
                );
                // Disable buttons when the carousel reaches the last/first, and enable when not
                if(!o.circular) {
                    $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
                    $( (curr-o.scroll<0 && o.btnPrev)
                        ||
                       (curr+o.scroll > itemLength-v && o.btnNext)
                        ||
                       []
                     ).addClass("disabled");
                }

            }
            return false;
        };
    });
};

function css(el, prop) {
    return parseInt($.css(el[0], prop)) || 0;
};
function width(el) {
    return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
};
function height(el) {
    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
};

})(jQuery);





var divs_duplicado = new Array(10); 

function iecompattest(){
	return(document.compatMode&&document.compatMode!="BackCompat")? document.documentElement : document.body}

function iecompattestIframe(){
	return(parent.document.compatMode&&parent.document.compatMode!="BackCompat")? parent.document.documentElement : parent.document.body}
function get_cookie(Name){
	var search=Name+"="
	var returnvalue=""
	if(parent.document.cookie.length>0){
		offset=parent.document.cookie.indexOf(search)
		if(offset !=-1){
			offset+=search.length
			end=parent.document.cookie.indexOf(";",offset)
			if(end==-1)end=parent.document.cookie.length
			returnvalue=unescape(parent.document.cookie.substring(offset,end))}}
	return returnvalue
}

var fWidth;
function getLeftLightbox(divcito){
	//For old IE browsers
	if(document.all)
		fWidth = document.body.clientWidth;
	//For DOM1 browsers
	else if(document.getElementById &&!document.all)
		fWidth = innerWidth;
	else if(document.getElementById)
		fWidth = innerWidth;
	//For Opera
	else if (is.op)
		fWidth = innerWidth;
	//For old Netscape
	else if (document.layers)
		fWidth = window.innerWidth;
		
	var widthdivcito = obtenerEstilo(divcito,"width");
	return ((fWidth/2)-(widthdivcito/2))+"px";
}

function getLeftLightboxIframe(divcito){
	//For old IE browsers
	if(document.all)
		fWidth = parent.document.body.clientWidth;
	//For DOM1 browsers
	else if(parent.document.getElementById &&!document.all)
		fWidth = parent.innerWidth;
	else if(parent.document.getElementById)
		fWidth = parent.innerWidth;
	//For Opera
	else if (is.op)
		fWidth = parent.innerWidth;
	//For old Netscape
	else if (parent.document.layers)
		fWidth = window.innerWidth;		
	var widthdivcito = obtenerEstiloIframe(divcito,"width");
	return ((fWidth/2)-(widthdivcito/2))+"px";
}

function obtenerEstilo(elemento,estilo){
	if(elemento.width)
	   return elemento.width;
	
	style = estilo;
	value=elemento.style.estilo;
	if (!value) {
		  if (document.defaultView && document.defaultView.getComputedStyle) {
			var css = document.defaultView.getComputedStyle(elemento, null);
			value = css ? css[style] : null;
		  } else if (elemento.currentStyle) {
			value = elemento.currentStyle[style];
		  }
	}
	if(isNaN(value))
	   return elemento.offsetWidth;
	else if(value)
		return value.replace("px","");
	else
		return 0;
}

function obtenerEstiloIframe(elemento,estilo){
	if(elemento.width)
	   return elemento.width;
	
	style = estilo;
	value=elemento.style.estilo;
	if (!value) {
		  if (parent.document.defaultView && parent.document.defaultView.getComputedStyle) {
			var css = parent.document.defaultView.getComputedStyle(elemento, null);
			value = css ? css[style] : null;
		  } else if (elemento.currentStyle) {
			value = elemento.currentStyle[style];
		  }
	}
	if(isNaN(value))
	   return elemento.offsetWidth;
	else if(value)
		return value.replace("px","");
	else
		return 0;
}

function abrirLightbox(windowID, borrarContenido, contenedorcampos){
	if(borrarContenido==1){
	   document.getElementById(contenedorcampos).innerHTML = divs_duplicado[windowID].innerHTML;
    }
    
   	ponerVelo();
	this.id=windowID
	barheight=document.getElementById(this.id).offsetHeight
	var ns=(navigator.appName.indexOf("Netscape")!=-1)|| window.opera
	var d=document
	function ml(id){
		var el=d.getElementById(id)
		if(!persistclose || persistclose&&get_cookie("remainclosed")=="")
		el.style.display="block"
		if(d.layers)el.style=el
		el.sP=function(x,y){this.style.left=getLeftLightbox(el);this.style.top=y+"px";}
		el.x=startX
		if(verticalpos=="fromtop")
		el.y=startY
		else{
			el.y=ns ? pageYOffset+innerHeight : iecompattest().scrollTop+iecompattest().clientHeight
			el.y-=startY}
		return el}
	window.stayTopLeft=function(){
		if(verticalpos=="fromtop"){
			var pY=ns ? pageYOffset : iecompattest().scrollTop
			ftlObj.y+=(pY+startY-ftlObj.y)/8}
		else{
			var pY=ns ? pageYOffset+innerHeight-barheight: iecompattest().scrollTop+iecompattest().clientHeight-barheight
			ftlObj.y+=(pY-startY-ftlObj.y)/8}
		ftlObj.sP(ftlObj.x,ftlObj.y)
		setTimeout("stayTopLeft()",10)}
	ftlObj=ml(this.id)
	stayTopLeft()
}

function abrirLightboxcontac(windowID, borrarContenido, contenedorcampos, titulo){
	if(borrarContenido==1){	   	   	
        document.getElementById(contenedorcampos).innerHTML = divs_duplicado[windowID].innerHTML;       
    }     
   	ponerVelo();
	this.id=windowID
	
	document.getElementById("tipoContacto").innerHTML = titulo;
		
	barheight=document.getElementById(this.id).offsetHeight
	var ns=(navigator.appName.indexOf("Netscape")!=-1)|| window.opera
	var d=document
	function ml(id){
		var el=d.getElementById(id)
		if(!persistclose || persistclose&&get_cookie("remainclosed")=="")
		el.style.display="block"
		if(d.layers)el.style=el
		el.sP=function(x,y){this.style.left=x+"%";this.style.top=y+"px";}
		el.x=startX
		if(verticalpos=="fromtop")
		el.y=startY
		else{
			el.y=ns ? pageYOffset+innerHeight : iecompattest().scrollTop+iecompattest().clientHeight
			el.y-=startY}
		return el}
	window.stayTopLeft=function(){
		if(verticalpos=="fromtop"){
			var pY=ns ? pageYOffset : iecompattest().scrollTop
			ftlObj.y+=(pY+startY-ftlObj.y)/8}
		else{
			var pY=ns ? pageYOffset+innerHeight-barheight: iecompattest().scrollTop+iecompattest().clientHeight-barheight
			ftlObj.y+=(pY-startY-ftlObj.y)/8}
		ftlObj.sP(ftlObj.x,ftlObj.y)
		setTimeout("stayTopLeft()",10)}
	ftlObj=ml(this.id)
	stayTopLeft()
}

function abrirLightboxvotar(windowID, borrarContenido, contenedorcampos,otro){
	if(borrarContenido==1){	   	   	
        document.getElementById(contenedorcampos).innerHTML = divs_duplicado[windowID].innerHTML;       
    }    
  	ponerVelo();
	this.id=windowID
	if(otro==0)
	  document.getElementById("mensajevotar").innerHTML = "Sólo se permite un voto por usuario";
	else
	  document.getElementById("mensajevotar").innerHTML = "Gracias por tu Calificaci&oacute;n!!!";
		
	barheight=document.getElementById(this.id).offsetHeight
	var ns=(navigator.appName.indexOf("Netscape")!=-1)|| window.opera
	var d=document
	function ml(id){
		var el=d.getElementById(id)
		if(!persistclose || persistclose&&get_cookie("remainclosed")=="")
		el.style.display="block"
		if(d.layers)el.style=el
		el.sP=function(x,y){this.style.left=x+"%";this.style.top=y+"px";}
		el.x=startX
		if(verticalpos=="fromtop")
		el.y=startY
		else{
			el.y=ns ? pageYOffset+innerHeight : iecompattest().scrollTop+iecompattest().clientHeight
			el.y-=startY}
		return el}
	window.stayTopLeft=function(){
		if(verticalpos=="fromtop"){
			var pY=ns ? pageYOffset : iecompattest().scrollTop
			ftlObj.y+=(pY+startY-ftlObj.y)/8}
		else{
			var pY=ns ? pageYOffset+innerHeight-barheight: iecompattest().scrollTop+iecompattest().clientHeight-barheight
			ftlObj.y+=(pY-startY-ftlObj.y)/8}
		ftlObj.sP(ftlObj.x,ftlObj.y)
		setTimeout("stayTopLeft()",10)}
	ftlObj=ml(this.id)
	stayTopLeft()
}
function cerrarLightboxVotar(windowID){
    document.getElementById("mensajevotar").innerHTML = '';
    cerrarLightbox(windowID);
}
function cerrarLightbox(windowID){
	quitarVelo();
	this.id=windowID
	if(persistclose)
	document.cookie="remainclosed=1"
	document.getElementById(this.id).style.display="none"
}
function JSWindow(windowID){
	document.getElementById('vermask').className='layerlightver'
	oTable=document.createElement("table")
	oTable.cellSpacing=0
	oTable.cellPadding=0
	oTable.border=0
	var windowdiv=document.getElementById(windowID)
	var urlight=document.getElementById(windowID)
	while(windowdiv.hasChildNodes())windowdiv.removeChild(windowdiv.firstChild)
	windowdiv.appendChild(oTable)
	var oTR=oTable.insertRow(0)
	oTD=oTR.insertCell(0)
	oTD.innerHTML="<img src='"+urlight.value+"' border=0>"}

function ponerVelo(){
   document.getElementById('vermask').className='layerlightver';
}
function ponerVeloIframe(){
  parent.velo.className='layerlightver';
}

function quitarVelo(){
   document.getElementById('vermask').className='';
}
function mostrarRecursoMultimedia(respuesta){
   var divmulti = document.getElementById("contenidoReproductor").innerHTML=respuesta;
   abrirLightbox("lightboxMultimedia",0);
}

function enviarNuevoError(idform){
   
    form =  document.getElementById(idform);
    
    //para tomar el enlace de la pagian en la que se encuentra
    var link = form.redireccion.value;
    
    var nombreusua=form.nombreUsu.value;
	var correousua=form.correoUsu.value;
	var mensaje=form.mensajeUsu.value; 
	
    var barra_mensaje = document.getElementById("mensaje_error_reportar_amigo");
   
	if(isEmpty(nombreusua))
	{
		barra_mensaje.innerHTML = "Por favor, escribe tu nombre";
		return;
	}
	
	if(!isEmail(correousua))
	{
		barra_mensaje.innerHTML = "Tu dirección de correo electrónico no es válida";
		return;
	}

	if(isEmpty(mensaje))
	{
		barra_mensaje.innerHTML = "Por favor, escribe tu  mensaje";
		return;
	}	
	 document.getElementById("contentcamposError").innerHTML = "<br><br><br><h1>Un momento por favor. Estamos enviando sus observaciones a nuestro equipo editorial.</h1><br><br><br>";
     incluirObjeto("ENVIAR_ERROR",nombreusua, correousua, mensaje, link, "contentcamposError");
                
  } 
  function enviarContacto(idform, tipoContacto){
   
    form =  document.getElementById(idform);
    
    var nombreusua=form.nombreUsu.value;
    var cedulausua = form.cedulaUsu.value;
    var telefonousua = form.telefonoUsu.value;
    var correousua=form.correoUsu.value;
	var mensaje=form.mensajeUsu.value; 
	
	if(isEmpty(nombreusua))
	{
		alert("Por favor, escribe tu nombre");
		return;
	}
	
	if(isEmpty(cedulausua))
	{
		alert("Por favor, escribe tu cédula");
		return;
	}
	
	if(isEmpty(telefonousua))
	{
		alert("Por favor, escribe tu teléfono");
		return;
	}
	
	if(!isEmail(correousua))
	{
		alert("Tu dirección de correo electrónico no es válida");
		return;
	}

	if(isEmpty(mensaje))
	{
		alert("Por favor, escribe tu  mensaje");
		return;
	}
     //tomo el tipo de contacto 	
	 var tipo = document.getElementById("tipoContacto").innerHTML;
	  	
	 document.getElementById("contentcamposcontact").innerHTML = "<br><br><br><h1>Enviando reporte, por favor espere...</h1><br><br><br>";
     incluirObjeto("ENVIAR_CONTACTO",nombreusua, cedulausua, telefonousua, correousua, mensaje,tipo,"contentcamposcontact");
                
  } 
  
  function enviarAmigo(idform, idRecurso){
   
    form =  document.getElementById(idform);
    
    //para tomar el enlace de la pagian en la que se encuentra
	var link = form.redireccion.value;
    
    var nombreorigen=form.nombreor.value;
	var mailorigen=form.mailor.value;
	var nombredestino=form.nombredes.value;
    var maildestino=form.maildes.value;
  	var mensajemail=form.mensaje.value;
	 
	if(isEmpty(nombreorigen))
	{
		alert("Por favor, escribe tu nombre");
		return;
	}
	
	if(!isEmail(mailorigen))
	{
		alert("Tu dirección de correo electrónico no es válida");
		return;
	}
    if(isEmpty(nombredestino))
	{
		alert("Por favor, escribe el nombre de tu amigo");
		return;
	}
	
	if(!isEmail(maildestino))
	{
		alert("La dirección de correo electrónico de tu amigo no es válida");
		return;
	}
	if(isEmpty(mensajemail))
	{
		alert("Por favor, escribe tu mensaje");
		return;
	}	
	 document.getElementById("contentcamposAmigo").innerHTML = "<div class='uncamporegistro'><h2>Un momento por favor. Estamos enviando la informaci&oacute;n.</h2></div>";
     incluirObjeto("ENVIAR_AMIGO",nombreorigen,mailorigen,nombredestino,maildestino,mensajemail, link,idRecurso, "contentcamposAmigo");
                
  } 
  
  function enviarInformanos(idform){
   
    form =  document.getElementById(idform);
    
    //para tomar el enlace de la pagian en la que se encuentra
    var link = document.getElementById("redireccion").value;
    
    var infonombre=form.infoNombre.value;
    var infoapellido=form.infoApellido.value;
	var infomail=form.infoMail.value;
    var infotipo=form.infoTipo.value;
    var infodirec=form.infoDirec.value;
    var infotele=form.infoTele.value;
    var infocelu=form.infoCelu.value;
    var infociudad=form.infoCiudad.value;
	var infomensaje=form.infoMensaje.value;

	if(isEmpty(infonombre))
	{
		alert("Por favor, escribe tu nombre");
		return;
	}
	if(isEmpty(infoapellido))
	{
		alert("Por favor, escribe tu apellido");
		return;
	}
	
	if(!isEmail(infomail))
	{
		alert("Tu dirección de correo electrónico no es válida");
		return;
	}
    if(isEmpty(infotipo))
	{
		alert("Por favor, elije un tipo");
		return;
	}
	
	if(isEmpty(infodirec))
	{
		alert("Por favor, escribe tu dirección");
		return;
	}
	
	if(isEmpty(infotele))
	{
		alert("Por favor, escribe tu teléfono");
		return;
	}
	if(isEmpty(infocelu))
	{
		alert("Por favor, escribe tu  celular");
		return;
	}
	
	if(isEmpty(infociudad))
	{
		alert("Por favor, escribe tu  Ciudad");
		return;
	}
	
	if(isEmpty(infomensaje))
	{
		alert("Por favor, escribe tu  mensaje");
		return;
	}	
	 document.getElementById("contentcamposInformanos").innerHTML = "<div class='uncamporegistro'><br><br><br><h1>Un momento por favor. Estamos enviando la informaci&oacute;n a nuestro equipo editorial.</h1><br><br><br></div>";
     incluirObjeto("ENVIAR_INFORMANOS",infonombre,infoapellido,infomail,infotipo,infodirec,infotele,infocelu,infociudad,infomensaje,"contentcamposInformanos");
                
  } 
    
  function isEmail (s)
  {
    if (isEmpty(s)) 
      if (isEmail.arguments.length == 1) return false;
      else return (isEmail.arguments[1] == true);
      var i = 1;
      var sLength = s.length;
      while ((i < sLength) && (s.charAt(i) != "@")) i++;
      
      if ((i >= sLength) || (s.charAt(i) != "@")) return false;
      else i += 2;
      
      while ((i < sLength) && (s.charAt(i) != "."))i++;
      
      if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
      else return true;
  }
    
  function isEmpty(s)
  {   
	return ((s == null) || (s.length == 0));
  }

function recargarObjeto2(nombre_objeto, div_respuesta, o, pordefecto, cual){
   
    //Quitar el foco de la pestaña a la que le hicieron click
     //o.style.display='block';
     //o.blur(); 
     o.parentNode.style.display='block';
     o.parentNode.blur();
             
    //Quitarle el estilo a la pestaña actual
    var list = document.getElementById('NavigationMiPortafolio').getElementsByTagName("li");
    for (var i = 0; i < list.length; i++) {
		if (list[i].className == pordefecto) {
			list[i].className = "";	
		}
	}
	//clase a la pestaña del click
	//o.className = pordefecto;
    o.parentNode.className = pordefecto;
    
    incluirObjeto(nombre_objeto, cual, div_respuesta);   
}  

function eliminarFavorito(idrecurso){
	abrirLightbox('lightboxEliminarFav',0,'contenteliminarFav');
	document.getElementById("contenteliminarFav").innerHTML = "<p><center>Espere unos segundos.</center></p>";
  	incluirObjeto("ELIMINAR_FAVORITO",idrecurso,'contenteliminarFav');	

}

function agregarAlerta(){
	abrirLightbox('lightboxAgregarAl',0,'contentagregaral');
	/*document.getElementById("contenteliminarFav").innerHTML = "<p><center>Espere unos segundos.</center></p>";
  	incluirObjeto("AGREGAR_ALERTA",idrecurso,'contenteliminarFav');	*/

}

function agregarAlerta2(idform){
   
    form =  document.getElementById(idform);
    
    var alerta = form.alerta.value;
    var estado = form.estado;
    var estado2 = form.estado.value;
	
	if(isEmpty(alerta))
	{
		alert("Por favor escriba su alerta");
		return;
	}
	
	if (estado.options[estado.selectedIndex].value == "")
	{
		alert("Por favor, elija un estado para su alerta");
		return;
	}
	  	
	 document.getElementById("contentagregaral").innerHTML = "<br><br><br><h1>Agregando alerta, por favor espere...</h1><br><br><br>";
     incluirObjeto("AGREGAR_ALERTA",alerta, estado2, "contentagregaral");
                
}

function editarAlerta(alerta,estado){
	abrirLightbox('lightboxModificarAl',0,'contentmodificaral');
	/*document.getElementById("contenteliminarFav").innerHTML = "<p><center>Espere unos segundos.</center></p>";*/
  	incluirObjeto("MODIFICAR_ALERTA",alerta,estado,'contentmodificaral');	

}

function editarAlerta2(idformal){
   
    form =  document.getElementById(idformal);
    
    var alerta = form.alerta.value;
    var estado = form.estado;
    var palabra_anterior = form.palabra_anterior.value;
    var estado2 = form.estado.value;
	
	if(isEmpty(alerta))
	{
		alert("Por favor escriba su alerta");
		return;
	}
	
	if (estado.options[estado.selectedIndex].value == "")
	{
		alert("Por favor, elija un estado para su alerta");
		return;
	}
	  	
	 document.getElementById("contentmodificaral").innerHTML = "<br><br><br><h1>Modificando alerta, por favor espere...</h1><br><br><br>";
     incluirObjeto("MODIFICAR_ALERTA2",alerta, estado2, palabra_anterior, "contentmodificaral");
                
}

function eliminarAlerta(palabra){
	abrirLightbox('lightboxEliminarAl',0,'contenteliminarAl');
	document.getElementById("contenteliminarAl").innerHTML = "<p><center>Espere unos segundos.</center></p>";
  	incluirObjeto("ELIMINAR_ALERTA",palabra,'contenteliminarAl');	

} 


function abrirLightboxIframe(windowID, borrarContenido, contenedorcampos){
	if(borrarContenido==1){
	          document.getElementById(contenedorcampos).innerHTML = divs_duplicado[windowID].innerHTML;
    }
    ponerVeloIframe();
	this.id=windowID
	barheight=parent.document.getElementById(this.id).offsetHeight
	var ns=(navigator.appName.indexOf("Netscape")!=-1)|| window.opera
	var d=parent.document
	function ml(id){
		var el=d.getElementById(id)
		if(!persistclose || persistclose&&get_cookie("remainclosed")=="")
		el.style.display="block"
		if(d.layers)el.style=el
		//el.sP=function(x,y){this.style.left=x+"%";this.style.top=y+"px";}
		//el.sP=function(x,y){this.style.left="5%";this.style.top=y+"px";}
   		 el.sP=function(x,y){this.style.left=getLeftLightboxIframe(el);this.style.top=y+"px";}
		 el.x=startX
		if(verticalpos=="fromtop")
		el.y=startY
		else{
			el.y=ns ? pageYOffset+innerHeight : iecompattest().scrollTop+iecompattest().clientHeight
			el.y-=startY}
		return el}
	window.stayTopLeft=function(){
		if(verticalpos=="fromtop"){
			var pY=ns ? parent.pageYOffset : iecompattestIframe().scrollTop
			ftlObj.y+=(pY+startY-ftlObj.y)/8}
		else{
			var pY=ns ? pageYOffset+innerHeight-barheight: iecompattestIframe().scrollTop+iecompattestIframe().clientHeight-barheight
			ftlObj.y+=(pY-startY-ftlObj.y)/8}
		ftlObj.sP(ftlObj.x,ftlObj.y)
		setTimeout("stayTopLeft()",10)}
	ftlObj=ml(this.id)
	stayTopLeft()
}
    
function pintarIframeEncuesta(id_encuesta){
  var urlencuesta='http://www.eltiempo.com/sondeos/admin/user-statistics.php?sid='+id_encuesta;
  parent.document.getElementById('iframeId').src=urlencuesta;

}

function abrirBarra(){
    $("div#mibarra").show();
	document.getElementById("mibarra").innerHTML = '<div class="opciones-login"><div class="form2"><div class="dato dato1"><input type="checkbox" class="inputCheckbox" name="recordar" id="recordar"/><label for="recordar">Recordar mi clave en este equipo</label><a class="vinculo-especial" href="javascript:void(0)" onclick="abrirLightbox(\'lightboxOlvideClave\',1,\'contentcamposOlvide\'); return false;" >Olvidé mi clave</a></div></div><div class="clear"></div></div>';
}

function enviarOlvidoClave(idform){
   
    form =  document.getElementById(idform);
    
    //para tomar el enlace de la pagian en la que se encuentra
    var link = form.redireccion.value;
   	var correousua=form.correoUsu.value;
	
    var barra_mensaje = document.getElementById("mensaje_olvide_clave");
    barra_mensaje.innerHTML = "";
	
	if(!isEmail(correousua))
	{
		barra_mensaje.innerHTML = "Tu dirección de correo electrónico no es válida";
		return;
	}
	 document.getElementById("contentcamposOlvide").innerHTML = "<br><h2>Dénos un segundo. Estamos enviando su solicitud.</h2><br>";
     incluirObjeto("ENVIAR_OLVIDE_CLAVE",correousua, link, "contentcamposOlvide");
                
} 
var escribiSobre = "";
var divActivo = "";

function mostrarNuevoRecursoMultimedia(respuesta){
  document.getElementById("info_visible").innerHTML=respuesta;
  if (fileRec && idDivRec && tipoRec ) {
      if (fileRec != '' && idDivRec != '' && tipoRec != '') {
          generarVideoJS(fileRec , idDivRec, tipoRec, 400, 320,urlimgRec);
          fileRec = '';
          idDivRec = '';
          tipoRec = '';
          urlimgRec='';
     }
  }
}

function mostrarNuevoRecursoMultimediaPequeno(respuesta){
  document.getElementById("info_visible").innerHTML=respuesta;
  if (fileRec && idDivRec && tipoRec ) {      
      if (fileRec != '' && idDivRec != '' && tipoRec != '') {
          generarVideoJS(fileRec , idDivRec, tipoRec, 210, 180,urlimgRec);
          fileRec = '';
          idDivRec = '';
          tipoRec = '';
          urlimgRec='';
     }
  }
}

function mostrarNuevoRecursoAudio(respuesta){
  
  var objDiv = document.getElementById("mostrar_aqui"+divActivo);
  objDiv.style.display = "block";
  objDiv.innerHTML=respuesta;
  
  if (fileRec && idDivRec && tipoRec) {
      if (fileRec != '' && idDivRec != '' && tipoRec != '') {
          generarVideoJS(fileRec , idDivRec, tipoRec, 200, 120);
          fileRec = '';
          idDivRec = '';
          tipoRec = '';
     }
  }
 
}

function mostrarRecursoMultimediaLightbox(respuesta){
   abrirLightbox("lightboxMultimedia",0);
   var divmulti = document.getElementById("contenidoReproductor").innerHTML=respuesta;
}
function cambiarDiv(id_div){
     objDiv = document.getElementById("relacionado"+id_div);
      
     var lista = document.getElementById('info_relacionada_articulo_nuevotiempo');
     var total_lista = lista.getElementsByTagName("div");
     for (var i = 0; i < total_lista.length; i++) {
        var nombreDiv = total_lista[i].id;
        if(nombreDiv.search('mostrar_aqui')==0)
           	total_lista[i].style.display = "none";
        else
			total_lista[i].style.display = "block";
	 }
	  
	 if(objDiv)
      objDiv.style.display = "none";
    
   
}

function cambiarDivEmergencia(id_div){
     
     objDiv = document.getElementById("relacionado"+id_div);
      
     var lista = document.getElementById('listado_relacionados_nuevotiempo');
     var total_lista = lista.getElementsByTagName("div");
     for (var i = 0; i < total_lista.length; i++) {
			total_lista[i].style.display = "block";
	 }
	  
	 if(objDiv)
      objDiv.style.display = "none";
	  
}

function enviarMyNotaAmigo(idform, idRecurso){
   
    form =  document.getElementById(idform);
    
    //para tomar el enlace de la pagian en la que se encuentra
    //var link = document.getElementById("redireccion").value;
    var link = form.redireccion.value;
    var nombreorigen=form.nombreor.value;
	var mailorigen=form.mailor.value;
	var nombredestino=form.nombredes.value;
    var maildestino=form.maildes.value;
  	var mensajemail=form.mensaje.value;
	 
	var barra_mensaje = document.getElementById("mensaje_error_enviar_amigo");
	if(isEmpty(nombreorigen))
	{
		//alert("Por favor, escribe tu nombre");
        barra_mensaje.innerHTML = "Por favor, escribe tu nombre";
		return;
	}
	
	if(!isEmail(mailorigen))
	{
		barra_mensaje.innerHTML = "Tu dirección de correo electrónico no es válida";
		return;
	}
    if(isEmpty(nombredestino))
	{
		barra_mensaje.innerHTML = "Por favor, escribe el nombre de tu amigo";
		return;
	}
	
	if(!isEmail(maildestino))
	{
		barra_mensaje.innerHTML = "La dirección de correo electrónico de tu amigo no es válida";
		return;
	}
	if(isEmpty(mensajemail))
	{
		barra_mensaje.innerHTML = "Por favor, escribe tu mensaje";
		return;
	}	
	 document.getElementById("contentcamposAmigo").innerHTML = "<div class='uncamporegistro'><br><br><br><h1>Espere un segundo por favor. Estamos enviando la informaci&oacute;n.</h1><br><br><br></div>";
     incluirObjeto("MOSTRAR_GRACIAS_AMIGO",nombreorigen,mailorigen,nombredestino,maildestino,mensajemail, link,idRecurso, "contentcamposAmigo");
                
  } 
  
  function cambiarFuente(iddiv, accion){
    
    var estilo;
    divcito = document.getElementById(iddiv);
    elementsp=divcito.getElementsByTagName('p'); 
    claseActual = elementsp[0].className;
    switch (accion) {         
        case 'aumenta2':
          estilo = 'masmas';
 
        break;
        case 'aumenta1':
          estilo = 'mas';
            
        break;
        default:
            estilo = '';
    }
    for(i=0;i<elementsp.length;i++){
        if(elementsp[i].id!="noaumenta"){
            elementsp[i].className = estilo;
        }
    }
  }
  
function calificarComment(votarVetar, idcomentario,consecutivo,tienePermiso,idUsuario){  
  if(loginUsuario!=''){     
     incluirObjeto("REESCRIBIR_VOTACION",idcomentario,votarVetar,idUsuario,consecutivo,"caja_voto"+idcomentario);
  }   
  else
  {
      abrirLightbox('lightboxIngresar',0,'contenidoCamposIngresar');
  }
}

function ocultarVerComentario(idcomentario){
	//Este es el cuerpo del comentario
	var contenido2=document.getElementById(idcomentario);
	
	//Este es el div que tiene el link de "ocultar comentario" o "abrir comentario"
	var divLink=document.getElementById("ocultarabrir"+idcomentario);
	
	if(contenido2.style.display=="block"){
		divLink.innerHTML="[ver comentario oculto]";
		//oculto el comentario
		contenido2.style.display="none";
	}
	else{
		//muestro el comentario
		contenido2.style.display="block";
		divLink.innerHTML="[ocultar comentario]";
	}
	
}

function cambiarPag(posicion, limite, pag)
{   
   //document.foro.action = "";
   document.foro.posicion.value=(posicion-1)*1;
   document.foro.hasta.value=(limite*1);
   document.foro.pagActual.value=pag;
   document.foro.target ="_top";
   document.foro.submit();
}

function comentarcomentario(idcom){
     cambiarIdParaComentar(idcom);
     var url = location.href;
  	 url = url.replace("#comentarNota","");
  	 location.href = url+"#comentarNota";
}

function cambiarIdParaComentar(id_padre) {
     if(document.formComm != null)
        document.formComm.id_padre.value = id_padre;
}

function comentar()
  {
    if(isWhitespace(document.formComm.comentario.value))
	{
		alert("Por favor, escriba su comentario");
		return;
	}
	if(document.formComm.comentario.value.length > 1000)
	{
	  alert("El comentario tiene m&aacute;s caracteres que los permitidos. Por favor ed&iacute;telo");
	  return;
	}
	
	input = document.formComm.inputcaptcha.value;
	suaz = document.formComm.suazzz.value;	
	var urltmp = document.location.href;	
	abrirLightbox('lightboxComentario',0,'respuestacomentario');	
    document.getElementById("respuestacomentario").innerHTML = "<div id='mensajecomentar'><br><br><br><h3>Su comentario se est&aacute; enviando<br>por favor espere...</h3><br><br><br></div>";
    incluirObjeto("MOSTRAR_GRACIAS_COMENTAR", document.formComm.comentario.value,
	document.formComm.id_padre.value,document.formComm.id_recurso.value, document.formComm.url.value, 
	document.generales.redireccionamiento.value, suaz,  input, "respuestacomentario");
	document.getElementById('vermask').className='layerlightver';    
  }
  

  function isWhitespace (s)
  {
    var i;
    var whitespace = " \t\n\r";    
    if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++)
    {   
      var c = s.charAt(i);
      // si el caracter en que estoy no aparece en whitespace,
      // entonces retornar falso
      if (whitespace.indexOf(c) == -1) return false;
    }
    return true;
  }  
  function cambiar_texto(texto)
{
        //Objeto etiqueta al cual se le vca a cambiar el texto
        var obj=document.getElementById('_califica');
        
        //Remueve todos los nodos del objeto
        while(obj.hasChildNodes()) obj.removeChild(obj.firstChild);

		//Crea el nodo de texto 
		obj_texto=document.createTextNode(texto);												
        
        //Se a?ade el nodo de texto al objeto etiqueta
        obj.appendChild(obj_texto);
}

function cargarDatosPageView(divReproductor ,titulo, seccionPrincipal, seccionHija) {
    if (!arregloMedias[divReproductor]) {
        arregloMedias[divReproductor] = new Array(4);
    }
    arregloMedias[divReproductor][0] = 0;
    arregloMedias[divReproductor][1] = titulo;
    arregloMedias[divReproductor][2] = seccionPrincipal;
    arregloMedias[divReproductor][3] = seccionHija;        
}

function facebook_click(){
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}

function validarYoPublico(){
   var divErrores = document.getElementById("mensajeYoPublico");
   
   var a=true;
   
   with(document.forma) {
        
        //Según sea imagen o video se vaidan los campos
        var activoRadio='imagen';
        /*for(var i = 0; i < tipoArchivo.length; i++) {
		  if(tipoArchivo[i].checked) {
			 activoRadio = radioObj[i].value;
		  }
	    }*/
        if(activoRadio!='video'){
           if (archivo.value == ""){
              divErrores.style.display = "block";
			  divErrores.innerHTML = "<p>Por favor, seleccione el archivo</p>";
			  a = false;
		   }
	    }else{
	       if (enlaceyoutube.value == "" || enlaceyoutube.value == "http://www.youtube.com/watch?v= SuCodigo"){
              divErrores.style.display = "block";
			  divErrores.innerHTML = "<p>Por favor, ingrese la dirección youtube de su video</p>";
			  a = false;
		   }else{
		      if (enlaceyoutube.value.search("www.youtube.com/watch")==-1){
                 divErrores.style.display = "block";
			     divErrores.innerHTML = "<p>Por favor, verifique la dirección youtube de su video</p>";
			     a = false;
		      }
		   }
	    }
        //Fin según sea imagen o video se vaLidan los campos
        
		if (titulo.value == ""){
     		divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor, ingrese el titulo</p>";
			a = false;
		}
		if (descripcion.value == ""){
     		divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor, ingrese la descripción</p>";
			a = false;
		}
		if (lugar.value == ""){
 		    divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor, ingrese el lugar</p>";
			a = false;
		}
		if (categoria.value == ""){
			divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor, ingrese la categoria</p>";
			a = false;
		}
		if (etiquetas.value == ""){
		    divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor, ingrese las etiquetas</p>";
			a = false;
		}
		if (!termCond.checked){
		   
		    divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Para enviar contenido usted debe aceptar las condiciones del servicio </p>";
			a = false;
		}	
		if (menu1.value == "" || menu1.value == "0"){
		    divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor, seleccione la licencia Creative Commons</p>";
			a = false;
		}
				
		if (a) {
           abrirLightbox("lightboxCargandoYp",0);
	       submit();
		}else{
		    if (document.location.hash != ""){
               document.location = document.location;
            }else
		       document.location = document.location+"#cabeza";
		}
   }
}

function validarFechas(){
   with(document.buscarPorFecha) {
      var divErrores = document.getElementById("noFecha");
   
      var a=true;
      if (diaEdicAnteriores.value == "" &&  mesEdicAnteriores.value == "" && anioEdicAnteriores.value == ""){
		    divErrores.innerHTML = "<p>Ingrese por lo menos un criterio de búsqueda</p>";
			a = false;
	  }
      if (diaEdicAnteriores.value != "" && anioEdicAnteriores.value == "" &&  mesEdicAnteriores.value == ""){
		    divErrores.innerHTML = "<p>Por favor, seleccione el mes y/o el año</p>";
			a = false;
	  }

	  if (a) {
		  //submit();
		  document.location = action+"/a/"+anioEdicAnteriores.value+"/m/"+mesEdicAnteriores.value+"/d/"+diaEdicAnteriores.value;
	  }
   }
}

function enviarComentaristaDestacado(){
    
    var divErrores = document.getElementById("algoEstaMal");
 
    var nombre=document.formenviarerror.nombre.value;
    var apellido=document.formenviarerror.apellido.value;
	var correo=document.formenviarerror.email.value;
	var ciudad=document.formenviarerror.ciudad.value;    
	var pais=document.formenviarerror.pais.value;    
	var ocupacion=document.formenviarerror.ocupacion.value;    
	var cedula=document.formenviarerror.cedula.value;    
	var fijo=document.formenviarerror.fijo.value;    
	var oficina=document.formenviarerror.oficina.value;    
	var celular=document.formenviarerror.celular.value;    
	if(isEmpty(nombre))
	{
		divErrores.innerHTML = "Por favor, escriba su nombre";
		return;
	}
    if(isEmpty(apellido))
	{
		divErrores.innerHTML = "Por favor, escriba sus apellidos";
		return;
	}
    if(isEmpty(cedula))
	{
		divErrores.innerHTML = "Por favor, escriba su número de cédula";
		return;
	}
				
	if(!isEmail(correo))
	{
		divErrores.innerHTML = "Su dirección de correo electrónico no es válida";
		return;
	}

	if(isEmpty(ciudad))
	{
		divErrores.innerHTML = "Por favor, escriba la ciudad";
		return;
	}
    if(isEmpty(pais))
	{
		divErrores.innerHTML = "Por favor, escriba el país";
		return;
	}
    if(isEmpty(ocupacion))
	{
		divErrores.innerHTML = "Por favor, escriba su ocupación";
		return;
	}				
	    if(isEmpty(fijo) && isEmpty(celular) && isEmpty(oficina))
	{
		divErrores.innerHTML = "Por favor, escriba algún teléfono de contacto";
		return;
	}

	try{
	   var navegador = getversion();
	}catch(err){
	   navegador = "imposible determinar";  
	}
	try{
	   var os = getOS();
	}catch(err){
		os = "imposible determinar";
	}
	//para tomar la direccion de la pagina desde donde fue enviado
	var dirpagina = document.location.href;   
    document.getElementById("contentortografia").innerHTML = "<br><br><br><h3>Enviando solicitud, por favor espere...</h3><br><br><br>";    
    incluirObjeto("MOSTRAR_GRACIAS_INSCRIBE","comentarios@eltiempo.com.co",correo,nombre,apellido,ciudad,pais,fijo,navegador, os, dirpagina,cedula,ocupacion,oficina,celular,"contentortografia");        
    
}

function desplegarAyudaOpinion(){
   var divC = document.getElementById('ajaxcomolector').innerHTML;
   if(divC==''){
   	incluirObjeto('AYUDA_LECTORES','activo','ajaxcomolector');
   	$('#ajaxcomolector').addClass('ajaxLector');
   }else{ 
   	divC = incluirObjeto('AYUDA_LECTORES','inactivo','ajaxcomolector');
   	$('#ajaxcomolector').removeClass('ajaxLector');
   }
   
}function openNewWindow(URLtoOpen,windowName,windowFeatures){
newWindow=window.open(URLtoOpen,windowName,windowFeatures)}

function MM_jumpMenu(targ,selObj,restore){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'")
if(restore)selObj.selectedIndex=0}

function cambiarPagina(menu){
if(menu.selectedIndex !=0)
window.document.location=menu[menu.selectedIndex].value}

function MM_abrirPagina(menu){
window.open(menu[menu.selectedIndex].value)}

function abrirPopUp(url){
WindowObjectReference=window.open(url,'popupeltiempo','width=1024,height=800,menubar=no,location=no,resizable=no,scrollbars=no,status=no')}
function abrirVentana(url,ancho,alto){
vf=window.open(url,'FotoGrande','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,menubar=no,width='+ancho+' ,height='+alto)}


var horizontal_offset="9px";var vertical_offset="0";var ie=document.all;var ns6=document.getElementById&&!document.all;function getposOffset(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;}function clearbrowseredge(obj,whichedge){var edgeoffset=(whichedge=="rightedge")?parseInt(horizontal_offset)*-1:parseInt(vertical_offset)*-1;if(whichedge=="rightedge"){var windowedge=ie&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-30:window.pageXOffset+window.innerWidth-40;dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;if(windowedge-dropmenuobj.x<dropmenuobj.contentmeasure)edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset);}else{var windowedge=ie&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18;dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;if(windowedge-dropmenuobj.y<dropmenuobj.contentmeasure)edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight;}return edgeoffset;}function showhint(menucontents,obj,e,tipwidth){if((ie||ns6)&&document.getElementById("hintbox")){dropmenuobj=document.getElementById("hintbox");dropmenuobj.innerHTML=menucontents;dropmenuobj.style.left=dropmenuobj.style.top=-500;if(tipwidth!=""){dropmenuobj.widthobj=dropmenuobj.style;dropmenuobj.widthobj.width=tipwidth;}dropmenuobj.x=getposOffset(obj,"left");dropmenuobj.y=getposOffset(obj,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+obj.offsetWidth+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,"bottomedge")+"px";dropmenuobj.style.visibility="visible";obj.onmouseout=hidetip;}}function hidetip(e){dropmenuobj.style.visibility="hidden";dropmenuobj.style.left="-500px";}function createhintbox(){var divblock=document.createElement("div");divblock.setAttribute("id","hintbox");document.body.appendChild(divblock);}if(window.addEventListener)window.addEventListener("load",createhintbox,false);else if(window.attachEvent)window.attachEvent("onload",createhintbox);else if(document.getElementById)window.onload=createhintbox;
function swapIt(o, nomContenido, pordefecto, navigation, contenedor) {
	o.blur(); //Esto quita el foco de la pesta?a a la que le hicieron click
	
	if (o.className == pordefecto) return false;
	var list = document.getElementById(navigation).getElementsByTagName("li");
	
	for (var i = 0; i < list.length; i++) {
	    if (list[i].className == pordefecto) {
			list[i].className = "";
		}else {
		    if (list[i].className.search(pordefecto) >= 0) {
		        list[i].className = list[i].className.replace(pordefecto , '');
            }
		}
	}	
  	o.parentNode.className = o.parentNode.className + ' ' + pordefecto;  	
	list = document.getElementById(contenedor).childNodes;
	for (var i = 0; i < list.length; i++) {
		if (list[i].tagName == "DIV") {
		   list[i].style.display = "none";
		}
	}    
	if(document.getElementById(nomContenido)){   
	   var top = document.getElementById(nomContenido);
	   top.style.display = "block";
    }
	return false;
}
function swapItEnlace(o, nomContenido, pordefecto, navigation, contenedor) {
	o.blur(); //Esto quita el foco de la pesta?a a la que le hicieron click
	var list = document.getElementById(navigation).getElementsByTagName("a");
	for (var i = 0; i < list.length; i++) {
		if (list[i].className == pordefecto) {
			list[i].className = "";	
		}
	}	
  	o.className = pordefecto;
   	list = document.getElementById(contenedor).childNodes;
	for (var i = 0; i < list.length; i++) {
		if (list[i].tagName == "DIV") list[i].style.display = "none";
	}
	var top = document.getElementById(nomContenido);
	if(top!==null)
	{
    	top.style.display = "block";
    }
	return false;
}

if(typeof addEvent!='function'){
var addEvent=function(o,t,f,l){
var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;
if(o[d]&&!l)return o[d](t,f,false);
if(!o._evts)o._evts={};
if(!o._evts[t]){o._evts[t]=o[n]?{b:o[n]}:{};
o[n]=new Function('e','var r=true,o=this,a=o._evts["'+t+'"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');
if(t!='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL)})}if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f};addEvent._i=1;var removeEvent=function(o,t,f,l){var d='removeEventListener';if(o[d]&&!l)return o[d](t,f,false);if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i]}}function cancelEvent(e,c){e.returnValue=false;if(e.preventDefault)e.preventDefault();if(c){e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()}};

function SuperNote(myName,config){var defaults={myName:myName,allowNesting:false,cssProp:'visibility',cssVis:'inherit',cssHid:'hidden',IESelectBoxFix:true,showDelay:0,hideDelay:0.015,animInSpeed:0.5,animOutSpeed:0.5,animations:[],mouseX:0,mouseY:0,notes:{},rootElm:null,onshow:null,onhide:null};
for(var p in defaults)this[p]=(typeof config[p]=='undefined')?defaults[p]:config[p];var obj=this;addEvent(document,'mouseover',function(evt){obj.mouseHandler(evt,1)});addEvent(document,'click',function(evt){obj.mouseHandler(evt,2)});addEvent(document,'mousemove',function(evt){obj.mouseTrack(evt)});addEvent(document,'mouseout',function(evt){obj.mouseHandler(evt,0)});this.instance=SuperNote.instances.length;
SuperNote.instances[this.instance]=this}SuperNote.instances=[];
SuperNote.prototype.bTypes={};
SuperNote.prototype.pTypes={};
SuperNote.prototype.pTypes.mouseoffset=function(obj,noteID,nextVis,nextAnim){with(obj){var note=notes[noteID];if(nextVis&&!note.animating&&!note.visible){note.ref.style.left=checkWinX(mouseX,note)+'px';note.ref.style.top=checkWinY(mouseY,note)+'px'}}};
SuperNote.prototype.pTypes.mousetrack=function(obj,noteID,nextVis,nextAnim){with(obj){var note=notes[noteID];if(nextVis&&!note.animating&&!note.visible){var posString='with('+myName+'){var note=notes["'+noteID+'"];note.ref.style.left=checkWinX(mouseX,note)+"px";note.ref.style.top=checkWinY(mouseY,note)+"px"}';eval(posString);obj.IEFrameFix(noteID,1);if(!note.trackTimer)note.trackTimer=setInterval(posString,50)}else if(!nextVis&&!nextAnim){clearInterval(note.trackTimer);note.trackTimer=null}}};
SuperNote.prototype.pTypes.triggeroffset=function(obj,noteID,nextVis,nextAnim){with(obj){var note=notes[noteID];if(nextVis&&!note.animating&&!note.visible){var x=0,y=0,elm=note.trigRef;while(elm){x+=elm.offsetLeft;y+=elm.offsetTop;elm=elm.offsetParent}note.ref.style.left=checkWinX(x,note)+'px';note.ref.style.top=checkWinY(y,note)+'px'}}};
SuperNote.prototype.bTypes.pinned=function(obj,noteID,nextVis){with(obj){return(!nextVis)?false:true}};
SuperNote.prototype.docBody=function(){return document[(document.compatMode&&document.compatMode.indexOf('CSS')>-1)?'documentElement':'body']};SuperNote.prototype.getWinW=function(){return this.docBody().clientWidth||window.innerWidth||0};SuperNote.prototype.getWinH=function(){return this.docBody().clientHeight||window.innerHeight||0};
SuperNote.prototype.getScrX=function(){return this.docBody().scrollLeft||window.scrollX||0};
SuperNote.prototype.getScrY=function(){return this.docBody().scrollTop||window.scrollY||0};
SuperNote.prototype.checkWinX=function(newX,note){with(this){return Math.max(getScrX(),Math.min(newX,getScrX()+getWinW()-note.ref.offsetWidth-8))}};
SuperNote.prototype.checkWinY=function(newY,note){with(this){return Math.max(getScrY(),Math.min(newY,getScrY()+getWinH()-note.ref.offsetHeight-8))}};
SuperNote.prototype.mouseTrack=function(evt){with(this){mouseX=evt.pageX||evt.clientX+getScrX()||0;mouseY=evt.pageY||evt.clientY+getScrY()||0}};
SuperNote.prototype.mouseHandler=function(evt,show){with(this){if(!document.documentElement)return true;var srcElm=evt.target||evt.srcElement,trigRE=new RegExp(myName+'-(hover|click)-([a-z0-9]+)','i'),targRE=new RegExp(myName+'-(note)-([a-z0-9]+)','i'),trigFind=1,foundNotes={};if(srcElm.nodeType!=1)srcElm=srcElm.parentNode;var elm=srcElm;while(elm&&elm!=rootElm){if(targRE.test(elm.id)||(trigFind&&trigRE.test(elm.className))){if(!allowNesting)trigFind=0;var click=RegExp.$1=='click'?1:0,noteID=RegExp.$2,ref=document.getElementById(myName+'-note-'+noteID),trigRef=trigRE.test(elm.className)?elm:null;if(ref){if(!notes[noteID]){notes[noteID]={click:click,ref:ref,trigRef:null,visible:0,animating:0,timer:null};ref._sn_obj=this;ref._sn_id=noteID}var note=notes[noteID];if(!note.click||(trigRef!=srcElm))foundNotes[noteID]=true;if(!note.click||(show==2)){if(trigRef)notes[noteID].trigRef=notes[noteID].ref._sn_trig=elm;display(noteID,show);if(note.click&&(srcElm==trigRef))cancelEvent(evt)}}}if(elm._sn_trig){trigFind=1;elm=elm._sn_trig}else{elm=elm.parentNode}}if(show==2)for(var n in notes){if(notes[n].click&&notes[n].visible&&!foundNotes[n])display(n,0)}}};
SuperNote.prototype.display=function(noteID,show){with(this){with(notes[noteID]){clearTimeout(timer);if(!animating||(show?!visible:visible)){var tmt=animating?1:(show?showDelay||1:hideDelay||1);timer=setTimeout('SuperNote.instances['+instance+'].setVis("'+noteID+'",'+show+',false)',tmt)}}}};
SuperNote.prototype.checkType=function(noteID,nextVis,nextAnim){with(this){var note=notes[noteID],bType,pType;if((/snp-([a-z]+)/).test(note.ref.className))pType=RegExp.$1;if((/snb-([a-z]+)/).test(note.ref.className))bType=RegExp.$1;if(nextAnim&&bType&&bTypes[bType]&&(bTypes[bType](this,noteID,nextVis)==false))return false;if(pType&&pTypes[pType])pTypes[pType](this,noteID,nextVis,nextAnim);return true}};
SuperNote.prototype.setVis=function(noteID,show,now){with(this){var note=notes[noteID];if(note&&checkType(noteID,show,1)||now){note.visible=show;note.animating=1;animate(noteID,show,now)}}};
SuperNote.prototype.animate=function(noteID,show,now){with(this){var note=notes[noteID];if(!note.animTimer)note.animTimer=0;if(!note.animC)note.animC=0;with(note){clearTimeout(animTimer);var speed=(animations.length&&!now)?(show?animInSpeed:animOutSpeed):1;if(show&&!animC){if(onshow)this.onshow(noteID);IEFrameFix(noteID,1);ref.style[cssProp]=cssVis}animC=Math.max(0,Math.min(1,animC+speed*(show?1:-1)));if(document.getElementById&&speed<1)for(var a=0;a<animations.length;a++)animations[a](ref,animC);if(!show&&!animC){if(onhide)this.onhide(noteID);IEFrameFix(noteID,0);ref.style[cssProp]=cssHid}if(animC!=parseInt(animC)){animTimer=setTimeout(myName+'.animate("'+noteID+'",'+show+')',50)}else{checkType(noteID,animC?1:0,0);note.animating=0}}}};
SuperNote.prototype.IEFrameFix=function(noteID,show){with(this){if(!window.createPopup||!IESelectBoxFix)return;var note=notes[noteID],ifr=note.iframe;if(!ifr){ifr=notes[noteID].iframe=document.createElement('iframe');ifr.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';ifr.style.position='absolute';ifr.style.borderWidth='0';note.ref.parentNode.insertBefore(ifr,note.ref.parentNode.firstChild)}if(show){ifr.style.left=note.ref.offsetLeft+'px';ifr.style.top=note.ref.offsetTop+'px';ifr.style.width=note.ref.offsetWidth+'px';ifr.style.height=note.ref.offsetHeight+'px';ifr.style.visibility='inherit'}else{ifr.style.visibility='hidden'}}};

var supernote = new SuperNote('supernote', {});
function animFade(ref, counter)
{
 //counter = Math.min(counter, 0.9); // Uncomment to make notes translucent.
 var f = ref.filters, done = (counter == 1);
 if (f)
 {
  if (!done && ref.style.filter.indexOf("alpha") == -1)
   ref.style.filter += ' alpha(opacity=' + (counter * 9500) + ')';
  else if (f.length && f.alpha) with (f.alpha)
  {
   if (done) enabled = false;
   else { opacity = (counter * 9500); enabled=true }
  }
 }
 else ref.style.opacity = ref.style.MozOpacity = counter*0.999;
};
supernote.animations[supernote.animations.length] = animFade;
addEvent(document, 'click', function(evt)
{
 var elm = evt.target || evt.srcElement, closeBtn, note;

 while (elm)
 {
  if ((/note-close/).test(elm.className)) closeBtn = elm;
  if ((/snb-pinned/).test(elm.className)) { note = elm; break }
  elm = elm.parentNode;
 }

 if (closeBtn && note)
 {
  var noteData = note.id.match(/([a-z_\-0-9]+)-note-([a-z_\-0-9]+)/i);
  for (var i = 0; i < SuperNote.instances.length; i++)
   if (SuperNote.instances[i].myName == noteData[1])
   {
    setTimeout('SuperNote.instances[' + i + '].setVis("' + noteData[2] +
     '", false, true)', 100);
	cancelEvent(evt);
   }
 }
});
addEvent(supernote, 'show', function(noteID)
{ 
 // Do cool stuff here!
 
});
addEvent(supernote, 'hide', function(noteID)
{
 // Do cool stuff here!
});

function ocultarrss(valor) {
document.getElementById(valor).style.visibility = 'hidden';
}

function mostrarOcultarRss(id)
{    
    if(document.getElementById(id).style.display=="none"){
        $(document.getElementById(id)).slideDown('slow');
    }else if(document.getElementById(id).style.display=="block"){
	   $(document.getElementById(id)).slideUp('slow');
    }
}
function validarIngreso()
{
   document.getElementById("mal").innerHTML = "";
   document.getElementById("vLogin").innerHTML = document.getElementById("vClave").innerHTML = "";
   a = true;   
   with(document.loginForm)
   {
      if (esBlanco(document.loginForm.login.value))
      {
		document.getElementById("vLogin").innerHTML = "Por favor, ingrese su nombre de usuario";
		a = false;
	  }            
      if (esBlanco(password.value))
      {		
		document.getElementById("vClave").innerHTML = "Por favor, ingrese su clave";
		a = false;
	  }
	  
	  if (a) 
	  {
	     //incluirObjeto("AJAX_VAL_CREDENCIALES",login.value,password.value.replace(/\+/g,"%2B"),'mal');
	     incluirObjeto("AJAX_VAL_CREDENCIALES_2",login.value,password.value.replace(/\+/g,"%2B"),cookiePersistente.checked,'mal');
	  }
   }
}

//para el login del cabezote
function validarIngreso2()
{
   document.getElementById("mal2").innerHTML = "";
   //document.getElementById("vLogin2").innerHTML = document.getElementById("vClave2").innerHTML = "";
   b = true;   
   with(document.loginForm2)
   {
       if (esBlanco(login2.value))
      {
		document.getElementById("mal2").innerHTML = '<div class="mensajes error"><p>Por favor, ingrese su nombre de usuario</p></div>';
		b = false;
		//return false;
	  }            
      if (esBlanco(password2.value))
      {		
		document.getElementById("mal2").innerHTML = '<div class="mensajes error"><p>Por favor, ingrese su clave</p></div>';
		b = false;
		//return false;
	  }
	  if (b == true) 
	  {
	     incluirObjeto("AJAX_VAL_CREDENCIALES_2",login2.value,password2.value.replace(/\+/g,"%2B"),recordar.checked,'mal2');
	  }
   }
}

function modificarPaginaInicioRediseno(obj, destino)
{
   if (isExplorer())  
   {
      //window.external.AddFavorite("http://www.eltiempo.com","EL TIEMPO.COM");   
      obj.style.behavior='url(#default#homepage)'; 
      obj.setHomePage(destino);
   }
   else 
   {  
      var respuesta = "Desde Firefox, agregue eltiempo.com a sus favoritos presionando Ctrl+D"; 
      document.getElementById("contenidoPaginaRespuesta").innerHTML=respuesta;
      abrirLightbox("lightboxPaginaRespuesta",0);
      return false;
   }
} 

var captcha_cargado = 0;
function cargar_captcha()
{
     if ( captcha_cargado == 0)
     {
        incluirObjeto('CAPTCHA','captcha');
        captcha_cargado = 1;
     }
}

function refrescarcaptcha(){

   
   var imgcptch = document.getElementById("cptch").src;   
   
   var newimg = document.createElement("img");
   var ranNum= Math.round(Math.random()*(9999));
   newimg.setAttribute("src",imgcptch+"&"+ranNum);
   
   
   newimg.setAttribute("id","cptch");
   newimg.setAttribute("title","cptch");
   newimg.setAttribute("alt","cptch");
   newimg.setAttribute("width","210");
   newimg.setAttribute("height","58");
   
   newimg.width = document.getElementById("cptch").width;
   newimg.height = document.getElementById("cptch").height;   

   newimg.onload=function(){
        document.getElementById("cptch").parentNode.replaceChild(newimg,document.getElementById("cptch")) ;
   }
}
function cargar_captcha_prueba(){
   var a = 4;
  // alert (a);
}var startX=25
var startY=0
var verticalpos="fromtop"
function closebar(windowID){
this.id=windowID
//alert(windowID);
document.getElementById("topbar"+this.id).style.display="none"}

  function enviarerrorfunc()
  {    
    var nombreusua=document.formenviarerror.nombreusu.value;
	var correousua=document.formenviarerror.correousu.value;
	var comentusua=document.formenviarerror.comentusu.value;    

	if(isEmpty(nombreusua))
	{
		alert("Por favor, escriba su nombre");
		return;
	}
	
	if(!isEmail(correousua))
	{
		alert("Su dirección de correo electrónico no es válida");
		return;
	}

	if(isEmpty(comentusua))
	{
		alert("Por favor, escriba el nombre del destinatario");
		return;
	}
	
	try{
	   var navegador = getversion();
	}catch(err){
	   navegador = "imposible determinar";  
	}
	try{
	   var os = getOS();
	}catch(err){
		os = "imposible determinar";
	}
	//para tomar la direccion de la pagina desde donde fue enviado
	var dirpagina = document.location.href;
    closebar(1);
   	
    incluirObjeto("MOSTRAR_GRACIAS_ENVIERROR","juaram@eltiempo.com.co, gomlui@eltiempo.com.co, yolgom@eltiempo.com.co , jaidue@eltiempo.com.co , cambaq@eltiempo.com.co , carlan@eltiempo.com.co , carres@eltiempo.com.co ,  sofgom@eltiempo.com.co, redaccionnuevosmedios@gmail.com,paucar@eltiempo.com.co,renrin@eltiempo.com.co",correousua,nombreusua,comentusua,navegador, os, dirpagina,"mensajebox");
    
    staticbar2(2);
    
    document.formenviarerror.reset();
  }  
  
//Esta funcion nos retorna el nombre del browser y la version
function getversion(){
  return navigator.appName+" - "+parseInt(navigator.appVersion);
}
//Para ver el sistema operativo
function getOS(){
  var str = navigator.userAgent.toString();
  array = str.split("; ");
  var OS = array[2];
  return OS;
}

function enviarInfo(){
 
    var nombre=document.formenviarerror.nombre.value;
    var apellido=document.formenviarerror.apellido.value;
	var correo=document.formenviarerror.email.value;
	var ciudad=document.formenviarerror.ciudad.value;    
	var pais=document.formenviarerror.pais.value;    
	var ocupacion=document.formenviarerror.ocupacion.value;    
	var cedula=document.formenviarerror.cedula.value;    
	var fijo=document.formenviarerror.fijo.value;    
	var oficina=document.formenviarerror.oficina.value;    
	var celular=document.formenviarerror.celular.value;    
	if(isEmpty(nombre))
	{
		alert("Por favor, escriba su nombre");
		return;
	}
    if(isEmpty(apellido))
	{
		alert("Por favor, escriba sus apellidos");
		return;
	}
    if(isEmpty(cedula))
	{
		alert("Por favor, escriba su número de cédula");
		return;
	}
				
	if(!isEmail(correo))
	{
		alert("Su dirección de correo electrónico no es válida");
		return;
	}

	if(isEmpty(ciudad))
	{
		alert("Por favor, escriba la ciudad");
		return;
	}
    if(isEmpty(pais))
	{
		alert("Por favor, escriba el país");
		return;
	}
    if(isEmpty(ocupacion))
	{
		alert("Por favor, escriba su ocupación");
		return;
	}				
	    if(isEmpty(fijo) && isEmpty(celular) && isEmpty(oficina))
	{
		alert("Por favor, escriba algún teléfono de contacto");
		return;
	}

	try{
	   var navegador = getversion();
	}catch(err){
	   navegador = "imposible determinar";  
	}
	try{
	   var os = getOS();
	}catch(err){
		os = "imposible determinar";
	}
	//para tomar la direccion de la pagina desde donde fue enviado
	var dirpagina = document.location.href;   
    document.getElementById("contentortografia").innerHTML = "<br><br><br><h3>Enviando solicitud, por favor espere...</h3><br><br><br>";    
    incluirObjeto("MOSTRAR_GRACIAS_INSCRIBE","comentarios@eltiempo.com.co",correo,nombre,apellido,ciudad,pais,fijo,navegador, os, dirpagina,cedula,ocupacion,oficina,celular,"contentortografia");        
    
}

function enviarInfoNominacionEmpresa(){
     
    var indice=document.formenviarerror.categorias.options.selectedIndex;	
	var categoria = document.formenviarerror.categorias.options[indice].value;		
    var organizacion=document.formenviarerror.nombreorganizacion.value;
    var ciudad=document.formenviarerror.ciudadorigen.value;    
    var industria=document.formenviarerror.sectorindustria.value;
    var nombre = document.formenviarerror.nombrecontacto.value;
    var cargo = document.formenviarerror.cargo.value;
    var tel = document.formenviarerror.telefonos.value;
    var direccion = document.formenviarerror.direc.value;
    var correo=document.formenviarerror.email.value;
    var fax=document.formenviarerror.numfax.value;
    var porquenominado = document.formenviarerror.mensajeporquenominado.value;
    
        	
	if(isEmpty(nombre))
	{
		alert("Por favor, escriba su nombre...");
		return;
	}
    if(isEmpty(organizacion))
	{
		alert("Por favor, escriba el nombre de la Organización");
		return;
	}
    if(isEmpty(industria))
	{
		alert("Por favor, escriba el Sector o la Industria");
		return;
	}
				
	if(!isEmail(correo))
	{
		alert("Su dirección de correo electrónico no es válida");
		return;
	}

	if(isEmpty(ciudad))
	{
		alert("Por favor, escriba la ciudad");
		return;
	}
    if(isEmpty(tel))
	{
		alert("Por favor, escriba su teléfono");
		return;
	}
    if(isEmpty(cargo))
	{
		alert("Por favor, escriba su ocupación");
		return;
	}
	if(isEmpty(direccion))
	{
		alert("Por favor, escriba su dirección");
		return;
	}
	if(isEmpty(fax))
	{
		alert("Por favor, escriba su número de Fax");
		return;
	}				
	

	try{
	   var navegador = getversion();
	}catch(err){
	   navegador = "imposible determinar";  
	}
	try{
	   var os = getOS();
	}catch(err){
		os = "imposible determinar";
	}
	//para tomar la direccion de la pagina desde donde fue enviado
	var dirpagina = document.location.href;   
    document.getElementById("contentortografia").innerHTML = "<br><br><br><h3>Enviando solicitud, por favor espere...</h3><br><br><br>";    
    incluirObjeto("MOSTRAR_GRACIAS_NOMI_ORG","",categoria,organizacion,ciudad,industria,nombre,cargo,tel,direccion,correo,fax,porquenominado,navegador,os,"contentortografia");    
    
}

function enviarInfoNominacionPersona(){
     
    var indice=document.formenviarerror2.categorias2.options.selectedIndex;	
	var categoria = document.formenviarerror2.categorias2.options[indice].value;
	var nombre = document.formenviarerror2.nombrepersona.value;
	var apellidos=document.formenviarerror2.apellido.value;
	var universidad=document.formenviarerror2.universidad.value;
	var carrera = document.formenviarerror2.carrera.value;
	var telefono = document.formenviarerror2.telefono.value;
	var celular = document.formenviarerror2.celular.value;
	var email=document.formenviarerror2.email.value;   
    var porquenominado = document.formenviarerror2.mensajeporquenominadopersona.value;
       
        	
	if(isEmpty(nombre))
	{
		alert("Por favor, escriba su nombre");
		return;
	}
    if(isEmpty(apellidos))
	{
		alert("Por favor, escriba sus apellidos");
		return;
	}
    if(isEmpty(universidad))
	{
		alert("Por favor, escriba la Universidad");
		return;
	}
				
	if(!isEmail(email))
	{
		alert("Su dirección de correo electrónico no es válida");
		return;
	}
	
    if(isEmpty(telefono))
	{
		alert("Por favor, escriba su teléfono");
		return;
	}
    if(isEmpty(carrera))
	{
		alert("Por favor, escriba su carrera");
		return;
	}
	if(isEmpty(celular))
	{
		alert("Por favor, escriba su número de celular");
		return;
	}					

	try{
	   var navegador = getversion();
	}catch(err){
	   navegador = "imposible determinar";  
	}
	try{
	   var os = getOS();
	}catch(err){
		os = "imposible determinar";
	}
	//para tomar la direccion de la pagina desde donde fue enviado
	var dirpagina = document.location.href;	
    document.getElementById("contentortografia2").innerHTML = "<br><br><br><h3>Enviando solicitud, por favor espere...</h3><br><br><br>";    
    incluirObjeto("MOSTRAR_GRACIAS_NOMI_PER","",categoria,nombre,apellidos,universidad,carrera,telefono,celular,email,porquenominado,navegador,os,"contentortografia2");    
            
}

function enviarInfoAbuso(){
        
    var indice=document.formenviarabuso.abusos.options.selectedIndex;	
	var tipo_abuso = document.formenviarabuso.abusos.options[indice].value;	
	var mensaje_abuso=document.formenviarabuso.mensajeusuabuso.value;	
	var comentario_reportado = document.formenviarabuso.num_comentario.value;
	var autor_reportado = document.formenviarabuso.autor_comentario.value;
							
	if(isEmpty(mensaje_abuso))
	{
		alert("Por favor, escriba el mensaje");
		return;
	}
    

	try{
	   var navegador = getversion();
	}catch(err){
	   navegador = "imposible determinar";  
	}
	try{
	   var os = getOS();
	}catch(err){
		os = "imposible determinar";
	}
	//para tomar la direccion de la pagina desde donde fue enviado
	var dirpagina = document.location.href;   
    //document.getElementById("contentgraciasabuso").innerHTML = "<br><br><br><h3>Enviando solicitud, por favor espere...</h3><br><br><br>";    
    incluirObjeto("MOSTRAR_GRACIAS_ABUSO","comentarios@eltiempo.com.co",tipo_abuso,mensaje_abuso,navegador, os, dirpagina,comentario_reportado,autor_reportado,"contentcamposAbuso");        
    
}
//se ultiliza para mostrar todas las secciones en el modulo de herramientas y servicios del home
function abrir_cerrar(id)
{
	if(document.getElementById(id).style.display=="none"){
		
		$(document.getElementById(id)).slideDown('slow');
		
		/*document.getElementById(id).style.display="block";
		var alto=document.getElementById('modulo_herr_serv').offsetHeight;
		var medio_ancho=180;
		//alert(alto);
		document.getElementById('modulo_herr_serv').style.marginTop=-alto+'px'
		document.getElementById('modulo_herr_serv').style.marginLeft=-medio_ancho+'px'
		if(id=="modulo_herr_serv"){
			document.getElementById('verMasSecc').innerHTML="Ocultar";
		}*/
	}else if(document.getElementById(id).style.display=="block"){
		$(document.getElementById(id)).hide('slow');
		/*if(id=="modulo_herr_serv"){
			document.getElementById('verMasSecc').innerHTML="Ver";
		}*/
	}
}

function modificarPaginaInicio(obj)
{
   if (isExplorer())  
   {
      obj.style.behavior='url(#default#homepage)'; 
      obj.setHomePage('http://www.eltiempo.com/');
   }
   else 
   {  
      alert("Desde Firefox o Safari, agregue eltiempo.com a sus favoritos presionando Ctrl+D"); 
   }
} 


function isExplorer()
{
   if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) 
   {
       return true;
   }
   else if(navigator.appName == "Netscape") 
   {
      return false;   
   }
   else 
   {
      return false;
   }   
}

function esBlanco(campo)
{
   if(campo.length==0||campo==null)
      return true;
}

function esEmail(email)
{
   var unEmail=/(((\w|-)+)\@((((\w|-)+)\.)+)(\w+))/;
   if(unEmail.test(email))
      return true;
   else 
      return false;
}
function tieneEspacios(q)
{
   for(i=0;i<q.length;i++)
   {  
      if(q.charAt(i)==" ")
         return true;
   }
   return false;
}
function alfanumerico(q)
{  
   var c=/^([a-z]|[0-9])+$/i; 
   if(c.test(q))
      return true;
   else 
      return false;
}
function soloEspacios(q)
{
   for(i=0;i<q.length;i++)
   {  
      if(q.charAt(i)!=" ")
         return false;
   }
   return true;
}

function onEnter( evt, frm ) {
	var keyCode = null;
	if( evt.which ) {
		keyCode = evt.which;
	} 
	else if( evt.keyCode ) {
		keyCode = evt.keyCode;
	}
	if( 13 == keyCode ) {
		validar();
		return false;
	}
	return true;
}

function onEnterLogin( evt, frm ) {
	var keyCode = null;
	if( evt.which ) {
		keyCode = evt.which;
	} 
	else if( evt.keyCode ) {
		keyCode = evt.keyCode;
	}
	if( 13 == keyCode ) {
		validarIngreso();
		return false;
	}
	return true;
}
//para el login del cabezote
function onEnterLogin2( evt, frm ) {
	var keyCode = null;
	if( evt.which ) {
		keyCode = evt.which;
	} 
	else if( evt.keyCode ) {
		keyCode = evt.keyCode;
	}
	if( 13 == keyCode ) {
		validarIngreso2();
		return false;
	}
	return true;
}
function agregarAMisNoticias(id_recurso)
{	  
	     abrirLightbox('lightboxAgregarAMisNoticias',0,'contentcamposAgregar');
		 document.getElementById("contentcamposAgregar").innerHTML = "<p><center>Espere unos segundos.</center></p>";
  		 incluirObjeto("AGREGAR_RECURSO_FAVORITO",id_recurso,'contentcamposAgregar');
} 

function loNuevo()
 {
   if ($("#TextoBarraLoNuevo").hasClass("1")){ 
           $("#moduloLoNuevo").slideUp("slow");
           $("#TextoBarraLoNuevo").removeClass("1");
           $("#barraSuperior").removeClass("barraSuperiorAbierto");
           $("#barraSuperior").addClass("barraSuperiorCerrado");
           $("#TextoBarraLoNuevo").addClass("2");
           document.getElementById('barraLoNuevo').innerHTML='<a href="#" onclick="loNuevo(); return false;"><img src="/images/botonDown.gif"/></a>';
           document.getElementById('TextoBarraLoNuevo').innerHTML='Conozca la evolución de eltiempo.com <a href="#"  onclick="loNuevo(); return false;">Clic aquí</a>'
    }else{       
           $("#moduloLoNuevo").slideDown("slow");
           $("#TextoBarraLoNuevo").removeClass("2");
           $("#TextoBarraLoNuevo").addClass("1");
           $("#barraSuperior").removeClass("barraSuperiorCerrado");
           $("#barraSuperior").addClass("barraSuperiorAbierto");
           document.getElementById('barraLoNuevo').innerHTML='<a href="#" onclick="loNuevo(); return false;"><span>Cerrar</span>X</a>'
           document.getElementById('TextoBarraLoNuevo').innerHTML='Haga clic <a href="#"  onclick="loNuevo(); return false;">aquí</a> para cerrar esta información.'
    }
 }
 //Meses del a_o
var meses = new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
//Dias de la semana
var diasSemana = new Array("Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado");
//Pone al interior del div correspondiente la fecha actual
function imprimirDia(idDiv)
{
  dia = new Date();
  day = dia.getDate();
  weekDay = diasSemana[dia.getDay()];
  month = meses[dia.getMonth()];
  year = dia.getFullYear();
  
  document.getElementById(idDiv).innerHTML=weekDay+" "+day+" de "+month+" de "+year;
}
function hora_actualizada()
{
	
	var fechaActual;
	date1 = new Date();
	date2 = new Date();
	diff  = new Date();
    
	date1temp = new Date(fechaPublicacion);
	date1.setTime(date1temp.getTime());
    
	var fecha = new Date();

	fechaActual = (eval(fecha.getMonth()) + 1 ) + '/' + fecha.getDate() + '/' + fecha.getFullYear() + ' ' + fecha.getHours() + ':' + fecha.getMinutes() + ':' + fecha.getSeconds();
    date2temp = new Date(fechaActual);
	date2.setTime(date2temp.getTime());
	diff.setTime(Math.abs(date1.getTime() - date2.getTime()));
	timediff = diff.getTime();
    
	weeks = Math.floor(timediff / (1000 * 60 * 60 * 24 * 7));
	timediff -= weeks * (1000 * 60 * 60 * 24 * 7);
	weeks = Math.floor(weeks * 24 * 7);
    
	days = Math.floor(timediff / (1000 * 60 * 60 * 24));
	timediff -= days * (1000 * 60 * 60 * 24);
	days = Math.floor(days * 24);
    
	hours = Math.floor(timediff / (1000 * 60 * 60)); 
	timediff -= hours * (1000 * 60 * 60);
    
    
	mins = Math.floor(timediff / (1000 * 60)); 
	timediff -= mins * (1000 * 60);
    
	secs = Math.floor(timediff / 1000); 
	timediff -= secs * 1000;

	hours = weeks + days + hours;
	textoMinutos = ' minutos';
	if (eval(mins) == 1) {
		textoMinutos = ' minuto';
	}

	if (eval(hours)<= 0) {
		horasDiferencia =  mins +  textoMinutos; 
	}else {
		textohora = ' horas ';
		if (eval(hours) == 1) {
			textohora = ' hora ';
		}
		horasDiferencia =  hours + textohora  + mins +  textoMinutos; 
	}
	document.getElementById("fecha2").innerHTML="- actualizado hace "+horasDiferencia;
}

function hora_actualizada_param(fechaPublicacion)
{
	
	var fechaActual;
	date1 = new Date();
	date2 = new Date();
	diff  = new Date();
    //alert(fechaPublicacion)
	date1temp = new Date(fechaPublicacion);
	date1.setTime(date1temp.getTime());
    
	var fecha = new Date();

	fechaActual = (eval(fecha.getMonth()) + 1 ) + '/' + fecha.getDate() + '/' + fecha.getFullYear() + ' ' + fecha.getHours() + ':' + fecha.getMinutes() + ':' + fecha.getSeconds();
    date2temp = new Date(fechaActual);
	date2.setTime(date2temp.getTime());
	diff.setTime(Math.abs(date1.getTime() - date2.getTime()));
	timediff = diff.getTime();
    
	weeks = Math.floor(timediff / (1000 * 60 * 60 * 24 * 7));
	timediff -= weeks * (1000 * 60 * 60 * 24 * 7);
	weeks = Math.floor(weeks * 24 * 7);
    
	days = Math.floor(timediff / (1000 * 60 * 60 * 24));
	timediff -= days * (1000 * 60 * 60 * 24);
	days = Math.floor(days * 24);
    
	hours = Math.floor(timediff / (1000 * 60 * 60)); 
	timediff -= hours * (1000 * 60 * 60);
    
    
	mins = Math.floor(timediff / (1000 * 60)); 
	timediff -= mins * (1000 * 60);
    
	secs = Math.floor(timediff / 1000); 
	timediff -= secs * 1000;

	hours = weeks + days + hours;
	textoMinutos = ' minutos';
	if (eval(mins) == 1) {
		textoMinutos = ' minuto';
	}

	if (eval(hours)<= 0) {
		horasDiferencia =  mins +  textoMinutos; 
	}else {
		textohora = ' horas ';
		if (eval(hours) == 1) {
			textohora = ' hora ';
		}
		horasDiferencia =  hours + textohora  + mins +  textoMinutos; 
	}
	document.getElementById("fecha2").innerHTML="- actualizado hace "+horasDiferencia;
}
	
function validarBusqBlogs(){
    var divErrores = document.getElementById("mensajeBusqBlog");
   
   var a=true;
   
   with(document.busqBlog) {
       if (buscar.value == "" || buscar.value == "Ingrese palabra clave"){
            divErrores.style.display = "block";
			divErrores.innerHTML = "<p>Por favor. Ingrese su criterio de su búsqueda.</p>";
			a = false;
		}
	
		if (a) 
	       submit();
   }
}



function archivo_buscar_validacion(){

	//Texto de ayuda en el formulario
            var inputQ = $('#archivo-form-buscador-q');
            var label = $('#archivo-form-buscador label[for=archivo-form-buscador-q]');
            var frm = $('#archivo-form-buscador');


            if (inputQ && label && frm){
                //Utilizar el texto de ayuda cuando el campo de búsqueda no tenga ningún valor
                if (jQuery.trim(inputQ.val()).length == 0){
                    inputQ.val(label.text());
                }
    
                //Borrar el texto de ayuda cuando se quiera buscar algo
                inputQ.focus(function(){
                    $('#archivo-form-mensaje').hide();
                    if ($(this).val() == label.text()){
                        $(this).val('');
                    }
                });
    
                //Verificar que se esté buscando un texto
                frm.submit(function(){
                    if ((jQuery.trim(inputQ.val()).length == 0) || (inputQ.val() == label.text())){
                        $('#archivo-form-mensaje').show();
                        inputQ.val('');
                        return false;
                    }
                });
            }

}


$(document).ready(function(){

/*	$(".small-video a").hover(function() {
		$(this).next(".tooltip div").animate({opacity: "show"}, "slow");
	}, function() {
		$(this).next(".tooltip div").animate({opacity: "hide"}, "fast");
	});
*/
    $("ul.menu1").superfish({
		hoverClass	: "sfHover", delay:0
	});
	
    archivo_buscar_validacion();
    

});


function cambiarPagExperto(posicion, limite, pag)
{   
//   document.foroExperto.action = "";
   document.foroExperto.posicionExperto.value=posicion-1;
   document.foroExperto.hastaExperto.value=limite;
   document.foroExperto.pagActual.value=pag;
   document.foroExperto.target ="_top";
   document.foroExperto.submit();
}  


function generarVideoJSPlayer(video, divHTML, tipoReproduccion, ancho, alto,urlImagen, ubicacion) {

 if (tipoReproduccion == 'audio' && !ancho && !alto) {
        alto = 20;
        altoVideo = 20;
    }else {
        altoVideo = alto + 20;
	}
	var playlistArray;
    playlistArray = new Array();
    playlistArray[0] = "";
    playlistArray[1] = "";
    
    if (tipoReproduccion == 'audio')
       var s3 = new SWFObject("/reproductores/audio/mediaplayer.swf", tipoReproduccion + '_' + divHTML ,ancho,24,"7");    
    else
       var s3 = new SWFObject(ubicacion, tipoReproduccion + '_' + divHTML ,ancho,altoVideo,"7");
    if(tipoReproduccion == 'audio')   {
       s3.addParam("allowfullscreen","false");   
       
    }   
	s3.addParam("swLiveConnect","true");
	s3.addVariable("width",ancho);	
   	s3.addVariable("height",alto);
   	s3.addVariable("displaywidth" , ancho);
	s3.addVariable("displayheight" , alto);
	s3.addVariable("file", video);
	s3.addParam("wmode","transparent"); 
  	  
	if(tipoReproduccion == 'video'){
	  s3.addParam("allowfullscreen","true");
	  s3.addVariable("showdigits" , "total");
	  s3.addVariable("image" ,urlImagen);
	  s3.addVariable("searchbar" , "false");
	  s3.addVariable("showstop" , "false");
   }
 	   
   s3.addVariable("apl_publicidad","true");
   s3.addVariable("posx","21");
   s3.addVariable("posy" , "59");
   s3.addVariable("tamw" , 539);
   s3.addVariable("tamh" , 392);
//   s3.addVariable("apl_url" , "http://www.sony.com.co/bravia/");
   //s3.addVariable("apl_url" , "http://ads.us.e-planning.net/ei/3/c1e/5b0e72486f152e48?it=0&p=c2df2e6ed9ab6460&pb=141e84691072151b&rnd=$RANDOM");
   s3.addVariable("apl_url" , "http://ads.us.e-planning.net/ei/3/c1e/94913f71dd1c15ac?it=0&p=c2df2e6ed9ab6460&pb=141e84691072151b&rnd=$RANDOM");
   s3.write(divHTML);

}

//Buscador de ClasifiCAR
function vehiculo (index, id_marca, marca, id_linea, linea, id_especificacion, especificacion, modelo, precioventa, kilometraje, placa, codigo, idfichatecnica) {
 this.index = index;
 this.id_marca = id_marca;
 this.marca = marca;
 this.id_linea = id_linea;
 this.linea = linea;
 this.id_especificacion = id_especificacion;
 this.especificacion = especificacion;
 this.modelo = modelo;
 this.precioventa = precioventa;
 this.kilometraje = kilometraje;
 this.placa = placa;
 this.codigo = codigo;
 this.idfichatecnica = idfichatecnica;
}
function get_random(maxNum) {
 if (Math.random && Math.round)
 {
  var ranNum= Math.round(Math.random()*(maxNum-1));
  ranNum+=1;
  return ranNum;
 }
 else
 {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19)
   hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
  return ranNum;
  }
}
function modificarSelectHomeElTiempoCL (modo) {
  if (modo == 1) {
    document.getElementById('nuevos').className ='clasificarActivo';
    document.getElementById('usados').className ='clasificarInactivo';
	document.getElementById('selectnuevos').disabled = false;
	document.getElementById('selectusados').disabled = true;
  }
  else {
    document.getElementById('nuevos').className ='clasificarInactivo';
    document.getElementById('usados').className ='clasificarActivo';
	document.getElementById('selectnuevos').disabled = true;
	document.getElementById('selectusados').disabled = false;
  }     
}

function publicareImagen(){
   document.getElementById('cargarImagen').style.display="block";
   document.getElementById('cargarVideo').style.display="none";
   document.getElementById('avisoAyudaSubir').innerHTML="<p>Las imágenes pueden ser de máximo <em>1.000Kb</em> Todo material publicado es revisado antes de ser publicado. <em>eltiempo.com</em> se reserva el derecho a rechazar fotos y videos que violen el código de ética de participación de <em>eltiempo.com</em>. </p>";
}
function publicareVideo(){
   document.getElementById('cargarImagen').style.display="block";
   document.getElementById('cargarVideo').style.display="none";
   document.getElementById('avisoAyudaSubir').innerHTML="<p>Los videos pueden ser de máximo 50M.  Todo material publicado es revisado antes de ser publicado. <em>eltiempo.com</em> se reserva el derecho a rechazar fotos y videos que violen el código de ética de participación de <em>eltiempo.com</em>. </p>";
   /*document.getElementById('cargarImagen').style.display="none";
   document.getElementById('cargarVideo').style.display="block";
*/
}
/***************************************************************
  Bloque de codigo slider
***************************************************************/  
var swidth=300;

//scroller's height
var sheight=80;

//scroller's speed 
var sspeed=2;
var restart=sspeed;
var rspeed=sspeed;

//scroller's pause 
var spause=10000;

//scroller's background
var sbcolor="#F9F9F9";


//-- begin: Scroller's Algorithm -->
var ii=0;
function goup(){if(sspeed!=rspeed*16){sspeed=sspeed*2;restart=sspeed;}}

function start(){
if(document.getElementById){ns6div=document.getElementById('iens6div');ns6div.style.top=sheight+"px";ns6div.innerHTML=singletext[0];sizeup=ns6div.offsetHeight;ns6scroll();}
else 
if(document.layers){ns4layer=document.ns4div.document.ns4div1;ns4layer.top=sheight;ns4layer.document.write(singletext[0]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}
else 
if(document.all){iediv=iens6div;iediv.style.pixelTop=sheight+"px";iediv.innerHTML=singletext[0];sizeup=iediv.offsetHeight;iescroll();}}
function iescroll(){if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){iediv.style.pixelTop=0;setTimeout("iescroll()",spause);}else 
if(iediv.style.pixelTop>=sizeup*-1){iediv.style.pixelTop-=sspeed+"px";setTimeout("iescroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;iediv.style.pixelTop=sheight+"px";iediv.innerHTML=singletext[ii];sizeup=iediv.offsetHeight;iescroll();}}
function ns4scroll(){if(ns4layer.top>0&&ns4layer.top<=sspeed){ns4layer.top=0;setTimeout("ns4scroll()",spause);}else 
if(ns4layer.top>=sizeup*-1){ns4layer.top-=sspeed;setTimeout("ns4scroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;ns4layer.top=sheight;ns4layer.document.write(singletext[ii]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}}
function ns6scroll(){if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){ns6div.style.top=0;setTimeout("ns6scroll()",spause);}else 
if(parseInt(ns6div.style.top)>=sizeup*-1){ns6div.style.top=parseInt(ns6div.style.top)-sspeed+"px";setTimeout("ns6scroll()",100);}
else{if(ii==singletext.length-1)ii=0;else ii++;
ns6div.style.top=sheight+"px";ns6div.innerHTML=singletext[ii];sizeup=ns6div.offsetHeight;ns6scroll();}}
//-- end Algorithm -->

function sorter(){
	$(document).ready(function() {
	$("table").tablesorter();
	$("#ajax-append").click(function() {
		 $.get("assets/ajax-content.html", function(html) {
		 	// append the "ajax'd" data to the table body
		 	$("table tbody").append(html);
			// let the plugin know that we made a update
			$("table").trigger("update");
			// set sorting column and direction, this will sort on the first and third column
			var sorting = [[2,1],[0,0]];
			// sort on the first column
			$("table").trigger("sorton",[sorting]);
		});
		return false;
	});
});
}

function cargarDetalleOlimpicos(objeto,div)
{
    incluirObjeto(objeto,div);
    sorter();
}

function generarPageView(nombre_pagina,seccion,sub_seccion)
{
   s_channel = seccion?seccion:s_channel;
   s_prop1 = seccion?seccion:s_prop1;
   s_prop2 = sub_seccion?sub_seccion:s_prop2;
   s_pageName = nombre_pagina?nombre_pagina:s_pageName;
   //Registrar el page view para Certifica
   if (cert_registerHit){
       ruta = certifica_crear_ruta([s_channel, s_prop1, s_prop2,  s_pageName]);
       cert_registerHit(20837, ruta, 'cert_Pivot'); 
   }
   void(s_gs(s_account))
}



/***********************
*     TABLESORTER      *
***********************/


(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,cells[i]);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i];}}return parsers[0];}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));}cols.push(i);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){if(!node)return"";var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML;}else{t=node.innerHTML;}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node);}else{t=$(node).text();}}return t;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0;};$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(!this.sortDisabled){$(this).addClass(table.config.cssHeader);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0;}else{i=(v==(0||1))?v:0;}return i;}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function sortText(a,b){return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){var DECIMAL='\\'+config.decimal;var exp='/(^[+]?0('+DECIMAL+'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'+DECIMAL+'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*'+DECIMAL+'0+$)/';return RegExp(exp).test($.trim(s));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$¿?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}$("tr:visible",table.tBodies[0]).filter(':even').removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(':odd').removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);