/* [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','4613',jdecode('Inicio'),jdecode(''),'/4613.html','true',[],'',''],
	['PAGE','4724',jdecode('Productos'),jdecode(''),'/4724/index.html','true',[ 
		['PAGE','4751',jdecode('Art%C3%ADculos+para+Premiaci%C3%B3n'),jdecode(''),'/4724/4751.html','true',[],'',''],
		['PAGE','4778',jdecode('Art.+Promocionales+A-M'),jdecode(''),'/4724/4778.html','true',[],'',''],
		['PAGE','193112',jdecode('Art.+Promocionales+N-Z'),jdecode(''),'/4724/193112.html','true',[],'',''],
		['PAGE','9703',jdecode('Eventos'),jdecode(''),'/4724/9703.html','true',[],'',''],
		['PAGE','11813',jdecode('Fotograf%C3%ADa'),jdecode(''),'/4724/11813.html','true',[],'',''],
		['PAGE','4805',jdecode('Imagen+Corporativa'),jdecode(''),'/4724/4805.html','true',[],'','']
	],'',''],
	['PAGE','4859',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/4859.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Global';
theSitetree.paletteFamily='CC3300';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='85';
theSitetree.graphicsetId='107';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Global',
				paletteFamily: 	'CC3300',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'85',
				graphicsetId: 	'107',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'CB1C00',
				b_color: 		'FF9900',
				c_color: 		'000000',
				d_color: 		'EAEAEA',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4613',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-109917']={
webappId:    '1501',
documentId:  '4613',
internalId:  '109917',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20100610-174411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4724',
internalId:  '',
customField: '20090422-131826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4751',
internalId:  '',
customField: '20100413-205059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4778',
internalId:  '',
customField: '20100610-180442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9703',
internalId:  '',
customField: '20090422-132015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11813',
internalId:  '',
customField: '20100421-154038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4805',
internalId:  '',
customField: '20090422-132208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '193112',
internalId:  '',
customField: '20100602-175040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4859',
internalId:  '',
customField: '20100610-181108'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXXFL';
var companyName   = 'Consorcio++Publicitario++y++Eventos';
var htmlTitle	  = 'www.conpuben.com.mx';
var metaKeywords  = 'plumas+llaveros+medallas+invitaciones+globos+payasos+diplomas+reconocimientos+fotos+agendas+calendarios+usbs+cds+chamarras+rompevientos+medallas+fistoles+pins+gomas+reglas+calculadoras';
var metaContents  = 'abanicos%2C+abanico+tela%2C+abanico+plastico%2C+articulos+de+acrilico%2C+buzon%2C+urnas%2C+tombolas%2C+agendas%2C+directorios%2C+agenda+magnetica%2C+audio+y+sonido%2C+radios+portatiles%2C+radio+AM%2C+radio+FM%2C+automovil%2C+auto%2C+coche%2C+parasol+naylon%2C+parasol%2C+tyvek%2C+bolsa+basura+auto%2C+portaplaca%2C+bebidas%2C+bar+y+vino%2C+taza+termica%2C+taza+conica%2C+belleza%2C+cuidado+y+uso+personal%2C+bolsa+plastico%2C+poliuretano%2C+bolsa+kraft%2C+bolsa+ri%C3%B1on%2C+bolsa+couche%2C+bolsa+dise%C3%B1o%2C+bolsa+traslucida%2C+bolsa+vino%2C+cavas%2C+articulos+promocionales%2C+articulos+de+premiacion%2C+coordinacion+de+eventos%2C+impresiones+en+general%2C+regalos+institucionales%2C+regalos+corporativos%2C+regalos+empresariales%2C+fotografia+digital%2C+articulos+para+promociones%2C+articulos+para+premiacion%2C+coordinamos+tus+eventos%2C+imprimimos+de+todo+en+todo%2C+regalos+para+todos+y+todas+ocasiones%2C+enmarcado+y+poliester';
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();
};
