/* [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','14101',jdecode('Nosotros'),jdecode(''),'/14101.html','true',[],'',''],
	['PAGE','4052',jdecode('Servicios+de+Marketing'),jdecode(''),'/4052/index.html','true',[ 
		['PAGE','20701',jdecode('E-mailing+Ejecutivos+TOP'),jdecode(''),'/4052/20701.html','true',[],'','']
	],'',''],
	['PAGE','4073',jdecode('Soluciones+de+Impresi%C3%B3n'),jdecode(''),'/4073.html','true',[],'',''],
	['PAGE','4094',jdecode('Soluciones+CRM'),jdecode(''),'/4094.html','true',[],'',''],
	['PAGE','4115',jdecode('Soluciones+ERP'),jdecode(''),'/4115.html','true',[],'',''],
	['PAGE','17301',jdecode('Nuestros+Partners'),jdecode(''),'/17301.html','true',[],'',''],
	['PAGE','4136',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/4136.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Oblique';
theSitetree.paletteFamily='7193BF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33310';
theSitetree.graphicsetId='14182';
theSitetree.contentColor='4A6F9F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Oblique',
				paletteFamily: 	'7193BF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33310',
				graphicsetId: 	'14182',
				contentColor: 	'4A6F9F',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20100430-205511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4052',
internalId:  '',
customField: '20100430-205243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4073',
internalId:  '',
customField: '20100430-205328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4094',
internalId:  '',
customField: '20100430-205357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4115',
internalId:  '',
customField: '20100430-205430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4136',
internalId:  '',
customField: '20100430-205546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100430-205148'
};
webappMappings['7050']=webappMappings['7050-3929']={
webappId:    '7050',
documentId:  '20701',
internalId:  '3929',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-10043']={
webappId:    '7008',
documentId:  '4136',
internalId:  '10043',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100430-233300'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHB0D';
var companyName   = 'Enfot%C3%A1ctica%3A+Consultor%C3%ADa+%26+Soluciones+TI';
var htmlTitle	  = 'Enfot%C3%A1ctica%2C+servicios+de+marketing%2C+consultor%C3%ADa+TI%2C+impresi%C3%B3n+digital%2C+software+CRM%2C+programa+ERP';
var metaKeywords  = 'Enfot%C3%A1ctica%2C+marketing%2C+consultor%C3%ADa%2C+dise%C3%B1o%2C+Web%2C+e-mailing%2C+impresi%C3%B3n+digital%2C+CRM%2C+ERP.';
var metaContents  = 'Enfot%C3%A1ctica%3B+servicios+de+marketing+relacional%2C+dise%C3%B1o+gr%C3%A1fico+y+Web%2C+campa%C3%B1as+de+e-mailing+y+direct+mail.+Consultor%C3%ADa+e+integraci%C3%B3n+de+soluciones+de+tecnolog%C3%ADa%2C+impresi%C3%B3n+digital%2C+software+CRM+y+programas+ERP.';
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();
};
