/* [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','1901',jdecode('Luxus+Iracema+House'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','301',jdecode('Terra%C3%A7os+Iracema+Apartments'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','1922',jdecode('BeachFront+Lots'),jdecode(''),'/1922.html','true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Push';
theSitetree.paletteFamily='B99BC7';
theSitetree.keyvisualId='11441';
theSitetree.keyvisualName='kv_11441.jpg';
theSitetree.fontsetId='32013';
theSitetree.graphicsetId='13840';
theSitetree.contentColor='2C4E8B';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Push',
				paletteFamily: 	'B99BC7',
				keyvisualId: 	'11441',
				keyvisualName: 	'kv_11441.jpg',
				fontsetId: 		'32013',
				graphicsetId: 	'13840',
				contentColor: 	'2C4E8B',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20110121-182406'
};
webappMappings['7008']=webappMappings['7008-1067']={
webappId:    '7008',
documentId:  '1922',
internalId:  '1067',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20110121-183344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1922',
internalId:  '',
customField: '20110121-183941'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1922',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INLC0A';
var companyName   = 'FRONTBEACH++LUXURY+APARTMENTS+TO+RENT+IN+FORTALEZA';
var htmlTitle	  = 'Brazil+apartments%2CFortaleza+Apartments+Book+online%2C+Holidays+in+Brazil%2C+Brazil+lands%2C+Praia+Canoe%2C+Ceara+lots%2C+Brazil+Beach%2C+Beachfront+lots%2C+Beachfront+lots+in+Brazil%2C+Rent+apartments+in+Brazil%2C+Rent+a+luxury+apartment+in+in+Fortaleza%2C+Beach+House++in+Br';
var metaKeywords  = '%3CTITLE%3ELuxury+apartments+to+rent+in+Fortaleza%2Cin+Ceara%C3%A1%2C+in+Brazil%2C+Brazil+lands%2C++Apartamentos+en+Fortaleza%2C+terrenos+en+Brasil%3C%2FTITLE%3E%3C%21--Luxury+apartments+to+rent+in+Fortaleza%2Cin+Cear%C3%A1%2C+in+Brazil%2C+Brazil+lands%2CApartamentos+en+Fortaleza%2C+terrenos+en+Brasil--%3E%0D%0A%0D%0A%3C%21--+Inicio+MetaTag%27s+--%3E%0D%0A%0D%0A%3Cmeta+name%3D%22title%22+content%3D%22Luxury+apartments+to+rent+in+Fortaleza%2Cin+Cear%C3%A1%2C+in+Brazil%2C+Brazil+lands%2CApartamentos+en+Fortaleza%2C+terrenos+en+Brasil%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22description%22+content%3D%22Luxury+apartments+to+rent+in+Fortaleza%2Cin+Ceara%C3%A1%2C+in+Brazil%2C+Brazil+lands%2CApartamentos+en+Fortaleza%2C+terrenos+en+Brasil%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22keywords%22%0D%0A%0D%0Acontent%3D%22Luxury+apartments+to+rent+in+Fortaleza%2Cin+Ceara%C3%A1%2C+in+Brazil%2C+Brazil+lands%2C++Apartamentos+en+Fortaleza%2C+terrenos+en+Brasil%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22distribution%22+content%3D%22Global%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22category%22+content%3D%22realstate%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22language%22+content%3D%22en%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22identifier-url%22+content%3D%22http%3A%2F%2Ffortaleza.br.com%2F%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22rating%22+content%3D%22General%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22author%22+content%3D%22mundifincas%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22reply-to%22+content%3D%22mundifincas%40mundifincas.com+name%3D%22copyright%22content%3D%22mundifincas%22%3E%0D%0A%0D%0A%3Cmeta+http-equiv%3D%22cache-control%22+content%3D%22no-cache%22%3E%0D%0A%0D%0A%3Cmeta+http-equiv%3D%22pragma%22+content%3D%22no-cache%22%3E%0D%0A%0D%0A%3Cmeta+http-equiv%3D%22Content-Type%22+content%3D%22text%2Fhtml%3B+charset%3DISO-8859-1%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22resource-type%22+content%3D%22document%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22robots%22+content%3D%22all%22%3E%0D%0A%0D%0A%3Cmeta+name%3D%22revisit-after%22+content%3D%221%22%3E%0D%0A%0D%0A%3C%21--+Final+MetaTag%27s+--%3E%0D%0A%0D%0A';
var metaContents  = 'Luxury+apartments+to+rent+in+Fortaleza%2Cin+Cear%C3%A1%2C+in+Brazil%2C+Brazil+lands%2C++Apartamentos+en+Fortaleza%2C+terrenos+en+Brasil%3C%2FTITLE%3E%3C%21--Luxury+apartments+to+rent+in+Fortaleza%2Cin+Cear%C3%A1%2C+in+Brazil%2C+Brazil+lands%2CApartamentos+en+Fortaleza%2C+terrenos+en+Brasil--%3E%0D%0A%0D%0A';
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();
};

