/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','352',jdecode('A+Caldetec'),jdecode(''),'/352/index.html','true',[ 
		['PAGE','373',jdecode('Produtos+e+Servi%C3%A7os'),jdecode(''),'/352/373.html','true',[],''],
		['PAGE','25501',jdecode('Cozinhadores+de+Caldas'),jdecode(''),'/352/25501.html','true',[],''],
		['PAGE','25601',jdecode('Dispersores'),jdecode(''),'/352/25601.html','true',[],''],
		['PAGE','25622',jdecode('Filtros'),jdecode(''),'/352/25622.html','true',[],''],
		['PAGE','27301',jdecode('Instala%C3%A7%C3%B5es+de+Resinas'),jdecode(''),'/352/27301.html','true',[],''],
		['PAGE','27401',jdecode('Laborat%C3%B3rio'),jdecode(''),'/352/27401.html','true',[],''],
		['PAGE','27501',jdecode('Masseiras'),jdecode(''),'/352/27501.html','true',[],''],
		['PAGE','27601',jdecode('Misturadores'),jdecode(''),'/352/27601.html','true',[],''],
		['PAGE','29201',jdecode('Montagens+Industriais'),jdecode(''),'/352/29201.html','true',[],''],
		['PAGE','29301',jdecode('Reatores'),jdecode(''),'/352/29301.html','true',[],''],
		['PAGE','29701',jdecode('Silos'),jdecode(''),'/352/29701.html','true',[],''],
		['PAGE','29801',jdecode('Tanques'),jdecode(''),'/352/29801.html','true',[],'']
	],''],
	['PAGE','415',jdecode('Contato'),jdecode(''),'/415.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='49';
theSitetree.graphicsetId='57';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Easy',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'49',
				graphicsetId: 	'57',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090217-094124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20090113-110521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20090622-182551'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '415',
internalId:  '',
customField: '20090827-112139'
};
webappMappings['7060']=webappMappings['7060-e63e0c51e8cf66d49549b151bc1d5c71']={
webappId:    '7060',
documentId:  '25501',
internalId:  'e63e0c51e8cf66d49549b151bc1d5c71',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-670726a663219f4658e58a104e121b92']={
webappId:    '7060',
documentId:  '25601',
internalId:  '670726a663219f4658e58a104e121b92',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-6a995743047db5860b687de57f893984']={
webappId:    '7060',
documentId:  '25622',
internalId:  '6a995743047db5860b687de57f893984',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-46e703f3bd48ff349e0326a2d4fb2c4f']={
webappId:    '7060',
documentId:  '27301',
internalId:  '46e703f3bd48ff349e0326a2d4fb2c4f',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-ce04380c4d8231972dad92db793abb18']={
webappId:    '7060',
documentId:  '27401',
internalId:  'ce04380c4d8231972dad92db793abb18',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-de12bd2f801276edc255eabc9dbbd4bb']={
webappId:    '7060',
documentId:  '27501',
internalId:  'de12bd2f801276edc255eabc9dbbd4bb',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-66135e5f47fa38c799c91e20fc24b279']={
webappId:    '7060',
documentId:  '27601',
internalId:  '66135e5f47fa38c799c91e20fc24b279',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-6d63c0f5f33fc01ec58544020e57dce6']={
webappId:    '7060',
documentId:  '29201',
internalId:  '6d63c0f5f33fc01ec58544020e57dce6',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-8833bf750d5e7442529c2e63da487e6e']={
webappId:    '7060',
documentId:  '29301',
internalId:  '8833bf750d5e7442529c2e63da487e6e',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-3279caa8a9329de57fff37691573513e']={
webappId:    '7060',
documentId:  '29701',
internalId:  '3279caa8a9329de57fff37691573513e',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-faaaff3a0d71dbb3294f32c0f231ea40']={
webappId:    '7060',
documentId:  '29801',
internalId:  'faaaff3a0d71dbb3294f32c0f231ea40',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20090622-183702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25601',
internalId:  '',
customField: '20090622-183723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25622',
internalId:  '',
customField: '20090622-183746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27301',
internalId:  '',
customField: '20090622-183047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27401',
internalId:  '',
customField: '20090622-183143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20090622-183212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20090622-183311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20090622-183353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20090622-183446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20090622-183520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20090622-183607'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLR3F';
var companyName   = 'CALDETEC';
var htmlTitle	  = 'Caldetec';
var metaKeywords  = '';
var metaContents  = 'calderaria++maquina+de+calda';
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();
};
