/* [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','201',jdecode('Home'),jdecode(''),'/201.html','true',[],'',''],
	['PAGE','4701',jdecode('History'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','149526',jdecode('Hawaii'),jdecode(''),'/149526.html','true',[],'',''],
	['PAGE','20611',jdecode('Custom+Line'),jdecode(''),'/20611/index.html','true',[ 
		['PAGE','4711',jdecode('Features'),jdecode(''),'/20611/4711.html','true',[],'',''],
		['PAGE','20106',jdecode('Optional+Upgrades'),jdecode(''),'/20611/20106.html','true',[],'',''],
		['PAGE','20621',jdecode('Government+Trailers'),jdecode(''),'/20611/20621.html','true',[],'',''],
		['PAGE','105547',jdecode('5th+Wheel'),jdecode(''),'/20611/105547.html','true',[],'',''],
		['PAGE','105568',jdecode('PWC+Trailers'),jdecode(''),'/20611/105568.html','true',[],'','']
	],'',''],
	['PAGE','125026',jdecode('Owner%26%23x27%3Bs+Community'),jdecode(''),'/125026/index.html','true',[ 
		['PAGE','20641',jdecode('Trailer+Services'),jdecode(''),'/125026/20641.html','true',[],'',''],
		['PAGE','20646',jdecode('Trailer+Maintenance'),jdecode(''),'/125026/20646.html','true',[],'','']
	],'',''],
	['PAGE','105526',jdecode('FAQs'),jdecode(''),'/105526/index.html','true',[ 
		['PAGE','151526',jdecode('Why+Aluminum%3F'),jdecode(''),'/105526/151526.html','true',[],'','']
	],'',''],
	['PAGE','40620',jdecode('Testimonials'),jdecode(''),'/40620.html','true',[],'',''],
	['PAGE','59926',jdecode('Photo+Gallery'),jdecode(''),'/59926.html','true',[],'',''],
	['PAGE','105610',jdecode('New+Location'),jdecode(''),'/105610.html','true',[],'',''],
	['PAGE','107726',jdecode('Closeouts'),jdecode(''),'/107726/index.html','true',[ 
		['PAGE','105589',jdecode('Trailer+Parts'),jdecode(''),'/107726/105589.html','true',[],'','']
	],'',''],
	['PAGE','19711',jdecode('Contact+Us'),jdecode(''),'/19711.html','true',[],'',''],
	['PAGE','4746',jdecode('Links'),jdecode(''),'/4746.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Maschine';
theSitetree.paletteFamily='264B41';
theSitetree.keyvisualId='1917';
theSitetree.keyvisualName='industry2.jpg';
theSitetree.fontsetId='320';
theSitetree.graphicsetId='371';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Maschine',
				paletteFamily: 	'264B41',
				keyvisualId: 	'1917',
				keyvisualName: 	'industry2.jpg',
				fontsetId: 		'320',
				graphicsetId: 	'371',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-456114']={
webappId:    '1501',
documentId:  '201',
internalId:  '456114',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19711',
internalId:  '',
customField: '20091130-101400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20611',
internalId:  '',
customField: '20080917-084951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20091130-101114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107726',
internalId:  '',
customField: '20100323-125840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105589',
internalId:  '',
customField: '20091130-101900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20080811-141631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149526',
internalId:  '',
customField: '20080816-151928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4711',
internalId:  '',
customField: '20080811-152733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20106',
internalId:  '',
customField: '20080811-121914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20621',
internalId:  '',
customField: '20080816-134428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105547',
internalId:  '',
customField: '20080816-142906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105568',
internalId:  '',
customField: '20080811-153453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125026',
internalId:  '',
customField: '20080816-132051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20641',
internalId:  '',
customField: '20080811-160915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20646',
internalId:  '',
customField: '20080811-101129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105526',
internalId:  '',
customField: '20080917-085709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151526',
internalId:  '',
customField: '20080917-085740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40620',
internalId:  '',
customField: '20100115-150509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59926',
internalId:  '',
customField: '20080816-133839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105610',
internalId:  '',
customField: '20080917-085846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4746',
internalId:  '',
customField: '20070801-100656'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INX2QL';
var companyName   = 'West+Coast+ABT+';
var htmlTitle	  = 'www.ABTrailers.com';
var metaKeywords  = 'aluminum+boat+trailers%2C+southern+california%2C+west+coast%2C+manufacturer%2Cpacifc+trailers%2C+loadmaster%2C+trailrite%2C+myco';
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();
};
