/* [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','5801',jdecode('About+us'),jdecode(''),'/5801.html','true',[],''],
	['PAGE','5852',jdecode('Prices'),jdecode(''),'/5852.html','true',[],''],
	['PAGE','5873',jdecode('Buyer+Info'),jdecode(''),'/5873.html','true',[],''],
	['PAGE','5894',jdecode('Seller+Info'),jdecode(''),'/5894.html','true',[],''],
	['PAGE','5915',jdecode('Inspection+Info'),jdecode(''),'/5915.html','true',[],''],
	['PAGE','5936',jdecode('New+Home+Info'),jdecode(''),'/5936.html','true',[],''],
	['PAGE','5957',jdecode('1+Year+Warranty'),jdecode(''),'/5957.html','true',[],''],
	['PAGE','5978',jdecode('Investor+Info'),jdecode(''),'/5978.html','true',[],''],
	['PAGE','5999',jdecode('What+We+Can+Do+For+You'),jdecode(''),'/5999.html','true',[],''],
	['PAGE','6020',jdecode('Common+Questions'),jdecode(''),'/6020.html','true',[],''],
	['PAGE','6041',jdecode('Code+of+Ethics'),jdecode(''),'/6041.html','true',[],''],
	['PAGE','6062',jdecode('Inspection+Report'),jdecode(''),'/6062.html','true',[],''],
	['PAGE','6083',jdecode('Summary+Report'),jdecode(''),'/6083.html','true',[],''],
	['PAGE','6104',jdecode('Inspector+Links'),jdecode(''),'/6104.html','true',[],''],
	['PAGE','6125',jdecode('Realtor+Links'),jdecode(''),'/6125.html','true',[],''],
	['PAGE','6146',jdecode('Customer+Comments'),jdecode(''),'/6146.html','true',[],''],
	['PAGE','6167',jdecode('Other+Links'),jdecode(''),'/6167.html','true',[],''],
	['PAGE','6188',jdecode('Contact+Us'),jdecode(''),'/6188.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Capri';
theSitetree.paletteFamily='943434';
theSitetree.keyvisualId='7154';
theSitetree.keyvisualName='kv_7154.jpg';
theSitetree.fontsetId='16413';
theSitetree.graphicsetId='12137';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Capri',
				paletteFamily: 	'943434',
				keyvisualId: 	'7154',
				keyvisualName: 	'kv_7154.jpg',
				fontsetId: 		'16413',
				graphicsetId: 	'12137',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20100208-174302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6146',
internalId:  '',
customField: '20091113-141207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5852',
internalId:  '',
customField: '20100208-181457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5873',
internalId:  '',
customField: '20091113-140112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5999',
internalId:  '',
customField: '20091112-185928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5894',
internalId:  '',
customField: '20091113-140151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5915',
internalId:  '',
customField: '20091113-140221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5936',
internalId:  '',
customField: '20091112-183647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5957',
internalId:  '',
customField: '20091112-184116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5978',
internalId:  '',
customField: '20091112-184542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6020',
internalId:  '',
customField: '20091112-190155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6041',
internalId:  '',
customField: '20091113-140458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6062',
internalId:  '',
customField: '20100208-174052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6083',
internalId:  '',
customField: '20100208-182327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6188',
internalId:  '',
customField: '20100206-174215'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6104',
internalId:  '',
customField: '20100208-183859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6125',
internalId:  '',
customField: '20091112-143655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6167',
internalId:  '',
customField: '20100208-183030'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLLJN';
var companyName   = 'Wilson+Property+Inspections%2C+LLC';
var htmlTitle	  = '';
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();
};
