/* [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','1101',jdecode('INICIO'),jdecode(''), jdecode('%2F1101.html'), 'true',[],'',''],
	['PAGE','6101',jdecode('Contacto+y+Mapa'),jdecode(''), jdecode('%2F6101.html'), 'true',[],'',''],
	['PAGE','10201',jdecode('Volantes'),jdecode(''), jdecode('%2F10201.html'), 'true',[],'',''],
	['PAGE','6185',jdecode('Tr%C3%ADpticos+y+D%C3%ADpticos'),jdecode(''), jdecode('%2F6185.html'), 'true',[],'',''],
	['PAGE','6164',jdecode('Lonas+y+Demostands'),jdecode(''), jdecode('%2F6164.html'), 'true',[],'',''],
	['PAGE','8501',jdecode('Postales+Posters+Folders'),jdecode(''), jdecode('%2F8501.html'), 'true',[],'',''],
	['PAGE','28001',jdecode('Tarjetas+de+Presentaci%C3%B3n'),jdecode(''), jdecode('%2F28001.html'), 'true',[],'',''],
	['PAGE','6122',jdecode('Impresi%C3%B3n+Digital'),jdecode(''), jdecode('%2F6122.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Evident';
theSitetree.paletteFamily='D94147';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10433';
theSitetree.graphicsetId='10777';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-hostin',
  product: 'WSCVWLSSSLYTC2IW'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Evident',
				paletteFamily: 	'D94147',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10433',
				graphicsetId: 	'10777',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D83F45',
				e_color: 		'7C272A',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20110820-144117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20120103-231401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20110902-181805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6185',
internalId:  '',
customField: '20110820-144238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6164',
internalId:  '',
customField: '20120103-233753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090803-220438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6122',
internalId:  '',
customField: '20110817-075212'
};
webappMappings['7008']=webappMappings['7008-26017']={
webappId:    '7008',
documentId:  '6101',
internalId:  '26017',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28001',
internalId:  '',
customField: '20120103-234033'
};
webappMappings['7008']=webappMappings['7008-26018']={
webappId:    '7008',
documentId:  '10201',
internalId:  '26018',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-26045']={
webappId:    '7008',
documentId:  '6122',
internalId:  '26045',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-26070']={
webappId:    '7008',
documentId:  '6185',
internalId:  '26070',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-26071']={
webappId:    '7008',
documentId:  '28001',
internalId:  '26071',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-26095']={
webappId:    '7008',
documentId:  '6164',
internalId:  '26095',
customField: 'language:es;country:ES;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INFUA0';
var companyName   = 'imprimimos+CON+LA+MEJOR+CALIDAD';
var htmlTitle	  = 'imprimimos';
var metaKeywords  = 'IMPRESION+OFFSET%3A+Folletos++++Revistas++++Cat%C3%A1logos++++Posters++++Tr%C3%ADpticos++++Etiquetas++++Cajas++++Volantes++++Facturas+Fiscales+SAT++++Hojas+Membretadas++++Men%C3%BAs++++Invitaciones++PROMOCIONALES%3A++Playeras++++Gorras++++Botones++++Agendas++++Encendedores+++++Bol%C3%ADgrafos++++Globos++++Maletas++++Chamarras++++Delantales+++Pines+++++Mouse+Pads+++++Imanes++++Relojes++++Tazas++ROTULACI%C3%93N%3B++Lonas+en+Selecci%C3%B3n+de+Color++++++++++DISE%C3%91O+GR%C3%81FICO++REGALOS+PERSONALIZADOS+PARA+ESCUELAS++INVITACIONES+XV+MUY+ORIGINALES+A%C3%91OS+BAUTIZO%2C+PORTADOCUMENTOS%2C+PORTACREDENCIALES%2C+GAFETES%2C+CARPETAS%2C+BRAZALETES.++++++++++++';
var metaContents  = 'OFFSET%3A+Folletos++++Revistas++++Cat%C3%A1logos++++Posters++++Tr%C3%ADpticos++++Etiquetas++++++Cajas++++Volantes++++Facturas+Fiscales+SAT++++Hojas+Membretadas++++Men%C3%BAs++++Invitaciones++PROMOCIONALES%3A++Playeras++++Gorras++++Botones++++Agendas++++Encendedores+++++Bol%C3%ADgrafos++++Globos++++Maletas++++Chamarras++++Delantales+++Pines+++++Mouse+Pads+++++Imanes++++Relojes++++Tazas++ROTULACI%C3%93N%3A++Lonas+en+Selecci%C3%B3n+de+Color++++++++++DISE%C3%91O+GR%C3%81FICO+++REGALOS+PERSONALIZADOS+PARA+ESCUELAS++INVITACIONES++MUY+ORIGINALES+XV+A%C3%91OS%2C+BAUTIZO%2C+PORTADOCUMENTOS%2C+PORTACREDENCIALES%2C+GAFETES%2C+CARPETAS%2C+BRAZALETES.+';
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();
};

