/* [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','72912',jdecode('RCC+Consultoria+de+Im%C3%B3veis'),jdecode(''),'/72912.html','true',[],''],
	['PAGE','55812',jdecode('Casas+3+Dormitorios'),jdecode(''),'/55812.html','true',[],''],
	['PAGE','72612',jdecode('Casa+2+Dormitorios'),jdecode(''),'/72612.html','true',[],''],
	['PAGE','67312',jdecode('Apartamentos+3+Dormitorios'),jdecode(''),'/67312.html','true',[],''],
	['PAGE','701',jdecode('Apartamentos+2+Dormitorios'),jdecode(''),'/701.html','true',[],''],
	['PAGE','72663',jdecode('Flat'),jdecode(''),'/72663.html','true',[],''],
	['PAGE','64512',jdecode('Terrenos%2FChacaras'),jdecode(''),'/64512.html','true',[],''],
	['PAGE','72684',jdecode('Administra%C3%A7%C3%A3o+de+im%C3%B3veis'),jdecode(''),'/72684.html','true',[],''],
	['PAGE','72705',jdecode('Financiamento'),jdecode(''),'/72705.html','true',[],''],
	['PAGE','72726',jdecode('Ofertas+especiais'),jdecode(''),'/72726.html','true',[],''],
	['PAGE','87223',jdecode('Contato'),jdecode(''),'/87223.html','true',[],'']];
var siteelementCount=11;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='423';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'423',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '72912',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72612',
internalId:  '',
customField: '20090821-124807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67312',
internalId:  '',
customField: '20090821-125457'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '72912',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55812',
internalId:  '',
customField: '20090821-123616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72912',
internalId:  '',
customField: '20090820-144838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090821-125828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64512',
internalId:  '',
customField: '20090821-111006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72663',
internalId:  '',
customField: '20090708-230744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72684',
internalId:  '',
customField: '20090708-230900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72705',
internalId:  '',
customField: '20090708-230949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72726',
internalId:  '',
customField: '20090708-231027'
};
webappMappings['1501']=webappMappings['1501-7976515']={
webappId:    '1501',
documentId:  '72912',
internalId:  '7976515',
customField: '1501'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '72912',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '55812',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '72612',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '67312',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '701',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '72663',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '64512',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '72684',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '72705',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '72726',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87223',
internalId:  '',
customField: '20090825-112829'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZGFG';
var companyName   = 'RCC+CONSULTORIA+DE+IM%C3%93VEIS+-+CRECI+75808';
var htmlTitle	  = 'IMOVEIS+A+VENDA++S%C3%83O+JOSE+DOS+CAMPOS';
var metaKeywords  = 'compra-+venda+-+troca+-+imov%C3%A9is+-+casa+-+apartamento+-+s%C3%A3o+jose+dos+campos+-+em+s%C3%A3o+jose+dos+campos-+zona+sul+-+venda+de++casas+em+s%C3%A3o+jose+dos+campos+-+venda+de+apartamentos+em+s%C3%A3o+jose+dos+campos-+casas+na+zona+sul+-+apartamentos+na+zona+sul+-+imoveis+a+venda+-+parque+industrial+-+31+mar%C3%A7o+-+morumbi+-+jardim+oriente+-+palmeira+s%C3%A3o+jose+-+jardim+veneza+-+terras+do+sul+-+jardim+sul+-+jardim+satelite+-+jardim+das+industrias+-+uni%C3%A3o+-+financiamento+-+';
var metaContents  = '+Venda+de+Apartamentos++-+Venda+de+Casas+-+Imov%C3%A9is+%C3%A1+Venda+em+S%C3%A3o+Jose+dos+Campos+-++venda+de+casas+em+s%C3%A3o+jose+dos+campos+-+venda+de+apartamentos+em+s%C3%A3o+jose+dos+campos-+casas+na+zona+sul+-+apartamentos+na+zona+sul+-+imoveis+a+venda+-+financiamento+de+imoveis+-';
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();
};
