/* [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','5001',jdecode('home.html'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','5052',jdecode('Conventional+Homes'),jdecode(''),'/5052.html','true',[],'',''],
	['PAGE','8101',jdecode('Mfg.%2FMobile+Homes'),jdecode(''),'/8101.html','true',[],'',''],
	['PAGE','5094',jdecode('Vacant+Lots+%26+Acreage'),jdecode(''),'/5094.html','true',[],'',''],
	['PAGE','5115',jdecode('Commercial'),jdecode(''),'/5115.html','true',[],'',''],
	['PAGE','14801',jdecode('Buyer+%26+Seller+Info'),jdecode(''),'/14801.html','true',[],'',''],
	['PAGE','8122',jdecode('Loans%2FTools'),jdecode(''),'/8122.html','true',[],'',''],
	['PAGE','8143',jdecode('Local+Information'),jdecode(''),'/8143.html','true',[],'',''],
	['PAGE','8164',jdecode('Contact%2FAbout+Me'),jdecode(''),'/8164.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Meta';
theSitetree.paletteFamily='72A7D3';
theSitetree.keyvisualId='11103';
theSitetree.keyvisualName='kv_11103.jpg';
theSitetree.fontsetId='31993';
theSitetree.graphicsetId='13826';
theSitetree.contentColor='020202';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Meta',
				paletteFamily: 	'72A7D3',
				keyvisualId: 	'11103',
				keyvisualName: 	'kv_11103.jpg',
				fontsetId: 		'31993',
				graphicsetId: 	'13826',
				contentColor: 	'020202',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20100705-180420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20081119-171611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20090517-154836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5094',
internalId:  '',
customField: '20090517-154649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8143',
internalId:  '',
customField: '20090517-154211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5115',
internalId:  '',
customField: '20081119-180741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8122',
internalId:  '',
customField: '20090220-161526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8164',
internalId:  '',
customField: '20090517-154330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20090517-155131'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE0OD';
var companyName   = 'Century+21+Lake+Isabella+Realty%2C+Inc.%C2%AE';
var htmlTitle	  = '';
var metaKeywords  = 'Lynne+McCloskey%2C+Lake+Isabella+Realty%2C+homes+for+sale%2C+Kern+River+Valley%2C+California%2C+Wofford+Heights%2C+Kernville%2C+Lake+Isabella%2C+Onyx%2C+Weldon%2C+Bodfish%2C+Mt.+Mesa%2C+Southlake%2C+fishing%2C+water+skiing%2C+whitewater%2C+rafting%2C+kayak%2C+Kern+River%2C+camping%2C+campgrounds%2C+hiking%2C+rock+climbing%2C+Sierra+Nevada%2C+Whiskey+Flat%2C+Sequoia+National+Forest%2C+redwood%2C+mining%2C+turkey+vulture%2C+Bakersfield%2C+snow+skiing%2C+mountains';
var metaContents  = 'Homes+for+sale+and+information+about+the+Kern+River+Valley%2FLake+Isabella+area+of+central+California.+Website+of+Lynne+McCloskey%2C+Realtor%2C+agent+at+Century+21+Lake+Isabella+Realty.';
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();
};
