/* [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','501',jdecode('INICIO'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','25401',jdecode('OFERTAS+DEL+MES'),jdecode(''), jdecode('%2F25401.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Energ%C3%ADa+Solar'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','43801',jdecode('Agua+caliente'),jdecode(''), jdecode('%2F552%2F43801.html'), 'true',[],'',''],
		['PAGE','43822',jdecode('Electricidad'),jdecode(''), jdecode('%2F552%2F43822.html'), 'true',[],'',''],
		['PAGE','43843',jdecode('Calefacci%C3%B3n+Piscinas'),jdecode(''), jdecode('%2F552%2F43843.html'), 'true',[],'','']
	],'',''],
	['PAGE','39401',jdecode('Chimeneas+Ecol%C3%B3gicas'),jdecode(''), jdecode('%2F39401%2Findex.html'), 'true',[ 
		['PAGE','43201',jdecode('High+Tech'),jdecode(''), jdecode('%2F39401%2F43201.html'), 'true',[],'',''],
		['PAGE','43864',jdecode('N%C3%B3rdico'),jdecode(''), jdecode('%2F39401%2F43864.html'), 'true',[],'',''],
		['PAGE','43885',jdecode('Contempor%C3%A1neo'),jdecode(''), jdecode('%2F39401%2F43885.html'), 'true',[],'',''],
		['PAGE','43906',jdecode('Cl%C3%A1sico'),jdecode(''), jdecode('%2F39401%2F43906.html'), 'true',[],'',''],
		['PAGE','43927',jdecode('En+Gres'),jdecode(''), jdecode('%2F39401%2F43927.html'), 'true',[],'',''],
		['PAGE','43948',jdecode('Encastrables'),jdecode(''), jdecode('%2F39401%2F43948.html'), 'true',[],'',''],
		['PAGE','43969',jdecode('Interior-Exterior'),jdecode(''), jdecode('%2F39401%2F43969.html'), 'true',[],'',''],
		['PAGE','43990',jdecode('Accesorios'),jdecode(''), jdecode('%2F39401%2F43990.html'), 'true',[],'',''],
		['PAGE','44011',jdecode('Combustible'),jdecode(''), jdecode('%2F39401%2F44011.html'), 'true',[],'','']
	],'',''],
	['PAGE','22501',jdecode('Purificadores+de+agua'),jdecode(''), jdecode('%2F22501.html'), 'true',[],'',''],
	['PAGE','22522',jdecode('Descalcificadores'),jdecode(''), jdecode('%2F22522.html'), 'true',[],'',''],
	['PAGE','19722',jdecode('Agua+salada+para+piscinas'),jdecode(''), jdecode('%2F19722.html'), 'true',[],'',''],
	['PAGE','39422',jdecode('Cubiertas+para+piscina'),jdecode(''), jdecode('%2F39422.html'), 'true',[],'',''],
	['PAGE','19743',jdecode('Servicio+de+instalaci%C3%B3n'),jdecode(''), jdecode('%2F19743.html'), 'true',[],'',''],
	['PAGE','19401',jdecode('Cont%C3%A1ctenos'),jdecode(''), jdecode('%2F19401.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='86862D';
theSitetree.keyvisualId='910';
theSitetree.keyvisualName='kinder.jpg';
theSitetree.fontsetId='167';
theSitetree.graphicsetId='196';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'piensa',
  product: 'WSCSYSSSSLYTC2IR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'86862D',
				keyvisualId: 	'910',
				keyvisualName: 	'kinder.jpg',
				fontsetId: 		'167',
				graphicsetId: 	'196',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'86862D',
				c_color: 		'000000',
				d_color: 		'2C331B',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091122-192922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22522',
internalId:  '',
customField: '20091120-213828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091122-200034'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20091122-192900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19722',
internalId:  '',
customField: '20091122-211200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19743',
internalId:  '',
customField: '20091122-193135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20090806-184255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20091122-200416'
};
webappMappings['1501']=webappMappings['1501-9053079']={
webappId:    '1501',
documentId:  '501',
internalId:  '9053079',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20091122-202338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39422',
internalId:  '',
customField: '20091122-211457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20091120-225853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43801',
internalId:  '',
customField: '20091122-200525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43822',
internalId:  '',
customField: '20091121-175448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43843',
internalId:  '',
customField: '20091122-200618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43864',
internalId:  '',
customField: '20091120-202111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43885',
internalId:  '',
customField: '20091120-202226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43906',
internalId:  '',
customField: '20091120-202336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43927',
internalId:  '',
customField: '20091120-202403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43948',
internalId:  '',
customField: '20091120-202429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43969',
internalId:  '',
customField: '20091120-202512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43990',
internalId:  '',
customField: '20091120-221005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44011',
internalId:  '',
customField: '20091120-202605'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INLJMQ';
var companyName   = 'Hacemos+su+hogar+mas+%22eficiente%22+++++';
var htmlTitle	  = 'Ecodomus+Hogares+Eficientes';
var metaKeywords  = 'purificadores+de+agua++osmosis+inversa++descalcificadores++paneles+solares++piscinas+de+agua+salada';
var metaContents  = 'purificadores+de+agua%2C++osmosis+inversa%2C++descalcificadores%2C++paneles+solares%2C++piscinas+de+agua+salada%2C+chimeneas+ecologicas%2C+cubiertas+de+piscinas%2C+climatizaci%C3%B3n+de+piscinas%2C+chimeneas+de+bioetanol+';
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();
};

