/* [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','206',jdecode('Susan+Cobb+'),jdecode(''), jdecode('%2F206%2Findex.html'), 'true',[ 
		['PAGE','4102',jdecode('Contact+Susan'),jdecode(''), jdecode('%2F206%2F4102.html'), 'false',[],'','']
	],'',''],
	['PAGE','26101',jdecode('Meet+Kitty+Mike%21'),jdecode(''), jdecode('%2F26101.html'), 'true',[],'',''],
	['PAGE','45401',jdecode('Meet+My+Family%21'),jdecode(''), jdecode('%2F45401.html'), 'true',[],'','']];
var siteelementCount=4;
theSitetree.topTemplateName='Mondrian';
theSitetree.paletteFamily='3E51B5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10711';
theSitetree.graphicsetId='10886';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E51B5';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'wl_enom',
  product: 'WSCENOSSSLYTC21A'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mondrian',
				paletteFamily: 	'3E51B5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10711',
				graphicsetId: 	'10886',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E51B5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D3D3D3',
				e_color: 		'D3D3D3',
				f_color: 		'D3D3D3',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '206',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '206',
internalId:  '',
customField: '20110926-214642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4102',
internalId:  '',
customField: '20090401-145723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20110926-220202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45401',
internalId:  '',
customField: '20110926-230040'
};
webappMappings['7008']=webappMappings['7008-668']={
webappId:    '7008',
documentId:  '206',
internalId:  '668',
customField: 'language:en;country:US;'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010IN277H';
var companyName   = 'Susan+Cobb';
var htmlTitle	  = 'Susan+Cobb+-+A+Note+From+Susan';
var metaKeywords  = 'Cobb%2CSusan+Cobb%2CSusan%2C+St.+Clements%2C+Bill+Cobb%2C+Rev.+Bill+Cobb%2C+Holly+Packard+Cobb%2C+SallyCobb%2C+Sally+Cobb%2C+Sarah+Ann+Cobb%2C+El+Paso%2C+Texas%2C+Missing%2C+St.+Clements+Church%2CEl+Paso%2C+Texas%2CIrving%2C+Texas%2C+Texas%2C+Colorado%2C+William+Cobb%2CRev.+William+Cobb%2C+Sacramento%2C+California%2C+Navy%2C+Anglican%2CEpiscopal%2CCatholic%2C+Bill+Cobb%2C+William+Cox+Cobb%2C+Rev.+Bill+Cobb%2C+Holly+Packard+Cobb%2CHolly+Cobb%2CRichard+S.+Cobb%2C+Richard+Cobb%2CSally+Cobb%2CSarah+Ann+Cobb%2CSarah+Ann+Summers+Cobb%2C+Sarah%2C+Cobb%2C+Will+Cobb%2C+Colorado%2CMonty+Lord%2C+Georgetown%2C+Tyler+Texas%2C+Cobb+Family%2CNavy%2CMilitary%2CRights%2CElderly+Rights%2Cdisabled+rights%2C+God%2Chope%2C+grieve%2C+learn%2Cfree%2Ceducation%2Cfun%2C+Irving%2C+Texas%2C+El+Paso%2C+Texas+teacher%2Cillness%2Crelief%2Cpain%2Csuffering%2Clife%2Cchange%2Cself+help%2Cscripture%2Cendurance%2C+truth%2C+trust%2C+support%2C+pardon%2C+forgive%2C+Cobb+Bible%2Clove%2CJesus%2Cstrength%2Cexercise%2Cmental%2Cnervous+system%2C+neurological%2C+surgery%2Cquiet%2Cunafraid%2Cafraid%2Cenjoy%2Cenjoyment%2Cbeautiful%2C+decisions%2C+learning%2C+teaching%2C+schools%2C+loss%2C+enjoyment%2C+encouragement%2C+hope%2C+program%2C+feelings%2C+hurt%2C+caring%2C+suffering%2C+friend%2C+trust%2Cbook%2Cbooks%2Cvoice%2C+listen%2C+medical%2C+physician%2C+doctor%2C+patients%2C+caregivers%2C+residents%2C+handbooks%2C+minds%2C+lifetime%2C+new%2C+improved%2C+notes%2C+posting%2C+post%2C+messages%2C+message%2C+computers%2C+cats%2C+dogs%2C+homepage%2C+food%2C+links%2C+help%2C+helpful%2Cmedications%2Clove%2Cclasses%2Cschool';
var metaContents  = 'Susan+Cobb+-+A+Note+From+Susan';
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();
};

