/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],''],
	['PAGE','4801',jdecode('What+is+Autism%3F'),jdecode(''),'/4801.html','true',[],''],
	['PAGE','4821',jdecode('What+is+ABA%3F'),jdecode(''),'/4821.html','true',[],''],
	['PAGE','4826',jdecode('What+is+DTT%3F'),jdecode(''),'/4826.html','true',[],''],
	['PAGE','4831',jdecode('Our+Services'),jdecode(''),'/4831/index.html','true',[ 
		['PAGE','4836',jdecode('Parent+Education'),jdecode(''),'/4831/4836.html','true',[],''],
		['PAGE','16701',jdecode('Seminars+%26+Trainings'),jdecode(''),'/4831/16701.html','true',[],''],
		['PAGE','4841',jdecode('Consultation+Services'),jdecode(''),'/4831/4841.html','true',[],''],
		['PAGE','4846',jdecode('In-Home+DTT+Programs'),jdecode(''),'/4831/4846.html','true',[],''],
		['PAGE','16722',jdecode('School-Based+Services'),jdecode(''),'/4831/16722.html','true',[],''],
		['PAGE','16743',jdecode('Social-Skills+Group'),jdecode(''),'/4831/16743.html','true',[],'']
	],''],
	['PAGE','4851',jdecode('Latest+News'),jdecode(''),'/4851.html','true',[],''],
	['PAGE','4856',jdecode('Resources'),jdecode(''),'/4856.html','true',[],''],
	['PAGE','16764',jdecode('Related+Links'),jdecode(''),'/16764.html','true',[],''],
	['PAGE','4861',jdecode('Contact+Us'),jdecode(''),'/4861.html','true',[],''],
	['PAGE','9902',jdecode('Guestbook'),jdecode(''),'/9902/index.html','true',[ 
		['PAGE','9903',jdecode('Read+Guestbook'),jdecode(''),'/9902/9903.html','false',[],'']
	],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Padma';
theSitetree.paletteFamily='006699';
theSitetree.keyvisualId='1067';
theSitetree.keyvisualName='trampolin.jpg';
theSitetree.fontsetId='181';
theSitetree.graphicsetId='216';
theSitetree.contentColor='003366';
theSitetree.contentBGColor='9E9D90';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Padma',
				paletteFamily: 	'006699',
				keyvisualId: 	'1067',
				keyvisualName: 	'trampolin.jpg',
				fontsetId: 		'181',
				graphicsetId: 	'216',
				contentColor: 	'003366',
				contentBGColor: '9E9D90',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'006699',
				b_color: 		'003366',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-9902aen010in2g35']={
webappId:    '1002',
documentId:  '9902',
internalId:  '9902aen010in2g35',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20070828-222417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20070828-214248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4821',
internalId:  '',
customField: '20070828-214439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4826',
internalId:  '',
customField: '20070828-214644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4831',
internalId:  '',
customField: '20070828-214933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4836',
internalId:  '',
customField: '20070828-222700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20070828-215431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4841',
internalId:  '',
customField: '20070828-215653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4846',
internalId:  '',
customField: '20070828-222845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20070828-220003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16743',
internalId:  '',
customField: '20070828-220102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4851',
internalId:  '',
customField: '20070828-220159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4856',
internalId:  '',
customField: '20070828-223005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16764',
internalId:  '',
customField: '20070917-145555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4861',
internalId:  '',
customField: '20070917-144147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9902',
internalId:  '',
customField: '20070828-221015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9903',
internalId:  '',
customField: '20070828-223244'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010IN2G35';
var companyName   = 'Today+For+Tomorrow';
var htmlTitle	  = 'Today+For+Tomorrow+Behavior+Intervention+Services';
var metaKeywords  = 'autism+applied+behavior+analysis+discrete+trial+behavior+early+children';
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();
};
