/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','10801',jdecode('Schedule'),jdecode(''),'/10801.html','true',[],'',''],
	['PAGE','806',jdecode('Programs'),jdecode(''),'/806.html','true',[],'',''],
	['PAGE','109001',jdecode('Benefits+%26+History'),jdecode(''),'/109001.html','true',[],'',''],
	['PAGE','11901',jdecode('Rates'),jdecode(''),'/11901.html','true',[],'',''],
	['PAGE','20606',jdecode('Instructor+Training'),jdecode(''),'/20606.html','true',[],'',''],
	['PAGE','764',jdecode('Trainers'),jdecode(''),'/764.html','true',[],'',''],
	['PAGE','701',jdecode('Contact+Us%2FLinks'),jdecode(''),'/701.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='CEC8F8';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10350';
theSitetree.graphicsetId='10478';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'cutout',
				paletteFamily: 	'CEC8F8',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10350',
				graphicsetId: 	'10478',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				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['7060']=webappMappings['7060-b17bc68c79ac52c5ebdfabdc82727f86']={
webappId:    '7060',
documentId:  '764',
internalId:  'b17bc68c79ac52c5ebdfabdc82727f86',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109001',
internalId:  '',
customField: '20100404-224921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100906-043004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100906-042602'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC241']={
webappId:    '5003',
documentId:  '501',
internalId:  'tid:1;pid:WSCSYSSSSLYTC241',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '806',
internalId:  '',
customField: '20100801-210235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100508-123122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '764',
internalId:  '',
customField: '20100829-203337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100625-203106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20606',
internalId:  '',
customField: '20100801-210334'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX342';
var companyName   = 'Gotham+City+Pilates+at+Gramercy%2C+LLC';
var htmlTitle	  = 'Gotham+City+Pilates+at+Gramercy%2C+LLC';
var metaKeywords  = 'pilates%2C+wellness%2C+gramercy%2C+new+york+city%2C+reformer%2C+mat+class%2C+half+trap%2C+half-trap%2C+balanced+body%2C+strengthening%2C+core%2C+abdominals%2C+abs%2C+lengthening%2C+core+strength%2C+posture%2C+alignment%2C+breathing%2C+relaxation%2C+toning%2C+shape%2C+improve+alignment%2C+stretching%2C+stretch%2C+foam+roller%2C+chairs%2C+barrel%2C+spinal+health%2C+rehab%2C+rehabilitation%2C+rehab+injuries%2C+energize%2C+enchance%2C+prenatal%2C+postpartum%2C+weight+loss%2C+weight+management%2C+pilates+apparatus%2C+spine+corrector%2C+roll+down+bar%2C+push+down+bar%2C+cadillac%2C+trapeze%2C+magic+circle%2C+pilates+ring%2C+ultra-fit+circle%2C+improve+balance%2C+core%2C+group+classes%2C+leg+springs%2C+lexington%2C+madison%2C+baruch%2C+midtown%2C+tower+of+power%2C+emily+tremaine%2C+allyson+gracie%2C+Hundreds%2C+Joy+Karley%2C+Teser%2C+master+trainer%2C+blaine+gregg+miller%2C+beginner%2C+intermediate%2C+advanced%2C+super+advanced%2C+pelvis%2C+pelvic+stabilization%2C+core+stabilization%2C+Joseph+Pilates%2C+pelvic+strength%2C+Carola+Pilates%2C+athletes%2C+swan%2C+cross-training%2C+cross+training+supplement%2C+inhale%2C+exhale%2C+improve+coordination%2C+osteoperosis%2C+scoop+the+abdominals%2C+posture%2C+flexion%2C+extension%2C+challenge+control+of+torso+and+legs%2C+chest+expansion%2C+twist%2C+salutes%2C+torso%2C+legs%2C+arms%2C+airplane%2C+sternum%2C+studio%2C+increase+dynamic+torso+stabilization%2C+stretch+hamstrings+and+back%2C+strengthen+abdominals+and+hip+flexors%2C+strenghten+biceps+bracialis%2C+pectoralis+major%2C+rotator+cuff%2C+deltoid%2C+serratus+anterior%2C+trapesius%2C+rhomboid%2C+mermaid%2C+sidebends%2C+active+disk+injuries%2C+sacroilia+joint+instability%2C+siatica%2C+glutes%2C+hamstrings%2C+improve+spinal+articulation%2C+dancers%2C+long+spine%2C+short+spine%2C+bridging%2C+thigh+stretch%2C+push+ups%2C+prone%2C+supine%2C+emily+tremaine%2Cblaine+gregg+alexander%2C+joy+karley%2C+allyson+gracie%2C+private%2C+semi-private%2C+pilates+only%2C+zumba%2C+fabricia+misterhof';
var metaContents  = 'Pilates+Exercise+and+Wellness+Information+Balanced+Body+University+Instructor+Training+CenterPilates+Training+Studio+Balanced+Body+Equipment';
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();
};
