/* [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','22',jdecode('Home'),jdecode(''),'/22.html','true',[],'',''],
	['PAGE','387',jdecode('Bio'),jdecode(''),'/387.html','true',[],'',''],
	['PAGE','1618',jdecode('Gallery'),jdecode(''),'/1618/index.html','true',[ 
		['PAGE','22201',jdecode('Smith%26%23x27%3Bs+Bar+Sept.+2009'),jdecode(''),'/1618/22201.html','true',[],'',''],
		['PAGE','22301',jdecode('J.O.D.+And+Innes+Sibun+%40+Mirell%26%23x27%3Bs'),jdecode(''),'/1618/22301.html','true',[],'','']
	],'',''],
	['PAGE','6015',jdecode('Music'),jdecode(''),'/6015.html','true',[],'',''],
	['PAGE','6071',jdecode('News'),jdecode(''),'/6071.html','true',[],'',''],
	['PAGE','405',jdecode('Upcoming+Shows'),jdecode(''),'/405.html','true',[],'',''],
	['PAGE','396',jdecode('Contact'),jdecode(''),'/396.html','true',[],'',''],
	['PAGE','1730',jdecode('Friends+Links'),jdecode(''),'/1730.html','true',[],'',''],
	['PAGE','5903',jdecode('Guestbook'),jdecode(''),'/5903/index.html','true',[ 
		['PAGE','5902',jdecode('Read+Guestbook'),jdecode(''),'/5903/5902.html','false',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Easy';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='49';
theSitetree.graphicsetId='51';
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: 			'Easy',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'49',
				graphicsetId: 	'51',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				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:  '405',
internalId:  '',
customField: '20100701-161619'
};
webappMappings['1002']=webappMappings['1002-5903AHW050INX3R6']={
webappId:    '1002',
documentId:  '5903',
internalId:  '5903AHW050INX3R6',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-0d6dac2197f250e82b77c7eb53bec81c']={
webappId:    '7060',
documentId:  '1618',
internalId:  '0d6dac2197f250e82b77c7eb53bec81c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20090928-215422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22',
internalId:  '',
customField: '20100630-221050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '387',
internalId:  '',
customField: '20090112-213704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1618',
internalId:  '',
customField: '20080313-011141'
};
webappMappings['7060']=webappMappings['7060-57d7f8c09ba63dc0aa17423998eb20c4']={
webappId:    '7060',
documentId:  '22301',
internalId:  '57d7f8c09ba63dc0aa17423998eb20c4',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6015',
internalId:  '',
customField: '20080203-150701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6071',
internalId:  '',
customField: '20090928-210406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '396',
internalId:  '',
customField: '20071127-022830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1730',
internalId:  '',
customField: '20090928-210217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5903',
internalId:  '',
customField: '20071127-023211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5902',
internalId:  '',
customField: '20071127-023211'
};
webappMappings['7060']=webappMappings['7060-6737200fffd4b16b7d38cc6e3b979995']={
webappId:    '7060',
documentId:  '22201',
internalId:  '6737200fffd4b16b7d38cc6e3b979995',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20090928-215313'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '22',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3R6';
var companyName   = 'Jacks+O%27+Diamonds';
var htmlTitle	  = '';
var metaKeywords  = 'Jacks+O+Diamonds%2C+Josh+Allen%2C++Jim+Leach%2C+Blues+Music%2C+Blues+Rock%2C+Rock+New+York+Blues+Bands%2C++Long+Island+Music%2C+New+York+Music';
var metaContents  = 'Jacks+O+Diamonds%2C+Josh+Allen%2C++Jim+Leach%2C+New+York+Blues+Rock+Band';
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();
};
