/* [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','1401',jdecode('Home'),jdecode(''), jdecode('%2F1401.html'), 'true',[],'',''],
	['PAGE','3001',jdecode('Portraits+For+Sale'),jdecode(''), jdecode('%2F3001.html'), 'true',[],'',''],
	['PAGE','5022',jdecode('Landscapes+For+Sale'),jdecode(''), jdecode('%2F5022.html'), 'true',[],'',''],
	['PAGE','65434',jdecode('Reproductions+For+Sale'),jdecode(''), jdecode('%2F65434.html'), 'true',[],'',''],
	['PAGE','64134',jdecode('Silhouettes+For+Sale'),jdecode(''), jdecode('%2F64134.html'), 'true',[],'',''],
	['PAGE','72734',jdecode('Prints+For+Sale'),jdecode(''), jdecode('%2F72734.html'), 'true',[],'',''],
	['PAGE','42312',jdecode('Bible+Aid+For+Sale'),jdecode(''), jdecode('%2F42312.html'), 'true',[],'',''],
	['PAGE','42012',jdecode('Prices+For+Commissions'),jdecode(''), jdecode('%2F42012.html'), 'true',[],'',''],
	['PAGE','5001',jdecode('Portraits+Not+For+Sale'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','37412',jdecode('%22Behold+Satan%22'),jdecode(''), jdecode('%2F37412.html'), 'true',[],'',''],
	['PAGE','36412',jdecode('%22Glory%22'),jdecode(''), jdecode('%2F36412.html'), 'false',[],'',''],
	['PAGE','58923',jdecode('Crucifixion'),jdecode(''), jdecode('%2F58923.html'), 'true',[],'',''],
	['PAGE','10901',jdecode('My+credentials'),jdecode(''), jdecode('%2F10901.html'), 'true',[],'',''],
	['PAGE','10501',jdecode('How+I+paint'),jdecode(''), jdecode('%2F10501.html'), 'true',[],'',''],
	['PAGE','6801',jdecode('Strip+Painting'),jdecode(''), jdecode('%2F6801.html'), 'true',[],'',''],
	['PAGE','55523',jdecode('Behind+The+Scene'),jdecode(''), jdecode('%2F55523%2Findex.html'), 'true',[ 
		['PAGE','40312',jdecode('Dutch+Masters+Tour'),jdecode(''), jdecode('%2F55523%2F40312.html'), 'true',[],'',''],
		['PAGE','38512',jdecode('One+That+Got+Away'),jdecode(''), jdecode('%2F55523%2F38512.html'), 'true',[],'',''],
		['PAGE','34012',jdecode('Music'),jdecode(''), jdecode('%2F55523%2F34012.html'), 'true',[],'','']
	],'',''],
	['PAGE','3043',jdecode('Contact+Me'),jdecode(''), jdecode('%2F3043.html'), 'true',[],'',''],
	['PAGE','49823',jdecode('Thank+You%2C+God'),jdecode(''), jdecode('%2F49823.html'), 'true',[],'',''],
	['PAGE','57423',jdecode('Models'),jdecode(''), jdecode('%2F57423.html'), 'false',[],'',''],
	['PAGE','91967',jdecode('Israel+pictures'),jdecode(''), jdecode('%2F91967.html'), 'false',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='5C512E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12687';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='484132';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLY0XFEL'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rivet',
				paletteFamily: 	'5C512E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12687',
				contentColor: 	'FFFFFF',
				contentBGColor: '484132',
				a_color: 		'000000',
				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:  '1401',
internalId:  '',
customField: '20120120-064925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42312',
internalId:  '',
customField: '20111229-123026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40312',
internalId:  '',
customField: '20111030-090222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42012',
internalId:  '',
customField: '20111229-123202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37412',
internalId:  '',
customField: '20111220-221849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34012',
internalId:  '',
customField: '20111221-212355'
};
webappMappings['7008']=webappMappings['7008-10963']={
webappId:    '7008',
documentId:  '3043',
internalId:  '10963',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20111229-125320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38512',
internalId:  '',
customField: '20111015-230654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3043',
internalId:  '',
customField: '20111118-211437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20111229-123426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5022',
internalId:  '',
customField: '20111227-134142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20111218-210344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20111030-115923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20111228-080858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49823',
internalId:  '',
customField: '20111217-193626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36412',
internalId:  '',
customField: '20111220-222239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55523',
internalId:  '',
customField: '20111228-092131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58923',
internalId:  '',
customField: '20111223-071510'
};
webappMappings['7008']=webappMappings['7008-12751']={
webappId:    '7008',
documentId:  '57423',
internalId:  '12751',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57423',
internalId:  '',
customField: '20111129-073536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64134',
internalId:  '',
customField: '20111224-115346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91967',
internalId:  '',
customField: '20111228-144116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65434',
internalId:  '',
customField: '20111224-115335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72734',
internalId:  '',
customField: '20120119-220254'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INFM3T';
var companyName   = '+++++++++++++++++Oil+on+canvass+++++++++-+++++++Nashville%2C+Indiana';
var htmlTitle	  = 'Edward+Patterson+Indiana+artist';
var metaKeywords  = 'artist+oil+painter+painting+nashville+indiana+teacher+trainer+class+classes+instruction+instructor+Edd+Patterson+Eddie';
var metaContents  = 'Indiana+artist+specializing+in+painting+portraits+in+oil';
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();
};

