/* [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','129',jdecode('Home'),jdecode(''),'/129.html','true',[],''],
	['PAGE','11132',jdecode('upcoming+events'),jdecode(''),'/11132.html','true',[],''],
	['PAGE','13380',jdecode('Donations'),jdecode(''),'/13380.html','true',[],''],
	['PAGE','8561',jdecode('Send+Stephanie+a+Message'),jdecode(''),'/8561.html','true',[],''],
	['PAGE','8570',jdecode('Think+You+Can+help+us%3F%3F%3F'),jdecode(''),'/8570.html','true',[],''],
	['PAGE','11123',jdecode('Photo+Albums'),jdecode(''),'/11123.html','true',[],''],
	['PAGE','11563',jdecode('Our+Supporters'),jdecode(''),'/11563.html','true',[],''],
	['PAGE','11572',jdecode('Education+and+Awareness'),jdecode(''),'/11572.html','true',[],''],
	['PAGE','11643',jdecode('Guestbook'),jdecode(''),'/11643/index.html','true',[ 
		['PAGE','11642',jdecode('Read+Guestbook'),jdecode(''),'/11643/11642.html','false',[],'']
	],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Commander';
theSitetree.paletteFamily='2B25A2';
theSitetree.keyvisualId='2374';
theSitetree.keyvisualName='asphalt.jpg';
theSitetree.fontsetId='392';
theSitetree.graphicsetId='439';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E0E0E0';
var theTemplate={
				name: 			'Commander',
				paletteFamily: 	'2B25A2',
				keyvisualId: 	'2374',
				keyvisualName: 	'asphalt.jpg',
				fontsetId: 		'392',
				graphicsetId: 	'439',
				contentColor: 	'000000',
				contentBGColor: 'E0E0E0',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'E0E0E0',
				b_color: 		'5762CA',
				c_color: 		'A1A4D2',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11132',
internalId:  '',
customField: '20090328-182055'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '129',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-11643AHW050INXS8F']={
webappId:    '1002',
documentId:  '11643',
internalId:  '11643AHW050INXS8F',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-4497']={
webappId:    '1501',
documentId:  '129',
internalId:  '4497',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129',
internalId:  '',
customField: '20080823-194958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13380',
internalId:  '',
customField: '20080607-015558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8561',
internalId:  '',
customField: '20080602-032854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8570',
internalId:  '',
customField: '20080701-194740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11123',
internalId:  '',
customField: '20080523-173427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11563',
internalId:  '',
customField: '20080823-194518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11572',
internalId:  '',
customField: '20080613-043630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11643',
internalId:  '',
customField: '20080602-024210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11642',
internalId:  '',
customField: '20080528-142137'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXS8F';
var companyName   = 'Supporting+Our+Stephanie+++';
var htmlTitle	  = 'www.supportingourstephanie.com';
var metaKeywords  = 'support+%2C+donations%2C+benefits%2C+Charity%2C+cancer+patient%2C+stephanie';
var metaContents  = 'Donations%2C+Charity%2C+Cancer+patient%2C+Support%2C+stephanie';
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();
};
