/* [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','301',jdecode('Home'),jdecode(''), jdecode('%2F301.html'), 'true',[],'',''],
	['PAGE','373',jdecode('S.+Paulo%2FGuarulhos'),jdecode(''), jdecode('%2F373%2Findex.html'), 'true',[ 
		['PAGE','415',jdecode('Casas+%2F+Sobrados'),jdecode(''), jdecode('%2F373%2F415.html'), 'true',[],'',''],
		['PAGE','436',jdecode('Apartamentos'),jdecode(''), jdecode('%2F373%2F436.html'), 'true',[],'',''],
		['PAGE','49101',jdecode('Terrenos'),jdecode(''), jdecode('%2F373%2F49101.html'), 'true',[],'',''],
		['PAGE','67012',jdecode('Ch%C3%A1caras+%2F+S%C3%ADtios'),jdecode(''), jdecode('%2F373%2F67012.html'), 'true',[],'','']
	],'',''],
	['PAGE','12801',jdecode('Casas+em+Condom%C3%ADnio'),jdecode(''), jdecode('%2F12801%2Findex.html'), 'true',[ 
		['PAGE','12822',jdecode('Aru%C3%A3+%2F+EcoPark'),jdecode(''), jdecode('%2F12801%2F12822.html'), 'true',[],'',''],
		['PAGE','12843',jdecode('Aruj%C3%A1'),jdecode(''), jdecode('%2F12801%2F12843.html'), 'true',[],'',''],
		['PAGE','17201',jdecode('Guarulhos'),jdecode(''), jdecode('%2F12801%2F17201.html'), 'true',[],'','']
	],'',''],
	['PAGE','60101',jdecode('Lotes+em+Condom%C3%ADnio'),jdecode(''), jdecode('%2F60101.html'), 'true',[],'',''],
	['PAGE','275112',jdecode('Morumbi'),jdecode(''), jdecode('%2F275112.html'), 'true',[],'',''],
	['PAGE','243212',jdecode('Tatuap%C3%A9+'),jdecode(''), jdecode('%2F243212.html'), 'true',[],'',''],
	['PAGE','244712',jdecode('An%C3%A1lia+Franco'),jdecode(''), jdecode('%2F244712.html'), 'true',[],'',''],
	['PAGE','244733',jdecode('Litoral'),jdecode(''), jdecode('%2F244733.html'), 'true',[],'',''],
	['PAGE','49601',jdecode('Loca%C3%A7%C3%A3o'),jdecode(''), jdecode('%2F49601%2Findex.html'), 'true',[ 
		['PAGE','50201',jdecode('Residencial'),jdecode(''), jdecode('%2F49601%2F50201.html'), 'true',[],'',''],
		['PAGE','50222',jdecode('Comercial'),jdecode(''), jdecode('%2F49601%2F50222.html'), 'true',[],'','']
	],'',''],
	['PAGE','130512',jdecode('Industrial'),jdecode(''), jdecode('%2F130512%2Findex.html'), 'true',[ 
		['PAGE','134812',jdecode('Galp%C3%B5es'),jdecode(''), jdecode('%2F130512%2F134812.html'), 'true',[],'',''],
		['PAGE','134833',jdecode('%C3%81reas'),jdecode(''), jdecode('%2F130512%2F134833.html'), 'true',[],'','']
	],'',''],
	['PAGE','625',jdecode('Ofertas+Especiais'),jdecode(''), jdecode('%2F625.html'), 'true',[],'',''],
	['PAGE','646',jdecode('Trabalhe+Conosco'),jdecode(''), jdecode('%2F646.html'), 'true',[],'',''],
	['PAGE','667',jdecode('Contato'),jdecode(''), jdecode('%2F667.html'), 'true',[],'',''],
	['PAGE','61601',jdecode('O+Que+Voc%C3%AA+Procura%3F'),jdecode(''), jdecode('%2F61601.html'), 'true',[],'',''],
	['PAGE','91012',jdecode('Cadastre+seu+im%C3%B3vel'),jdecode(''), jdecode('%2F91012.html'), 'true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='95895A';
theSitetree.keyvisualId='2421';
theSitetree.keyvisualName='jobsuche.jpg';
theSitetree.fontsetId='399';
theSitetree.graphicsetId='446';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='95895A';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'95895A',
				keyvisualId: 	'2421',
				keyvisualName: 	'jobsuche.jpg',
				fontsetId: 		'399',
				graphicsetId: 	'446',
				contentColor: 	'FFFFFF',
				contentBGColor: '95895A',
				a_color: 		'95895A',
				b_color: 		'6D6442',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-131']={
webappId:    '7008',
documentId:  '91012',
internalId:  '131',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-132']={
webappId:    '7008',
documentId:  '61601',
internalId:  '132',
customField: 'language:pt;country:BR;'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '301',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20111116-151537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20081230-113244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '415',
internalId:  '',
customField: '20120106-150037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436',
internalId:  '',
customField: '20111116-160027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49101',
internalId:  '',
customField: '20110216-153804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67012',
internalId:  '',
customField: '20110902-111436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20070911-134945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12822',
internalId:  '',
customField: '20120130-090143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12843',
internalId:  '',
customField: '20110301-155929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20111124-093911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60101',
internalId:  '',
customField: '20101105-145320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '275112',
internalId:  '',
customField: '20101117-095227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '243212',
internalId:  '',
customField: '20101117-100836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '244712',
internalId:  '',
customField: '20101117-103418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '244733',
internalId:  '',
customField: '20091202-133413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49601',
internalId:  '',
customField: '20090331-164611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50201',
internalId:  '',
customField: '20110325-101209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50222',
internalId:  '',
customField: '20110708-100059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130512',
internalId:  '',
customField: '20071110-105104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134812',
internalId:  '',
customField: '20101116-141108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134833',
internalId:  '',
customField: '20090727-091222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '625',
internalId:  '',
customField: '20110624-154142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '646',
internalId:  '',
customField: '20091014-145840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '667',
internalId:  '',
customField: '20091014-150139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61601',
internalId:  '',
customField: '20070323-084925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91012',
internalId:  '',
customField: '20070323-130946'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN35DK';
var companyName   = 'NATIVA+IM%C3%93VEIS++%2811%29+2452-8480+';
var htmlTitle	  = 'Nativa+Im%C3%B3veis++Guarulhos+-+Condominio+Aru%C3%A3+%2F+EcoPark+%2F+Monterey';
var metaKeywords  = 'Imobili%C3%A1ria+em+Guarulhos%2C+Im%C3%B3veis+em+Aruj%C3%A1%2C++Im%C3%B3veis+em+Aru%C3%A3%2C++Im%C3%B3veis+em+Guarulhos%2C+imoveis+aruj%C3%A1%2C++imoveis+aru%C3%A3%2C++imoveis+em+guarulhos%2C++Im%C3%B3veis+Aru%C3%A3+Lagos%2C++Im%C3%B3veis+Aru%C3%A3+EcoPark%2C++Lagos%2C++EcoPark%2C++imoveis+aru%C3%A3+lagos%2C++imoveis+aru%C3%A3+ecopark%2C++nativa%2C++Empregos%2C+loca%C3%A7ao+em+guarulhos%2C+vendas%2C+imobiliarias+em+Guarulhos%2C+condominio+aru%C3%A3%2C+imobiliaria+em+aru%C3%A3%2C+aru%C3%A3%2C+casa+em+aru%C3%A3';
var metaContents  = 'Nativa+Im%C3%B3veis%2C+Guarulhos%2C+Condom%C3%ADnio+Aru%C3%A3%2C+Vendas%2C+Loca%C3%A7%C3%A3o%2C+Casas%2C+Apartamentos%2C+Sobrados%2C+Terrenos%2C+Lotes%2C+Aru%C3%A3%2C+Brisas%2C+Aruj%C3%A1+e+Guarulhos.+Consulte-nos%21';
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();
};

