/* [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 theSitetree=[ 
	['PAGE','301',jdecode('D+And+D+Home+Page'),jdecode(''),'/301.html','true',[],''],
	['PAGE','501',jdecode('Contact+information'),jdecode(''),'/501.html','true',[],''],
	['PAGE','17427',jdecode('Contact'),jdecode(''),'/17427/index.html','true',[ 
		['PAGE','18501',jdecode('Map'),jdecode(''),'/17427/18501.html','true',[],'']
	],''],
	['PAGE','5601',jdecode('What+we+do'),jdecode(''),'/5601.html','true',[],''],
	['PAGE','11001',jdecode('About+us'),jdecode(''),'/11001/index.html','true',[ 
		['PAGE','11022',jdecode('The+team'),jdecode(''),'/11001/11022.html','true',[],'']
	],''],
	['PAGE','15531',jdecode('Photo+Album+%231%2C+D%26D+1%262+++++'),jdecode(''),'/15531.html','true',[],''],
	['PAGE','19101',jdecode('Photo+Album+%232%2C+Hartford'),jdecode(''),'/19101.html','true',[],''],
	['PAGE','19601',jdecode('Photo+Album+%233%2C+WIndsor'),jdecode(''),'/19601.html','true',[],''],
	['PAGE','11043',jdecode('Offers'),jdecode(''),'/11043.html','true',[],''],
	['PAGE','17322',jdecode('Services'),jdecode(''),'/17322/index.html','true',[ 
		['PAGE','17343',jdecode('Accounting+and+Tax+Problem'),jdecode(''),'/17322/17343.html','true',[],''],
		['PAGE','17364',jdecode('Management+Consulting'),jdecode(''),'/17322/17364.html','true',[],''],
		['PAGE','17385',jdecode('Notary+Services'),jdecode(''),'/17322/17385.html','true',[],'']
	],''],
	['PAGE','10906',jdecode('Guestbook'),jdecode(''),'/10906/index.html','true',[ 
		['PAGE','10901',jdecode('Read+Guestbook'),jdecode(''),'/10906/10901.html','false',[],'']
	],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='FFCC66';
theSitetree.keyvisualId='2055';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='281';
theSitetree.graphicsetId='343';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFCC66';
var theTemplate={
				name: 			'Architekt',
				paletteFamily: 	'FFCC66',
				keyvisualId: 	'2055',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'281',
				graphicsetId: 	'343',
				contentColor: 	'000000',
				contentBGColor: 'FFCC66',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFCC66',
				b_color: 		'CC6600',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24M']={
webappId:    '5003',
documentId:  '301',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24M',
customField: 'en:US:'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-10906AHW050INXXYJ']={
webappId:    '1002',
documentId:  '10906',
internalId:  '10906AHW050INXXYJ',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-2858']={
webappId:    '7008',
documentId:  '5601',
internalId:  '2858',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-2859']={
webappId:    '7008',
documentId:  '11043',
internalId:  '2859',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-0ec40d637387fbaa836f894799f91ea5']={
webappId:    '7060',
documentId:  '15531',
internalId:  '0ec40d637387fbaa836f894799f91ea5',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-2860']={
webappId:    '7008',
documentId:  '501',
internalId:  '2860',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '18501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-aaa49a388b176be7934bfef5d7cc6264']={
webappId:    '7060',
documentId:  '19101',
internalId:  'aaa49a388b176be7934bfef5d7cc6264',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-8a8ac9fc1b8867991842b64d264d05bd']={
webappId:    '7060',
documentId:  '19601',
internalId:  '8a8ac9fc1b8867991842b64d264d05bd',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20080730-155403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11043',
internalId:  '',
customField: '20080620-135427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20080620-134617'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXYJ';
var companyName   = 'D+And+D+Enterprises';
var htmlTitle	  = 'D+and+D+Enterprises';
var metaKeywords  = 'acounting%2C+notay+Public%2C+Business+Analyst%2C++Tax+Preparers%2C+resumes%2C+profit%2C+management%2C+payroll';
var metaContents  = 'Accounting+service';
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();
};

