/* [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','62',jdecode('Home'),jdecode(''), jdecode('%2F62.html'), 'true',[],'',''],
	['PAGE','22001',jdecode('News'),jdecode(''), jdecode('%2F22001.html'), 'true',[],'',''],
	['PAGE','292496',jdecode('Featured+Item'),jdecode(''), jdecode('%2F292496.html'), 'true',[],'',''],
	['PAGE','83',jdecode('Furniture'),jdecode(''), jdecode('%2F83.html'), 'true',[],'',''],
	['PAGE','2486',jdecode('Textiles'),jdecode(''), jdecode('%2F2486.html'), 'true',[],'',''],
	['PAGE','2495',jdecode('Treen'),jdecode(''), jdecode('%2F2495.html'), 'true',[],'',''],
	['PAGE','296550',jdecode('Lighting'),jdecode(''), jdecode('%2F296550.html'), 'true',[],'',''],
	['PAGE','2513',jdecode('Iron%2FBrass'),jdecode(''), jdecode('%2F2513.html'), 'true',[],'',''],
	['PAGE','295296',jdecode('Books'),jdecode(''), jdecode('%2F295296.html'), 'true',[],'',''],
	['PAGE','304811',jdecode('Just+for+Fun'),jdecode(''), jdecode('%2F304811.html'), 'true',[],'',''],
	['PAGE','287496',jdecode('Sale+Page'),jdecode(''), jdecode('%2F287496.html'), 'true',[],'',''],
	['PAGE','172723',jdecode('The+Necessary'),jdecode(''), jdecode('%2F172723.html'), 'true',[],'',''],
	['PAGE','450',jdecode('Past+Show+Booths'),jdecode(''), jdecode('%2F450.html'), 'true',[],'',''],
	['PAGE','119323',jdecode('Williamsburg+and+Jamestown'),jdecode(''), jdecode('%2F119323.html'), 'true',[],'',''],
	['PAGE','215923',jdecode('Gaol'),jdecode(''), jdecode('%2F215923.html'), 'true',[],'',''],
	['PAGE','278296',jdecode('Frontier+Culture+Museum'),jdecode(''), jdecode('%2F278296.html'), 'true',[],'',''],
	['PAGE','2210',jdecode('On+the+Road'),jdecode(''), jdecode('%2F2210.html'), 'true',[],'',''],
	['PAGE','459',jdecode('Links'),jdecode(''), jdecode('%2F459.html'), 'true',[],'',''],
	['PAGE','69723',jdecode('Services+%26+Restoration'),jdecode(''), jdecode('%2F69723.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='453102';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10615';
theSitetree.graphicsetId='10812';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='453102';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'netnation',
  product: 'WSCSYSSSSLYTC24G'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Delta',
				paletteFamily: 	'453102',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10615',
				graphicsetId: 	'10812',
				contentColor: 	'FFFFFF',
				contentBGColor: '453102',
				a_color: 		'856417',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '62',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20120129-114844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '450',
internalId:  '',
customField: '20110712-223444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '459',
internalId:  '',
customField: '20110831-135021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20120104-233631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83',
internalId:  '',
customField: '20120129-114747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '296550',
internalId:  '',
customField: '20120131-225647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2486',
internalId:  '',
customField: '20120131-230721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2495',
internalId:  '',
customField: '20120131-225201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2513',
internalId:  '',
customField: '20120111-130301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '295296',
internalId:  '',
customField: '20111112-210931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '304811',
internalId:  '',
customField: '20111024-013246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '292496',
internalId:  '',
customField: '20120113-121212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119323',
internalId:  '',
customField: '20100708-114900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2210',
internalId:  '',
customField: '20111218-182431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69723',
internalId:  '',
customField: '20120105-000006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '172723',
internalId:  '',
customField: '20111125-224333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215923',
internalId:  '',
customField: '20100917-114818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '287496',
internalId:  '',
customField: '20120111-131545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '278296',
internalId:  '',
customField: '20110815-232057'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXC1';
var companyName   = 'Antiques+at+Hillwood+Farms';
var htmlTitle	  = '';
var metaKeywords  = 'Antique';
var metaContents  = '17th%2C18th+and+early+19th+Century+American+furniture+in+original+or+old+surface%2C+as+well+as+appropriate+accessories';
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();
};

