/* [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','373',jdecode('BIENVENIDOS'),jdecode(''),'/373.html','true',[],'',''],
	['PAGE','4722',jdecode('PRODUCTOS'),jdecode(''),'/4722/index.html','true',[ 
		['PAGE','22301',jdecode('Materias+Primas'),jdecode(''),'/4722/22301.html','true',[],'',''],
		['PAGE','4701',jdecode('Art%C3%ADculos+para+Decoracion'),jdecode(''),'/4722/4701.html','true',[],'',''],
		['PAGE','4743',jdecode('Accesorios+y+Utensilios'),jdecode(''),'/4722/4743.html','true',[],'','']
	],'',''],
	['PAGE','19101',jdecode('CURSOS'),jdecode(''),'/19101/index.html','true',[ 
		['PAGE','53801',jdecode('DECORACION+TECNICA+WILTON'),jdecode(''),'/19101/53801.html','true',[],'',''],
		['PAGE','19122',jdecode('Calendario'),jdecode(''),'/19101/19122.html','true',[],'',''],
		['PAGE','55001',jdecode('Calendario+II'),jdecode(''),'/19101/55001.html','false',[],'',''],
		['PAGE','51601',jdecode('calendario+III'),jdecode(''),'/19101/51601.html','false',[],'','']
	],'',''],
	['PAGE','12801',jdecode('CAT%C3%81LOGO+FOTOGR%C3%81FICO'),jdecode(''),'/12801.html','true',[],'',''],
	['PAGE','4785',jdecode('CONTACTO'),jdecode(''),'/4785.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2445';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='405';
theSitetree.graphicsetId='461';
theSitetree.contentColor='2F325F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2445',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'405',
				graphicsetId: 	'461',
				contentColor: 	'2F325F',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-59b290347e183ccb40a8f90635afe355']={
webappId:    '7060',
documentId:  '12801',
internalId:  '59b290347e183ccb40a8f90635afe355',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20100518-163240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20061204-173702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20070814-161405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20070109-165609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20061204-174000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20100715-143618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20100705-162302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20070211-144337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4785',
internalId:  '',
customField: '20080802-104446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20100715-145013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53801',
internalId:  '',
customField: '20100705-161701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55001',
internalId:  '',
customField: '20100715-161245'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2VA7';
var companyName   = '%C2%A1%C2%A1+Bienvenidos+a+ParaPastel+%21%21';
var htmlTitle	  = 'PARA+PASTEL';
var metaKeywords  = 'PASTELES+PAYS+PIES+MATERIAS+PRIMAS+PASTELERIA+ACCESORIOS+COCINA+MOLDES+DUYAS+DUYAS+MANGAS+ESPATULAS+CUCHILLOS+MARGARINA+CHANTILLY+';
var metaContents  = 'SOMOS+PROVEEDORES+DE+MATERIAS+PRIMAS%2C+ACCESORIOS+Y+ART%C3%8DCULOS+PARA+LA+INDUSTRIA+PASTELERA+Y+REPOSTERA.+CON+20+A%C3%91OS+DE+PRESENCIA+EN+EL+MERCADO+DEL+BAJ%C3%8DO.';
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();
};
