/* [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','41001',jdecode('HIP+Home'),jdecode(''),'/41001.html','true',[],''],
	['PAGE','1801',jdecode('Welcome+Message+%28A+Call+to+Artists%29'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','1852',jdecode('Selected+Writings'),jdecode(''),'/1852/index.html','true',[ 
		['PAGE','1894',jdecode('Articles'),jdecode(''),'/1852/1894.html','false',[],''],
		['PAGE','70401',jdecode('Book+Reviews'),jdecode(''),'/1852/70401.html','true',[],''],
		['PAGE','1915',jdecode('Poetry'),jdecode(''),'/1852/1915.html','true',[],''],
		['PAGE','1873',jdecode('Scripts'),jdecode(''),'/1852/1873.html','true',[],''],
		['PAGE','6501',jdecode('Clustermiscellany'),jdecode(''),'/1852/6501.html','false',[],'']
	],''],
	['PAGE','9322',jdecode('Pictorial%2C+Graphic+and+Sculptural+Works'),jdecode(''),'/9322/index.html','true',[ 
		['PAGE','4801',jdecode('Paintings+by+Kelly+Marie'),jdecode(''),'/9322/4801.html','true',[],'']
	],''],
	['PAGE','9343',jdecode('Videos'),jdecode(''),'/9343/index.html','true',[ 
		['PAGE','41101',jdecode('Master+of+Bink'),jdecode(''),'/9343/41101.html','false',[],'']
	],''],
	['PAGE','41122',jdecode('Music'),jdecode(''),'/41122.html','false',[],''],
	['PAGE','9601',jdecode('Greatest+Bands+%281954+to+present%29'),jdecode(''),'/9601/index.html','true',[ 
		['PAGE','10722',jdecode('Indispensable+Musical+Visionaries+%28%231-10%29'),jdecode(''),'/9601/10722.html','true',[],''],
		['PAGE','10743',jdecode('Rounding+Out+the+First+String+%28%2311-30%29'),jdecode(''),'/9601/10743.html','true',[],''],
		['PAGE','43901',jdecode('A+Deep+and+Heavy+Hitting+Bench+%28%2331+et+seq.%29'),jdecode(''),'/9601/43901.html','true',[],'']
	],''],
	['PAGE','10701',jdecode('Thus+Spake+Bunn+Bunn'),jdecode(''),'/10701.html','false',[],''],
	['PAGE','46301',jdecode('Ask+Bunn+Bunn'),jdecode(''),'/46301.html','false',[],''],
	['PAGE','48601',jdecode('Bunnroll+%282009+archive%29'),jdecode(''),'/48601.html','true',[],''],
	['PAGE','9301',jdecode('Smartmonkey+Free+Zone+%28SFZ%29'),jdecode(''),'/9301.html','true',[],''],
	['PAGE','1936',jdecode('Electronic+Places'),jdecode(''),'/1936.html','false',[],''],
	['PAGE','2041',jdecode('Who+am+I%3F'),jdecode(''),'/2041.html','false',[],''],
	['PAGE','2062',jdecode('Contact'),jdecode(''),'/2062.html','true',[],''],
	['PAGE','60501',jdecode('For+Badgeholders+Only'),jdecode(''),'/60501.html','false',[],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Mazy';
theSitetree.paletteFamily='96958D';
theSitetree.keyvisualId='11099';
theSitetree.keyvisualName='kv_11099.jpg';
theSitetree.fontsetId='31988';
theSitetree.graphicsetId='13823';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Mazy',
				paletteFamily: 	'96958D',
				keyvisualId: 	'11099',
				keyvisualName: 	'kv_11099.jpg',
				fontsetId: 		'31988',
				graphicsetId: 	'13823',
				contentColor: 	'3C3D3C',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41101',
internalId:  '',
customField: '20081012-163307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20090115-150849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20090908-151113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20090404-182510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20080818-205718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20090115-155227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20090111-193542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20090404-200300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41001',
internalId:  '',
customField: '20090908-152129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20090421-025552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60501',
internalId:  '',
customField: '20090404-202650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2041',
internalId:  '',
customField: '20080818-222433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2062',
internalId:  '',
customField: '20090404-172909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20090115-154813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20090115-154655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20080823-180733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20090115-154234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20090119-161942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20090509-043002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70401',
internalId:  '',
customField: '20090908-150431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41122',
internalId:  '',
customField: '20081012-163307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10743',
internalId:  '',
customField: '20090115-154110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46301',
internalId:  '',
customField: '20081221-193729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43901',
internalId:  '',
customField: '20090115-154150'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '41001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20090124-172425'
};
webappMappings['7060']=webappMappings['7060-66b3d2af8e1729139295c59b32854810']={
webappId:    '7060',
documentId:  '60501',
internalId:  '66b3d2af8e1729139295c59b32854810',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INE9AI';
var companyName   = 'holmes-i-presume';
var htmlTitle	  = 'holmes-i-presume';
var metaKeywords  = 'holmes+bunn+bunnroll+artists+writers+painters+poets+musicians+electronic+publishing+service+list+greatest+bands+book+review+black+swan';
var metaContents  = 'holmes-i-presume';
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();
};
