/* [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','3301',jdecode('Home'),jdecode(''),'/3301/index.html','true',[ 
		['PAGE','5322',jdecode('Facebook'),jdecode(''),'/3301/5322.html','true',[],'',''],
		['PAGE','36112',jdecode('Quotes'),jdecode(''),'/3301/36112.html','true',[],'',''],
		['PAGE','11201',jdecode('Mission'),jdecode(''),'/3301/11201.html','true',[],'',''],
		['PAGE','4300',jdecode('Contact+Us'),jdecode(''),'/3301/4300.html','true',[],'',''],
		['PAGE','4321',jdecode('Store'),jdecode(''),'/3301/4321.html','true',[],'','']
	],'',''],
	['PAGE','91445',jdecode('Games%2FQuizzes'),jdecode(''),'/91445.html','true',[],'',''],
	['PAGE','3352',jdecode('Resources'),jdecode(''),'/3352/index.html','true',[ 
		['PAGE','3901',jdecode('Community+List'),jdecode(''),'/3352/3901.html','true',[],'',''],
		['PAGE','3922',jdecode('Hotlines'),jdecode(''),'/3352/3922.html','true',[],'',''],
		['PAGE','3415',jdecode('Information'),jdecode(''),'/3352/3415.html','true',[],'',''],
		['PAGE','3985',jdecode('Links'),jdecode(''),'/3352/3985.html','true',[],'',''],
		['PAGE','57923',jdecode('Health'),jdecode(''),'/3352/57923.html','true',[],'',''],
		['PAGE','103045',jdecode('Happiness'),jdecode(''),'/3352/103045.html','true',[],'','']
	],'',''],
	['PAGE','3373',jdecode('Tips'),jdecode(''),'/3373/index.html','true',[ 
		['PAGE','4048',jdecode('Tips'),jdecode(''),'/3373/4048.html','true',[],'',''],
		['PAGE','4090',jdecode('Say+it+Better'),jdecode(''),'/3373/4090.html','true',[],'',''],
		['PAGE','4111',jdecode('Be+Positive%21'),jdecode(''),'/3373/4111.html','true',[],'',''],
		['PAGE','4153',jdecode('Self-Talk+'),jdecode(''),'/3373/4153.html','true',[],'','']
	],'',''],
	['PAGE','3541',jdecode('Blog'),jdecode(''),'/3541/index.html','true',[ 
		['PAGE','65023',jdecode('A+%26+L%26%23x27%3Bs++Blog'),jdecode(''),'/3541/65023.html','true',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Court';
theSitetree.paletteFamily='EEBE79';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16443';
theSitetree.graphicsetId='12145';
theSitetree.contentColor='472A15';
theSitetree.contentBGColor='FCE7CA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Court',
				paletteFamily: 	'EEBE79',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16443',
				graphicsetId: 	'12145',
				contentColor: 	'472A15',
				contentBGColor: 'FCE7CA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-1563']={
webappId:    '7050',
documentId:  '3541',
internalId:  '1563',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20110403-004100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57923',
internalId:  '',
customField: '20101203-065113'
};
webappMappings['7008']=webappMappings['7008-10196']={
webappId:    '7008',
documentId:  '4300',
internalId:  '10196',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20100505-002428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3352',
internalId:  '',
customField: '20101203-054131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20101203-054243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3415',
internalId:  '',
customField: '20110217-120541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3985',
internalId:  '',
customField: '20101203-055708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3922',
internalId:  '',
customField: '20100713-200547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3373',
internalId:  '',
customField: '20110217-120541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4048',
internalId:  '',
customField: '20100808-231204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4090',
internalId:  '',
customField: '20100808-231204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4111',
internalId:  '',
customField: '20091018-010027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4153',
internalId:  '',
customField: '20091020-001000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65023',
internalId:  '',
customField: '20100430-030939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3541',
internalId:  '',
customField: '20100401-025722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36112',
internalId:  '',
customField: '20100604-142354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4300',
internalId:  '',
customField: '20110217-120541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4321',
internalId:  '',
customField: '20101203-055340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20100504-211522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103045',
internalId:  '',
customField: '20101203-062218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91445',
internalId:  '',
customField: '20100927-003742'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INL2MD';
var companyName   = 'Loveland+Relationship';
var htmlTitle	  = 'Loveland+Relationship';
var metaKeywords  = 'Couples+Communication%2C+Relationship+Resources%2C+Teenager+Relationships%2C+Seniors+dating%2C+communication+skills+for+singles%2C+healing+for+those+going+through+a+Divorces%2C+communication+skills+for+stepfamilies%2C+Dating%2C+Engaged%2C+Expecting+Parents%2C+Parents%2C+Families%2C+Children+with+Disabilites%2C+marriage+retreats+in+Orange+County%2C+Marriage+Retreats';
var metaContents  = 'Resources+to+promote+healthy+relationships+for+teenagers%2C+seniors%2C+parents%2C+singles%2C+engaged%2C+singles+again%2C+stepfamilies%2C+parents+of+children+with+autism.+';
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();
};

