/* [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','2701',jdecode('Heather+I.+Dixon%2C+LMT+Homepage'),jdecode(''),'/2701.html','true',[],''],
	['PAGE','2901',jdecode('Massage+Therapy+Services'),jdecode(''),'/2901.html','true',[],''],
	['PAGE','5201',jdecode('Spa+Treatments+%26+Packages'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','5301',jdecode('Printable+Coupon+%26+Menu'),jdecode(''),'/5301.html','true',[],''],
	['PAGE','5701',jdecode('Completely+Pampered+Services'),jdecode(''),'/5701.html','true',[],''],
	['PAGE','9701',jdecode('Massage+Photo+Gallery+%26+More'),jdecode(''),'/9701.html','true',[],''],
	['PAGE','2922',jdecode('How+to+find+us'),jdecode(''),'/2922.html','true',[],''],
	['PAGE','5901',jdecode('Links'),jdecode(''),'/5901.html','true',[],''],
	['PAGE','8901',jdecode('Guestbook'),jdecode(''),'/8901.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='C5E6FB';
theSitetree.keyvisualId='11281';
theSitetree.keyvisualName='kv_11281.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13933';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Vita02',
				paletteFamily: 	'C5E6FB',
				keyvisualId: 	'11281',
				keyvisualName: 	'kv_11281.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13933',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				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:  '2701',
internalId:  '',
customField: '20100712-232533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100330-121215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20100120-121545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100716-191355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100716-191148'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20100618-101828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20100509-095016'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2922',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100703-101538'
};
webappMappings['1002']=webappMappings['1002-8901aendu0in2oug']={
webappId:    '1002',
documentId:  '8901',
internalId:  '8901aendu0in2oug',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20090331-134913'
};
webappMappings['7005']=webappMappings['7005-1988']={
webappId:    '7005',
documentId:  '9701',
internalId:  '1988',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2OUG';
var companyName   = 'Heather+I.+Dixon%2C+LMT';
var htmlTitle	  = 'Massage+Therapy%2C+Bodywork+%26+Spa+-+Panama+City%2C+Florida+32401';
var metaKeywords  = 'Massage+Therapy%2C+Spa%2C+Day+Spa%2C+Panama+City%2C+Heather+I+Dixon+LMT%2C+licensed+massage+therapist%2C+swedish%2C+deep+tissue%2C+bamboo+fusion%2C+cupping+therapy%2C+reiki%2C+healing%2C+nutrition%2C+health%2C+muscles%2C+body+wraps%2C+slimming%2C+mud+wraps%2C+32401%2C+32405%2C+Historic+St.+Andrews%2C+Completely+Pampered%2C+envy%2C+panama+city+beach%2C+entertainment%2C+vacation%2C+relaxing';
var metaContents  = 'Heather+I+Dixon+LMT%3A+Therapeutic+Massage%2C+Bodywork%2C++Spa+joined+with+Completely+Pampered+Hair+Salon++Boutique+are+located+in+the+Historic+St.+Andrews+District+of+Panama+City%2C+Florida+32401.';
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();
};
