/* [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','12',jdecode('Home'),jdecode(''),'/12.html','true',[],'',''],
	['PAGE','33',jdecode('A+Empresa'),jdecode(''),'/33.html','true',[],'',''],
	['PAGE','42',jdecode('Fale+conosco'),jdecode(''),'/42/index.html','true',[ 
		['PAGE','2040',jdecode('Nossos+Servi%C3%A7os+%28p%C3%A1gina+seguir%29'),jdecode(''),'/42/2040.html','false',[],'','']
	],'',''],
	['PAGE','51',jdecode('LOCA%C3%87%C3%83O'),jdecode(''),'/51/index.html','true',[ 
		['PAGE','60',jdecode('loca%C3%A7%C3%A3o++residencial'),jdecode(''),'/51/60.html','true',[],'',''],
		['PAGE','69',jdecode('loca%C3%A7%C3%A3o++comercial'),jdecode(''),'/51/69.html','true',[],'','']
	],'',''],
	['PAGE','78',jdecode('VENDAS+'),jdecode(''),'/78/index.html','true',[ 
		['PAGE','1115',jdecode('Vendas+-+Apartamentos'),jdecode(''),'/78/1115.html','true',[],'',''],
		['PAGE','58001',jdecode('at%C3%A9+R%24+150.000'),jdecode(''),'/78/58001.html','true',[],'',''],
		['PAGE','58022',jdecode('acima+de+R%24+150.000'),jdecode(''),'/78/58022.html','true',[],'',''],
		['PAGE','1124',jdecode('Vendas+-+Resid%C3%AAncias+'),jdecode(''),'/78/1124.html','true',[],'',''],
		['PAGE','57601',jdecode('at%C3%A9+R%24+160.000'),jdecode(''),'/78/57601.html','true',[],'',''],
		['PAGE','57622',jdecode('de+R%24+161.000+a+R%24240.000'),jdecode(''),'/78/57622.html','true',[],'',''],
		['PAGE','57643',jdecode('de+R%24+241.000+a+R%24320.000'),jdecode(''),'/78/57643.html','true',[],'',''],
		['PAGE','57664',jdecode('acima+de+R%24+321.000'),jdecode(''),'/78/57664.html','true',[],'',''],
		['PAGE','38301',jdecode('-+Destaque1'),jdecode(''),'/78/38301.html','true',[],'',''],
		['PAGE','38322',jdecode('-+Destaque2'),jdecode(''),'/78/38322.html','true',[],'',''],
		['PAGE','85712',jdecode('-+Destaque3'),jdecode(''),'/78/85712.html','true',[],'',''],
		['PAGE','85912',jdecode('-+Destaque4'),jdecode(''),'/78/85912.html','true',[],'',''],
		['PAGE','111934',jdecode('-+Destaque5'),jdecode(''),'/78/111934.html','true',[],'',''],
		['PAGE','1133',jdecode('Vendas+-+Investimento'),jdecode(''),'/78/1133.html','true',[],'','']
	],'',''],
	['PAGE','87',jdecode('Cadastre+seu+Im%C3%B3vel'),jdecode(''),'/87/index.html','true',[ 
		['PAGE','1509',jdecode('Cadastre+seu+Im%C3%B3vel+%28p%C3%A1gina+seguir%29'),jdecode(''),'/87/1509.html','false',[],'','']
	],'',''],
	['PAGE','96',jdecode('Jur%C3%ADdico'),jdecode(''),'/96/index.html','true',[ 
		['PAGE','1981',jdecode('-+D%C3%BAvidas'),jdecode(''),'/96/1981/index.html','true',[ 
			['PAGE','2018',jdecode('-+D%C3%BAvidas+%28p%C3%A1gina+seguir%29'),jdecode(''),'/96/1981/2018.html','false',[],'','']
		],'','']
	],'',''],
	['PAGE','105',jdecode('Contato'),jdecode(''),'/105.html','true',[],'',''],
	['PAGE','114',jdecode('Mapa'),jdecode(''),'/114.html','true',[],'',''],
	['PAGE','123',jdecode('Como+Alugar'),jdecode(''),'/123/index.html','true',[ 
		['PAGE','1308',jdecode('-+pessoa+f%C3%ADsica++'),jdecode(''),'/123/1308.html','true',[],'',''],
		['PAGE','1317',jdecode('-+pessoa+jur%C3%ADdica'),jdecode(''),'/123/1317.html','true',[],'','']
	],'','']];
var siteelementCount=32;
theSitetree.topTemplateName='Chaste';
theSitetree.paletteFamily='DFBB74';
theSitetree.keyvisualId='11551';
theSitetree.keyvisualName='kv_11551.jpg';
theSitetree.fontsetId='32877';
theSitetree.graphicsetId='13965';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Chaste',
				paletteFamily: 	'DFBB74',
				keyvisualId: 	'11551',
				keyvisualName: 	'kv_11551.jpg',
				fontsetId: 		'32877',
				graphicsetId: 	'13965',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'DFBB74',
				b_color: 		'846A36',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12',
internalId:  '',
customField: '20100719-132155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51',
internalId:  '',
customField: '20090826-131338'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-6499']={
webappId:    '7008',
documentId:  '1981',
internalId:  '6499',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111934',
internalId:  '',
customField: '20100423-141853'
};
webappMappings['7008']=webappMappings['7008-6500']={
webappId:    '7008',
documentId:  '42',
internalId:  '6500',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85912',
internalId:  '',
customField: '20100514-102125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85712',
internalId:  '',
customField: '20100413-133852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60',
internalId:  '',
customField: '20100723-082715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33',
internalId:  '',
customField: '20081120-075435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20060829-141432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2040',
internalId:  '',
customField: '20060829-141113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69',
internalId:  '',
customField: '20100723-084522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78',
internalId:  '',
customField: '20100514-101736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20100622-143138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58001',
internalId:  '',
customField: '20100622-143453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58022',
internalId:  '',
customField: '20100622-143623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1124',
internalId:  '',
customField: '20100622-144544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57601',
internalId:  '',
customField: '20100622-143741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57622',
internalId:  '',
customField: '20100622-144453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57643',
internalId:  '',
customField: '20100623-130042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57664',
internalId:  '',
customField: '20100622-144347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20091121-073156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38322',
internalId:  '',
customField: '20100420-092226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1133',
internalId:  '',
customField: '20100420-150438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87',
internalId:  '',
customField: '20060403-103201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1509',
internalId:  '',
customField: '20060403-103023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96',
internalId:  '',
customField: '20090806-144323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1981',
internalId:  '',
customField: '20060825-084841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2018',
internalId:  '',
customField: '20060825-084727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105',
internalId:  '',
customField: '20100104-122834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114',
internalId:  '',
customField: '20090318-090623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123',
internalId:  '',
customField: '20090901-122948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1308',
internalId:  '',
customField: '20060330-151249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1317',
internalId:  '',
customField: '20060330-152707'
};
webappMappings['7008']=webappMappings['7008-6498']={
webappId:    '7008',
documentId:  '87',
internalId:  '6498',
customField: 'language:pt;country:BR;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2BGV';
var companyName   = 'www.caravana.com.br';
var htmlTitle	  = 'www.caravana.com.br+-+Im%C3%B3veis+em+Osasco+e+regi%C3%A3o+-++loca%C3%A7%C3%A3o+e+vendas';
var metaKeywords  = 'im%C3%B3veis%2C+imoveis%2C+loca%C3%A7%C3%A3o%2C+venda%2C+Osasco%2C+S%C3%A3o+Paulo%2C+sobrados%2C+casas%2C+alugar%2C+aluguel%2C+vender%2C+comprar%2C+administra%C3%A7%C3%A3o%2C+apartamentos%2C+terrenos%2C+jur%C3%ADdico%2C+advogados%2C+corretores%2C+creci%2C+financiamento+imobili%C3%A1rio%2C+fgts%2C+real+state';
var metaContents  = 'im%C3%B3veis%2C+imoveis%2C+loca%C3%A7%C3%A3o%2C+Osasco%2C+S%C3%A3o+Paulo%2C+sobrados%2C+casas%2C+alugar%2C+vender%2C+comprar%2C+administra%C3%A7%C3%A3o%2C+apartamentos%2C+terrenos%2C+jur%C3%ADdico%2C+advogados%2C+financiamento+imobili%C3%A1rio';
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();
};
