/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','2201',jdecode('Properties+for+Rent'),jdecode(''),'/2201.html','true',[],'',''],
	['PAGE','2801',jdecode('Rental+Application'),jdecode(''),'/2801.html','true',[],'',''],
	['PAGE','9201',jdecode('Pet+Policies'),jdecode(''),'/9201.html','true',[],'',''],
	['PAGE','2243',jdecode('Properties+For+Sale'),jdecode(''),'/2243.html','true',[],'',''],
	['PAGE','2285',jdecode('Rental+Service+Request'),jdecode(''),'/2285.html','true',[],'',''],
	['PAGE','2327',jdecode('Contact+Us'),jdecode(''),'/2327.html','true',[],'',''],
	['PAGE','6601',jdecode('95-97+Cardinal+Acres'),jdecode(''),'/6601.html','false',[],'',''],
	['PAGE','6622',jdecode('105+Callahan+Dr'),jdecode(''),'/6622.html','false',[],'',''],
	['PAGE','6643',jdecode('101+Indiana'),jdecode(''),'/6643.html','false',[],'',''],
	['PAGE','6664',jdecode('501D+Bridge+Crossing'),jdecode(''),'/6664.html','false',[],'',''],
	['PAGE','6801',jdecode('121+Winterset'),jdecode(''),'/6801.html','false',[],'',''],
	['PAGE','22201',jdecode('121+Winterset+Pass'),jdecode(''),'/22201.html','true',[],'',''],
	['PAGE','6822',jdecode('119+Winterset'),jdecode(''),'/6822.html','false',[],'',''],
	['PAGE','6843',jdecode('5333+Aden'),jdecode(''),'/6843.html','true',[],'',''],
	['PAGE','6864',jdecode('142-144+Old+Church'),jdecode(''),'/6864.html','true',[],'',''],
	['PAGE','6885',jdecode('1523+Jamestown+Rd'),jdecode(''),'/6885.html','false',[],'',''],
	['PAGE','8901',jdecode('Local+Interest+Links'),jdecode(''),'/8901.html','true',[],'',''],
	['PAGE','23001',jdecode('119+Winterset+Pass'),jdecode(''),'/23001.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='617F92';
theSitetree.keyvisualId='6913';
theSitetree.keyvisualName='kv_6913.jpg';
theSitetree.fontsetId='11214';
theSitetree.graphicsetId='12036';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='809DAF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'617F92',
				keyvisualId: 	'6913',
				keyvisualName: 	'kv_6913.jpg',
				fontsetId: 		'11214',
				graphicsetId: 	'12036',
				contentColor: 	'FFFFFF',
				contentBGColor: '809DAF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20091221-144150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2243',
internalId:  '',
customField: '20100116-133627'
};
webappMappings['7008']=webappMappings['7008-24149']={
webappId:    '7008',
documentId:  '2801',
internalId:  '24149',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20111009-215412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20110124-101919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2285',
internalId:  '',
customField: '20091219-174740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2327',
internalId:  '',
customField: '20110119-110549'
};
webappMappings['7008']=webappMappings['7008-24153']={
webappId:    '7008',
documentId:  '2285',
internalId:  '24153',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6885',
internalId:  '',
customField: '20091222-110517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20091222-113403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20091222-112258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20091222-163225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6643',
internalId:  '',
customField: '20091222-165614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20100901-152142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6664',
internalId:  '',
customField: '20091222-101817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20091222-102039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6822',
internalId:  '',
customField: '20091222-102039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6843',
internalId:  '',
customField: '20110119-100639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6864',
internalId:  '',
customField: '20111009-215318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20110131-185727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20110119-105927'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INVX03';
var companyName   = '';
var htmlTitle	  = '';
var metaKeywords  = 'Property+for+Sale+Rentals+Rent+Clay+Properties+Land+Williamsburg+VA+Virginial+Rental+Norge+Lightfoot';
var metaContents  = 'Welcome+to+Clay+Properties+These+properties+are+personally+owned%2C+managed++maintained+by+the+owner+and+his+family+who+live++work+here+in+Williamsburg.++Please+take+a+look+at+the+property+you+are+interested+in%3B+we+have+included+lots+of+current+photos%2C+detailed+property+descriptions%2C+school+districts%2C+even+utility+providers+and+their+contact+information.Once+you+know+the+property+fits+you+and+your+familys+needs%2C+feel+free+to+fill+out++email+the+Application.++We+have+no+application+fees%21++Upon+receipt%2C+we+will+be+in+touch+to+discuss+a+lease++specifics+related+to+your+move.We+look+forward+to+the+opportunity+to+work+with+you+and+provide+a+safe++comfortable+home+in+this+wonderful+community%21We+have+Rental+Properties+Property%2C+Land+and+Lots+for+Sale%2C+We+specialize+in+the+Williamsburg%2C+Norge+Lighfoot+Areas.+';
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();
};

