/* [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','5252',jdecode('INTEGRITY'),jdecode(''),'/5252.html','true',[],'',''],
	['PAGE','5201',jdecode('SERVICE'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','22412',jdecode('TAX+DEDUCTIONS'),jdecode(''),'/22412/index.html','true',[ 
		['PAGE','23012',jdecode('Page+2'),jdecode(''),'/22412/23012.html','true',[],'',''],
		['PAGE','23512',jdecode('Page+3'),jdecode(''),'/22412/23512.html','true',[],'',''],
		['PAGE','23533',jdecode('Page+4'),jdecode(''),'/22412/23533.html','true',[],'',''],
		['PAGE','23554',jdecode('Page+5'),jdecode(''),'/22412/23554.html','true',[],'',''],
		['PAGE','23575',jdecode('Page+6'),jdecode(''),'/22412/23575.html','true',[],'',''],
		['PAGE','24312',jdecode('Page+7'),jdecode(''),'/22412/24312.html','true',[],'',''],
		['PAGE','24333',jdecode('Page+8'),jdecode(''),'/22412/24333.html','true',[],'','']
	],'',''],
	['PAGE','5401',jdecode('EDUCATION'),jdecode(''),'/5401/index.html','true',[ 
		['PAGE','19033',jdecode('Business'),jdecode(''),'/5401/19033.html','true',[],'',''],
		['PAGE','19012',jdecode('Individual'),jdecode(''),'/5401/19012.html','true',[],'',''],
		['PAGE','19412',jdecode('Tax+Alerts'),jdecode(''),'/5401/19412.html','true',[],'',''],
		['PAGE','21412',jdecode('Fair+Tax+Act'),jdecode(''),'/5401/21412.html','true',[],'','']
	],'',''],
	['PAGE','5422',jdecode('PERSPECTIVE'),jdecode(''),'/5422.html','true',[],'',''],
	['PAGE','5443',jdecode('COMMUNICATION'),jdecode(''),'/5443.html','true',[],'',''],
	['PAGE','14512',jdecode('QUESTIONS'),jdecode(''),'/14512.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2416';
theSitetree.keyvisualName='digital.jpg';
theSitetree.fontsetId='394';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2416',
				keyvisualName: 	'digital.jpg',
				fontsetId: 		'394',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100118-111429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20100118-104623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14512',
internalId:  '',
customField: '20100118-141102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100118-161046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20100118-154258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5443',
internalId:  '',
customField: '20100118-111730'
};
webappMappings['1501']=webappMappings['1501-6801467']={
webappId:    '1501',
documentId:  '5252',
internalId:  '6801467',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5252',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-6323']={
webappId:    '7008',
documentId:  '14512',
internalId:  '6323',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19012',
internalId:  '',
customField: '20100122-095732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19412',
internalId:  '',
customField: '20100122-100548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19033',
internalId:  '',
customField: '20100118-161523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21412',
internalId:  '',
customField: '20110112-143259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22412',
internalId:  '',
customField: '20110114-145323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23012',
internalId:  '',
customField: '20110114-152031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23512',
internalId:  '',
customField: '20110114-152733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23533',
internalId:  '',
customField: '20110114-153255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23554',
internalId:  '',
customField: '20110114-153951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23575',
internalId:  '',
customField: '20110114-154945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24312',
internalId:  '',
customField: '20110114-155510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24333',
internalId:  '',
customField: '20110114-155259'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ0WR';
var companyName   = '';
var htmlTitle	  = 'C.R.+COOPER%2C+CPA%2C+PA';
var metaKeywords  = 'ACCOUNTING+TAX+RETURNS+IRS+LETTERS+AUDITS+BOOKKEEPING+PAYROLL+TAXES+CPA+CERTIFIED+PUBLIC+ACCOUNTANT';
var metaContents  = 'Professional.+Accurate.+Accounting+services.';
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();
};

