/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','952',jdecode('About+us'),jdecode(''),'/952/index.html','true',[ 
		['PAGE','6801',jdecode('The+team'),jdecode(''),'/952/6801.html','true',[],'','']
	],'',''],
	['PAGE','973',jdecode('Services'),jdecode(''),'/973.html','true',[],'',''],
	['PAGE','994',jdecode('Fee+Schedule'),jdecode(''),'/994.html','true',[],'',''],
	['PAGE','1015',jdecode('Contact'),jdecode(''),'/1015.html','true',[],'',''],
	['PAGE','11301',jdecode('Products'),jdecode(''),'/11301/index.html','true',[ 
		['PAGE','11322',jdecode('First+Product'),jdecode(''),'/11301/11322.html','true',[],'',''],
		['PAGE','11343',jdecode('Second+Product'),jdecode(''),'/11301/11343.html','true',[],'','']
	],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='3F70CF';
theSitetree.keyvisualId='7934';
theSitetree.keyvisualName='kv_7934.jpg';
theSitetree.fontsetId='16911';
theSitetree.graphicsetId='12323';
theSitetree.contentColor='163D88';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Trend',
				paletteFamily: 	'3F70CF',
				keyvisualId: 	'7934',
				keyvisualName: 	'kv_7934.jpg',
				fontsetId: 		'16911',
				graphicsetId: 	'12323',
				contentColor: 	'163D88',
				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:  '901',
internalId:  '',
customField: '20090622-103457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20090622-104145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11322',
internalId:  '',
customField: '20090518-170943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11343',
internalId:  '',
customField: '20080220-172929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20090519-132159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20091111-220808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20091111-220903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20090519-131814'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20090519-132032'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLYQY';
var companyName   = 'SAV+Associates+Construction+%26+Real+Estate';
var htmlTitle	  = 'Real+Estate+Appraiser+Spokane';
var metaKeywords  = 'Real+Estate+Appraiser+Spokane%2C+Appraiser+Spokane%2C+Spokane+Appraisal%2C+Real+Estate+Appraiser%2C+Real+Estate+Appraisal%2C+Spokane+Real+Estate+Appraiser%2C+Spokane+Real+Estate+Appraisal%2C+Real+Estate+Appraiser+Liberty+Lake%2C+Liberty+Lake+Appraiser%2C+Liberty+Lake+Appraisal%2C+Liberty+Lake+Real+Estate+Appraisal%2C+Real+Property+Appraiser%2C+Real+Property+Appraisal%2C+Appraiser%2C+Appraisal.';
var metaContents  = 'Real+Estate+Appraiser+in+the+Spokane+region+of+the+State+of+Washington+within+the+boundaries+of+Spokane+County+with+emphasis+on+Real+Estate+Appraisal+in+Liberty+Lake%2C+Spokane+Valley%2C+Otis+Orchards%2C+Veradale%2C+Green+Acres+and+surrounding+areas+of+Spokane.+We+also+serve+a+portion+of+Kootenai+County+in+Northern+Idaho.';
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();
};
