/* [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','401',jdecode('AWFC+Home'),jdecode(''),'/401/index.html','true',[ 
		['PAGE','473',jdecode('History'),jdecode(''),'/401/473.html','true',[],'']
	],''],
	['PAGE','90801',jdecode('AWFC+Foster+Parents'),jdecode(''),'/90801.html','true',[],''],
	['PAGE','25801',jdecode('Become+a+Foster+Parent'),jdecode(''),'/25801/index.html','true',[ 
		['PAGE','79901',jdecode('Requirements'),jdecode(''),'/25801/79901.html','true',[],''],
		['PAGE','79922',jdecode('Foster+Parent+FAQs'),jdecode(''),'/25801/79922.html','true',[],''],
		['PAGE','79943',jdecode('The+Process'),jdecode(''),'/25801/79943.html','true',[],''],
		['PAGE','79964',jdecode('The+Reward'),jdecode(''),'/25801/79964.html','true',[],''],
		['PAGE','79985',jdecode('Transfering+Families'),jdecode(''),'/25801/79985.html','true',[],''],
		['PAGE','89801',jdecode('New+Foster+Parent+Info'),jdecode(''),'/25801/89801.html','false',[],'']
	],''],
	['PAGE','91201',jdecode('Training+and+Events'),jdecode(''),'/91201.html','true',[],''],
	['PAGE','110101',jdecode('Employment+Opportunities'),jdecode(''),'/110101.html','true',[],''],
	['PAGE','109222',jdecode('News'),jdecode(''),'/109222.html','true',[],''],
	['PAGE','26074',jdecode('Interesting+links'),jdecode(''),'/26074.html','true',[],''],
	['PAGE','108001',jdecode('How+You+Can+Help'),jdecode(''),'/108001.html','true',[],''],
	['PAGE','26053',jdecode('%28Discussion%29+forum'),jdecode(''),'/26053.html','true',[],''],
	['PAGE','25822',jdecode('Contact'),jdecode(''),'/25822.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1225';
theSitetree.keyvisualName='kinder.jpg';
theSitetree.fontsetId='192';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1225',
				keyvisualName: 	'kinder.jpg',
				fontsetId: 		'192',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090127-171133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20090112-183201'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90801',
internalId:  '',
customField: '20081228-111328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91201',
internalId:  '',
customField: '20081228-121354'
};
webappMappings['1501']=webappMappings['1501-12489136']={
webappId:    '1501',
documentId:  '401',
internalId:  '12489136',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20090127-170414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25822',
internalId:  '',
customField: '20090512-184909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108001',
internalId:  '',
customField: '20090422-003548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109222',
internalId:  '',
customField: '20090306-174302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26053',
internalId:  '',
customField: '20081227-144112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26074',
internalId:  '',
customField: '20081227-144112'
};
webappMappings['1003']=webappMappings['1003-avec10inp8im11e7a02ee59']={
webappId:    '1003',
documentId:  '26053',
internalId:  'avec10inp8im11e7a02ee59',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79901',
internalId:  '',
customField: '20090127-172638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79922',
internalId:  '',
customField: '20090127-173942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79943',
internalId:  '',
customField: '20090403-153712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79964',
internalId:  '',
customField: '20090212-115942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79985',
internalId:  '',
customField: '20090212-120159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110101',
internalId:  '',
customField: '20090615-203815'
};
webappMappings['7008']=webappMappings['7008-2141']={
webappId:    '7008',
documentId:  '89801',
internalId:  '2141',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89801',
internalId:  '',
customField: '20081228-094716'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INP8IM';
var companyName   = 'A+World+For+Children';
var htmlTitle	  = 'AWFC+WebSite+';
var metaKeywords  = 'foster%2C+foster+parents%2C+adoption%2C+adopt%2C+abused%2C+children%2C+round+rock%2C+austin%2C+dallas%2C+tyler%2C+houston%2C+el+paso%2C+amarillo';
var metaContents  = 'Foster+Parents%2C+foster%2C+children%2C+adoption%2C+adopt%2C+abused%2C+round+rock%2C+austin%2C+dallas%2C+tyler%2C+houston%2C+el+paso%2C+amarillo%2C+mc+allen%2C+non+profit';
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();
};
