/* [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','118',jdecode('Century+Apartments'),jdecode(''),'/118/index.html','true',[ 
		['PAGE','129',jdecode('The+team'),jdecode(''),'/118/129.html','true',[],'','']
	],'',''],
	['PAGE','124',jdecode('Features'),jdecode(''),'/124.html','true',[],'',''],
	['PAGE','134',jdecode('Floor+Plans'),jdecode(''),'/134/index.html','true',[ 
		['PAGE','7418',jdecode('1+Bedroom'),jdecode(''),'/134/7418.html','true',[],'',''],
		['PAGE','7423',jdecode('2+Bedroom'),jdecode(''),'/134/7423.html','true',[],'',''],
		['PAGE','7428',jdecode('3+Bedroom'),jdecode(''),'/134/7428.html','true',[],'','']
	],'',''],
	['PAGE','6218',jdecode('Rental+Rates'),jdecode(''),'/6218.html','true',[],'',''],
	['PAGE','8118',jdecode('Directions'),jdecode(''),'/8118.html','true',[],'',''],
	['PAGE','8123',jdecode('Recreation'),jdecode(''),'/8123.html','true',[],'',''],
	['PAGE','9857',jdecode('Schools'),jdecode(''),'/9857.html','true',[],'',''],
	['PAGE','8128',jdecode('Chamber'),jdecode(''),'/8128.html','true',[],'',''],
	['PAGE','8133',jdecode('City+Dickinson'),jdecode(''),'/8133.html','true',[],'',''],
	['PAGE','13618',jdecode('Millionaire%3F'),jdecode(''),'/13618.html','true',[],'',''],
	['PAGE','9619',jdecode('Century+Photos'),jdecode(''),'/9619.html','true',[],'',''],
	['PAGE','11019',jdecode('Flowers+and+Birds'),jdecode(''),'/11019.html','true',[],'',''],
	['PAGE','52518',jdecode('The+Owl+Box'),jdecode(''),'/52518.html','true',[],'',''],
	['PAGE','16618',jdecode('Other+Apartments'),jdecode(''),'/16618.html','true',[],'',''],
	['PAGE','18218',jdecode('Featured+Links'),jdecode(''),'/18218.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Solid';
theSitetree.paletteFamily='8396BA';
theSitetree.keyvisualId='4357';
theSitetree.keyvisualName='kv_4357.jpg';
theSitetree.fontsetId='10800';
theSitetree.graphicsetId='11232';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8396BA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Solid',
				paletteFamily: 	'8396BA',
				keyvisualId: 	'4357',
				keyvisualName: 	'kv_4357.jpg',
				fontsetId: 		'10800',
				graphicsetId: 	'11232',
				contentColor: 	'FFFFFF',
				contentBGColor: '8396BA',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '118',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-513205']={
webappId:    '1501',
documentId:  '118',
internalId:  '513205',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-6cefc9108d2425b34ae21e2ebaffc974']={
webappId:    '7060',
documentId:  '9619',
internalId:  '6cefc9108d2425b34ae21e2ebaffc974',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-7f045d5d7443f61c6ac17a1c4e50c496']={
webappId:    '7060',
documentId:  '11019',
internalId:  '7f045d5d7443f61c6ac17a1c4e50c496',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118',
internalId:  '',
customField: '20051027-101007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129',
internalId:  '',
customField: '20050524-085027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124',
internalId:  '',
customField: '20050711-051313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134',
internalId:  '',
customField: '20050611-215639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7418',
internalId:  '',
customField: '20060308-164449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7423',
internalId:  '',
customField: '20060308-164536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7428',
internalId:  '',
customField: '20060308-164636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6218',
internalId:  '',
customField: '20090203-143741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8118',
internalId:  '',
customField: '20050611-220907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8123',
internalId:  '',
customField: '20050524-085331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9857',
internalId:  '',
customField: '20050524-085355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8128',
internalId:  '',
customField: '20050524-085426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8133',
internalId:  '',
customField: '20050524-085444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13618',
internalId:  '',
customField: '20050730-054016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9619',
internalId:  '',
customField: '20050523-142602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11019',
internalId:  '',
customField: '20050523-142617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16618',
internalId:  '',
customField: '20050818-131545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18218',
internalId:  '',
customField: '20080228-152439'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INX39U';
var companyName   = 'Century+Apartments+-+Dickinson%2C+ND';
var htmlTitle	  = 'Century+Apartments%2C+Dickinson%2C+North+Dakota+ND';
var metaKeywords  = 'apartments%2C+Dickinson%2C+ND%2C+rent%2C+renters%2C+lease%2C+apartment%2C+1%2C+2%2C+3%2C+bedroom%2C+townhome%2C+rental%2C+rentals%2C+Century%2C+apt%2C+apts%2C+rooms%2C+bedrooms%2C+airconditioned%2C+pool%2C+patio+home%2C+garage%2C+roommate%2C+student%2C+retirement%2C+North%2C+Dakota%2C+North+Dakota%2C+renting%2C+apartments+dickinson%2C+dickinson+apartments%2C+apartments+in+dickinson%2C+moving%2C+real+estate%2C+homes%2C+';
var metaContents  = 'Apartments%2C+Dickinson%2C+North+Dakota.+Apartments+For+Rent+in+Dickinson%2C+ND.+Renters+find+1%2C+2+and+3+bedroom+apartments+available+in+Dickinson%2C+ND.+Century+Apartments%2C+Dickinson%2C+ND+58601.+Century+Apartments+features+include%3A+Swimming+pool%2C+tennis%2C+exercise+room%2C+Balcony%2FPatio+and+Garages.+Fenced+Playground+%2F+Picnic+Area.+Dickinson+State+University+and+shopping+near+by.+Students+welcome+at+Century+Apartments%2C+Dickinson%2C+North+Dakota.+';
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();
};
