/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','1301',jdecode('What+Is+Guardianship'),jdecode(''), jdecode('%2F1301.html'), 'true',[],'',''],
	['PAGE','1322',jdecode('Questions+and+Answers'),jdecode(''), jdecode('%2F1322.html'), 'true',[],'',''],
	['PAGE','9001',jdecode('Services+'),jdecode(''), jdecode('%2F9001.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('Guardianship+Education'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','16044',jdecode('Class+Registration'),jdecode(''), jdecode('%2F16044.html'), 'true',[],'',''],
	['PAGE','7601',jdecode('Contact'),jdecode(''), jdecode('%2F7601.html'), 'true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='FFCC66';
theSitetree.keyvisualId='1709';
theSitetree.keyvisualName='kommunikation.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='343';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFCC66';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brighthousenetworks',
  product: 'WSCSYSSSSLYTC241'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'FFCC66',
				keyvisualId: 	'1709',
				keyvisualName: 	'kommunikation.jpg',
				fontsetId: 		'280',
				graphicsetId: 	'343',
				contentColor: 	'000000',
				contentBGColor: 'FFCC66',
				a_color: 		'FFCC66',
				b_color: 		'CC6600',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110912-084949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20120112-095202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20111019-134735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1322',
internalId:  '',
customField: '20100809-120654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20110912-085214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20110912-085356'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC241']={
webappId:    '5003',
documentId:  '501',
internalId:  'tid:1;pid:WSCSYSSSSLYTC241',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16044',
internalId:  '',
customField: '20111019-135004'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN39ET';
var companyName   = 'Guardian+Angel+Services%2C+Inc.';
var htmlTitle	  = 'Elder+and+Senior+Services';
var metaKeywords  = 'elder+seniors+guardians+professional+guardians+education+family+education+care+management+families++florida+guardians+florida+medicaid+applications+guardian+accountings+and+guardian+plans+care+management+power+of+attorney+personal+representative+trustee+consulting+40+Hour+Professional+Guardian+Training+or+Classes+Florida+Guardians%2C++college+courses+for+guardians+college+credits%2C+college+training';
var metaContents  = 'elder+seniors+guardians+professional+guardians+education+family+education+care+management+florida+medicaid+applications+guardian+accountings+and+guardian+plans+care+management+trustee+personal+representative+power+of+attorney+consulting+college+courses%2C+guardianship+education+professional+guardianship+course+40+hour+professional+guardianship+training';
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();
};

