/* [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','22',jdecode('Home'),jdecode(''),'/22.html','true',[],''],
	['PAGE','39523',jdecode('Facebook'),jdecode(''),'/39523.html','true',[],''],
	['PAGE','3528',jdecode('Jesse%26%23x27%3Bs+Photos'),jdecode(''),'/3528.html','true',[],''],
	['PAGE','11316',jdecode('News'),jdecode(''),'/11316.html','true',[],''],
	['PAGE','2488',jdecode('Tour+Dates'),jdecode(''),'/2488.html','true',[],''],
	['PAGE','2368',jdecode('Videos'),jdecode(''),'/2368.html','true',[],''],
	['PAGE','12680',jdecode('Audio'),jdecode(''),'/12680.html','true',[],''],
	['PAGE','15929',jdecode('Guestbook'),jdecode(''),'/15929/index.html','true',[ 
		['PAGE','15928',jdecode('Read+Guestbook'),jdecode(''),'/15929/15928.html','false',[],'']
	],''],
	['PAGE','2359',jdecode('Press+Releases%2FReviews+++++++++++++++++++++'),jdecode(''),'/2359.html','true',[],''],
	['PAGE','2289',jdecode('Contact'),jdecode(''),'/2289.html','true',[],''],
	['PAGE','1255',jdecode('Interesting+links'),jdecode(''),'/1255.html','true',[],''],
	['PAGE','3747',jdecode('Band+Members'),jdecode(''),'/3747.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10562',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '22',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15929',
internalId:  '',
customField: '20080621-114457'
};
webappMappings['7060']=webappMappings['7060-86a36c90ee1ea99db5b47dcabebdc7b4']={
webappId:    '7060',
documentId:  '3528',
internalId:  '86a36c90ee1ea99db5b47dcabebdc7b4',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-110062']={
webappId:    '1501',
documentId:  '22',
internalId:  '110062',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22',
internalId:  '',
customField: '20100210-223030'
};
webappMappings['1002']=webappMappings['1002-15929ahw050inx2uo']={
webappId:    '1002',
documentId:  '15929',
internalId:  '15929ahw050inx2uo',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3528',
internalId:  '',
customField: '20090709-163206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2368',
internalId:  '',
customField: '20100126-215940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12680',
internalId:  '',
customField: '20100120-221639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15928',
internalId:  '',
customField: '20080621-114457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2359',
internalId:  '',
customField: '20090731-214056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2488',
internalId:  '',
customField: '20100226-145842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11316',
internalId:  '',
customField: '20100226-145641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2289',
internalId:  '',
customField: '20091123-135000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1255',
internalId:  '',
customField: '20100120-215642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3747',
internalId:  '',
customField: '20091123-134812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39523',
internalId:  '',
customField: '20100120-220456'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2UO';
var companyName   = 'JESSE+KINCH';
var htmlTitle	  = '';
var metaKeywords  = 'Jesse+Kinch+music+rock+guitarist+performer+NYC+indie+band+peace+bullet';
var metaContents  = '+rock+guitarist+Jesse+Kinch+peace+bullet+musician';
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();
};
