/* [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','4801',jdecode('Home'),jdecode(''), jdecode('%2F4801.html'), 'true',[],'',''],
	['PAGE','15201',jdecode('+Decompression+Brands'),jdecode(''), jdecode('%2F15201.html'), 'true',[],'',''],
	['PAGE','19401',jdecode('Our+Method'),jdecode(''), jdecode('%2F19401.html'), 'true',[],'',''],
	['PAGE','16401',jdecode('Spine+Surgery'),jdecode(''), jdecode('%2F16401.html'), 'true',[],'',''],
	['PAGE','18201',jdecode('Research+%2F+Clinic+Trials'),jdecode(''), jdecode('%2F18201.html'), 'true',[],'',''],
	['PAGE','20601',jdecode('Types+of+Back+Pain'),jdecode(''), jdecode('%2F20601.html'), 'true',[],'',''],
	['PAGE','28501',jdecode('Disc+Herniation+Info'),jdecode(''), jdecode('%2F28501.html'), 'true',[],'',''],
	['PAGE','17701',jdecode('+Herniation+Symptoms'),jdecode(''), jdecode('%2F17701.html'), 'true',[],'',''],
	['PAGE','28522',jdecode('Sciatica+Info'),jdecode(''), jdecode('%2F28522.html'), 'true',[],'',''],
	['PAGE','28543',jdecode('Spinal+Stenosis+Info'),jdecode(''), jdecode('%2F28543.html'), 'true',[],'',''],
	['PAGE','28564',jdecode('Degenerative+Disc'),jdecode(''), jdecode('%2F28564.html'), 'true',[],'',''],
	['PAGE','8601',jdecode('+Location+%26+Directions'),jdecode(''), jdecode('%2F8601.html'), 'true',[],'',''],
	['PAGE','8622',jdecode('Office+Hours'),jdecode(''), jdecode('%2F8622.html'), 'true',[],'',''],
	['PAGE','13401',jdecode('Our+News+Offer'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'',''],
	['PAGE','8643',jdecode('Contact+us'),jdecode(''), jdecode('%2F8643.html'), 'true',[],'',''],
	['PAGE','23701',jdecode('Chiropractic+Blog'),jdecode(''), jdecode('%2F23701.html'), 'true',[],'',''],
	['PAGE','27101',jdecode('Success+Stories'),jdecode(''), jdecode('%2F27101.html'), 'true',[],'',''],
	['PAGE','33001',jdecode('DRX9000+info'),jdecode(''), jdecode('%2F33001.html'), 'true',[],'',''],
	['PAGE','35401',jdecode('VAX-D+info'),jdecode(''), jdecode('%2F35401.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='8CBBD8';
theSitetree.keyvisualId='1684';
theSitetree.keyvisualName='abendsonne.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='348';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='8CBBD8';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hostway_generic',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'8CBBD8',
				keyvisualId: 	'1684',
				keyvisualName: 	'abendsonne.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:  '4801',
internalId:  '',
customField: '20111010-175000'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '8601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8643',
internalId:  '',
customField: '20110407-180212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8622',
internalId:  '',
customField: '20110407-180106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20110407-180043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20110112-224343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20110810-192038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20111010-171933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20110524-195109'
};
webappMappings['1501']=webappMappings['1501-8720251']={
webappId:    '1501',
documentId:  '4801',
internalId:  '8720251',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20110524-190903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20110407-175727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20110726-192535'
};
webappMappings['7050']=webappMappings['7050-3406']={
webappId:    '7050',
documentId:  '23701',
internalId:  '3406',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20110222-210853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20110628-140201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28501',
internalId:  '',
customField: '20110628-135344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28522',
internalId:  '',
customField: '20110726-191823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28543',
internalId:  '',
customField: '20110715-185556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28564',
internalId:  '',
customField: '20110715-190718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20110630-194433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33001',
internalId:  '',
customField: '20111010-184329'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ2JP';
var companyName   = 'Palomar+Spinal+Decompression';
var htmlTitle	  = 'Non+Surgical+Spinal+Decompression+Therapy';
var metaKeywords  = 'Spinal+Decompression+Therapy%2C+Herniated+Disc%2C+Disc+Bulge%2C+Spinal+Stenosis%2C+Facet+Syndrome%2C+Failed+back+surgery%2C+minimally+invasive+back+surgery%2C+back+pain%2C+neck+pain%2C+chronic+back+pain%2C+chronic+neck+pain%2C+physical+therapy%2C+Chiropractic%2C+Chiropractor%2C+spinal+manipulation%2C+osteopathic+manipulation%2C+chiropractic+adjustments';
var metaContents  = 'Non-surgical+Spinal+Decompression';
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();
};

