/* [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','3001',jdecode('Welcome%21'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','3022',jdecode('Property+Management'),jdecode(''),'/3022/index.html','true',[ 
		['PAGE','3073',jdecode('Owners%2FInvestors'),jdecode(''),'/3022/3073.html','true',[],'',''],
		['PAGE','5301',jdecode('Real+Estate+Agents'),jdecode(''),'/3022/5301.html','true',[],'','']
	],'',''],
	['PAGE','3136',jdecode('Finding+A+Rental'),jdecode(''),'/3136/index.html','true',[ 
		['PAGE','3157',jdecode('Prospective+Tenants'),jdecode(''),'/3136/3157.html','true',[],'','']
	],'',''],
	['PAGE','22301',jdecode('Unfurnished+Rentals'),jdecode(''),'/22301/index.html','true',[ 
		['PAGE','22322',jdecode('Great+Phx+Gated+Community%21'),jdecode(''),'/22301/22322.html','false',[],'',''],
		['PAGE','28801',jdecode('Great+Baseline+Corridor+Home%21'),jdecode(''),'/22301/28801.html','true',[],'',''],
		['PAGE','22343',jdecode('Queen+Creek+Beauty%21'),jdecode(''),'/22301/22343.html','false',[],'',''],
		['PAGE','22364',jdecode('Another+Queen+Creek+Beauty%21'),jdecode(''),'/22301/22364.html','false',[],'',''],
		['PAGE','22385',jdecode('Tempe+Rental+with+Pool%21'),jdecode(''),'/22301/22385.html','false',[],'',''],
		['PAGE','22406',jdecode('South+Tempe+Rental+with+Pool%21'),jdecode(''),'/22301/22406.html','false',[],'',''],
		['PAGE','32301',jdecode('Georgeous+Foothills+Rental%21'),jdecode(''),'/22301/32301.html','false',[],'','']
	],'',''],
	['PAGE','22427',jdecode('Furnished+Rentals'),jdecode(''),'/22427/index.html','true',[ 
		['PAGE','5322',jdecode('North+Scottsdale+Rental'),jdecode(''),'/22427/5322.html','true',[],'','']
	],'',''],
	['PAGE','5343',jdecode('Current+Tenant+Pages'),jdecode(''),'/5343/index.html','true',[ 
		['PAGE','5364',jdecode('Maintenance+Request'),jdecode(''),'/5343/5364.html','true',[],'',''],
		['PAGE','5385',jdecode('ACH+Payment+Forms'),jdecode(''),'/5343/5385.html','true',[],'','']
	],'',''],
	['PAGE','3220',jdecode('About+us'),jdecode(''),'/3220/index.html','true',[ 
		['PAGE','3241',jdecode('Our+team'),jdecode(''),'/3220/3241.html','true',[],'','']
	],'',''],
	['PAGE','3283',jdecode('Contact'),jdecode(''),'/3283/index.html','true',[ 
		['PAGE','10001',jdecode('Holiday+Schedule'),jdecode(''),'/3283/10001.html','true',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Capri';
theSitetree.paletteFamily='947333';
theSitetree.keyvisualId='7191';
theSitetree.keyvisualName='kv_7191.jpg';
theSitetree.fontsetId='16411';
theSitetree.graphicsetId='12136';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Capri',
				paletteFamily: 	'947333',
				keyvisualId: 	'7191',
				keyvisualName: 	'kv_7191.jpg',
				fontsetId: 		'16411',
				graphicsetId: 	'12136',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3022',
internalId:  '',
customField: '20100527-133348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3073',
internalId:  '',
customField: '20100527-133412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20100527-173849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3136',
internalId:  '',
customField: '20100618-151007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3157',
internalId:  '',
customField: '20100527-154937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5343',
internalId:  '',
customField: '20100527-133603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20100528-124241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3220',
internalId:  '',
customField: '20100528-150926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3241',
internalId:  '',
customField: '20100527-135416'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3283',
internalId:  '',
customField: '20100528-102821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20100527-150846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5385',
internalId:  '',
customField: '20100527-133647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20100730-134023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20100527-134020'
};
webappMappings['7008']=webappMappings['7008-28432']={
webappId:    '7008',
documentId:  '5364',
internalId:  '28432',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-28434']={
webappId:    '7008',
documentId:  '3157',
internalId:  '28434',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-49a212b363845fbc9dbfeaf6741cec4d']={
webappId:    '7060',
documentId:  '5322',
internalId:  '49a212b363845fbc9dbfeaf6741cec4d',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20100810-135950'
};
webappMappings['7060']=webappMappings['7060-1336871094f196062af8971301008267']={
webappId:    '7060',
documentId:  '32301',
internalId:  '1336871094f196062af8971301008267',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20100805-183428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20100708-162807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22343',
internalId:  '',
customField: '20100713-171539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22322',
internalId:  '',
customField: '20100712-182302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22364',
internalId:  '',
customField: '20100715-184718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22385',
internalId:  '',
customField: '20100714-140757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22427',
internalId:  '',
customField: '20100708-172636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22406',
internalId:  '',
customField: '20100712-182231'
};
webappMappings['7060']=webappMappings['7060-802956cc658ce28d12b627172cb503cd']={
webappId:    '7060',
documentId:  '28801',
internalId:  '802956cc658ce28d12b627172cb503cd',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INVVCG';
var companyName   = 'First+Sonoran+Property+Management';
var htmlTitle	  = 'First+Sonoran+Property+Management';
var metaKeywords  = '';
var metaContents  = '';
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();
};
