﻿var DHTML = (document.getElementById || document.all || document.layers);
/************************************
 * OBTENER DOMINIO DEL SITIO        *
 ************************************/
dominio = document.domain.toLowerCase();
pUrl = document.location.href.toLowerCase();

var site ;
//var dominio = "www.elnorte.com";



    siteMenu = 'http://'+dominio
    
   // alert(pUrl.indexOf('/plazaconsulta=reforma/'))
   
    if ( pUrl.indexOf('/elnorte/') != -1) siteMenu = 'http://www.elnorte.com'
    else if ( pUrl.indexOf('/reforma/') != -1) siteMenu = 'http://www.reforma.com'
    else if ( pUrl.indexOf('/mural/') != -1) siteMenu = 'http://www.mural.com'
    else if ( pUrl.indexOf('/palabra/') != -1) siteMenu = 'http://www.palabra.com'
   
    if (dominio.indexOf('busquedas') == -1){
        site = dominio.replace("www.","");
        site = site.replace("gruporeforma.","");
        site = site.replace("envivo.","");
        site = site.replace(".com","");
    }
    else {
        if (pUrl.indexOf('/elnorte/') != -1) site = 'elnorte'
        else if (pUrl.indexOf('/reforma/') != -1) site = 'reforma'
        else if (pUrl.indexOf('/mural/') != -1) site = 'mural'
        else if (pUrl.indexOf('/palabra/') != -1) site = 'palabra'
    }


siteMenu = siteMenu.replace("comercial","www");
siteMenu = siteMenu.replace("gruporeforma","www");


//siteMenu = 'http://intranetsgc/stageenlineagc';


/************************************
 * OBTENER FECHA (PARA (S)HTML'S)   *
 ************************************/
function fecha()
{
    var fechahoy = new Date();
    diahoy = new String('0'+fechahoy.getDate());
    if (diahoy.length > 2)
        {diahoy = diahoy.substr(1,2);}
    var meshoy =fechahoy.getMonth();
    var aniohoy = new String(fechahoy.getFullYear());
    mes = new Array('Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic');
    
document.write(diahoy +'-'+ mes[meshoy]+'-'+aniohoy.substr(2,2));
}
/************************************
 * IDENTIFICAR PLATAFORMA Y BROWSER *
 ************************************/
var navUA = navigator.userAgent.toLowerCase();
var tipoBrowser;
var tipoPlataforma;
if (navUA.indexOf('msie') != -1)
	tipoBrowser = 'explorer';
else if (navUA.indexOf('netscape') != -1)
	tipoBrowser = 'netscape';
else if (navUA.indexOf('firefox') != -1)
	tipoBrowser = 'firefox';
else if (navUA.indexOf('safari') != -1)
	tipoBrowser = 'safari';
if (navUA.indexOf('windows') != -1)
	tipoPlataforma = 'windows';
else
	tipoPlataforma = 'mac';
/****************************
 * FUNCIONES PARA MENU      *
 ****************************/
function CreateMenuHeader()
{
    var str='';
    var nParamsBase=0;
    str+="<table width='"+configMenu.tamanioHeader+"' height='23' border='0' cellpadding='0' cellspacing='0' class='MenuHeaderClass'><tr>";
    for (var i=0; i<arguments.length; i++) 
    {    
     str+="<td id='td"+i+"' style='text-align:center;' onmouseover='creaMenuItems(this,\"menu_Arrow"+i+"\","+i+",\""+configMenu.fontColor+"\",\""+configMenu.fontColorHover+"\");'><img name='menu_Arrow"+i+"' width='15' height='15' border='0' align='absmiddle' src='"+configMenu.flechaOff+"'>"+arguments[i]+"</td><td height='23'>"
     if(i<arguments.length-1)
        str+="<img width='1' height='23' border='0' valign='top' src='"+configMenu.imagenSeparador+"'>";
     str+="</td>"
    }
    str+="</tr></table>";
    return str;
}

function classNameClicks(nombre)
{
    var posicion= nombre.indexOf(">");
    var length=nombre.length-posicion;
    nombre=nombre.substr(posicion+1,length)
    nombre= nombre.replace(/ /gi,"");
    nombre= nombre.replace(/á/gi,"a");
    nombre= nombre.replace(/é/gi,"e");
    nombre= nombre.replace(/í/gi,"i");
    nombre= nombre.replace(/ó/gi,"o");
    nombre= nombre.replace(/ú/gi,"u");
    return "zonaMENU" + nombre.toUpperCase();
}

function CreateElementsMenu(plaza,seccion)
{
    var classClick=classNameClicks(seccion);
    //alert(classClick);
    var str="<table  border='0' cellpadding='0' cellspacing='0' style='background-color:"+configMenu.backColorLevelOne+";' class=\""+classClick +"\">";
    var urlElem='';
    for (var i=2; i<arguments.length; i=i+2) 
    {
        urlElem=arguments[i+1];                
                   
	    str+="<tr>"+CrearSubElement(arguments[i],urlElem,plaza)+"</tr>";	
	}
	str+="</table>"
	return str;
}

function CrearSubElement(nombre,url2,plaza)
{
    url2=ValidarUrl(url2,plaza);
    var str='';
    if(nombre=='')
        return "<td onmouseover=\"overPhantom(this,true);\" onmouseout=\"outPhantom(this);\"><nobr>&nbsp;</nobr></td>";
    str+="<td height='18' valign='center' class='txtSeccion' style='cursor:pointer;' onmouseover=\"overPhantom(this);\" onmouseout=\"outPhantom(this);\"";
    str+=" onclick=\""
    if(url2.indexOf("javascript:")>-1)
        str+=url2;
    else
        str+="ira('"+url2+"');"
    str+="\"><nobr>&nbsp;&nbsp;&nbsp;" +nombre+"&nbsp;&nbsp;&nbsp;</nobr></td>";	
    return str;
}

function CreateElementsNColumnsMenu(plaza,seccion)
{
    var classClick=classNameClicks(seccion);
    var str="<table  border='0' cellpadding='0' cellspacing='0' style='background-color:"+configMenu.backColorLevelOne+";' class=\""+classClick +"\">";
    
    var arrIzq=new Array();
    var arrDer=new Array();
    var mid=Math.floor((arguments.length-2)/2);
    for (var i=2; i<arguments.length; i=i+2) 
    {
        if(i<mid)
        {
            arrIzq[i-2]=arguments[i];
            arrIzq[i-1]=arguments[i+1];
        }
        else
        {
            arrDer[i-mid-2]=arguments[i];               
            arrDer[i-mid-1]=arguments[i+1];            
        }
    }
    var columna=0;var url='';var nombre='';
    for (var i=0; i<arrIzq.length; i=i+2) 
    {
        var modulo=columna%2;
        nombre='';url='';        
        if(arrIzq.length>i+1)
        {                    
            nombre=arrIzq[i];
            url=arrIzq[i+1];
        }
        str+="<tr>";
        str+=CrearSubElement(nombre,url,plaza);	
        nombre='';url=''; 
        if(arrDer.length>i+1)
        {                    
            nombre=arrDer[i];
            url=arrDer[i+1];
        }        
        str+=CrearSubElement(nombre,url,plaza);
        str+="</tr>";        
        columna++;
	}
	str+="</table>"
	return str;
}
function ValidarUrl(url,plaza)
{
    if(url==null || url=='')
        return '';
    //url= url.replace(/\'/g,"\\\'");
    if(!EsUrlAbsoluto(url))
        url=plaza+url;
    return url;
}

function EsUrlAbsoluto(url)
{    return url.indexOf('http://')>-1 || url.indexOf('javascript:')>-1;}

/***/

function dynamicLoad(jsFileName){
		if(document.getElementById)
		{
			var cnode =document.getElementById('dynld');
			var nnode = document.createElement('script');
			nnode.src = jsFileName;
			nnode.id  = 'dynld';
			cnode.parentNode.replaceChild(nnode,cnode);			
		}
     }
 
        
    var objMenu;
    function creaItem(td, arrowName,posicion,index)
    {
        this.id=td.id;
        this.index=index;
        this.td=td;
        this.td.imagen=document.images[arrowName];
        this.td.parent=this;
        this.posicion=posicion;
        this.top=0;
        this.left=0;
        this.width=null;
        this.height=null;
        this.innerHTML=menuItem[this.posicion];  
        
        this.obtienePosicion=function()
        {
            this.top=0;
            this.left=0;
            var parentTag=this.td.offsetParent;
            while (parentTag.tagName.toLowerCase()!='body')
            {
                this.left+=parentTag.offsetLeft;
                this.top+=parentTag.offsetTop;
                parentTag=parentTag.offsetParent;
            }
            this.left+=this.td.offsetLeft;
            this.top+=this.td.offsetTop + this.td.offsetHeight;
        }
        
        this.td.selectedItem=function()
        {
            this.style.color =objMenu.colorItemSelected;
            this.imagen.src=this.imagen.src.replace("flecha_menu_off.gif","flecha_menu_on.gif");           
        }
        
        this.td.unselectedItem=function()
        {            
            this.style.color =objMenu.colorItemUnselected;
            this.imagen.src=this.imagen.src.replace("flecha_menu_on.gif","flecha_menu_off.gif");
        }
        
        this.td.onmouseover= function()
        {            
            this.selectedItem();
            objMenu.setSelectedIndex(this.parent.index);
            if (this.parent.innerHTML!="")
            {
                objMenu.inPhantom=true;
                this.parent.showPhantom();
            }
        }
                                
        this.td.onmouseout= function(){            
            this.unselectedItem();
            if (this.parent.innerHTML!="")
            {
                objMenu.inPhantom=false;
                objMenu.timerId=window.setTimeout("objMenu.items[objMenu.selectedIndex].hidePhantom();",500);
            }
        }
        
        this.showPhantom=function()
        {            
            this.obtienePosicion();
            objMenu.phantom.style.position="absolute";
            objMenu.phantom.style.left=this.left + "px";
            objMenu.phantom.style.top=this.top + "px";            
            objMenu.phantom.style.visibility="visible";
            objMenu.phantom.innerHTML=this.innerHTML;
            objMenu.phantom.style.visibility="visible";
            objMenu.phantom.style.display="block";           
            if ((this.width==null) || (this.height==null))
            {
                this.width=objMenu.phantom.offsetWidth;
                this.height=objMenu.phantom.offsetHeight;
            }
                        
            objMenu.mask.style.left=this.left + "px";
            objMenu.mask.style.top=this.top + "px";
            objMenu.mask.style.height=this.height + "px";
            objMenu.mask.style.width=this.width + "px";
            objMenu.mask.style.visibility="visible";
            objMenu.mask.style.display="block";
           
        }
        
        this.hidePhantom=function()
        {
            if (!objMenu.inPhantom)
            {
                objMenu.phantom.style.visibility="hidden";
                objMenu.phantom.style.display="none";                
                objMenu.phantom.innerHTML="";
                
                objMenu.mask.style.visibility="hidden";
                objMenu.mask.style.display="none";                
           } 
           else
            window.clearInterval(objMenu.timerId);               
        }
                
        this.td.onmouseover();
        return this;
    }

    function creaMenu()
    {
        if (document.getElementById)
        {
            this.headers=document.getElementById("menu");
            this.phantom = document.getElementById("phantom");
            this.mask=document.getElementById("mask");        
            this.items = new Array();
            this.selectedIndex=0;
            this.inPhantom=false;
            this.phantom.parent=this;
            this.timerId;
            this.colorItemSelected=null;
            this.colorItemUnselected=null;
                    
            this.itemsDefined = function(value){
                for (var i=0;i<this.items.length;i++)
                   if (value.id==this.items[i].id)
                   {
                    return i;
                   }
               return -1;       
            }
           
            this.addItem=function(td,arrowName,posicion,colorItemSelected,colorItemUnselected)
            {
                if (this.colorItemSelected==null) this.colorItemSelected=colorItemSelected;                                
                if (this.colorItemUnselected==null) this.colorItemUnselected=colorItemUnselected;                
                this.items.push(new creaItem(td,arrowName,posicion,this.items.length));
            }
            
            this.setSelectedIndex=function(value)
            {            
                this.selectedIndex=value;         
            }            
            this.headers.innerHTML=menu_header;
            return this;
          }
          else
            return null;          
    }
    
   function overPhantom(td,nocolor)
    {        
        if(nocolor==null)
            nocolor=false;
        objMenu.inPhantom=true;
        if(!nocolor)
        {
        td.bgColor = configMenu.backColorLevelOneHover;
	    td.style.color=configMenu.fontColorLevelOneHover;	      
	    }
	    objMenu.items[objMenu.selectedIndex].td.selectedItem();
    }
    
    function outPhantom(td,colorfondo,colortexto)
    {        
        td.bgColor = configMenu.backColorLevelOne;
	    td.style.color=configMenu.fontColorLevelOne;	    
	    objMenu.inPhantom=false;	    
	    objMenu.items[objMenu.selectedIndex].td.unselectedItem();
	    objMenu.timerId= window.setTimeout("objMenu.items[objMenu.selectedIndex].hidePhantom();",500);
    }
    
    function creaMenuItems(td,arrowName,posicion,colorItemSelected,colorItemUnselected)
    {        
        var flag=objMenu.itemsDefined(td);
        if (flag==-1)
            objMenu.addItem(td,arrowName,posicion,colorItemSelected,colorItemUnselected);
    }    
    
    function initMenu()
    {           
        objMenu= creaMenu();
    }
        
   function ira(href)
    {
        //alert(href);
        if(href=='' || (href.indexOf('http://')==-1 && href.indexOf('javascript:')==-1))
        {
            alert('liga no valida');
            return null;
            }
	    if (href.indexOf("(liga_sinergica)")!=-1)				
		    href= href.replace(/\(liga_sinergica\)/gi,siteMenu);
	    href=href.replace(/&apos;/gi,"'");
	    document.location.href =href;
    }
document.write('<scr'+'ipt id="dynld"></scr'+'ipt>');    
document.write('<div id="phantom" style="position:absolute;left:10px;top:10px;visibility:hidden;display:none;z-index:200;">phantom</div>');
document.write('<IFRAME id="mask" name="mask" frameBorder="0" scrolling="no" style="visibility: hidden; position:absolute; left:0px; top:0px; width:200px; height:50px; z-index:199; display:none;"></IFRAME>');   
var jsfile = siteMenu + "/libre/online07/menu/menu.js";
//var jsfile = "http://www.elnorte.com/libre/online07/menu/menu.js" ;
dynamicLoad(jsfile);

/****************************
 * FUNCIONES PARA IFRAME    *
 ****************************/
function resize_iFrame(iframe_name, lessH){
	if (navigator.userAgent.indexOf('MSIE') != -1)
		height = document.body.offsetHeight;
	else if (navigator.userAgent.indexOf('Mozilla/') != -1)
		height = document.documentElement.clientHeight;
	var objIframe = getObj(iframe_name)
	objIframe.height=height - lessH
}
/****************************
 * FUNCIONES PARA FECHA     *
 ****************************/
function MostrarFechaActual()  
{  var nombre_mes = new Array("Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic")

	var hoy_es = new Date()
	dia_mes = hoy_es.getDate()
	mes = hoy_es.getMonth() + 1
	anyo = hoy_es.getYear()

     if (anyo < 100)
     {  anyo = '19' + anyo }

	else 

     if ( ( anyo > 100 ) && ( anyo < 999 ) ) 
     {  var cadena_anyo = new String(anyo) ; anyo = '20' + cadena_anyo.substring(1,3) }

	document.write(dia_mes + "-" + nombre_mes[mes - 1] + "-" + anyo)    
 }
/****************************
 * FUNCIONES PARA COOKIES   *
 ****************************/
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();}
	else 
		expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1)    
	endstr = document.cookie.length;  
	var clave = unescape(document.cookie.substring(offset, endstr));
	return clave.toLowerCase();
}
function Get_Cookie(name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) 
	{    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg)      
			return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}
/****************************
 * FUNCIONES PARA CAMBIO DE *
 * TAMAÑO DE LETRA EN NOTAS *
 ****************************/
function setActiveStyleSheet(title) {
	var i, a, main;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alternate") != -1 && a.getAttribute("title")) {
			a.disabled = true;
			if(a.getAttribute("title") == title) a.disabled = false;
		}
	}
}
function getActiveStyleSheet() {
	var i, a;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alternate") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
	}
	return null;
}
function getPreferredStyleSheet() {
	return ('1');
}
function wOL() {
	var cookie = Get_Cookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	if (title == 'null')
		title = '1';
	setActiveStyleSheet(title);
}
function wOUL() {
	var title = getActiveStyleSheet();
	createCookie("style", title, 365);
}

function wOULHome() {
	createCookie("cookiemasvisto",document.forma.configura.selectedIndex,7);
}
/****************************
 * FUNCIONES PARA VENTANAS  *
 ****************************/
function herramienta(direccion)
{
	LeftPosition = (screen.width) ? (screen.width-800)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
	window.open(direccion,'pagina','top=' + TopPosition + ',left=' + LeftPosition + ',width=800,height=400,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
}
function herramientapdf(direccion)
{
	LeftPosition = (screen.width) ? (screen.width-800)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
	window.open(direccion,'pagina','top=' + TopPosition + ',left=' + LeftPosition + ',width=800,height=400,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=yes,resizable=yes');
}
function herrGaleria(direccion)
{
	LeftPosition = (screen.width) ? (screen.width-800)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-567)/2 : 0;
	window.open(direccion,'pagina','top=' + TopPosition + ',left=' + LeftPosition + ',width=800,height=567,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,address=no');
}
function herramientascroll(direccion)
{
	LeftPosition = (screen.width)  ? (screen.width-800)/2  : 0; 
	TopPosition  = (screen.height) ? (screen.height-400)/2 : 0;
	window.open(direccion,'pagina','top=' + TopPosition + ',left=' + LeftPosition + ',width=800,height=400,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no');
}

function musicaparanavegar(direccion)
{
	LeftPosition = (screen.width) ? (screen.width-800)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-400)/2 : 0;
	window.open(direccion,'paginamusicaparanavegar','top=' + TopPosition + ',left=' + LeftPosition + ',width=800,height=400,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
}


/****************************
 * FUNCIONES PARA ANUNCIOS  *
 ****************************/
 
 

_version=11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1){
_version=10;} 

var oas='http://anuncios.gruporeforma.com/RealMedia/ads/';
var RN = new String (Math.random());
var RNS = RN.substring (2, 11); 

function DisplayAds (pagina, position, width, height)
{
	var oaspage= sitepage + pagina +'/1' + RNS + '@' + position;
	var foto = baseURL.search('foto');
	var opi = baseURL.search('opinion');
	var indica = baseURL.search('indicador');
	var articulo = baseURL.search('articulo');
	//if (r > -1)
	{
		if (_version < 11) {

		document.write ('<A HREF="' + oas + 'click_nx.cgi/'+ oaspage + '" TARGET="_top" ><IMG SRC="' + oas + 'adstream_nx.cgi/' + oaspage + '" BORDER="0" WIDTH="' + width + '" HEIGHT="' + height + '"></a>');
		}
		else
		{
			document.write ('<'+'SCRIPT LANGUAGE="JavaScript1.1" SRC="' + oas + 'adstream_jx.cgi/' + oaspage + '">');
			document.write ('\<\!-- --\>');
			document.write ('\<\/SCRIPT\>');
			document.write ('\<\!-- --\>');
		}
	}
	/*else
		{
			baseSTG = '<img src="' + 'http://' + document.domain + '/stageenlineagc/img/';
			if ((position=="TopRight" || position=="Right" || position=="Right1" || position=="Right2" || position=="Right3") && articulo < 0)
				anuncio = 'anunpix.gif" width="180" height="60">';
			else
			 {
				if (position=="Top" || position=="Top1" || position=="Top2" || position=="Top3" )
					anuncio = 'anunpix.gif" width="182" height="90">';
				else
					{ 
					if (position=="Middle1" || position=="Middle2")
						 anuncio = 'anunpix.gif" width="270" height="132">';
					else
						{
						if (position=="Right1" && articulo > 0)
						 anuncio = 'anunpix.gif" width="120" height="115">';
						}						 
					}
			 }
			 document.write(baseSTG + anuncio);
		}*/
		
}
/************************************
 * CONECTAR / DESCONECTAR           *
 ************************************/
function textosLogon(){
	if ((site != 'elnorte') && (site != 'reforma') && (site != 'mural') && (site != 'palabra'))
		siteTl = '/stageenlineagc/';
	else
		siteTl = 'http://www.' + site  + '.com/';
	var ayuda = siteTl + 'libre/acceso/ayuda';;
	var conectar = siteTl + 'libre/acceso/acceso.htm';
	var desconectar = siteTl + 'libre/acceso/logout.asp';
	nivelcobro = 2;
	var grcuser = Get_Cookie('cusuarioss');
	var grcuser = Get_Cookie('cusuarioss');
		if (grcuser == null)
            {fecha();}
        else
        {
        document.write('<a href='+ desconectar +' id="ligaherr"><span class="arheader13">desconectar</span></a><img src="../Pages/inc/img/desc.gif" width="23" height="22" align="absmiddle" />');
        }
	
	/*if (grcuser == null){
	    document.write('<td style=width:115px;" align="center"><a href=' + conectar + ' id=ligablanca><span class="arheader13">conectar</span></a><img src="../Pages/inc/img/conec.gif"  style="width:23; height:22" align="absmiddle" alt=""/></td>');
	}
	else {
	    document.write('<td style=width:115px;" align="center"><a href=' + desconectar + ' id=ligablanca><span class="arheader13">desconectar</span></a><img src="../Pages/inc/img/desc.gif"  style="width:23; height:22" align="absmiddle" alt=""/></td>');
	}*/
}
function LogonHola(){
	if ((site != 'elnorte') && (site != 'reforma') && (site != 'mural') && (site != 'palabra'))
		siteTl = '/stageenlineagc/';
	else
		siteTl = 'http://www.' + site  + '.com/';
	var hola = siteTl + 'libre/acceso/registro/perfil.asp';
	var conectar = siteTl + 'libre/acceso/acceso.htm';
	
	nivelcobro = 2;
	var grcuser = Get_Cookie('cusuarioss');
	
    if (grcuser == null) 
    {
    document.write('<a href='+ conectar +' id="ligablanca"><span class="arheader13">conectar</span>&nbsp;&nbsp;<img src="../Pages/inc/img/conec.gif" width="23" height="22" align="absmiddle" border="0" /></span></a>');
    }
    else 
    {
    document.write('<a href='+ hola +'><span class="arheader13"><b><u>Hola,' + grcuser.substr(0,9) + '</u></b></span></a><span class="arheader13"><b>&#160;|</b></span><img src="../Pages/inc/img/mi_carpeta.gif" width="30" height="22" align="absmiddle" /><a href="'+ siteTl +'micajon/" id="ligaherr"><span class="arheader13">mi cajón</span></a><br/><img src="../Pages/inc/img/pix.gif" width="1" height="5"/>');
    }
	
	/*if (grcuser == null){
		}
	else {
	    document.write('<a href=' + hola +'><span class="arheader13"><b>Hola, <u>' + grcuser.substr(0,11) + ' </u></b></span></a><span class="arheader13"><b>&nbsp;|</b></span><img src="../Pages/inc/img/mi_carpeta.gif"  style="width:30px; height:22px" align="absmiddle" alt=""/><a href="'+ siteTl +'micajon/" id="A1"><span class="arheader13">mi cajón</span></a><br/><img src="../Pages/inc/img/pix.gif" style="width:1px; height:5px" alt=""/></td>');
	}*/
}
/************************************
 * LIGA DEL BUSCADOR                *
 ************************************/
/*function ligaBuscador(){
	if (pUrl.indexOf('plazaconsulta=elnorte') != -1) 
		sitePcob = 'elnorte';
	else if (pUrl.indexOf('plazaconsulta=reforma') != -1) 
		sitePcob = 'reforma';
	else if (pUrl.indexOf('plazaconsulta=mural') != -1) 
		sitePcob = 'mural';
	else if (pUrl.indexOf('plazaconsulta=palabra') != -1) 
		sitePcob = 'palabra';
	else	
		sitePcob = site;
	document.buscador.action = 'http://busquedas.gruporeforma.com/'+sitePcob+'/default.asp';
}   */
/************************************
 * LIGA DEL BUSCADOR                *
 ************************************/
 function caractEspec(strr)
{
	myString = new String(strr);
	myString = myString.replace('*','');
	myString = myString.replace('-','');
	myString = myString.replace('+','');
	myString = myString.replace('|','');
	myString = myString.replace('!','');
	myString = myString.replace('(','');
	myString = myString.replace(')','');
	myString = myString.replace('{','');
	myString = myString.replace('}','');
	myString = myString.replace('[','');
	myString = myString.replace(']','');
	myString = myString.replace('^','');
	myString = myString.replace('~','');
	myString = myString.replace('?','');
	myString = myString.replace(':','');
	myString = myString.replace('\\','');
	myString = myString.replace('#','');
	myString = myString.replace('<','');
	myString = myString.replace('>','');

	return myString;
}
function ligaBuscador(zona){
	if (pUrl.indexOf('plazaconsulta=elnorte') != -1) 
		sitePcob = 'elnorte';
	else if (pUrl.indexOf('plazaconsulta=reforma') != -1) 
		sitePcob = 'reforma';
	else if (pUrl.indexOf('plazaconsulta=mural') != -1) 
		sitePcob = 'mural';
	else if (pUrl.indexOf('plazaconsulta=palabra') != -1) 
		sitePcob = 'palabra';
	else	
		sitePcob = site;
		
/*busqueda en la plaza o en google*/
	
    if (zona==1)
    {
        var buscarG = document.buscador.radioG.checked;
        document.buscador.strbusqueda.value = caractEspec(document.buscador.strbusqueda.value);
        document.buscador.q.value=document.buscador.strbusqueda.value;
            if (buscarG==true) //si es google
                {
                  document.buscador.method="GET";
                  document.buscador.target="_top";
                  document.buscador.action = siteMenu + "/google/default.asp";
                }
             else
             {
                document.buscador.method="POST";
                document.buscador.target="_top";
                document.buscador.action = 'http://busquedas.gruporeforma.com/'+sitePcob+'/Pages/BuscaImpresa.aspx';
             }   

    }    
    else 
        if (zona==3)//buscador en categoria para articulos
        {   
            document.buscador3.strbusqueda.value = caractEspec(document.buscador3.strbusqueda.value);	
            document.buscador3.method="POST";
            document.buscador2.target="_top";
            document.buscador3.action = 'http://busquedas.gruporeforma.com/'+sitePcob+'/Pages/BuscaImpresa.aspx';
        }        
        else
        {
            var buscarG = document.buscador2.radioG.checked;
            document.buscador2.strbusqueda.value = caractEspec(document.buscador2.strbusqueda.value);	
            document.buscador2.q.value=document.buscador2.strbusqueda.value;
               if (buscarG==true) //si es google
                    {
                        document.buscador2.method="GET";
                        document.buscador2.target="_top";
                        document.buscador2.action = siteMenu + "/google/default.asp";
                    }
                 else
                 {
                    document.buscador2.method="POST";
                    document.buscador2.target="_top";
                    document.buscador2.action = 'http://busquedas.gruporeforma.com/'+sitePcob+'/Pages/BuscaImpresa.aspx';
                 }   
        }

}   
/************************************
 * PARA USO EN EDITORIALES          *
 * EN EL ARCHIVO QUIERES.INC        *
 ************************************/
function muestra(time)
	{var str = Nombre.value;
	if(str.indexOf(" y ")>0){
	Nombre.value=str.substring(0,str.indexOf(" y "));
	}
	var valor = Nombre.value;
	var valor1 = IDSeccion.value;
	var palabra = "palabramonitor=" + valor;
	//alert(palabra);
	var secc = "&seccion=" + valor1;
	var dias = "&dias=" + time;
	var liga = '../../../alertas/articulo/formacorreo.asp?' + palabra + secc + dias;
	return liga;
	}           
/************************************
 * PARA USO EN EDITORIALES          *
 * EN EL ARCHIVO QUIERES_RECIBIR.INC *
 ************************************/
function muestra1(time)
	{var str = Nombre.value;
	var valor = NombreM.value;
	var valor1 = IDSeccion.value;
	var palabra = "palabramonitor=" + valor;
	//alert(palabra);
	var secc = "&seccion=" + valor1;
	var dias = "&dias=" + time;
	var liga = '../../../alertas/articulo/formacorreo.asp?' + palabra + secc + dias;
	return liga;
	}
/************************************
 * FUNCION PARA RESIZE DE UNA       *
 * PAGINA Q ABRE EN POP UP          *
 ************************************/

function resizePopup(alto, ancho){
	window.resizeTo(alto,ancho);	
	if (navigator.userAgent.indexOf("Mac") >= 0)
			{
			 window.resizeTo(alto,ancho-40);
			}
	
}
/***********************************
* FUNCION PARA OBTENER LA POSICIÓN *
* PARA EL DIV DE ARTICULO CON FOTO *
* HORIZONTAL, PARA LOS ANUNCIOS    *
* DINAMICOS                        *
************************************/
	// this function returns the x, y position
	// works in IE and Mozilla.
	
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
	
	function getElementPosition(element){
		var x=0,y=0;
		while (element!=null){
			x+=element.offsetLeft-element.scrollLeft;
			y+=element.offsetTop-element.scrollTop;
			element=element.offsetParent;
		}
		return {x:x,y:y};
	}
	// Browser compatible element getter
	function getElement(id){
		if (document.all)
		return document.all[id];
		if (document.getElementById(id))
		return document.getElementById(id);
		return null;
	}
		// generic display function
	function findElement(id){
		// Get the element by its id
		element = getElement(id);
		// make sure that the element was found
		if (! element) return;
		// get the object that will contain the x,y coordinates
		position = getElementPosition(element);
		// display the coordinates
		var ycoords = position.y + 40;
		crossobj=(dom)?document.getElementById("layer2").style : ie? document.all.layer2 : document.layer2;
		crossobj.top=ycoords;
		}
		
/************************************
 * PARA USO EN EDITORIALES          *
 * SE USA EN HISTORICOS				*
 ************************************/
 
function cambiaTab(celda){
	document.getElementById('divcelda1').style.display = "none";
	document.getElementById('celda1').style.cursor = "hand";
	document.getElementById('divcelda2').style.display = "none";
	document.getElementById('celda2').style.cursor = "hand";
	var nombreDiv = 'div' + celda;
	document.getElementById(nombreDiv).style.display = "block";
	document.getElementById(celda).style.cursor = "arrow";
	celdaSel = celda
	
}

/************************************
 * PARA USO EN EDITORIALES          *
 * SE USA EN HISTORICOS				*
 ************************************/

/*function mOut(celda){
	if (celdaSel !=celda)
	document.getElementById(celda).bgColor = "#ffffff";
}*/

/************************************
 * PARA USO EN EDITORIALES          *
 * SE USA EN HISTORICOS				*
 ************************************/

function ShowHideLayer(id,pos){
	if (document.getElementById(id).style.display == "none")
		{
		document.getElementById(id).style.display = "block";
		}
	else {
		document.getElementById(id).style.display = "none"; 
		}
} 
		

/*Función para la navegación de las Fotos Dinámicas de Portada y de Articulos*/function actualizafotosmenu(){	baseAddress = document.domain;
	baseAddress = baseAddress.toLowerCase( );

	var stagenorte= baseAddress.search('edtweb05');
	var stagenorte1= baseAddress.search('edtimd050sw');
	var stagereforma= baseAddress.search('cicweb08');
	var stagemural= baseAddress.search('cioweb01');
	var stagepalabra = baseAddress.search('edtweb08');
	var publico= baseAddress.search('.com');
					
	if (stagenorte > -1 || stagenorte1 > -1) {folderplaza= "elnorte";}
	if (stagereforma > -1) {folderplaza= "reforma";}			
	if (stagemural > -1)   {folderplaza= "mural";}
	if (stagepalabra > -1) {folderplaza= "palabra";}
	if (publico > -1) 
		{
			var entrada= baseAddress ;									
			var r = entrada.search("elnorte.com");
			var s = entrada.search("reforma.com");
			var t = entrada.search("mural.com");
			var p= entrada.search("palabra.com");
		}
									
	if (r > -1)	{folderplaza= "elnorte";}
	if (s > -1)	{folderplaza= "reforma";}			
	if (t > -1) {folderplaza= "mural";}
	if (p > -1) {folderplaza= "palabra";}
}function DateAdd (fecha,dias) {
  var buffer = Date.parse(fecha);
	dias *= 24; //dias
	dias *= 60; //minutos
	dias *= 60; //segundos
	dias *= 1000; //milisegundos
	fecha = new Date(buffer+dias);
 	buffer = null;
  return fecha;
}
function fechaArreglada (fecha,periocidad)
{
	var fechaAux = new Date();
	var weekdayAux = fecha.getDay();
	var diasAtras = 0;
	fechaEncontrada = false;
	do
	{
	  if (parseInt(Math.pow(2,weekdayAux)&periocidad) > 0)
		{
			fechaEncontrada = true;
		}
		else
		{
		  diasAtras++;
			weekdayAux-=1;
			weekdayAux%=7;
			if(weekdayAux<0)weekdayAux+=7;
		}
	}
	while(!fechaEncontrada);
	fechaAux=DateAdd(fecha,-diasAtras);
	return fechaAux;
}
function ligaEII(seccion,periodicidad){
//Periodicidad 1-domingo, 2-lunes, 4-martes, 8-miercoles, 16-jueves, 32-viernes, 64-sabado, 127-diario
    fechaLiga = new Date();
    fechaAux=fechaArreglada(fechaLiga,periodicidad)
    DirAux=new String(fechaAux.getFullYear())
    Dir=DirAux.slice(2)
    DirAux=new String(fechaAux.getMonth()+1)
    if(DirAux.length==1)DirAux='0'+DirAux
    Dir=Dir+DirAux
    DirAux=new String(fechaAux.getDate())
    if(DirAux.length==1)DirAux='0'+DirAux
 	LeftPosition = (screen.width) ? (screen.width-640)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-440)/2 : 0;
    var ligaTopMag = 'http://www.' + site + '.com/edicionimpresa/interactiva/default.asp?fecha='+Dir+DirAux+'&seccion='+seccion;
	window.open(ligaTopMag,'paginaMag','top=' + TopPosition + ',left=' + LeftPosition + ',width=800,height=400,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no');
}

