/* [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','6612',jdecode('Home'),jdecode(''),'/6612.html','true',[],'',''],
	['PAGE','6663',jdecode('About+Us'),jdecode(''),'/6663.html','true',[],'',''],
	['PAGE','6810',jdecode('Blakey+Method'),jdecode(''),'/6810.html','true',[],'',''],
	['PAGE','6684',jdecode('Curriculum'),jdecode(''),'/6684.html','true',[],'',''],
	['PAGE','6705',jdecode('Tuition'),jdecode(''),'/6705.html','true',[],'',''],
	['PAGE','6726',jdecode('Class+Schedule'),jdecode(''),'/6726.html','true',[],'',''],
	['PAGE','6747',jdecode('Our+Staff'),jdecode(''),'/6747.html','true',[],'',''],
	['PAGE','6768',jdecode('Continuing+Education'),jdecode(''),'/6768.html','true',[],'',''],
	['PAGE','6789',jdecode('Appointments'),jdecode(''),'/6789.html','true',[],'',''],
	['PAGE','6831',jdecode('Massage+Fees'),jdecode(''),'/6831.html','true',[],'',''],
	['PAGE','6852',jdecode('Contact'),jdecode(''),'/6852.html','true',[],'',''],
	['PAGE','6873',jdecode('Catalogue+Request'),jdecode(''),'/6873.html','true',[],'',''],
	['PAGE','6894',jdecode('How+to+Find+Us'),jdecode(''),'/6894.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='FADE8A';
theSitetree.keyvisualId='2677';
theSitetree.keyvisualName='naturpur.jpg';
theSitetree.fontsetId='220';
theSitetree.graphicsetId='261';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FADE8A';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportive',
				paletteFamily: 	'FADE8A',
				keyvisualId: 	'2677',
				keyvisualName: 	'naturpur.jpg',
				fontsetId: 		'220',
				graphicsetId: 	'261',
				contentColor: 	'000000',
				contentBGColor: 'FADE8A',
				a_color: 		'FADE8A',
				b_color: 		'D0B976',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-9087']={
webappId:    '7008',
documentId:  '6852',
internalId:  '9087',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6612',
internalId:  '',
customField: '20100731-125032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6663',
internalId:  '',
customField: '20100731-125344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6684',
internalId:  '',
customField: '20100731-125631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6705',
internalId:  '',
customField: '20100731-130011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6726',
internalId:  '',
customField: '20100731-130410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6747',
internalId:  '',
customField: '20100731-132503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6768',
internalId:  '',
customField: '20100731-130648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6789',
internalId:  '',
customField: '20100731-122023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6810',
internalId:  '',
customField: '20100731-132706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6831',
internalId:  '',
customField: '20100731-130843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6852',
internalId:  '',
customField: '20100731-123703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6873',
internalId:  '',
customField: '20100731-130926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6894',
internalId:  '',
customField: '20100731-131309'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLG9O';
var companyName   = 'WestWind+Massage+Academy';
var htmlTitle	  = 'WestWind+Academy+of+Massage+Therapy';
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();
};
