/* [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','1801',jdecode('HOME'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','51601',jdecode('QUEM+SOMOS'),jdecode(''),'/51601.html','true',[],'',''],
	['PAGE','165001',jdecode('CADASTRE-SE'),jdecode(''),'/165001.html','true',[],'',''],
	['PAGE','223312',jdecode('SEGUROS'),jdecode(''),'/223312/index.html','true',[ 
		['PAGE','223333',jdecode('AUTOM%C3%93VEL'),jdecode(''),'/223312/223333.html','true',[],'',''],
		['PAGE','223375',jdecode('RESIDENCIAL'),jdecode(''),'/223312/223375.html','true',[],'',''],
		['PAGE','223396',jdecode('CONDOM%C3%8DNIO'),jdecode(''),'/223312/223396.html','true',[],'',''],
		['PAGE','223417',jdecode('EMPRESARIAL'),jdecode(''),'/223312/223417.html','true',[],'',''],
		['PAGE','223438',jdecode('VIDA'),jdecode(''),'/223312/223438.html','true',[],'',''],
		['PAGE','223459',jdecode('SA%C3%9ADE'),jdecode(''),'/223312/223459.html','true',[],'',''],
		['PAGE','223480',jdecode('ODONTOL%C3%93GICO'),jdecode(''),'/223312/223480.html','true',[],'',''],
		['PAGE','223501',jdecode('FIADOR+ALUGUEL'),jdecode(''),'/223312/223501.html','true',[],'',''],
		['PAGE','223522',jdecode('TRANSPORTES'),jdecode(''),'/223312/223522.html','true',[],'',''],
		['PAGE','224712',jdecode('N%C3%81UTICO'),jdecode(''),'/223312/224712.html','true',[],'','']
	],'',''],
	['PAGE','51664',jdecode('CONS%C3%93RCIOS'),jdecode(''),'/51664.html','true',[],'',''],
	['PAGE','67901',jdecode('PREVID%C3%8ANCIA'),jdecode(''),'/67901.html','true',[],'',''],
	['PAGE','51685',jdecode('FINANCIAMENTOS'),jdecode(''),'/51685.html','true',[],'',''],
	['PAGE','191401',jdecode('CART%C3%83O+DE+CR%C3%89DITO'),jdecode(''),'/191401.html','true',[],'',''],
	['PAGE','51706',jdecode('ALARMES'),jdecode(''),'/51706.html','true',[],'',''],
	['PAGE','51727',jdecode('SERVI%C3%87OS'),jdecode(''),'/51727.html','true',[],'',''],
	['PAGE','51790',jdecode('FALE+CONOSCO'),jdecode(''),'/51790.html','true',[],'',''],
	['PAGE','51748',jdecode('CENTRAL+24+HORAS'),jdecode(''),'/51748.html','true',[],'',''],
	['PAGE','51769',jdecode('DICAS+DE+SEGURAN%C3%87A'),jdecode(''),'/51769.html','true',[],'',''],
	['PAGE','51811',jdecode('A%C3%87%C3%83O+SOCIAL'),jdecode(''),'/51811.html','true',[],'',''],
	['PAGE','51832',jdecode('LINKS+%C3%9ATEIS'),jdecode(''),'/51832.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Mote';
theSitetree.paletteFamily='F84101';
theSitetree.keyvisualId='11388';
theSitetree.keyvisualName='kv_11388.jpg';
theSitetree.fontsetId='31998';
theSitetree.graphicsetId='13830';
theSitetree.contentColor='8E8C8C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mote',
				paletteFamily: 	'F84101',
				keyvisualId: 	'11388',
				keyvisualName: 	'kv_11388.jpg',
				fontsetId: 		'31998',
				graphicsetId: 	'13830',
				contentColor: 	'8E8C8C',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-545']={
webappId:    '7008',
documentId:  '51748',
internalId:  '545',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-546']={
webappId:    '7008',
documentId:  '51790',
internalId:  '546',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-547']={
webappId:    '7008',
documentId:  '51727',
internalId:  '547',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-549']={
webappId:    '7008',
documentId:  '165001',
internalId:  '549',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100814-103814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20100814-111552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165001',
internalId:  '',
customField: '20100814-095956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51664',
internalId:  '',
customField: '20100814-100047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67901',
internalId:  '',
customField: '20100814-100211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51685',
internalId:  '',
customField: '20100814-100324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191401',
internalId:  '',
customField: '20100814-100428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51706',
internalId:  '',
customField: '20100814-100556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51727',
internalId:  '',
customField: '20100814-100720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51790',
internalId:  '',
customField: '20100814-100812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51748',
internalId:  '',
customField: '20100814-174637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51769',
internalId:  '',
customField: '20100814-101049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51811',
internalId:  '',
customField: '20100814-101142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51832',
internalId:  '',
customField: '20100814-101226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223312',
internalId:  '',
customField: '20090215-161637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223333',
internalId:  '',
customField: '20100814-101436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223375',
internalId:  '',
customField: '20100814-101616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223396',
internalId:  '',
customField: '20100814-101753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223417',
internalId:  '',
customField: '20100814-102015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223438',
internalId:  '',
customField: '20100814-102132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223459',
internalId:  '',
customField: '20100814-102340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223480',
internalId:  '',
customField: '20100814-102513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223501',
internalId:  '',
customField: '20100814-102708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223522',
internalId:  '',
customField: '20100814-102832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224712',
internalId:  '',
customField: '20100814-103009'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3KV4';
var companyName   = '';
var htmlTitle	  = 'www.casascoseguros.com.br';
var metaKeywords  = 'SEGUROS++PREVID%C3%8ANCIA+PRIVADA+FIAN%C3%87A+LOCAT%C3%8DCIA+ALUGUEL+SEGURO+DE+TRANSPORTES+TRANSPORTES+DE+CARGA+ALARMES+SEGURO+SA%C3%9ADE+SEGURO+DE+VIDA+SINDICATOS+ADMINISTRADORAS+DE+BENS+CONS%C3%93RCIO+IMOBILI%C3%81RIO+CONS%C3%93RCIO+AUTOM%C3%93VEL+SEGURO+N%C3%81UTICO+';
var metaContents  = 'A+CASASCO+SEGUROS+%C3%89+ESPECIALIZADA+NA+COMERCIALIZA%C3%87%C3%83O+E+CONSULTORIA+DE+SEGUROS+EM+GERAL%2C+FIAN%C3%87A+LOCAT%C3%8DCIA%2C+PREVID%C3%8ANCIA%2C+CONS%C3%93RCIOS%2C+TRANSPORTES+DE+CARGA.';
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();
};
