/* [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','16801',jdecode('Natura+Senses'),jdecode(''),'/16801.html','true',[],''],
	['PAGE','16601',jdecode('Lumi%C3%A8re+Light+Th%C3%A8rapie'),jdecode(''),'/16601.html','true',[],''],
	['PAGE','16652',jdecode('Contacto'),jdecode(''),'/16652.html','true',[],''],
	['PAGE','18101',jdecode('Promociones'),jdecode(''),'/18101.html','true',[],''],
	['PAGE','18301',jdecode('Links'),jdecode(''),'/18301.html','true',[],''],
	['PAGE','18322',jdecode('Blog'),jdecode(''),'/18322.html','true',[],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Oblique';
theSitetree.paletteFamily='9EC78C';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33314';
theSitetree.graphicsetId='14184';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Oblique',
				paletteFamily: 	'9EC78C',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33314',
				graphicsetId: 	'14184',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-5795']={
webappId:    '7008',
documentId:  '16652',
internalId:  '5795',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20090324-191025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20090324-191123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16652',
internalId:  '',
customField: '20090324-185228'
};
webappMappings['7008']=webappMappings['7008-5800']={
webappId:    '7008',
documentId:  '18101',
internalId:  '5800',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20090324-191200'
};
webappMappings['7050']=webappMappings['7050-1393']={
webappId:    '7050',
documentId:  '18322',
internalId:  '1393',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20090324-191225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18322',
internalId:  '',
customField: '20090324-191247'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INV7TW';
var companyName   = 'Natura+Senses%E2%84%A2';
var htmlTitle	  = 'Natura+Senses...+descubre+la+luz+de+tu+belleza.';
var metaKeywords  = 'terapias+de+luz%2C+lumiere%2C+natura+senses%2C+light+therapy%2C+rejuvenecimiento%2C+envejecimiento%2C+cicatrices%2C+manchas%2C+acne%2C+arrugas%2C+lineas+de+expresi%C3%B3n%2C+poros%2C+tonicidad%2C+tono%2C+textura%2C+colageno%2C+elastina%2C+celulitis%2C+tratamientos%2C+faciales%2C+natural';
var metaContents  = 'rejuvenecimiento+facial%2C+control+de+acne%2C+quitar+arrugas%2C+eliminar+manchas%2C+quitar+manchas%2C+reduccion+de+poros%2C+tono+de+la+piel%2C+unificar+tono%2C+textura+de+la+piel%2C+tratamientos+para+la+piel%2C+tratamientos+para+quitar+manchas%2C+tratamientos+naturales%2C+tratamientos+para+quitar+arrugas%2C+tratamientos+faciales%2C+no+invasivo%2C+100%25+natural%2C+sin+dolor%2C+sin+molestias%2C+sin+cirugias%2C+sin+cicatrices';
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();
};
