/* [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','401',jdecode('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','32601',jdecode('Registration+Forms'),jdecode(''), jdecode('%2F32601.html'), 'true',[],'',''],
	['PAGE','452',jdecode('Staff'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','38301',jdecode('Class+Descriptions'),jdecode(''), jdecode('%2F38301.html'), 'true',[],'',''],
	['PAGE','81012',jdecode('FITNESS'),jdecode(''), jdecode('%2F81012.html'), 'true',[],'',''],
	['PAGE','38322',jdecode('Price+List'),jdecode(''), jdecode('%2F38322.html'), 'true',[],'',''],
	['PAGE','54212',jdecode('Studio+Pics'),jdecode(''), jdecode('%2F54212.html'), 'true',[],'',''],
	['PAGE','40401',jdecode('Recital+2010'),jdecode(''), jdecode('%2F40401.html'), 'true',[],'',''],
	['PAGE','105612',jdecode('Recital+2011'),jdecode(''), jdecode('%2F105612.html'), 'true',[],'',''],
	['PAGE','85212',jdecode('Other+Pictures'),jdecode(''), jdecode('%2F85212.html'), 'true',[],'',''],
	['PAGE','89212',jdecode('Dance+Team+2012'),jdecode(''), jdecode('%2F89212%2Findex.html'), 'true',[ 
		['PAGE','111212',jdecode('Dance+Team'),jdecode(''), jdecode('%2F89212%2F111212.html'), 'true',[],'','']
	],'',''],
	['PAGE','91212',jdecode('Dance+Team+Sponsors'),jdecode(''), jdecode('%2F91212.html'), 'true',[],'',''],
	['PAGE','536',jdecode('Contact'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','72112',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F72112.html'), 'true',[],'',''],
	['PAGE','82712',jdecode('Newsletters'),jdecode(''), jdecode('%2F82712.html'), 'true',[],'',''],
	['PAGE','31306',jdecode('Guestbook'),jdecode(''), jdecode('%2F31306%2Findex.html'), 'true',[ 
		['PAGE','31301',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F31306%2F31301.html'), 'false',[],'','']
	],'',''],
	['PAGE','96812',jdecode('Welcome+Letter'),jdecode(''), jdecode('%2F96812.html'), 'false',[],'',''],
	['PAGE','109712',jdecode('Race+for+the+Cure'),jdecode(''), jdecode('%2F109712.html'), 'false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Steps';
theSitetree.paletteFamily='315881';
theSitetree.keyvisualId='2263';
theSitetree.keyvisualName='culture.jpg';
theSitetree.fontsetId='368';
theSitetree.graphicsetId='419';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='315881';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'aplus',
  product: 'WSCSYSSSSLYTCPLI'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Steps',
				paletteFamily: 	'315881',
				keyvisualId: 	'2263',
				keyvisualName: 	'culture.jpg',
				fontsetId: 		'368',
				graphicsetId: 	'419',
				contentColor: 	'FFFFFF',
				contentBGColor: '315881',
				a_color: 		'315881',
				b_color: 		'2985B5',
				c_color: 		'3366CC',
				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:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9379028']={
webappId:    '1501',
documentId:  '401',
internalId:  '9379028',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105612',
internalId:  '',
customField: '20110822-184613'
};
webappMappings['1002']=webappMappings['1002-31306aaplu0inlxhg']={
webappId:    '1002',
documentId:  '31306',
internalId:  '31306aaplu0inlxhg',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120213-062842'
};
webappMappings['7008']=webappMappings['7008-220']={
webappId:    '7008',
documentId:  '536',
internalId:  '220',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32601',
internalId:  '',
customField: '20110529-100123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20110909-071919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20110701-125259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38322',
internalId:  '',
customField: '20100805-001724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54212',
internalId:  '',
customField: '20110221-162328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40401',
internalId:  '',
customField: '20110221-162257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20080812-072021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31306',
internalId:  '',
customField: '20080722-141932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20080705-064643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72112',
internalId:  '',
customField: '20100705-042311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81012',
internalId:  '',
customField: '20120213-063423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85212',
internalId:  '',
customField: '20110221-165002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82712',
internalId:  '',
customField: '20110908-202824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89212',
internalId:  '',
customField: '20111102-130523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91212',
internalId:  '',
customField: '20111102-124917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96812',
internalId:  '',
customField: '20110627-045617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109712',
internalId:  '',
customField: '20111007-063226'
};
webappMappings['7060']=webappMappings['7060-01f3b1106cde12e131c37b3628e11064']={
webappId:    '7060',
documentId:  '40401',
internalId:  '01f3b1106cde12e131c37b3628e11064',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-c6f41e434e2cbaf57ea9545f61100f04']={
webappId:    '7060',
documentId:  '111212',
internalId:  'c6f41e434e2cbaf57ea9545f61100f04',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '111212',
internalId:  '-',
customField: '20111102-132219'
};
webappMappings['7060']=webappMappings['7060-f2c4ab3a77030f0e841d0a6a0ef94212']={
webappId:    '7060',
documentId:  '105612',
internalId:  'f2c4ab3a77030f0e841d0a6a0ef94212',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cm4all.aplus.net:80';
var canonHostname = 'cm4all01.carrierzone.com';
var accountId     = 'AAPLU0INLXHG';
var companyName   = 'Resha%27s+School+of+Dance';
var htmlTitle	  = 'Reshas+School+of+Dance+in+Mt+Juliet%2C+TN';
var metaKeywords  = '%2FReshas%2CDance+School%2C+Dance%2C+Mt+Juliet%2Ctap%2Chip+hop%2Cballroom%2Cpoint%2C+pom%2C+studio.acrobatics%2Ccreative+movement%2C+TN';
var metaContents  = 'Mt+Juliet%2Creshas+dance%2C%2CReshas+Studio%2CStudio%2CDance+Classes%2CDance+Studio+Mt+Juliet%2CTN';
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();
};

