/* [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','2001',jdecode('Home+'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','30201',jdecode('Contact+Us'),jdecode(''),'/30201.html','true',[],'',''],
	['PAGE','2094',jdecode('Home+Sale+by+Owner'),jdecode(''),'/2094.html','true',[],'',''],
	['PAGE','2115',jdecode('The+best+way+to+find+a+home'),jdecode(''),'/2115.html','true',[],'',''],
	['PAGE','2136',jdecode('How+an+Attorney+will+help+You'),jdecode(''),'/2136.html','true',[],'',''],
	['PAGE','11901',jdecode('Attorney+Fees+for+Home+Sales'),jdecode(''),'/11901.html','true',[],'',''],
	['PAGE','8022',jdecode('Home+Seller+costs'),jdecode(''),'/8022.html','true',[],'',''],
	['PAGE','8043',jdecode('Home+Buyer+costs'),jdecode(''),'/8043.html','true',[],'',''],
	['PAGE','9701',jdecode('Home+Environmental+Issues'),jdecode(''),'/9701/index.html','true',[ 
		['PAGE','9722',jdecode('Mold+in+the+Home'),jdecode(''),'/9701/9722.html','true',[],'',''],
		['PAGE','10401',jdecode('Lead+in+the+Home'),jdecode(''),'/9701/10401.html','true',[],'',''],
		['PAGE','10422',jdecode('Radon+in+the+Home'),jdecode(''),'/9701/10422.html','true',[],'',''],
		['PAGE','10443',jdecode('Asbestos+in+the+Home'),jdecode(''),'/9701/10443.html','true',[],'',''],
		['PAGE','16701',jdecode('Home+Indoor+Air+Quality'),jdecode(''),'/9701/16701.html','true',[],'','']
	],'',''],
	['PAGE','8001',jdecode('Legal+Services'),jdecode(''),'/8001/index.html','true',[ 
		['PAGE','18301',jdecode('Wills+%26+Power+of+Attorneys'),jdecode(''),'/8001/18301.html','true',[],'',''],
		['PAGE','18322',jdecode('Estate+Planning+%26+Probate'),jdecode(''),'/8001/18322.html','true',[],'',''],
		['PAGE','18343',jdecode('Unemployment+Benefits'),jdecode(''),'/8001/18343.html','true',[],'',''],
		['PAGE','24201',jdecode('Driver%26%23x27%3Bs+License'),jdecode(''),'/8001/24201.html','true',[],'',''],
		['PAGE','26801',jdecode('Real+Estate+Tax+Appeals'),jdecode(''),'/8001/26801.html','true',[],'',''],
		['PAGE','31601',jdecode('Trademark+and+Copyright+Registration'),jdecode(''),'/8001/31601.html','true',[],'','']
	],'',''],
	['PAGE','22301',jdecode('Legal+Topics+for+Homeowners'),jdecode(''),'/22301.html','true',[],'',''],
	['PAGE','2241',jdecode('Some+Interesting+links'),jdecode(''),'/2241.html','true',[],'',''],
	['PAGE','2178',jdecode('How+to+find+our+office'),jdecode(''),'/2178.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='AAA769';
theSitetree.keyvisualId='2443';
theSitetree.keyvisualName='beratung.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='462';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'AAA769',
				keyvisualId: 	'2443',
				keyvisualName: 	'beratung.jpg',
				fontsetId: 		'406',
				graphicsetId: 	'462',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'AAA769',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20090405-102402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20081223-084711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20081229-170518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20081126-072233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2115',
internalId:  '',
customField: '20081222-061315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20090222-054654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20081125-064313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20090103-075502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20090103-075331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20090103-075057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9722',
internalId:  '',
customField: '20081230-070612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20081121-063622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20081122-114707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10443',
internalId:  '',
customField: '20090103-074904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20081118-173210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18301',
internalId:  '',
customField: '20081122-090203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18322',
internalId:  '',
customField: '20081122-060641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18343',
internalId:  '',
customField: '20081222-161311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20081230-105102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2241',
internalId:  '',
customField: '20081120-163020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20081114-034809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20081221-070350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20090222-101112'
};
webappMappings['7008']=webappMappings['7008-4748']={
webappId:    '7008',
documentId:  '30201',
internalId:  '4748',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20090408-052502'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPIMQ';
var companyName   = 'Law+Office+of+Patrick+T.+Chambers';
var htmlTitle	  = 'Patrick+Chambers+Law+Office';
var metaKeywords  = '';
var metaContents  = '';
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();
};
