/* [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','2701',jdecode('Homepage'),jdecode(''), jdecode('%2F2701.html'), 'true',[],'',''],
	['PAGE','2901',jdecode('Massage+Services'),jdecode(''), jdecode('%2F2901.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('Spa+Services'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','5301',jdecode('Printable+Coupon+'),jdecode(''), jdecode('%2F5301.html'), 'true',[],'',''],
	['PAGE','5701',jdecode('Harbour+Village'),jdecode(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','9701',jdecode('Gallery+%26+More'),jdecode(''), jdecode('%2F9701.html'), 'true',[],'',''],
	['PAGE','2922',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2922.html'), 'true',[],'',''],
	['PAGE','5901',jdecode('Links'),jdecode(''), jdecode('%2F5901.html'), 'true',[],'',''],
	['PAGE','8901',jdecode('Guestbook'),jdecode(''), jdecode('%2F8901.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Guest';
theSitetree.paletteFamily='FFF475';
theSitetree.keyvisualId='11764';
theSitetree.keyvisualName='kv_11764.jpg';
theSitetree.fontsetId='33047';
theSitetree.graphicsetId='14027';
theSitetree.contentColor='330000';
theSitetree.contentBGColor='FFF2DC';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Guest',
				paletteFamily: 	'FFF475',
				keyvisualId: 	'11764',
				keyvisualName: 	'kv_11764.jpg',
				fontsetId: 		'33047',
				graphicsetId: 	'14027',
				contentColor: 	'330000',
				contentBGColor: 'FFF2DC',
				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: '20120131-141757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20111212-111450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20110502-200955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20110422-222518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20111212-111355'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20110622-130336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20120131-141841'
};
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: '20110720-221410'
};
webappMappings['1002']=webappMappings['1002-8901aendu0in2oug']={
webappId:    '1002',
documentId:  '8901',
internalId:  '8901aendu0in2oug',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20101020-153730'
};
webappMappings['7005']=webappMappings['7005-1988']={
webappId:    '7005',
documentId:  '9701',
internalId:  '1988',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.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+massage+therapist%2C+spas%2C+Spa%2C+Day+Spa%2C+Panama+City%2C+Heather+I+Dixon+LMT%2C+licensed+massage+therapists%2C+swedish%2C+deep+tissue%2C+bamboo+fusion%2C+cupping+therapy%2C+reiki%2C+healing%2C+nutrition%2C+energy+work%2C+medical+massage%2C+ETPS%2C+tui-na%2C+aromatherapy%2C+health%2C+muscles%2C+body+wraps%2C+slimming%2C+mud+wraps%2C+body+scrubs%2C+exfoliation%2C+skin+care%2C+facials%2C+paraffin%2C+32404%2C+32407%2C+32401%2C+32405%2C+Historic+St.+Andrews%2C+Completely+Pampered%2C+envy%2C+panama+city+beach%2C+entertainment%2C+vacation%2C+relaxing%2C+alternative+medicine+practitioner%2C+stress+relief%2C+de-stress%2C+pamper%2C+gift+certificates%2C+essential+oils%2C+nebulizing+diffusers%2C+bath+bombs%2C+herbal+wraps%2C+yogi+teas';
var metaContents  = 'Heather+I+Dixon+LMT%3A+Therapeutic+Massage%2C+Bodywork+%26+Spa+joined+with+Completely+Pampered+Hair+Salon+%26+Spa++located+in+the+Historic+St.+Andrews+District+of+Panama+City%2C+Florida+32401.+Holistic+healing+for+mind...body...spirit...connection.+Instant+gift+certificates+available.';
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();
};

