/* [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 theSitetree=[ 
	['PAGE','4613',jdecode('Espa%C3%B1ol'),jdecode(''),'/4613/index.html','true',[ 
		['PAGE','4929',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''),'/4613/4929.html','true',[],''],
		['PAGE','4956',jdecode('Nuestro+equipo'),jdecode(''),'/4613/4956.html','true',[],''],
		['PAGE','4983',jdecode('Telas+escolares'),jdecode(''),'/4613/4983.html','true',[],''],
		['PAGE','5010',jdecode('Pa%C3%B1os'),jdecode(''),'/4613/5010.html','true',[],''],
		['PAGE','5037',jdecode('Tipicos'),jdecode(''),'/4613/5037.html','true',[],''],
		['PAGE','38919',jdecode('Lana'),jdecode(''),'/4613/38919.html','true',[],'']
	],''],
	['PAGE','28303',jdecode('English'),jdecode(''),'/28303/index.html','true',[ 
		['PAGE','28903',jdecode('Who+we+are%3F'),jdecode(''),'/28303/28903.html','true',[],''],
		['PAGE','5172',jdecode('Our+Team'),jdecode(''),'/28303/5172.html','true',[],''],
		['PAGE','28003',jdecode('Scotish+Fabrics'),jdecode(''),'/28303/28003.html','true',[],''],
		['PAGE','35193',jdecode('Felt'),jdecode(''),'/28303/35193.html','true',[],''],
		['PAGE','36500',jdecode('Traditional+Articles'),jdecode(''),'/28303/36500.html','true',[],''],
		['PAGE','38941',jdecode('Wool'),jdecode(''),'/28303/38941.html','true',[],'']
	],''],
	['PAGE','5199',jdecode('Cont%C3%A1ctenos+%2F+Contac+Us'),jdecode(''),'/5199.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1736';
theSitetree.keyvisualName='beauty.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1736',
				keyvisualName: 	'beauty.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-114922']={
webappId:    '1501',
documentId:  '4613',
internalId:  '114922',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4613',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20060714-135056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38919',
internalId:  '',
customField: '20090218-204953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5037',
internalId:  '',
customField: '20060714-173620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4929',
internalId:  '',
customField: '20060626-151548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4956',
internalId:  '',
customField: '20060626-151639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4983',
internalId:  '',
customField: '20060713-113132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5010',
internalId:  '',
customField: '20060713-115314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28303',
internalId:  '',
customField: '20060714-161426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28903',
internalId:  '',
customField: '20060626-155940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5172',
internalId:  '',
customField: '20060626-155428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28003',
internalId:  '',
customField: '20060713-175659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35193',
internalId:  '',
customField: '20060713-122131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36500',
internalId:  '',
customField: '20060713-181114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5199',
internalId:  '',
customField: '20070621-151652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38941',
internalId:  '',
customField: '20090218-205326'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INX2SE';
var companyName   = 'LA+LUZ+S.A.+DE+C.V.';
var htmlTitle	  = 'LA+LUZ+S.A.+DE+C.V.';
var metaKeywords  = 'textiles+lana+poliester';
var metaContents  = '';
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();
};
