/* [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','6501',jdecode('Home'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','27701',jdecode('Our+Programs'),jdecode(''),'/27701.html','true',[],''],
	['PAGE','27722',jdecode('Register+for+Classes'),jdecode(''),'/27722.html','true',[],''],
	['PAGE','27743',jdecode('Our+Studio+'),jdecode(''),'/27743.html','true',[],''],
	['PAGE','17522',jdecode('Request+Information'),jdecode(''),'/17522.html','true',[],''],
	['PAGE','29001',jdecode('Contact+Us'),jdecode(''),'/29001.html','true',[],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Simple';
theSitetree.paletteFamily='C1BCB6';
theSitetree.keyvisualId='2537';
theSitetree.keyvisualName='balett.jpg';
theSitetree.fontsetId='10346';
theSitetree.graphicsetId='10456';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='C1BCB6';
var theTemplate={
				name: 			'Simple',
				paletteFamily: 	'C1BCB6',
				keyvisualId: 	'2537',
				keyvisualName: 	'balett.jpg',
				fontsetId: 		'10346',
				graphicsetId: 	'10456',
				contentColor: 	'A00000',
				contentBGColor: 'C1BCB6',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'857157',
				e_color: 		'FFFFFF',
				f_color: 		'817E7E',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20090820-221113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20090820-214025'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17522',
internalId:  '',
customField: '20090820-213925'
};
webappMappings['7008']=webappMappings['7008-4507']={
webappId:    '7008',
documentId:  '27722',
internalId:  '4507',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20090820-213523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27722',
internalId:  '',
customField: '20090820-213635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27743',
internalId:  '',
customField: '20090820-213742'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLBXV';
var companyName   = '1st+Steps+to+Broadway';
var htmlTitle	  = 'Welcome+to+1st+Steps+to+Broadway+located+at+699-B+Hill+Rd+in+Pickerington+OH+43147';
var metaKeywords  = 'dance%3Bdance+instruction%3Bdance+classes%3Bdance+lessons%3B+pickerington%3Breynoldsburg%3B+canal+winchester%3Bpataskala%3Blancaster%3Bbaltimore%3Bcolumbus%3Bballet%3Btap%3Bjazz%3Btumbling%3Bdance+studio%3Bcombination+classes%3B43147%3B43068%3B43110%3B43062%3B43011%3B43232%3Bohio%3B1st+steps+to+broadway%3Bfirst+steps+to+broadway%3B1st+steps%3Bfirst+steps%3Bschool+of+dance%3Bdance+academy%3Bdance+center%3Bkids%3Bchildren%3Badult%3Bclasses%3Blessons%3Bfitness%3Bperformance%3Bexercise%3Bcamp%3Bsummer%3Bwinter%3Bfall%3Bspring%3Bannual%3Bcoupon%3Bdiscount%3Bfamily%3Benvironment%3Btechnique%3Brecreational%3Bcompetition%3Bday%3Bevening%3Bmommy+and+me%3Bgirls%3Bboys%3Bactivities%3Bextracurricular%3Bcommunity%3Bviolet+festival%3Btigers%3Bpanthers%3Bpyaa%3B';
var metaContents  = '1st+Steps+to+Broadway+located+at+699+Hill+Rd+in+Pickerington%2C+OH+43147.++It+is+a+premier+dance+studio+offering+a+large+selection+of+class+times+for+ballet%2C+tap%2C+jazz%2C+tumbling+and+adult+dance+instruction.';
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();
};
