/* [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 theSitetree=[ 
	['PAGE','192',jdecode('Home'),jdecode(''),'/192.html','true',[],''],
	['PAGE','243',jdecode('Employment'),jdecode(''),'/243.html','true',[],''],
	['PAGE','264',jdecode('Services'),jdecode(''),'/264/index.html','true',[ 
		['PAGE','285',jdecode('Work+Hardening'),jdecode(''),'/264/285.html','true',[],'']
	],''],
	['PAGE','348',jdecode('Contact'),jdecode(''),'/348/index.html','true',[ 
		['PAGE','5299',jdecode('Map'),jdecode(''),'/348/5299.html','true',[],'']
	],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Dispose';
theSitetree.paletteFamily='E99C2E';
theSitetree.keyvisualId='9696';
theSitetree.keyvisualName='kv_9696.gif';
theSitetree.fontsetId='10659';
theSitetree.graphicsetId='11182';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCACA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Dispose',
				paletteFamily: 	'E99C2E',
				keyvisualId: 	'9696',
				keyvisualName: 	'kv_9696.gif',
				fontsetId: 		'10659',
				graphicsetId: 	'11182',
				contentColor: 	'000000',
				contentBGColor: 'CCCACA',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '192',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5299',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192',
internalId:  '',
customField: '20051124-131646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '243',
internalId:  '',
customField: '20080918-140904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '264',
internalId:  '',
customField: '20051124-125952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '285',
internalId:  '',
customField: '20060202-175431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '348',
internalId:  '',
customField: '20051124-130313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5299',
internalId:  '',
customField: '20051124-132027'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'AAPLU0INXVZN';
var companyName   = 'Central+Washington+Physical+Therapy';
var htmlTitle	  = '';
var metaKeywords  = 'pt+jobs%2C+physical+therapy+jobs%2C+pt+employment%2C+therapist+position%2C+yakima+washington%2C+yakima%2C+wa%2C+central+washington%2C+pt%2C+rehab%2C+sports+rehap%2C+work+hardening%2C+physical+therapy%2C+therapist%2C+eastern+washington%2C+valley%2C+james%2C+simmons%2C+selah%2C+union+gap%2C+lower+valley%2C+northwest%2C+physical%2C+therapist';
var metaContents  = 'Central+Washington+Physical+Therapy+is+located+in+beautiful+Yakima%2C+Washington.+This+clinic+is+dedicated+to+improving+your+health.';
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();
};
