/* [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','401',jdecode('Home'),jdecode(''),'/401/index.html','true',[ 
		['PAGE','452',jdecode('Current+Show'),jdecode(''),'/401/452.html','true',[],'',''],
		['PAGE','473',jdecode('Schedule+of+Events'),jdecode(''),'/401/473.html','true',[],'','']
	],'',''],
	['PAGE','515',jdecode('Sales+Gallery'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','84712',jdecode('Gallery+Artists'),jdecode(''),'/84712.html','true',[],'',''],
	['PAGE','494',jdecode('Classes'),jdecode(''),'/494/index.html','true',[ 
		['PAGE','53312',jdecode('2010+Art+Camp+Classes'),jdecode(''),'/494/53312.html','true',[],'',''],
		['PAGE','81112',jdecode('2010+Supply+Lists'),jdecode(''),'/494/81112.html','true',[],'','']
	],'',''],
	['PAGE','44601',jdecode('Annual+Art+Auctions'),jdecode(''),'/44601/index.html','true',[ 
		['PAGE','29401',jdecode('50th+Annual+Art+Auction'),jdecode(''),'/44601/29401.html','true',[],'',''],
		['PAGE','75312',jdecode('51st+Annual+Art+Auction'),jdecode(''),'/44601/75312.html','true',[],'',''],
		['PAGE','120322',jdecode('52nd+Annual+Art+Auction'),jdecode(''),'/44601/120322.html','true',[],'','']
	],'',''],
	['PAGE','38801',jdecode('Art+Submissions'),jdecode(''),'/38801/index.html','true',[ 
		['PAGE','39401',jdecode('Sales+Gallery+'),jdecode(''),'/38801/39401.html','true',[],'',''],
		['PAGE','39422',jdecode('Group%2FJuried+Show'),jdecode(''),'/38801/39422.html','true',[],'','']
	],'',''],
	['PAGE','578',jdecode('About+us'),jdecode(''),'/578/index.html','true',[ 
		['PAGE','10201',jdecode('Board+of+Directors'),jdecode(''),'/578/10201.html','true',[],'',''],
		['PAGE','10222',jdecode('Current+Members'),jdecode(''),'/578/10222.html','true',[],'',''],
		['PAGE','46412',jdecode('How+to+Help'),jdecode(''),'/578/46412.html','true',[],'','']
	],'',''],
	['PAGE','85512',jdecode('Contact'),jdecode(''),'/85512/index.html','true',[ 
		['PAGE','85712',jdecode('Finding+Us'),jdecode(''),'/85512/85712.html','true',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='290';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'290',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100226-122648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120322',
internalId:  '',
customField: '20100226-130549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100226-132630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100206-002059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81112',
internalId:  '',
customField: '20091207-132547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100205-233228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53312',
internalId:  '',
customField: '20100226-123044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44601',
internalId:  '',
customField: '20100226-130729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20090714-223541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75312',
internalId:  '',
customField: '20100226-125556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20090714-223834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38801',
internalId:  '',
customField: '20090715-002644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20090715-002814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39422',
internalId:  '',
customField: '20090714-231445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20090714-231714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20100226-123710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10222',
internalId:  '',
customField: '20100226-124415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46412',
internalId:  '',
customField: '20090714-235212'
};
webappMappings['7008']=webappMappings['7008-438']={
webappId:    '7008',
documentId:  '85512',
internalId:  '438',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85512',
internalId:  '',
customField: '20090714-235442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85712',
internalId:  '',
customField: '20090715-000128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84712',
internalId:  '',
customField: '20100226-122946'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INEUG0';
var companyName   = '';
var htmlTitle	  = 'The+Dalles+Art+Center';
var metaKeywords  = 'The+Dalles%2C+Columbia+Gorge%2C+Mid-Columbia%2C+Art%2C+Crafts%2C+Gallery%2C+Exhibition%2C+History%2C+Gift+Shop%2C+the+Gorge%2C+Art+Center%2C+Art+Show%2C+Art+Auction%2C+Art+Classes';
var metaContents  = 'Gallery';
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();
};
