/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','59263',jdecode('UPDATING+WEBSITE+4-15-2009'),jdecode(''),'/59263.html','true',[],''],
	['PAGE','804',jdecode('Contact'),jdecode(''),'/804.html','true',[],''],
	['PAGE','59272',jdecode('C.P.+MORGAN+FILES+BK'),jdecode(''),'/59272.html','true',[],''],
	['PAGE','59281',jdecode('Earl+Gray+%26+Sons+Plumbing'),jdecode(''),'/59281.html','true',[],''],
	['PAGE','59290',jdecode('R.+L.+Hartman+Concrete+Inc.'),jdecode(''),'/59290.html','true',[],''],
	['PAGE','59299',jdecode('Westfield+Insurance+'),jdecode(''),'/59299.html','true',[],''],
	['PAGE','59328',jdecode('Various+E-Mails+%28Problems%29'),jdecode(''),'/59328.html','true',[],''],
	['PAGE','28801',jdecode('4-3-2006+My+Letter'),jdecode(''),'/28801.html','true',[],''],
	['PAGE','25301',jdecode('4-7-2006+My+Letter'),jdecode(''),'/25301.html','true',[],''],
	['PAGE','15901',jdecode('C.P.+Morgan+Letters+To+Me'),jdecode(''),'/15901.html','true',[],''],
	['PAGE','15922',jdecode('Call+For+Help+-+Channel+Six+'),jdecode(''),'/15922.html','true',[],''],
	['PAGE','9201',jdecode('Air+Quality+Tests'),jdecode(''),'/9201.html','true',[],''],
	['PAGE','11101',jdecode('My+Doctor%28s%29+Reports'),jdecode(''),'/11101.html','true',[],''],
	['PAGE','11143',jdecode('Health+Warning+Letter'),jdecode(''),'/11143.html','true',[],''],
	['PAGE','15001',jdecode('C.P.+Morgans+Manager+Book'),jdecode(''),'/15001.html','true',[],''],
	['PAGE','14701',jdecode('Original+Warranty+Request'),jdecode(''),'/14701.html','true',[],''],
	['PAGE','9264',jdecode('Supporting+Documents'),jdecode(''),'/9264.html','true',[],''],
	['PAGE','42801',jdecode('Various+Videos'),jdecode(''),'/42801.html','true',[],''],
	['PAGE','9222',jdecode('Various+Photographs'),jdecode(''),'/9222/index.html','true',[ 
		['PAGE','7901',jdecode('Photographs+%28follow+up+page%29'),jdecode(''),'/9222/7901.html','false',[],'']
	],''],
	['PAGE','35801',jdecode('Assorted+Photos'),jdecode(''),'/35801.html','true',[],''],
	['PAGE','39501',jdecode('Websites+About+C.P.+Morgan'),jdecode(''),'/39501.html','true',[],''],
	['PAGE','9285',jdecode('Complaints+By+Other+Folks'),jdecode(''),'/9285.html','true',[],''],
	['PAGE','11122',jdecode('Misc.%2C+State+Farm+Insurance'),jdecode(''),'/11122.html','true',[],''],
	['PAGE','14001',jdecode('Bank+Of+America'),jdecode(''),'/14001.html','true',[],''],
	['PAGE','699',jdecode('Visitor+Information'),jdecode(''),'/699/index.html','true',[ 
		['PAGE','23601',jdecode('My+Letters+To+C.P.+Morgan+%28follow+up+page%29'),jdecode(''),'/699/23601.html','false',[],'']
	],''],
	['PAGE','20106',jdecode('Guestbook'),jdecode(''),'/20106/index.html','true',[ 
		['PAGE','20101',jdecode('Read+Guestbook'),jdecode(''),'/20106/20101.html','false',[],'']
	],'']];
var siteelementCount=30;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				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:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-20106AHW050INE7ZA']={
webappId:    '1002',
documentId:  '20106',
internalId:  '20106AHW050INE7ZA',
customField: 'icq=false'
};
webappMappings['1001']=webappMappings['1001-ahw050ine7za3a13aa1d4ba84a60']={
webappId:    '1001',
documentId:  '7901',
internalId:  'ahw050ine7za3a13aa1d4ba84a60',
customField: 'followUp'
};
webappMappings['1001']=webappMappings['1001-ahw050ine7za7b99c401f870dff7']={
webappId:    '1001',
documentId:  '699',
internalId:  'ahw050ine7za7b99c401f870dff7',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050ine7za7b99c401f870dff7']={
webappId:    '1001',
documentId:  '23601',
internalId:  'ahw050ine7za7b99c401f870dff7',
customField: 'followUp'
};
webappMappings['7060']=webappMappings['7060-166b0eb0d6d556081ab3b77db918ef89']={
webappId:    '7060',
documentId:  '35801',
internalId:  '166b0eb0d6d556081ab3b77db918ef89',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090414-174219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '804',
internalId:  '',
customField: '20090414-223318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20070427-105442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20070427-105537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20070423-114401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15922',
internalId:  '',
customField: '20070427-120425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20070423-100337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20070427-113738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11143',
internalId:  '',
customField: '20070423-100457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20070423-112050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20070423-112157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9264',
internalId:  '',
customField: '20070423-100637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20071114-190049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9222',
internalId:  '',
customField: '20070614-120138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20070422-172548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20070614-115326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39501',
internalId:  '',
customField: '20070506-202541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9285',
internalId:  '',
customField: '20070423-101006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11122',
internalId:  '',
customField: '20070423-101052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20070427-110221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20070427-110318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20070425-132550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20106',
internalId:  '',
customField: '20070427-110344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20101',
internalId:  '',
customField: '20070427-110415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59263',
internalId:  '',
customField: '20090414-182939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59272',
internalId:  '',
customField: '20090414-182939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59281',
internalId:  '',
customField: '20090414-182939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59290',
internalId:  '',
customField: '20090414-182939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59299',
internalId:  '',
customField: '20090414-182939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59328',
internalId:  '',
customField: '20090414-223701'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INE7ZA';
var companyName   = 'cpmorgancomplaints.com';
var htmlTitle	  = 'cpmorgancomplaints.com';
var metaKeywords  = 'C.P.+Morgan+Complaints%2C+C.P.+Morgan%2C+C.P.+Morgan+Homes+Complaints%2C+C.P.+Morgan+Homebuilder+Complaints%2C+C.P.+Morgan+Largest+Home+Builder+In+Indiana+Complaints%2C+C.P.+Morgan+Homeowner+Complaints%2C+cpmorgancomplaints.com';
var metaContents  = 'C.+P.+Morgan+Complaints%2C+C.P.+Morgan%2C+C.P.+Morgan+Homes+Complaints%2C+C.P.+Morgan+Homebuilder+Complaints%2C+C.+P.+Morgan+Largest+Home+Builder+In+Indiana+Complaints%2C+C.P.+Morgan+Homeowner+Complaints%2C+cpmorgancomplaints.com';
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();
};
