/* [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','5401',jdecode('Home'),jdecode(''),'/5401.html','true',[],'',''],
	['PAGE','5452',jdecode('Contact'),jdecode(''),'/5452.html','true',[],'',''],
	['PAGE','5473',jdecode('Scenarios+%26+Solutions'),jdecode(''),'/5473/index.html','true',[ 
		['PAGE','5494',jdecode('Custom+Cabinet+Shop'),jdecode(''),'/5473/5494.html','true',[],'',''],
		['PAGE','5515',jdecode('Payroll+%26+Job+Cost+Flow+Chart'),jdecode(''),'/5473/5515.html','false',[],'',''],
		['PAGE','5536',jdecode('Materials+%26+Inventory+Flow+Chart'),jdecode(''),'/5473/5536.html','false',[],'','']
	],'',''],
	['PAGE','5557',jdecode('Products'),jdecode(''),'/5557/index.html','true',[ 
		['PAGE','5578',jdecode('TracManager+Module+Overview'),jdecode(''),'/5557/5578.html','true',[],'',''],
		['PAGE','5599',jdecode('Time+%26+Payroll'),jdecode(''),'/5557/5599.html','true',[],'',''],
		['PAGE','5620',jdecode('Job+Cost+%26+Analysis'),jdecode(''),'/5557/5620.html','true',[],'',''],
		['PAGE','5641',jdecode('Estimating'),jdecode(''),'/5557/5641.html','true',[],'',''],
		['PAGE','5683',jdecode('Materials+%26+Inventory'),jdecode(''),'/5557/5683.html','true',[],'',''],
		['PAGE','5662',jdecode('Manufacturing+%26+Scheduling'),jdecode(''),'/5557/5662.html','true',[],'',''],
		['PAGE','5704',jdecode('Data+Capture'),jdecode(''),'/5557/5704.html','true',[],'',''],
		['PAGE','5725',jdecode('Integration'),jdecode(''),'/5557/5725.html','true',[],'','']
	],'',''],
	['PAGE','5746',jdecode('Screenshots'),jdecode(''),'/5746/index.html','true',[ 
		['PAGE','5767',jdecode('Time+%26+Payroll'),jdecode(''),'/5746/5767.html','true',[],'',''],
		['PAGE','5788',jdecode('Job+Cost+%26+Analysis'),jdecode(''),'/5746/5788.html','true',[],'',''],
		['PAGE','5809',jdecode('Estimating'),jdecode(''),'/5746/5809.html','true',[],'',''],
		['PAGE','5830',jdecode('Materials+%26+Inventory'),jdecode(''),'/5746/5830.html','true',[],'',''],
		['PAGE','5851',jdecode('Manufacturing+%26+Scheduling'),jdecode(''),'/5746/5851.html','true',[],'','']
	],'',''],
	['PAGE','22201',jdecode('Report+Samples'),jdecode(''),'/22201.html','false',[],'',''],
	['PAGE','5872',jdecode('Product+Videos'),jdecode(''),'/5872.html','false',[],'',''],
	['PAGE','5893',jdecode('Customer+Showcase'),jdecode(''),'/5893/index.html','true',[ 
		['PAGE','22701',jdecode('Custom+Woodworking'),jdecode(''),'/5893/22701.html','true',[],'',''],
		['PAGE','22722',jdecode('Countertops'),jdecode(''),'/5893/22722.html','true',[],'',''],
		['PAGE','22743',jdecode('Custom+Manufacturing'),jdecode(''),'/5893/22743.html','true',[],'',''],
		['PAGE','22764',jdecode('Yachts'),jdecode(''),'/5893/22764.html','true',[],'',''],
		['PAGE','22785',jdecode('Other+Industries'),jdecode(''),'/5893/22785.html','true',[],'','']
	],'',''],
	['PAGE','5914',jdecode('Resources'),jdecode(''),'/5914.html','true',[],'',''],
	['PAGE','5935',jdecode('Support'),jdecode(''),'/5935.html','true',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Business';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='2487';
theSitetree.keyvisualName='seminar.jpg';
theSitetree.fontsetId='418';
theSitetree.graphicsetId='463';
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: 			'Business',
				paletteFamily: 	'003366',
				keyvisualId: 	'2487',
				keyvisualName: 	'seminar.jpg',
				fontsetId: 		'418',
				graphicsetId: 	'463',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20100503-102602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5935',
internalId:  '',
customField: '20100504-132840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5452',
internalId:  '',
customField: '20100621-110326'
};
webappMappings['7008']=webappMappings['7008-6470']={
webappId:    '7008',
documentId:  '5452',
internalId:  '6470',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5473',
internalId:  '',
customField: '20100503-132928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5494',
internalId:  '',
customField: '20100427-144849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5515',
internalId:  '',
customField: '20100427-143020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5536',
internalId:  '',
customField: '20100427-143040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5557',
internalId:  '',
customField: '20100503-132512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5578',
internalId:  '',
customField: '20100503-102156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5599',
internalId:  '',
customField: '20100503-101556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5620',
internalId:  '',
customField: '20100503-101812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5641',
internalId:  '',
customField: '20100503-101916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5662',
internalId:  '',
customField: '20100503-102139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5746',
internalId:  '',
customField: '20100203-160154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5767',
internalId:  '',
customField: '20100131-082324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5683',
internalId:  '',
customField: '20100503-101904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5704',
internalId:  '',
customField: '20100206-134737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5725',
internalId:  '',
customField: '20100206-134806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5872',
internalId:  '',
customField: '20100126-105950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5914',
internalId:  '',
customField: '20100504-142534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5788',
internalId:  '',
customField: '20100129-133919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5809',
internalId:  '',
customField: '20100310-160301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5830',
internalId:  '',
customField: '20100129-141228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5851',
internalId:  '',
customField: '20100202-150023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5893',
internalId:  '',
customField: '20100624-134450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100310-152618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22722',
internalId:  '',
customField: '20100129-153953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22743',
internalId:  '',
customField: '20100129-154316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22764',
internalId:  '',
customField: '20100129-155006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22785',
internalId:  '',
customField: '20100129-155627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20100129-141607'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5401',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZML0';
var companyName   = 'Tractivity+-+Job+Costing+Solutions';
var htmlTitle	  = 'Business+Management+Software+For+Job+Costing+and+Custom+Manufacturing';
var metaKeywords  = 'job+costing%2C+job+cost%2C+job+costing+software%2C+time+tracking%2C+estimating+software%2C+software%2C+inventory%2C+purchasing%2C+QuickBooks%2C+Custom%2C+Cabinetry%2C+Manufacturing%2C+ERP%2C+MRP';
var metaContents  = 'Job+Costing+Solutions+for+Custom+Manufacturing';
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();
};
