/* [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','4001',jdecode('Home'),jdecode(''),'/4001.html','true',[],''],
	['PAGE','11801',jdecode('Pricing'),jdecode(''),'/11801.html','true',[],''],
	['PAGE','4301',jdecode('Contact+Us'),jdecode(''),'/4301/index.html','true',[ 
		['PAGE','4343',jdecode('Your+therapist'),jdecode(''),'/4301/4343.html','true',[],'']
	],''],
	['PAGE','4364',jdecode('Massage'),jdecode(''),'/4364/index.html','true',[ 
		['PAGE','4406',jdecode('Benefits+of+Massage'),jdecode(''),'/4364/4406.html','false',[],'']
	],''],
	['PAGE','4448',jdecode('Spa+'),jdecode(''),'/4448.html','true',[],''],
	['PAGE','4385',jdecode('Policies'),jdecode(''),'/4385.html','true',[],''],
	['PAGE','4427',jdecode('Health+Links'),jdecode(''),'/4427.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='AED0E8';
theSitetree.keyvisualId='7285';
theSitetree.keyvisualName='kv_7285.jpg';
theSitetree.fontsetId='16460';
theSitetree.graphicsetId='12151';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Daily',
				paletteFamily: 	'AED0E8',
				keyvisualId: 	'7285',
				keyvisualName: 	'kv_7285.jpg',
				fontsetId: 		'16460',
				graphicsetId: 	'12151',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100719-172324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4364',
internalId:  '',
customField: '20080421-032046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4385',
internalId:  '',
customField: '20080419-185634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4406',
internalId:  '',
customField: '20080419-185634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4427',
internalId:  '',
customField: '20100726-190711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4301',
internalId:  '',
customField: '20100719-171642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4343',
internalId:  '',
customField: '20100719-171853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20100127-151620'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4448',
internalId:  '',
customField: '20090324-234402'
};
webappMappings['7008']=webappMappings['7008-30143']={
webappId:    '7008',
documentId:  '4301',
internalId:  '30143',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-27015540']={
webappId:    '1501',
documentId:  '4001',
internalId:  '27015540',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-4343aendu0in2dt1']={
webappId:    '1002',
documentId:  '4343',
internalId:  '4343aendu0in2dt1',
customField: 'icq=false'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11801',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4343',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4364',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4406',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4448',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4385',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4427',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2DT1';
var companyName   = 'Marisa+Badgley%2C+L.M.P.';
var htmlTitle	  = 'Marisa+Therapy+Massage+Vancouver%2C+WA+Licensed';
var metaKeywords  = 'massage%2C+therapy%2C+massage+therapy%2C+therapeutic+massage%2C+Vancouver%2C+Washington%2C+massage+in+vancouver+Wa%2C+swedish+massage%2C+deep+tissue+massage%2C+sports+massage%2C+myofascial+release%2C+pain+relief%2C+downtown+Vancouver+Wa%2C+marissa%2C+marisatherapymassage%2C+marisa+evergreen+blvd+vancouver%2C+Academy+Building%2C+evergreen%2C++Vancouver+Washington+Massage%2C+Massage+in+Vancouver+WA%2C+Washington+Massage+Therapists%2C+Certified+Massage+Therapists+in+Vancouver+WA%2C+WA+Massage%2C+Health%2C+Holistic%2C+Alternative+Health%2C+Alternative+Medicine%2C+Massage+Therapy+in+WA%2C+Therapeutic+Massage+in+WA%2C';
var metaContents  = 'Massage+therapy+in+Vancouver%2C+WA%2C+Professional+Swedish+massage%2C+deep+tissue+massage%2C+sports+massage%2C+myofascial+release+performed+by+licensed+massage+practitioner%2C+Marisa+Badgley%2C+LMP+practices+therapeutic+massage+in+downtown+Vancouver%2C+WA';
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();
};

