/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','4329',jdecode('Groups'),jdecode(''), jdecode('%2F4329%2Findex.html'), 'true',[ 
		['PAGE','6529',jdecode('TNT'),jdecode(''), jdecode('%2F4329%2F6529.html'), 'true',[],'',''],
		['PAGE','6550',jdecode('SWAP'),jdecode(''), jdecode('%2F4329%2F6550.html'), 'true',[],'',''],
		['PAGE','6571',jdecode('MIGHT'),jdecode(''), jdecode('%2F4329%2F6571.html'), 'true',[],'',''],
		['PAGE','6592',jdecode('SWAG'),jdecode(''), jdecode('%2F4329%2F6592.html'), 'true',[],'','']
	],'',''],
	['PAGE','4371',jdecode('Adult+Leaders'),jdecode(''), jdecode('%2F4371.html'), 'true',[],'',''],
	['PAGE','43551',jdecode('SWAP+Retreat'),jdecode(''), jdecode('%2F43551.html'), 'false',[],'',''],
	['PAGE','23229',jdecode('Workcamp+2012'),jdecode(''), jdecode('%2F23229%2Findex.html'), 'true',[ 
		['PAGE','34251',jdecode('Basic+Info'),jdecode(''), jdecode('%2F23229%2F34251.html'), 'true',[],'',''],
		['PAGE','34272',jdecode('Permission+Forms'),jdecode(''), jdecode('%2F23229%2F34272.html'), 'false',[],'',''],
		['PAGE','40151',jdecode('Packing+List'),jdecode(''), jdecode('%2F23229%2F40151.html'), 'false',[],'','']
	],'',''],
	['PAGE','44951',jdecode('On+the+Edge'),jdecode(''), jdecode('%2F44951.html'), 'true',[],'',''],
	['PAGE','12729',jdecode('Calendar'),jdecode(''), jdecode('%2F12729.html'), 'true',[],'',''],
	['PAGE','4350',jdecode('Pictures'),jdecode(''), jdecode('%2F4350.html'), 'false',[],'',''],
	['PAGE','34951',jdecode('Pictures'),jdecode(''), jdecode('%2F34951.html'), 'true',[],'',''],
	['PAGE','17929',jdecode('Resources'),jdecode(''), jdecode('%2F17929%2Findex.html'), 'true',[ 
		['PAGE','11571',jdecode('Devotional+Material'),jdecode(''), jdecode('%2F17929%2F11571.html'), 'true',[],'',''],
		['PAGE','16329',jdecode('Volunteering'),jdecode(''), jdecode('%2F17929%2F16329.html'), 'true',[],'',''],
		['PAGE','17950',jdecode('Dating+%26+Relationships'),jdecode(''), jdecode('%2F17929%2F17950.html'), 'true',[],'',''],
		['PAGE','17971',jdecode('Depression+'),jdecode(''), jdecode('%2F17929%2F17971.html'), 'true',[],'',''],
		['PAGE','29029',jdecode('Parents'),jdecode(''), jdecode('%2F17929%2F29029.html'), 'true',[],'','']
	],'',''],
	['PAGE','27129',jdecode('Kids+Time'),jdecode(''), jdecode('%2F27129.html'), 'true',[],'',''],
	['ITEM','44751',jdecode('Facebook'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2Fpages%2FRuthfred-Youth-Group%2F297530743622736'), 'true',[],'','_blank'],
	['PAGE','4434',jdecode('Contact+Us'),jdecode(''), jdecode('%2F4434.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Scenery';
theSitetree.paletteFamily='A01D1A';
theSitetree.keyvisualId='6928';
theSitetree.keyvisualName='kv_6928.jpg';
theSitetree.fontsetId='11227';
theSitetree.graphicsetId='12052';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B92E2B';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Scenery',
				paletteFamily: 	'A01D1A',
				keyvisualId: 	'6928',
				keyvisualName: 	'kv_6928.jpg',
				fontsetId: 		'11227',
				graphicsetId: 	'12052',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B92E2B',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20111109-123516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4329',
internalId:  '',
customField: '20110105-130034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6529',
internalId:  '',
customField: '20111227-095444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6550',
internalId:  '',
customField: '20091207-132446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6571',
internalId:  '',
customField: '20091207-133651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6592',
internalId:  '',
customField: '20111227-095809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4350',
internalId:  '',
customField: '20101221-151047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4434',
internalId:  '',
customField: '20100923-100308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4371',
internalId:  '',
customField: '20110526-123056'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16329',
internalId:  '',
customField: '20100324-151326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17929',
internalId:  '',
customField: '20100407-094100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34272',
internalId:  '',
customField: '20110331-143701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17971',
internalId:  '',
customField: '20100415-094257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34251',
internalId:  '',
customField: '20110913-100442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17950',
internalId:  '',
customField: '20100415-094243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11571',
internalId:  '',
customField: '20100713-140902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12729',
internalId:  '',
customField: '20111227-095151'
};
webappMappings['7008']=webappMappings['7008-31449']={
webappId:    '7008',
documentId:  '4434',
internalId:  '31449',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27129',
internalId:  '',
customField: '20110819-151750'
};
webappMappings['1501']=webappMappings['1501-25419880']={
webappId:    '1501',
documentId:  '1901',
internalId:  '25419880',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29029',
internalId:  '',
customField: '20110105-130454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23229',
internalId:  '',
customField: '20111227-095353'
};
webappMappings['7060']=webappMappings['7060-55f33f5a72fc8f19cfa557e248c11911']={
webappId:    '7060',
documentId:  '34951',
internalId:  '55f33f5a72fc8f19cfa557e248c11911',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34951',
internalId:  '',
customField: '20101221-151811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40151',
internalId:  '',
customField: '20110616-113237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43551',
internalId:  '',
customField: '20111025-120314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44951',
internalId:  '',
customField: '20120118-152015'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INVTOZ';
var companyName   = 'Ruthfred+Youth+Ministry';
var htmlTitle	  = 'Ruthfred+Youth+Ministry';
var metaKeywords  = 'Bethel+Park+Youth+Group+Ruthfred+Rutherford+High+School';
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();
};

