/* [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','2901',jdecode('Home'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','2952',jdecode('Meet+the+Founders'),jdecode(''),'/2952.html','true',[],'',''],
	['PAGE','2973',jdecode('Our+Mission+Methods'),jdecode(''),'/2973.html','true',[],'',''],
	['PAGE','2994',jdecode('Intl.+Deaf+Missions'),jdecode(''),'/2994/index.html','true',[ 
		['PAGE','3015',jdecode('Mission+Overview'),jdecode(''),'/2994/3015.html','true',[],'',''],
		['PAGE','3036',jdecode('Camping+Ministry'),jdecode(''),'/2994/3036.html','true',[],'',''],
		['PAGE','3057',jdecode('Deaf+Church+Ministries'),jdecode(''),'/2994/3057.html','true',[],'','']
	],'',''],
	['PAGE','3078',jdecode('Intl+Communication+Pub'),jdecode(''),'/3078/index.html','true',[ 
		['PAGE','3099',jdecode('Intl+Sign+Lang+Materials'),jdecode(''),'/3078/3099.html','true',[],'',''],
		['PAGE','3120',jdecode('SL+Video+Materials'),jdecode(''),'/3078/3120.html','true',[],'',''],
		['PAGE','5601',jdecode('ASL+Videos'),jdecode(''),'/3078/5601.html','false',[],'',''],
		['PAGE','3141',jdecode('Books+and+Materials'),jdecode(''),'/3078/3141.html','true',[],'','']
	],'',''],
	['PAGE','3162',jdecode('Christian+Education'),jdecode(''),'/3162/index.html','true',[ 
		['PAGE','3183',jdecode('Christian+Schools'),jdecode(''),'/3162/3183.html','true',[],'',''],
		['PAGE','3204',jdecode('Bible+Colleges+for+Deaf'),jdecode(''),'/3162/3204.html','true',[],'',''],
		['PAGE','3225',jdecode('Bible+Colleges+for+Hearing'),jdecode(''),'/3162/3225.html','true',[],'','']
	],'',''],
	['PAGE','3246',jdecode('Radio+Ministry'),jdecode(''),'/3246.html','true',[],'',''],
	['PAGE','3267',jdecode('Am+Soc+for+the+Deaf'),jdecode(''),'/3267.html','true',[],'',''],
	['PAGE','5401',jdecode('News+and+Events'),jdecode(''),'/5401.html','true',[],'',''],
	['PAGE','5422',jdecode('Intl+Sign+Lang+School'),jdecode(''),'/5422.html','true',[],'',''],
	['PAGE','3288',jdecode('Faces+the+Saved'),jdecode(''),'/3288.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-0d25d9adc9e34d15200993ca123d7c00']={
webappId:    '7060',
documentId:  '3015',
internalId:  '0d25d9adc9e34d15200993ca123d7c00',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20110520-075002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2952',
internalId:  '',
customField: '20110509-075653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2973',
internalId:  '',
customField: '20110325-062049'
};
webappMappings['7060']=webappMappings['7060-d5f950d9a7df846133c15f1335e94019']={
webappId:    '7060',
documentId:  '5601',
internalId:  'd5f950d9a7df846133c15f1335e94019',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-9067449']={
webappId:    '1501',
documentId:  '2901',
internalId:  '9067449',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2994',
internalId:  '',
customField: '20110410-053555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3015',
internalId:  '',
customField: '20110408-175828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3036',
internalId:  '',
customField: '20110410-054802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3078',
internalId:  '',
customField: '20110408-180856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3057',
internalId:  '',
customField: '20110410-055145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3246',
internalId:  '',
customField: '20110520-075509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3267',
internalId:  '',
customField: '20110410-060959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3288',
internalId:  '',
customField: '20110410-063031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3099',
internalId:  '',
customField: '20110323-063009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3120',
internalId:  '',
customField: '20110323-063009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20110326-224449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3141',
internalId:  '',
customField: '20110323-063009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3162',
internalId:  '',
customField: '20110509-071235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3183',
internalId:  '',
customField: '20110509-071442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3204',
internalId:  '',
customField: '20110509-073343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3225',
internalId:  '',
customField: '20110509-072950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20110509-074044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20110509-075417'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INFW24';
var companyName   = 'World+Mission+Society';
var htmlTitle	  = '';
var metaKeywords  = '';
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();
};

