/* [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','6201',jdecode('Home+Page'),jdecode(''),'/6201.html','true',[],''],
	['PAGE','8471',jdecode('Trunks+for+Sale'),jdecode(''),'/8471.html','true',[],''],
	['PAGE','22335',jdecode('Completed+trunks'),jdecode(''),'/22335.html','true',[],''],
	['PAGE','24435',jdecode('Before+%26+After+Trunks'),jdecode(''),'/24435.html','true',[],''],
	['PAGE','31063',jdecode('Contact'),jdecode(''),'/31063.html','true',[],''],
	['PAGE','25935',jdecode('Shipping'),jdecode(''),'/25935.html','true',[],''],
	['PAGE','31463',jdecode('Guestbook'),jdecode(''),'/31463.html','true',[],''],
	['PAGE','46715',jdecode('Antique+Trunk+links'),jdecode(''),'/46715.html','true',[],''],
	['PAGE','21735',jdecode('1880s+Wicker+pattern+Embossed+metal+Trunk++++++++'),jdecode(''),'/21735.html','false',[],''],
	['PAGE','50615',jdecode('Oak+Slat+Trunk'),jdecode(''),'/50615.html','false',[],''],
	['PAGE','62009',jdecode('Crouch+%26+Fitzgerald'),jdecode(''),'/62009.html','false',[],''],
	['PAGE','65591',jdecode('1870s+Dome+Top'),jdecode(''),'/65591.html','false',[],''],
	['PAGE','77527',jdecode('Zinc+flat+trunk'),jdecode(''),'/77527.html','false',[],''],
	['PAGE','77627',jdecode('Zinc+embossed'),jdecode(''),'/77627.html','false',[],''],
	['PAGE','82427',jdecode('Alburger+Saratoga+'),jdecode(''),'/82427.html','false',[],''],
	['PAGE','88727',jdecode('1890s+Antique+Uniform%2C+Child%26%23x27%3Bs+Doll+Trunk+'),jdecode(''),'/88727.html','false',[],''],
	['PAGE','90727',jdecode('Plaid+Doll+Trunk'),jdecode(''),'/90727.html','false',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='E58F12';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11064';
theSitetree.graphicsetId='11833';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Antique',
				paletteFamily: 	'E58F12',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11064',
				graphicsetId: 	'11833',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'664F23',
				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:  '6201',
internalId:  '',
customField: '20090402-031247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25935',
internalId:  '',
customField: '20090401-195627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82427',
internalId:  '',
customField: '20100512-134816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8471',
internalId:  '',
customField: '20100522-113201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31063',
internalId:  '',
customField: '20090304-030950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77627',
internalId:  '',
customField: '20100115-122520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31463',
internalId:  '',
customField: '20090304-030519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90727',
internalId:  '',
customField: '20100725-032904'
};
webappMappings['1002']=webappMappings['1002-31463aendu0inehu3']={
webappId:    '1002',
documentId:  '31463',
internalId:  '31463aendu0inehu3',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-a27edc7df9a7a7362252f20e5e51a7d4']={
webappId:    '7060',
documentId:  '21735',
internalId:  'a27edc7df9a7a7362252f20e5e51a7d4',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88727',
internalId:  '',
customField: '20100521-092907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77527',
internalId:  '',
customField: '20100102-234244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21735',
internalId:  '',
customField: '20090309-124046'
};
webappMappings['7060']=webappMappings['7060-3bddf0e3fb17a54a40299facaed5d3d5']={
webappId:    '7060',
documentId:  '22335',
internalId:  '3bddf0e3fb17a54a40299facaed5d3d5',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22335',
internalId:  '',
customField: '20090226-205821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24435',
internalId:  '',
customField: '20090905-124306'
};
webappMappings['7008']=webappMappings['7008-13930']={
webappId:    '7008',
documentId:  '31063',
internalId:  '13930',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62009',
internalId:  '',
customField: '20090913-131447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50615',
internalId:  '',
customField: '20090410-034119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46715',
internalId:  '',
customField: '20090415-141231'
};
webappMappings['7060']=webappMappings['7060-57a1184c81b91cf7250bfda1b024106c']={
webappId:    '7060',
documentId:  '50615',
internalId:  '57a1184c81b91cf7250bfda1b024106c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65591',
internalId:  '',
customField: '20100428-131806'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEHU3';
var companyName   = 'HMS+Antique+Trunks';
var htmlTitle	  = 'HMS+Antique+Trunks';
var metaKeywords  = 'Antique+trunks%2C+Antique+trunk+sales%2C+parts%2C+Dome%2C+Hump%2C+Back%2C+Barrel%2C+Stave%2C+Flat%2C+top%2C+Steamer%2C+Antique%2C+Vintage%2C+Leather%2C+wood%2C+draw+bolts%2C+cast%2C+oak%2C+hasp%2C+trunk%2C+casters%2C+Topham%2C+wicker%2C+sale%2C+1870s%2C+1880s%2C+trunk%2C+old%2C+Victorian%2C+1600%2C+1800%2C+1900%2C+Taylor%2C+Louis%2C+slats%2C+vintage%2C+antique%2C+Grecian%2C+pattern%2C+hardware%2C+Basket+weave%2C+Basket+weave%2C+history%2C+trunk+styles%2C+case%2C+solid+brass%2C+oak+slat%2C+history%2C+end+caps%2C+cloth%2C+fabric%2C+canvas%2C+leather%2C+slat+clamps%2C+grooved+slats%2C+zinc%2C+copper%2C+gold%2C+black%2C+Brass%2C+Crouch%2C+Fitzgerald%2C+CrouchFitzgerald';
var metaContents  = 'Restored+Antique+Trunks+and+original+Antique+trunk+parts+for+sale.+Repair+and+restoration+of+antique+trunks.+Oak+slat%2C+Flat+top%2C+Hump+back%2C+and+all+other+styles+of+trunks.+Specializing+in+rare%2C+and+hard+to+find+high+end+trunks.+';
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();
};
