/* [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','5801',jdecode('Home'),jdecode(''),'/5801.html','true',[],''],
	['PAGE','5852',jdecode('Tuition+Rates'),jdecode(''),'/5852.html','true',[],''],
	['PAGE','20001',jdecode('Current+Clients'),jdecode(''),'/20001/index.html','true',[ 
		['PAGE','20043',jdecode('Our+Blog%21'),jdecode(''),'/20001/20043.html','true',[],''],
		['PAGE','20064',jdecode('Monthly+Activity+Calendar'),jdecode(''),'/20001/20064.html','true',[],'']
	],''],
	['PAGE','5999',jdecode('Enrollment'),jdecode(''),'/5999/index.html','true',[ 
		['PAGE','5873',jdecode('Handbook+%26+Forms'),jdecode(''),'/5999/5873.html','true',[],''],
		['PAGE','17801',jdecode('Learning+Program'),jdecode(''),'/5999/17801.html','true',[],''],
		['PAGE','21801',jdecode('Prospective+Clients'),jdecode(''),'/5999/21801.html','true',[],'']
	],''],
	['PAGE','5957',jdecode('FAQS'),jdecode(''),'/5957.html','true',[],''],
	['PAGE','24601',jdecode('Contact+Us'),jdecode(''),'/24601.html','true',[],''],
	['PAGE','32601',jdecode('Links'),jdecode(''),'/32601.html','true',[],''],
	['PAGE','35201',jdecode('Poems'),jdecode(''),'/35201.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='064B91';
theSitetree.keyvisualId='6704';
theSitetree.keyvisualName='kv_6704.jpg';
theSitetree.fontsetId='11200';
theSitetree.graphicsetId='12013';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E9F3FF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Porthole',
				paletteFamily: 	'064B91',
				keyvisualId: 	'6704',
				keyvisualName: 	'kv_6704.jpg',
				fontsetId: 		'11200',
				graphicsetId: 	'12013',
				contentColor: 	'000000',
				contentBGColor: 'E9F3FF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20100604-133534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20100528-080821'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5852',
internalId:  '',
customField: '20100620-163001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5999',
internalId:  '',
customField: '20090918-100438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5873',
internalId:  '',
customField: '20100620-232545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20043',
internalId:  '',
customField: '20090918-135329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20090918-100329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5957',
internalId:  '',
customField: '20100517-151850'
};
webappMappings['7050']=webappMappings['7050-9021']={
webappId:    '7050',
documentId:  '20043',
internalId:  '9021',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20064',
internalId:  '',
customField: '20100517-141416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20090918-101151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21801',
internalId:  '',
customField: '20100319-232334'
};
webappMappings['1501']=webappMappings['1501-16962325']={
webappId:    '1501',
documentId:  '5801',
internalId:  '16962325',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-15597']={
webappId:    '7008',
documentId:  '24601',
internalId:  '15597',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '32601',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32601',
internalId:  '',
customField: '20100604-133602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20090918-102216'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3DT3';
var companyName   = 'Cradle+to+Crayons+Childcare';
var htmlTitle	  = 'Cradle+to+Crayons+Childcare';
var metaKeywords  = 'daycare%2C+childcare%2C+nursery+school%2C+toddler%2C+toddlers%2C+infant%2C+infants%2C+preschool%2C+preschoolers%2C+nursery%2C+baby%2C+babies%2C+program%2C+early+childhood%2C+education%2C+school%2C+children';
var metaContents  = 'We+are+a+licensed+childcare+facility+loacted+in+Anne+Arundel+County%2C+Maryland.++Enrollment+is+limited+to+eight+children%2C+who+may+range+in+age+from+6+weeks+through+4+years.++Our+home+is+non-smoking%2C+however+we+do+have+pets+that+are+kept+in+a+separate+part+of+the+home.++Provider+is+certified+in+CPR%2C+SIDS+and+First+Aide+Training.++Provider+has+worked+in+the+ECE+field+for+over+20+years.++';
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();
};
