function GRConfig() { this.Protocol = window.location.protocol; this.TLD = (/\.mx/i).test(window.location.hostname) ? ".mx" : ""; this.NuestroHost = this.Protocol + "//www.reforma.com" + this.TLD + "/"; this.EsStage = false; this.stageBase = function() { this.EsStage = !(/\.com/i).test(window.location.hostname); }; this.AnchoModal = 732; this.AltoModal = 622; this.IdPlaza = this.Get_Plaza(); this.IdSCHome = 672; this.comboftsuburbanas = { Item: [ { nombre: 'Club', idcoma: 109, idcms: 115, idft: 91 }, { nombre: 'Club Querétaro', idcoma: -1, idcms: 204, idft: 773 }, { nombre: 'Cumbres', idcoma: 0, idcms: 166, idft: 765 }, { nombre: 'Red Carpet', idcoma: 110, idcms: 116, idft: 760 }, { nombre: 'Todas', idcoma: -1, idcms: -1, idft: -1 } ] }; this.NombrePlaza = 'REFORMA'; this.IdProducto = 3; this.pathHndlr = this.Protocol + "//www.reforma.com" + this.TLD + "/aplicacioneslibre/handler.ashx"; this.ActivarTip = false; this.arrowNavP = { Portadas: [ { Texto: "Portada", Url: "" }, { Texto: "Opinión", Url: "editoriales/" }, { Texto: "Internacional", Url: "internacional/" }, { Texto: "Nacional", Url: "nacional/" }, { Texto: "Ciudad", Url: "ciudad/" }, { Texto: "Justicia", Url: "justicia/" }, { Texto: "Estados", Url: "estados/" }, { Texto: "Gente", Url: "gente/" }, { Texto: "Cultura", Url: "cultura/" }, { Texto: "Ciencia", Url: "ciencia/" }, { Texto: "Gadgets", Url: "gadgets/" }, { Texto: "Automotriz", Url: "automotriz/" }, { Texto: "Buena Mesa", Url: "buenamesa/" }, { Texto: "Revista R", Url: "revistar/" }, { Texto: "Vida", Url: "vida/" }, { Texto: "Moda", Url: "moda/" }, { Texto: "De Viaje", Url: "deviaje/" } ] } this.menuCategoriaActivada = true; this.IdSubCategoria = null; this.HeaderOverride = { subcategorias: [{ id: 1548, label: 'Fashion Week', url: 'moda/fashionweek/'}] }; } GRConfig.prototype.Get_Plaza = function() { var plaza = ''; if (!this.cookie_Habilitada()) alert("Para poder accesar al sitio correctamente se debe tener las Cookies habilitadas!"); plaza = this.Get_PlazaQueryString('pc'); if (plaza == null || typeof (plaza) == "undefined" || !this.Valida_Plaza(plaza)) { if (window.location.href.indexOf("Defaultn.htm") > -1 || window.location.href.indexOf("defaultn.htm") > -1) { plaza = '101'; } else if (window.location.href.indexOf("Defaultr.htm") > -1 || window.location.href.indexOf("defaultr.htm") > -1) { plaza = '102'; } else if (window.location.href.indexOf("Defaultm.htm") > -1 || window.location.href.indexOf("defaultm.htm") > -1) { plaza = '103'; } else { plaza = this.GetPlazaByUrl(); } } this.Set_CookiePlaza(plaza, 30); return plaza; } GRConfig.prototype.cookie_Habilitada = function() { return navigator.cookieEnabled; } GRConfig.prototype.Get_PlazaQueryString = function(qs) { var qsParam = new Array(); if (window.location.search) { var querys = window.location.search.substring(1); var param = querys.split('&'); for (var i = 0; i < param.length; i++) { var pos = param[i].indexOf('='); if (pos > 0) { var key = param[i].substring(0, pos); var val = param[i].substring(pos + 1); qsParam[key] = val; } } querystring = qsParam[qs]; return querystring; } return null; } GRConfig.prototype.Valida_Plaza = function(plaza) { var plazas_disp = ["101", "102", "103"]; return (plazas_disp.indexOf(plaza) != -1); } GRConfig.prototype.Set_CookiePlaza = function(cookieValue, nDays) { this.SetCookie("grcidfte", cookieValue, nDays); } GRConfig.prototype.SetCookie = function(cookieName, cookieValue, nDays) { var today = new Date(); var expire = new Date(); if (nDays == null || nDays == 0) nDays = 30; expire.setTime(today.getTime() + 3600000 * 24 * nDays); if (this.EsStage) { expire.setTime(today.getTime() + 24 * 60 * 60 * 1000 * nDays); document.cookie = cookieName + "=" + escape(cookieValue) + "; expires=" + expire.toGMTString() + "; path = /"; } else { document.cookie = cookieName + "=" + escape(cookieValue) + "; expires=" + expire.toGMTString() + "; path = /;domain=." + this.obtieneDominio(); } } GRConfig.prototype.obtieneDominio = function() { var dominio = window.location.hostname; dominio = dominio.replace(/^(www|gruporeforma|comercial)\./i, ''); return dominio; } GRConfig.prototype.GetPlazaByUrl = function() { var plaza = '102'; if ((/elnorte/i).test(window.location.hostname)) { plaza = '101'; } else if ((/stage\/elnorte/i).test(window.location.pathname)) { plaza = '101'; } else if ((/mural/i).test(window.location.hostname)) { plaza = '103'; } else if ((/stage\/mural/i).test(window.location.pathname)) { plaza = '103'; } this.Set_CookiePlaza(plaza, 30); return plaza; } //Este texto es solo para probar qeu cambio el archivo y no hace cache EEMC 2017/07/09 18:47