/* [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','2101',jdecode('Home'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','2152',jdecode('About+us'),jdecode(''), jdecode('%2F2152%2Findex.html'), 'true',[ 
		['PAGE','2173',jdecode('The+team'),jdecode(''), jdecode('%2F2152%2F2173.html'), 'true',[],'','']
	],'',''],
	['PAGE','2194',jdecode('Services'),jdecode(''), jdecode('%2F2194.html'), 'true',[],'',''],
	['PAGE','2215',jdecode('Waxing+and+Tinting'),jdecode(''), jdecode('%2F2215.html'), 'true',[],'',''],
	['PAGE','7901',jdecode('Facial+and+Micros'),jdecode(''), jdecode('%2F7901.html'), 'true',[],'',''],
	['PAGE','2236',jdecode('Body+Treatments+'),jdecode(''), jdecode('%2F2236.html'), 'true',[],'',''],
	['PAGE','7922',jdecode('Massage+'),jdecode(''), jdecode('%2F7922.html'), 'true',[],'',''],
	['PAGE','2257',jdecode('Manicure+and+Pedicure'),jdecode(''), jdecode('%2F2257.html'), 'true',[],'',''],
	['PAGE','2278',jdecode('Permanent+Makeup'),jdecode(''), jdecode('%2F2278.html'), 'true',[],'',''],
	['PAGE','2299',jdecode('Spa+Packages'),jdecode(''), jdecode('%2F2299.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('Gift+Certificates'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','2320',jdecode('Products'),jdecode(''), jdecode('%2F2320.html'), 'true',[],'',''],
	['PAGE','2341',jdecode('Contact'),jdecode(''), jdecode('%2F2341%2Findex.html'), 'true',[ 
		['PAGE','2383',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2341%2F2383.html'), 'true',[],'','']
	],'',''],
	['PAGE','10906',jdecode('Guestbook'),jdecode(''), jdecode('%2F10906%2Findex.html'), 'true',[ 
		['PAGE','10901',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F10906%2F10901.html'), 'true',[],'','']
	],'',''],
	['PAGE','20901',jdecode('Monthly+Special'),jdecode(''), jdecode('%2F20901.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='CC3333';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='440';
theSitetree.graphicsetId='495';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='e47272';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'CC3333',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'440',
				graphicsetId: 	'495',
				contentColor: 	'FFFFFF',
				contentBGColor: 'e47272',
				a_color: 		'e47272',
				b_color: 		'CC3333',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2215',
internalId:  '',
customField: '20110601-142201'
};
webappMappings['1002']=webappMappings['1002-10906AHW050INE0AU']={
webappId:    '1002',
documentId:  '10906',
internalId:  '10906AHW050INE0AU',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20111125-154226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20120104-064236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7922',
internalId:  '',
customField: '20100831-135740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20110730-215727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20090513-111435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20090513-111514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20070212-022903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2236',
internalId:  '',
customField: '20100602-135157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2257',
internalId:  '',
customField: '20100602-135753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2278',
internalId:  '',
customField: '20070211-022730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2299',
internalId:  '',
customField: '20100602-133928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20070511-130756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2320',
internalId:  '',
customField: '20100602-134655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2341',
internalId:  '',
customField: '20100107-160110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2383',
internalId:  '',
customField: '20070309-140913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10906',
internalId:  '',
customField: '20070209-161816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20070209-161816'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE0AU';
var companyName   = 'The+Face+and+Body+Place';
var htmlTitle	  = 'The+Face+and+Body+Place';
var metaKeywords  = '';
var metaContents  = '';
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();
};

