/* [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','10501',jdecode('Home'),jdecode(''), jdecode('%2F10501.html'), 'true',[],'',''],
	['PAGE','10573',jdecode('About+Us'),jdecode(''), jdecode('%2F10573.html'), 'true',[],'',''],
	['PAGE','11101',jdecode('Home+Care+Services'),jdecode(''), jdecode('%2F11101.html'), 'true',[],'',''],
	['PAGE','21001',jdecode('Pediatric+and+Newborn+Care'),jdecode(''), jdecode('%2F21001.html'), 'true',[],'',''],
	['PAGE','19201',jdecode('Qualify+for+home+health%3F'),jdecode(''), jdecode('%2F19201.html'), 'true',[],'',''],
	['PAGE','11122',jdecode('Our+Values+'),jdecode(''), jdecode('%2F11122.html'), 'true',[],'',''],
	['PAGE','11185',jdecode('Referrals'),jdecode(''), jdecode('%2F11185.html'), 'true',[],'',''],
	['PAGE','10552',jdecode('Contact+Us'),jdecode(''), jdecode('%2F10552.html'), 'true',[],'',''],
	['PAGE','11164',jdecode('Join+Our+Family'),jdecode(''), jdecode('%2F11164.html'), 'true',[],'',''],
	['PAGE','11206',jdecode('Physicians+Page'),jdecode(''), jdecode('%2F11206.html'), 'true',[],'',''],
	['PAGE','11143',jdecode('Resources%2FLinks'),jdecode(''), jdecode('%2F11143.html'), 'true',[],'',''],
	['PAGE','11227',jdecode('+Brochure'),jdecode(''), jdecode('%2F11227.html'), 'true',[],'',''],
	['PAGE','18501',jdecode('Patient%2C+Family+or+Friend+Referral'),jdecode(''), jdecode('%2F18501.html'), 'false',[],'',''],
	['PAGE','18901',jdecode('Physician%26%23x27%3Bs+Referral+'),jdecode(''), jdecode('%2F18901.html'), 'false',[],'',''],
	['PAGE','22622',jdecode('Career+Opportunities'),jdecode(''), jdecode('%2F22622.html'), 'true',[],'',''],
	['PAGE','22601',jdecode('Application+Request'),jdecode(''), jdecode('%2F22601.html'), 'false',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1757';
theSitetree.keyvisualName='medizin.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp13-cbeyon',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1757',
				keyvisualName: 	'medizin.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20110815-122852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10573',
internalId:  '',
customField: '20110118-171150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20100520-102012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11122',
internalId:  '',
customField: '20100520-112627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11185',
internalId:  '',
customField: '20100521-104558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10552',
internalId:  '',
customField: '20100519-181408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11164',
internalId:  '',
customField: '20110118-171013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11206',
internalId:  '',
customField: '20100514-135705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11143',
internalId:  '',
customField: '20100521-161100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11227',
internalId:  '',
customField: '20100521-161230'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-17252']={
webappId:    '7008',
documentId:  '18501',
internalId:  '17252',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20100520-180657'
};
webappMappings['7008']=webappMappings['7008-17253']={
webappId:    '7008',
documentId:  '18901',
internalId:  '17253',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100520-183431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20100521-104209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100616-121740'
};
webappMappings['7008']=webappMappings['7008-26580']={
webappId:    '7008',
documentId:  '22601',
internalId:  '26580',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22622',
internalId:  '',
customField: '20110923-145028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20110922-195321'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CS6U';
var companyName   = 'Family+Home+Health';
var htmlTitle	  = 'Family+Home+Health';
var metaKeywords  = 'Family%2C+home+health%2C+Boulder%2C+Colorado%2C+skilled%2C+registered+nurse%2C+PT%2C+Physical+Therapy%2C+OT%2C+Occupational+Therapy%2C+Speech+Therapy%2C+CNA%2C+home+health+aide%2C+boulder+county%2C+family+home+health%2C++injury%2C+surgery%2C+personalized+care%2C+recovery%2C+medical+services%2C+medical%2C+rehab%2C+wound+care%2C+IV%2C+IV+therapy%2C+Gilpin+county%2C+louisville%2C+lafayette%2C+longmont%2C+broomfield%2C+larimer+county%2C+weld+county%2C+berthoud%2C+jefferson+county%2C+personalized+services%2C+home+care+services%2C+Family+Home+Health%2C+newborn+home+care%2C+pediatric+home+care%2C+home+health+services%2C+infusion+therapy+';
var metaContents  = 'Family+Home+Health+works+with+your+physician%2Fmedical+professional+to+provides+quality+skilled+health+services+to+patients+in+their+home.+';
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();
};

