/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','601',jdecode('Hours+%2F+Appointments'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','10943',jdecode('What+is+Chiropractic%3F'),jdecode(''),'/10943.html','true',[],'',''],
	['PAGE','622',jdecode('Dr.+Meier%26%23x27%3Bs+Methods'),jdecode(''),'/622/index.html','true',[ 
		['PAGE','643',jdecode('Palmer+Method'),jdecode(''),'/622/643.html','true',[],'',''],
		['PAGE','685',jdecode('Instrument+Adjusting'),jdecode(''),'/622/685.html','true',[],'',''],
		['PAGE','706',jdecode('Cold+Laser+Therapy'),jdecode(''),'/622/706.html','true',[],'',''],
		['PAGE','727',jdecode('Spinal+Decompression'),jdecode(''),'/622/727.html','true',[],'',''],
		['PAGE','12001',jdecode('Custom+Foot+Orthotics'),jdecode(''),'/622/12001.html','true',[],'',''],
		['PAGE','10901',jdecode('Nutrition'),jdecode(''),'/622/10901.html','true',[],'','']
	],'',''],
	['PAGE','748',jdecode('Health+Tips'),jdecode(''),'/748.html','true',[],'',''],
	['PAGE','853',jdecode('Interesting+Links'),jdecode(''),'/853.html','true',[],'',''],
	['PAGE','874',jdecode('Contact+Us'),jdecode(''),'/874.html','true',[],'',''],
	['PAGE','5501',jdecode('Map'),jdecode(''),'/5501.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='8CBBD8';
theSitetree.keyvisualId='1723';
theSitetree.keyvisualName='sportstudio.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='348';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='8CBBD8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'8CBBD8',
				keyvisualId: 	'1723',
				keyvisualName: 	'sportstudio.jpg',
				fontsetId: 		'280',
				graphicsetId: 	'348',
				contentColor: 	'000000',
				contentBGColor: '8CBBD8',
				a_color: 		'8CBBD8',
				b_color: 		'338299',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100707-163028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100903-115733'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2732463']={
webappId:    '1501',
documentId:  '301',
internalId:  '2732463',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '622',
internalId:  '',
customField: '20100324-183837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '643',
internalId:  '',
customField: '20080829-120818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '685',
internalId:  '',
customField: '20100225-185833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '706',
internalId:  '',
customField: '20100324-182736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '727',
internalId:  '',
customField: '20100324-182812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20100324-182845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100903-120008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10943',
internalId:  '',
customField: '20100324-182628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '748',
internalId:  '',
customField: '20100324-183922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '853',
internalId:  '',
customField: '20100903-115831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '874',
internalId:  '',
customField: '20100707-163100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20100324-183046'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVQKC';
var companyName   = '+Meier+Chiropractic++++Everett+Wa';
var htmlTitle	  = 'Everett+Chiropractor%2C+Meier+Chiropractic+Center%2C+Palmer+Graduate%2C+Activator+Method';
var metaKeywords  = 'Everett%2C+chiropractor%2C+chiropractic%2C+Activator%2C+Chiro%2C+Meier%2C+Michael%2C+laser%2C+orthotics%2C+arthrostim%2C+vibracussor%2C+activator%2C+tmj%2C+carpal%2C+tunnel%2C+low+back%2C+pain%2C+everett%2C+washington%2C+nutrition%2C+decompression%2C+traction%2C+whiplash%2C+auto%2C+job%2C+accident%2C+injury%2C+mva+';
var metaContents  = 'Everett+and+surrounding+area+chiropractor%2C+providing+excellence+in+Chiropractic+care+for+Family%2C+Sports%2C+Auto+and+On-the-job+injuries+since+1992.+Michael+L.+Meier%2C+DC++5131+Colby+Avenue%2C+Everett+Wa++425-252-2744++';
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();
};
