/* [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','63',jdecode('Home'),jdecode(''), jdecode('%2F63.html'), 'true',[],'',''],
	['PAGE','11401',jdecode('HOMEBOUND+COUNSELING'),jdecode(''), jdecode('%2F11401.html'), 'true',[],'',''],
	['PAGE','11601',jdecode('CASE+MANAGEMENT+SERVICES+'),jdecode(''), jdecode('%2F11601.html'), 'true',[],'',''],
	['PAGE','13101',jdecode('CONSULTATIONS'),jdecode(''), jdecode('%2F13101.html'), 'true',[],'',''],
	['PAGE','13501',jdecode('SOCIAL+WORK+SUPERVISION+'),jdecode(''), jdecode('%2F13501.html'), 'true',[],'',''],
	['PAGE','11801',jdecode('MEDICAID+'),jdecode(''), jdecode('%2F11801.html'), 'true',[],'',''],
	['PAGE','111',jdecode('SERVICES'),jdecode(''), jdecode('%2F111.html'), 'true',[],'',''],
	['PAGE','120',jdecode('EMPLOYEES'),jdecode(''), jdecode('%2F120.html'), 'true',[],'',''],
	['PAGE','129',jdecode('GROUPS'),jdecode(''), jdecode('%2F129.html'), 'true',[],'',''],
	['PAGE','138',jdecode('SEMINARS'),jdecode(''), jdecode('%2F138.html'), 'true',[],'',''],
	['PAGE','147',jdecode('THE+POSTIVE+CONNECTION+'),jdecode(''), jdecode('%2F147.html'), 'true',[],'',''],
	['PAGE','156',jdecode('JOB+OPPORTUNITIES+'),jdecode(''), jdecode('%2F156.html'), 'true',[],'',''],
	['PAGE','10301',jdecode('LINKS+'),jdecode(''), jdecode('%2F10301%2Findex.html'), 'true',[ 
		['PAGE','4901',jdecode('Mark+Eghrari'),jdecode(''), jdecode('%2F10301%2F4901.html'), 'true',[],'','']
	],'',''],
	['PAGE','84',jdecode('ABOUT+US+'),jdecode(''), jdecode('%2F84%2Findex.html'), 'true',[ 
		['PAGE','93',jdecode('Our+team'),jdecode(''), jdecode('%2F84%2F93.html'), 'true',[],'',''],
		['PAGE','102',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F84%2F102.html'), 'true',[],'','']
	],'',''],
	['PAGE','4906',jdecode('GUESTBOOK+'),jdecode(''), jdecode('%2F4906.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='415';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='93A6CC';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'415',
				contentColor: 	'FFFFFF',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				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:  '63',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-4906ahw050inxst6']={
webappId:    '1002',
documentId:  '4906',
internalId:  '4906ahw050inxst6',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63',
internalId:  '',
customField: '20111110-114508'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '63',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84',
internalId:  '',
customField: '20111110-114706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93',
internalId:  '',
customField: '20091026-111448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102',
internalId:  '',
customField: '20111110-114912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111',
internalId:  '',
customField: '20091116-133116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120',
internalId:  '',
customField: '20091026-111618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129',
internalId:  '',
customField: '20080617-122053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138',
internalId:  '',
customField: '20080812-135421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147',
internalId:  '',
customField: '20111110-114756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156',
internalId:  '',
customField: '20080812-135542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4906',
internalId:  '',
customField: '20080617-111513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20080617-111513'
};
webappMappings['7050']=webappMappings['7050-1704']={
webappId:    '7050',
documentId:  '10301',
internalId:  '1704',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20091026-161442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20091117-110115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20091117-111142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11801',
internalId:  '',
customField: '20091117-111954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20091208-103203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20091208-103941'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXST6';
var companyName   = 'Long+Island+Elder+Care+LCSW%2C+PLLC';
var htmlTitle	  = 'LONG+ISLAND+ELDER+CARE';
var metaKeywords  = 'Home+Health+Care%2CCounseling%2C+community+services%2C+entitlements%2C+Long+Island%2C+Suffolk+County%2C+elder+care%2C+Medicaid%2C+meals+on+wheels%2C+Marital+counseling%2C+home+health+aide+services%2C+food+stamps%2C+nursing+home+placement%2C+assisted+living+placement%2C+Alzheimer%2C+dementia%2C+caregiver+support%2C+Parkinsons%2C+senior+citizens%2C+Geriatric+planning%2C+group+counseling%2C+psychotherapy%2C+therapy';
var metaContents  = 'At+Long+Island+Elder+Care+we+provide+homebound+counseling%2C+home+health+care%2C+consultations%2C+and+evaluations+for+community+services+and+entitlements.++Servicing+the+area+of+Suffolk+county+NY';
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();
};

