/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','401',jdecode('INICIO'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('CD.+VICTORIA'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','5443',jdecode('REYNOSA'),jdecode(''), jdecode('%2F5443.html'), 'true',[],'',''],
	['PAGE','7601',jdecode('MATAMOROS'),jdecode(''), jdecode('%2F7601.html'), 'true',[],'',''],
	['PAGE','1632462',jdecode('LAREDO'),jdecode(''), jdecode('%2F1632462.html'), 'true',[],'',''],
	['PAGE','5464',jdecode('TAMPICO'),jdecode(''), jdecode('%2F5464.html'), 'true',[],'',''],
	['PAGE','5485',jdecode('ALTAMIRA'),jdecode(''), jdecode('%2F5485.html'), 'true',[],'',''],
	['PAGE','5506',jdecode('MADERO'),jdecode(''), jdecode('%2F5506.html'), 'true',[],'',''],
	['PAGE','492801',jdecode('OCAMPO'),jdecode(''), jdecode('%2F492801.html'), 'true',[],'',''],
	['PAGE','342601',jdecode('LLERA+DE+CANALES'),jdecode(''), jdecode('%2F342601.html'), 'true',[],'',''],
	['PAGE','5527',jdecode('SOTO+LA+MARINA'),jdecode(''), jdecode('%2F5527.html'), 'true',[],'',''],
	['PAGE','5548',jdecode('JAUMAVE'),jdecode(''), jdecode('%2F5548.html'), 'true',[],'',''],
	['PAGE','737012',jdecode('TULA'),jdecode(''), jdecode('%2F737012.html'), 'true',[],'',''],
	['PAGE','6201',jdecode('REGIONAL'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','305301',jdecode('AMBROSIO+GARZA+D.'),jdecode(''), jdecode('%2F305301.html'), 'false',[],'',''],
	['PAGE','790012',jdecode('Atascadero'),jdecode(''), jdecode('%2F790012.html'), 'false',[],'',''],
	['PAGE','325301',jdecode('El+chango+platanero'),jdecode(''), jdecode('%2F325301.html'), 'false',[],'',''],
	['PAGE','414101',jdecode('frases'),jdecode(''), jdecode('%2F414101.html'), 'true',[],'',''],
	['PAGE','363201',jdecode('Enlaces+de+inter%C3%A9s'),jdecode(''), jdecode('%2F363201.html'), 'true',[],'',''],
	['PAGE','11801',jdecode('DIRECTORIO'),jdecode(''), jdecode('%2F11801.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='669900';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='481';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-hostin',
  product: 'WSCSYSSSSLY0XJEZ'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Card',
				paletteFamily: 	'669900',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'481',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-9489150']={
webappId:    '1501',
documentId:  '401',
internalId:  '9489150',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20111206-231108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20111107-090230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20110831-093503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100623-085751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5464',
internalId:  '',
customField: '20110811-082527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5485',
internalId:  '',
customField: '20111116-093639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5506',
internalId:  '',
customField: '20110629-084723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5527',
internalId:  '',
customField: '20111107-090354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5548',
internalId:  '',
customField: '20110830-093432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20111107-090622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '305301',
internalId:  '',
customField: '20111129-053623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '342601',
internalId:  '',
customField: '20110310-083855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '325301',
internalId:  '',
customField: '20090802-204017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20080513-082658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '363201',
internalId:  '',
customField: '20090119-161228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '414101',
internalId:  '',
customField: '20090427-081436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '492801',
internalId:  '',
customField: '20110901-072837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '737012',
internalId:  '',
customField: '20090730-195917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '790012',
internalId:  '',
customField: '20091105-090916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1632462',
internalId:  '',
customField: '20110103-123036'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INFTOV';
var companyName   = 'Martes+24+de+Enero++del+2012+++++++CD.+Victoria+Tamaulipas';
var htmlTitle	  = 'Periodico+Ejepol%C3%ADtico+El+Despertar+de+Tamaulipas';
var metaKeywords  = 'ejepol%C3%ADtico';
var metaContents  = 'periodismo+de+combate+ejepolitico+Ambrosio+Garza+Dragustinovis.++';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};

