/* [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.html','true',[],'',''],
	['PAGE','557',jdecode('Opening+hours'),jdecode(''),'/557.html','true',[],'',''],
	['PAGE','494',jdecode('Contact+%26+News'),jdecode(''),'/494.html','true',[],'',''],
	['PAGE','23501',jdecode('Map%2C+address+and+directions'),jdecode(''),'/23501.html','true',[],'',''],
	['PAGE','6701',jdecode('Photographers%3A'),jdecode(''),'/6701.html','true',[],'',''],
	['PAGE','6764',jdecode('Jack+Baber'),jdecode(''),'/6764/index.html','true',[ 
		['PAGE','58101',jdecode('Exhibitions'),jdecode(''),'/6764/58101.html','true',[],'','']
	],'',''],
	['PAGE','85327',jdecode('Chuck+Behrman'),jdecode(''),'/85327.html','true',[],'',''],
	['PAGE','84680',jdecode('Nixson+Borah'),jdecode(''),'/84680.html','true',[],'',''],
	['PAGE','84689',jdecode('Don+Eaton'),jdecode(''),'/84689.html','true',[],'',''],
	['PAGE','84698',jdecode('Dale+Reid+Ginder'),jdecode(''),'/84698.html','true',[],'',''],
	['PAGE','85782',jdecode('Alison+Watt+Jackson'),jdecode(''),'/85782/index.html','true',[ 
		['PAGE','85804',jdecode('Exhibitions+%26+Awards'),jdecode(''),'/85782/85804.html','true',[],'','']
	],'',''],
	['PAGE','84707',jdecode('Don+Krehbiel'),jdecode(''),'/84707.html','true',[],'',''],
	['PAGE','6827',jdecode('Howard+Steinberg'),jdecode(''),'/6827/index.html','true',[ 
		['PAGE','56401',jdecode('Biography'),jdecode(''),'/6827/56401.html','true',[],'',''],
		['PAGE','56422',jdecode('Resume'),jdecode(''),'/6827/56422.html','true',[],'',''],
		['PAGE','56443',jdecode('Artist%26%23x27%3Bs+Statement'),jdecode(''),'/6827/56443.html','true',[],'','']
	],'',''],
	['PAGE','6785',jdecode('A.+J.+Vincolisi'),jdecode(''),'/6785.html','true',[],'',''],
	['PAGE','6806',jdecode('Charlotte+Whitaker'),jdecode(''),'/6806.html','true',[],'',''],
	['PAGE','25201',jdecode('Photographers+Galleries'),jdecode(''),'/25201.html','true',[],'',''],
	['PAGE','85052',jdecode('Workshops'),jdecode(''),'/85052.html','true',[],'',''],
	['PAGE','78901',jdecode('Bookstore'),jdecode(''),'/78901.html','true',[],'',''],
	['PAGE','71706',jdecode('Guestbook'),jdecode(''),'/71706/index.html','true',[ 
		['PAGE','71701',jdecode('Read+Guestbook'),jdecode(''),'/71706/71701.html','false',[],'','']
	],'',''],
	['PAGE','76501',jdecode('Favorite+Links'),jdecode(''),'/76501.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Capri';
theSitetree.paletteFamily='737272';
theSitetree.keyvisualId='7245';
theSitetree.keyvisualName='kv_7245.jpg';
theSitetree.fontsetId='16409';
theSitetree.graphicsetId='12138';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Capri',
				paletteFamily: 	'737272',
				keyvisualId: 	'7245',
				keyvisualName: 	'kv_7245.jpg',
				fontsetId: 		'16409',
				graphicsetId: 	'12138',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-71706AHW050INE4L7']={
webappId:    '1002',
documentId:  '71706',
internalId:  '71706AHW050INE4L7',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '23501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100117-185748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20100131-233321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100525-125145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6764',
internalId:  '',
customField: '20070514-193835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58101',
internalId:  '',
customField: '20070712-203349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84680',
internalId:  '',
customField: '20091115-121515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84689',
internalId:  '',
customField: '20091103-233844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84698',
internalId:  '',
customField: '20081228-192247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84707',
internalId:  '',
customField: '20090108-140553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85327',
internalId:  '',
customField: '20091103-233938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6827',
internalId:  '',
customField: '20091115-121827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56401',
internalId:  '',
customField: '20081005-200452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56422',
internalId:  '',
customField: '20070307-233600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56443',
internalId:  '',
customField: '20070414-224649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6785',
internalId:  '',
customField: '20091115-122806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6806',
internalId:  '',
customField: '20100423-001048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20100525-125228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78901',
internalId:  '',
customField: '20100520-205525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20090705-194523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100515-171529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71706',
internalId:  '',
customField: '20070812-202625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71701',
internalId:  '',
customField: '20070401-153918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76501',
internalId:  '',
customField: '20100520-205616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85052',
internalId:  '',
customField: '20100520-205418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85782',
internalId:  '',
customField: '20100423-001134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85804',
internalId:  '',
customField: '20100423-000441'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INE4L7';
var companyName   = 'B-W+Gallery+';
var htmlTitle	  = 'B-W+Gallery';
var metaKeywords  = 'photography%2C+photographic%2C+gallery%2C+black+and+white%2C+photo';
var metaContents  = 'Doug+Howard%2C+Jack+Baber%2C+Don+Eaton%2C+Kabe+Russell%2C+Nixson+Borah%2C+Dale+Reid+Ginder%2C++Howard+Steinberg%2C+Charlotte+Whitaker%2C+A.+J.+Vincolisi%2C+Chuck+Behrman';
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();
};
