/* [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(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('%C2%BFQui%C3%A9n+somos%3F'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','6701',jdecode('Nuestros+Clientes'),jdecode(''),'/552/6701.html','true',[],'','']
	],'',''],
	['PAGE','4901',jdecode('Servicios+y+Calidad'),jdecode(''),'/4901/index.html','true',[ 
		['PAGE','11001',jdecode('Pol%C3%ADtica+de+Calidad'),jdecode(''),'/4901/11001.html','true',[],'',''],
		['PAGE','4922',jdecode('Carrier+Transicold'),jdecode(''),'/4901/4922.html','true',[],'',''],
		['PAGE','4943',jdecode('Serv.+Premium+LG+'),jdecode(''),'/4901/4943.html','true',[],'',''],
		['PAGE','4964',jdecode('Term%C3%B3grafos'),jdecode(''),'/4901/4964.html','true',[],'','']
	],'',''],
	['PAGE','573',jdecode('%C3%81lbum+de+fotos'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','657',jdecode('Ubicaci%C3%B3n+y+Contacto'),jdecode(''),'/657/index.html','true',[ 
		['PAGE','678',jdecode('Contacto'),jdecode(''),'/657/678.html','true',[],'',''],
		['PAGE','3901',jdecode('Contacto+%28follow+up+page%29'),jdecode(''),'/657/3901.html','false',[],'',''],
		['PAGE','5901',jdecode('Mapa+de+acceso'),jdecode(''),'/657/5901.html','true',[],'',''],
		['PAGE','6001',jdecode('C%C3%B3mo+encontrarnos'),jdecode(''),'/657/6001.html','true',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Commercial';
theSitetree.paletteFamily='C5E8FE';
theSitetree.keyvisualId='10203';
theSitetree.keyvisualName='flowers.swf';
theSitetree.fontsetId='21116';
theSitetree.graphicsetId='13215';
theSitetree.contentColor='004272';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Commercial',
				paletteFamily: 	'C5E8FE',
				keyvisualId: 	'10203',
				keyvisualName: 	'flowers.swf',
				fontsetId: 		'21116',
				graphicsetId: 	'13215',
				contentColor: 	'004272',
				contentBGColor: 'FFFFFF',
				a_color: 		'e6e6e6',
				b_color: 		'ffffff',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091117-121413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20091112-150210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20091112-200329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20091112-133916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091113-073453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20091113-073555'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5901',
internalId:  'location',
customField: 'language:es;country:ES;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6001',
internalId:  'routing',
customField: 'es_ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20091112-142421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20091112-142343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20091112-150018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4943',
internalId:  '',
customField: '20091112-200828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4922',
internalId:  '',
customField: '20091112-200708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4964',
internalId:  '',
customField: '20100211-182052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100104-154326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20091112-133447'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-7201']={
webappId:    '7008',
documentId:  '678',
internalId:  '7201',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwd718.servidoresdns.net';
var accountId     = 'AARS20INLTY9';
var companyName   = 'INDUFRET+S.L';
var htmlTitle	  = 'Termografo+%2F+Termografos+BARATOS%2C+modelos+homologados+y+validados+%28www.indufret.com%29';
var metaKeywords  = 'Termografos%2C+termografo%2C+registrador+de+temperaturas%2C+refrigeracion+para+el+transporte%2C+carrier%2C+carrier+transicold%2C+thermo+king.';
var metaContents  = 'Venta+de+Term%C3%B3grafos%2C+refrigeracci%C3%B3n+para+el+transporte%2C+refrigeraci%C3%B3n+industrial%2C+aire+acondicionado+LG+dom%C3%A9stico+e+industrial.';
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();
};
