/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','5152',jdecode('About+us'),jdecode(''),'/5152.html','true',[],''],
	['PAGE','5173',jdecode('How+to+find+us'),jdecode(''),'/5173.html','true',[],''],
	['PAGE','5236',jdecode('Artists'),jdecode(''),'/5236/index.html','true',[ 
		['PAGE','36112',jdecode('Scott+Baker'),jdecode(''),'/5236/36112.html','true',[],''],
		['PAGE','12312',jdecode('Santos+Barbosa'),jdecode(''),'/5236/12312.html','true',[],''],
		['PAGE','12333',jdecode('Leland+Beaman'),jdecode(''),'/5236/12333.html','true',[],''],
		['PAGE','36133',jdecode('Joan+Bruder'),jdecode(''),'/5236/36133.html','true',[],''],
		['PAGE','12354',jdecode('Jane+Skaar+Coleman'),jdecode(''),'/5236/12354.html','true',[],''],
		['PAGE','12375',jdecode('David+Flitner'),jdecode(''),'/5236/12375.html','true',[],''],
		['PAGE','36154',jdecode('Myrna+Harrison'),jdecode(''),'/5236/36154.html','true',[],''],
		['PAGE','10554',jdecode('Lynn+Langston'),jdecode(''),'/5236/10554.html','true',[],''],
		['PAGE','12633',jdecode('Sam+Litrenti'),jdecode(''),'/5236/12633.html','true',[],''],
		['PAGE','12396',jdecode('Ann+McLeod'),jdecode(''),'/5236/12396.html','true',[],''],
		['PAGE','10512',jdecode('Doug+Oliver'),jdecode(''),'/5236/10512.html','true',[],''],
		['PAGE','36175',jdecode('Denise+Pinkerton'),jdecode(''),'/5236/36175.html','true',[],''],
		['PAGE','36196',jdecode('Betty+Pyeatt'),jdecode(''),'/5236/36196.html','true',[],''],
		['PAGE','21912',jdecode('Roberta+Rogers'),jdecode(''),'/5236/21912.html','true',[],''],
		['PAGE','10575',jdecode('Susan+Rothermel'),jdecode(''),'/5236/10575.html','true',[],''],
		['PAGE','10533',jdecode('Sheila+Savannah'),jdecode(''),'/5236/10533.html','true',[],''],
		['PAGE','34912',jdecode('Joseph+Shaw'),jdecode(''),'/5236/34912.html','true',[],''],
		['PAGE','12675',jdecode('Diana+Simpson'),jdecode(''),'/5236/12675.html','true',[],''],
		['PAGE','12417',jdecode('Don+Vance'),jdecode(''),'/5236/12417.html','true',[],'']
	],''],
	['PAGE','5194',jdecode('Events'),jdecode(''),'/5194.html','true',[],''],
	['PAGE','5278',jdecode('Contact'),jdecode(''),'/5278.html','true',[],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='936251';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10450';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='936251';
var theTemplate={
				name: 			'Akropolis',
				paletteFamily: 	'936251',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10450',
				contentColor: 	'FFFFFF',
				contentBGColor: '936251',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'936251',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100130-121318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5278',
internalId:  '',
customField: '20100123-132103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20100130-122530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5173',
internalId:  '',
customField: '20100123-132006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5194',
internalId:  '',
customField: '20100220-165925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5236',
internalId:  '',
customField: '20100204-102645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10554',
internalId:  '',
customField: '20100130-130123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10575',
internalId:  '',
customField: '20091113-172310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12417',
internalId:  '',
customField: '20100205-155604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12312',
internalId:  '',
customField: '20100220-154337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10512',
internalId:  '',
customField: '20100203-093832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10533',
internalId:  '',
customField: '20100101-174950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12333',
internalId:  '',
customField: '20100131-154449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12354',
internalId:  '',
customField: '20091105-095216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12375',
internalId:  '',
customField: '20100220-154609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12633',
internalId:  '',
customField: '20100205-154635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12396',
internalId:  '',
customField: '20100205-091605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34912',
internalId:  '',
customField: '20100203-103526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12675',
internalId:  '',
customField: '20091217-114933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21912',
internalId:  '',
customField: '20091106-123644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36112',
internalId:  '',
customField: '20100205-094715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36133',
internalId:  '',
customField: '20100220-153750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36154',
internalId:  '',
customField: '20100206-162304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36175',
internalId:  '',
customField: '20100205-092236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36196',
internalId:  '',
customField: '20100205-091852'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLG0H';
var companyName   = 'Gold+Nugget+Art+Gallery';
var htmlTitle	  = '';
var metaKeywords  = '';
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();
};
