/* [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','100501',jdecode('Home'),jdecode(''),'/100501.html','true',[],''],
	['PAGE','100636',jdecode('Hours'),jdecode(''),'/100636.html','true',[],''],
	['PAGE','106701',jdecode('Online+Appointment'),jdecode(''),'/106701.html','true',[],''],
	['PAGE','111901',jdecode('Buy+a+GIFT+Certificate'),jdecode(''),'/111901.html','true',[],''],
	['PAGE','106722',jdecode('What%26%23x27%3Bs+New'),jdecode(''),'/106722.html','true',[],''],
	['PAGE','159101',jdecode('Environment'),jdecode(''),'/159101.html','true',[],''],
	['PAGE','118201',jdecode('Just+for+Men'),jdecode(''),'/118201.html','true',[],''],
	['PAGE','100552',jdecode('Buffalo+Team'),jdecode(''),'/100552.html','true',[],''],
	['PAGE','106743',jdecode('Monticello+Team'),jdecode(''),'/106743.html','true',[],''],
	['PAGE','162901',jdecode('Monticello+Open+house'),jdecode(''),'/162901.html','true',[],''],
	['PAGE','162922',jdecode('Wedding+Expo'),jdecode(''),'/162922.html','true',[],''],
	['PAGE','129401',jdecode('Monthly+Specials'),jdecode(''),'/129401.html','true',[],''],
	['PAGE','100573',jdecode('Menu+Hair+Services'),jdecode(''),'/100573.html','true',[],''],
	['PAGE','106764',jdecode('Menu+Massages'),jdecode(''),'/106764.html','true',[],''],
	['PAGE','106785',jdecode('Menu+Facials'),jdecode(''),'/106785.html','true',[],''],
	['PAGE','106806',jdecode('Menu+Spa+Packages'),jdecode(''),'/106806.html','true',[],''],
	['PAGE','100594',jdecode('Jobs'),jdecode(''),'/100594.html','true',[],''],
	['PAGE','106827',jdecode('Buffalo+Location'),jdecode(''),'/106827.html','true',[],''],
	['PAGE','100657',jdecode('Monticello+location'),jdecode(''),'/100657.html','true',[],''],
	['PAGE','106848',jdecode('e-mail'),jdecode(''),'/106848.html','true',[],''],
	['PAGE','108301',jdecode('Sign+our+guestbook'),jdecode(''),'/108301.html','true',[],''],
	['PAGE','108322',jdecode('Pictures'),jdecode(''),'/108322.html','true',[],'']];
var siteelementCount=22;
theSitetree.topTemplateName='Charm';
theSitetree.paletteFamily='BAD9F1';
theSitetree.keyvisualId='11067';
theSitetree.keyvisualName='kv_11067.jpg';
theSitetree.fontsetId='31952';
theSitetree.graphicsetId='13788';
theSitetree.contentColor='1F1F1F';
theSitetree.contentBGColor='BAD9F1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Charm',
				paletteFamily: 	'BAD9F1',
				keyvisualId: 	'11067',
				keyvisualName: 	'kv_11067.jpg',
				fontsetId: 		'31952',
				graphicsetId: 	'13788',
				contentColor: 	'1F1F1F',
				contentBGColor: 'BAD9F1',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108322',
internalId:  '',
customField: '20091015-070628'
};
webappMappings['7060']=webappMappings['7060-c891dca2e3990502866f39acfa7efef9']={
webappId:    '7060',
documentId:  '108322',
internalId:  'c891dca2e3990502866f39acfa7efef9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106827',
internalId:  '',
customField: '20091106-083141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106848',
internalId:  '',
customField: '20091106-083055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106743',
internalId:  '',
customField: '20100709-160803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106764',
internalId:  '',
customField: '20100314-175306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106785',
internalId:  '',
customField: '20091015-072503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106806',
internalId:  '',
customField: '20100314-175455'
};
webappMappings['1002']=webappMappings['1002-108301aendu0in2wkg']={
webappId:    '1002',
documentId:  '108301',
internalId:  '108301aendu0in2wkg',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '100501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106722',
internalId:  '',
customField: '20100713-155315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106701',
internalId:  '',
customField: '20100117-082411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100636',
internalId:  '',
customField: '20100312-075611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100657',
internalId:  '',
customField: '20100204-112511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100594',
internalId:  '',
customField: '20100622-081118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129401',
internalId:  '',
customField: '20100715-093643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100573',
internalId:  '',
customField: '20100314-175224'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '106827',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100552',
internalId:  '',
customField: '20100715-101038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100501',
internalId:  '',
customField: '20100708-092841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108301',
internalId:  '',
customField: '20091110-081104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111901',
internalId:  '',
customField: '20091021-085905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118201',
internalId:  '',
customField: '20100708-083134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162901',
internalId:  '',
customField: '20100708-084146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162922',
internalId:  '',
customField: '20100708-084356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159101',
internalId:  '',
customField: '20100513-063251'
};
webappMappings['1501']=webappMappings['1501-4905503']={
webappId:    '1501',
documentId:  '100501',
internalId:  '4905503',
customField: '1501'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2WKG';
var companyName   = 'Exhileration+Salon+%26+Spa';
var htmlTitle	  = 'Exhileration+Salon+and+Spa';
var metaKeywords  = 'salon%2C+spa%2C+hair%2C+nails%2C+buffalo%2C+massage%2C+facial%2C+pedicure%2C+manicure%2C+spa+package%2C+AVEDA%2C+Aveda';
var metaContents  = 'Exhileration+Salon+and+Spa%2C+an+AVEDA+Concept+salon%2C+located+in+Buffalo+MNExhileration+Salon+and+Spa%2C+an+AVEDA+LIFESTYLE+salon%2C+located+in+Monticello%2C+MN';
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();
};
