/* [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','801',jdecode('Inicio'),jdecode(''), jdecode('%2F801.html'), 'true',[],'',''],
	['PAGE','852',jdecode('acustica+y+ruidos'),jdecode(''), jdecode('%2F852%2Findex.html'), 'true',[ 
		['PAGE','14001',jdecode('saber+m%C3%A1s'),jdecode(''), jdecode('%2F852%2F14001.html'), 'true',[],'','']
	],'',''],
	['PAGE','873',jdecode('licencia+de+apertura'),jdecode(''), jdecode('%2F873%2Findex.html'), 'true',[ 
		['PAGE','8901',jdecode('saber+m%C3%A1s'),jdecode(''), jdecode('%2F873%2F8901.html'), 'true',[],'','']
	],'',''],
	['PAGE','134001',jdecode('declaracion+responsable'),jdecode(''), jdecode('%2F134001.html'), 'true',[],'',''],
	['PAGE','894',jdecode('obras+%26+edificaci%C3%B3n'),jdecode(''), jdecode('%2F894.html'), 'true',[],'',''],
	['PAGE','936',jdecode('informes+periciales'),jdecode(''), jdecode('%2F936.html'), 'true',[],'',''],
	['PAGE','5801',jdecode('servicios+a+empresas'),jdecode(''), jdecode('%2F5801%2Findex.html'), 'true',[ 
		['PAGE','7301',jdecode('arquitectura%26ingenier%C3%ADa'),jdecode(''), jdecode('%2F5801%2F7301.html'), 'true',[],'',''],
		['PAGE','7343',jdecode('empresas+instaladoras'),jdecode(''), jdecode('%2F5801%2F7343.html'), 'true',[],'',''],
		['PAGE','7722',jdecode('asesoramiento+t%C3%A9cnico'),jdecode(''), jdecode('%2F5801%2F7722.html'), 'true',[],'','']
	],'',''],
	['PAGE','957',jdecode('servicios+a+particulares'),jdecode(''), jdecode('%2F957.html'), 'true',[],'',''],
	['PAGE','978',jdecode('quienes+somos'),jdecode(''), jdecode('%2F978%2Findex.html'), 'true',[ 
		['PAGE','132101',jdecode('nuestro+compromiso'),jdecode(''), jdecode('%2F978%2F132101.html'), 'true',[],'','']
	],'',''],
	['PAGE','999',jdecode('CONTACTO'),jdecode(''), jdecode('%2F999.html'), 'true',[],'',''],
	['PAGE','1020',jdecode('bolsa+de+trabajo'),jdecode(''), jdecode('%2F1020.html'), 'true',[],'',''],
	['PAGE','18801',jdecode('HORARIO+ATENCION'),jdecode(''), jdecode('%2F18801.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Multimedia';
theSitetree.paletteFamily='3D464F';
theSitetree.keyvisualId='11111';
theSitetree.keyvisualName='kv_11111.jpg';
theSitetree.fontsetId='32006';
theSitetree.graphicsetId='13835';
theSitetree.contentColor='000F1F';
theSitetree.contentBGColor='3D464F';
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: 			'Multimedia',
				paletteFamily: 	'3D464F',
				keyvisualId: 	'11111',
				keyvisualName: 	'kv_11111.jpg',
				fontsetId: 		'32006',
				graphicsetId: 	'13835',
				contentColor: 	'000F1F',
				contentBGColor: '3D464F',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20110906-114819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20090519-121131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20110914-103653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20090519-121106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20090519-120240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1020',
internalId:  '',
customField: '20111010-181213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132101',
internalId:  '',
customField: '20110914-103224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '999',
internalId:  '',
customField: '20111010-175024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20090519-120321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134001',
internalId:  '',
customField: '20111109-142512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20110914-103537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20111010-181608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20110905-193202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '936',
internalId:  '',
customField: '20090519-103141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7343',
internalId:  '',
customField: '20090519-120430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20090519-120942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20110914-110909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20111010-175708'
};
webappMappings['7008']=webappMappings['7008-11456']={
webappId:    '7008',
documentId:  '999',
internalId:  '11456',
customField: 'language:es;country:ES;'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INL90O';
var companyName   = '+++++++++++++++dtena+ACUSTICA%2C+INGENIERIA+%26+EDIFICACION';
var htmlTitle	  = 'dtena%2C+ingenieria%26edificacion';
var metaKeywords  = 'dtena%2C+acustica%2C+ingenieria%2C+peritacion%2C+proyecto%2C+licencia+de+apertura%2C+licencia+de+actividad%2C+medicion+acustica%2C+obra%2C+medicion+de+ruido%2C+abogado%2C+informe+pericial%2C+administradores+de+fincas%2C+comunidad+de+propietarios%2C+arquitectura%2C+edificacion%2C+perito%2C+ingeniero%2C+arquitecto%2C+declaracion+responsable%2C+certificado+de+seguridad%2C+certificados+de+seguridad%2C+proyecto+tecnico%2C+proyecto+t%C3%A9cnico%2C+documentaci%C3%B3n+t%C3%A9cnica%2C+documentacion+tecnica%2C+certificado+de+direcci%C3%B3n+tecnica+de+instalaciones%2C+certificado+de+direcci%C3%B3n+t%C3%A9cnica+de+instalaciones%2C+informe+urban%C3%ADstico%2C+informe+urbanistico%2C+calificacion+ambiental%2C+licencia+de+instalacion%2C+memoria+de+calificacion+ambiental%2C+actividad+calificada%2C+dictamen+definitivo+del+instrumento+de+prevencion+y+control+ambiental%2C+cambio+de+titularidad%2C+certificado+de+medio+ambiente%2C+informe+de+prevencion+acustica%2C+informe+de+prevenci%C3%B3n+ac%C3%BAstica%2C+tramitaci%C3%B3n+de+licencias%2C+tramitacion+de+licencias%2C+licencia+de+obra%2C+estudio+ac%C3%BAstico%2C+estudio+acustico%2C+aislamiento+acustico';
var metaContents  = 'dtena+servicios+de+ingenieria+y+edificacion+para+particulares+y+empresas.';
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();
};

