/* [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','3301',jdecode('Iron+Gate+Antiques'),jdecode(''),'/3301.html','true',[],''],
	['PAGE','5801',jdecode('Directions'),jdecode(''),'/5801.html','true',[],''],
	['PAGE','6011',jdecode('Restoration+Repair+Examples'),jdecode(''),'/6011/index.html','true',[ 
		['PAGE','133101',jdecode('Armoire+Restoration'),jdecode(''),'/6011/133101.html','true',[],''],
		['PAGE','98001',jdecode('Victorian+Sideboard'),jdecode(''),'/6011/98001.html','false',[],''],
		['PAGE','112901',jdecode('George+III+Restoration'),jdecode(''),'/6011/112901.html','true',[],''],
		['PAGE','29822',jdecode('Hoosier+Restoration'),jdecode(''),'/6011/29822.html','true',[],''],
		['PAGE','74001',jdecode('Larkin'),jdecode(''),'/6011/74001.html','true',[],''],
		['PAGE','29801',jdecode('Roll+Top+Desk'),jdecode(''),'/6011/29801.html','true',[],'']
	],''],
	['PAGE','5822',jdecode('Recent+Acquisitions'),jdecode(''),'/5822.html','true',[],''],
	['PAGE','5843',jdecode('Beds+and+Bedroom+Sets'),jdecode(''),'/5843.html','true',[],''],
	['PAGE','70501',jdecode('Canes+%26+Candlesticks'),jdecode(''),'/70501.html','true',[],''],
	['PAGE','5864',jdecode('Chairs+and+Rockers'),jdecode(''),'/5864.html','true',[],''],
	['PAGE','84301',jdecode('Clocks'),jdecode(''),'/84301.html','true',[],''],
	['PAGE','99601',jdecode('Cups+%26+Saucers'),jdecode(''),'/99601.html','true',[],''],
	['PAGE','35401',jdecode('Desks'),jdecode(''),'/35401.html','false',[],''],
	['PAGE','5885',jdecode('Dressers%2C+Chests%2C+Buffets'),jdecode(''),'/5885.html','true',[],''],
	['PAGE','50401',jdecode('Lighting+'),jdecode(''),'/50401.html','true',[],''],
	['PAGE','5906',jdecode('Pictures+%26+Mirrors'),jdecode(''),'/5906.html','true',[],''],
	['PAGE','70401',jdecode('Quilts'),jdecode(''),'/70401.html','true',[],''],
	['PAGE','5927',jdecode('Smalls'),jdecode(''),'/5927.html','true',[],''],
	['PAGE','5948',jdecode('Sofas+%26+Parlor+Sets'),jdecode(''),'/5948.html','true',[],''],
	['PAGE','5969',jdecode('Tables'),jdecode(''),'/5969.html','true',[],''],
	['PAGE','72001',jdecode('Miscellaneous'),jdecode(''),'/72001.html','true',[],''],
	['PAGE','5990',jdecode('Upholstery+Examples'),jdecode(''),'/5990.html','true',[],''],
	['PAGE','6032',jdecode('Newsletter'),jdecode(''),'/6032.html','true',[],''],
	['PAGE','6053',jdecode('Iron+Gate+History'),jdecode(''),'/6053.html','true',[],''],
	['PAGE','6074',jdecode('The+Team'),jdecode(''),'/6074.html','true',[],''],
	['PAGE','6095',jdecode('Local+Businesses'),jdecode(''),'/6095.html','true',[],'']];
var siteelementCount=29;
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:  '3301',
internalId:  '',
customField: '20100101-181559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5864',
internalId:  '',
customField: '20100201-062701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20100104-164906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5822',
internalId:  '',
customField: '20100201-150640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5969',
internalId:  '',
customField: '20100107-045220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5843',
internalId:  '',
customField: '20100101-173037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5885',
internalId:  '',
customField: '20100107-052825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5906',
internalId:  '',
customField: '20100201-062311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5927',
internalId:  '',
customField: '20100201-061633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5948',
internalId:  '',
customField: '20091031-130636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5990',
internalId:  '',
customField: '20100101-183531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6011',
internalId:  '',
customField: '20100130-222524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6032',
internalId:  '',
customField: '20100201-063703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6053',
internalId:  '',
customField: '20091109-060041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6074',
internalId:  '',
customField: '20091231-194047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6095',
internalId:  '',
customField: '20100107-050700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20080331-184453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29822',
internalId:  '',
customField: '20080331-184544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20081031-194023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50401',
internalId:  '',
customField: '20100104-164459'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70501',
internalId:  '',
customField: '20091031-123103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70401',
internalId:  '',
customField: '20091001-002549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72001',
internalId:  '',
customField: '20100107-045814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74001',
internalId:  '',
customField: '20080927-114457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84301',
internalId:  '',
customField: '20100101-173157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98001',
internalId:  '',
customField: '20090101-022457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99601',
internalId:  '',
customField: '20100101-173819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112901',
internalId:  '',
customField: '20090321-140551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133101',
internalId:  '',
customField: '20091001-084900'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN24IV';
var companyName   = 'IRON+GATE+ANTIQUES--------------------';
var htmlTitle	  = 'Iron+Gate+Antiques';
var metaKeywords  = 'Antique%2Cantiques%2Ceastlake%2Cchippendale%2Crestoration%2Cfurniture+repair%2Cfurniture+refinishing%2CLoudoun%2CLoudoun+County%2C+Fairfax%2Cclock%2Ccane%2Cbed%2Cdresser%2Cvictorian%2Ctiffany%2Cquezal%2Clamp%2Crocker%2Cdresser%2Cdesk%2Cchair%2Crocker%2Carmoire%2Csideboard%2Cshade%2Cchest+of+drawers%2C+buffet%2C+pitcher%2C+wash+basin%2C+commode%2C+elm%2C+oak%2C+mahogany%2Cwalnut%2Cchestnut%2Cmaple';
var metaContents  = 'Iron+Gate+Antiques++where+the+unique+is+the+norm...Iron+Gate+specializes+in+the+repair+and+restoration+of+antique+furniture.+Working+with+other+area+craftsmen+we+can+also+provide+upholstery+service%2C+caning+and+rush+seat+work+and+are+partnered+with+an+appraiser+ceritified+in+Antiques%2C+Jewelry%2C+Gems%2C+19th+and+20th+Century+Art.+';
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();
};
