/* [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','116',jdecode('Home'),jdecode(''), jdecode('%2F116.html'), 'true',[],'',''],
	['PAGE','12901',jdecode('My+Bands'),jdecode(''), jdecode('%2F12901%2Findex.html'), 'true',[ 
		['PAGE','12922',jdecode('Solo'),jdecode(''), jdecode('%2F12901%2F12922.html'), 'true',[],'',''],
		['PAGE','14301',jdecode('Thick+and+Thin'),jdecode(''), jdecode('%2F12901%2F14301.html'), 'true',[],'',''],
		['PAGE','19901',jdecode('Eclectic+Acoustic'),jdecode(''), jdecode('%2F12901%2F19901.html'), 'true',[],'',''],
		['PAGE','19922',jdecode('Various+Jam+Bands'),jdecode(''), jdecode('%2F12901%2F19922.html'), 'true',[],'',''],
		['PAGE','14322',jdecode('The+Rock+Brothers'),jdecode(''), jdecode('%2F12901%2F14322.html'), 'true',[],'','']
	],'',''],
	['PAGE','13027',jdecode('My+Music'),jdecode(''), jdecode('%2F13027%2Findex.html'), 'true',[ 
		['PAGE','13048',jdecode('Audio'),jdecode(''), jdecode('%2F13027%2F13048.html'), 'true',[],'',''],
		['PAGE','13069',jdecode('Video'),jdecode(''), jdecode('%2F13027%2F13069.html'), 'true',[],'',''],
		['PAGE','14343',jdecode('Lyrics'),jdecode(''), jdecode('%2F13027%2F14343.html'), 'true',[],'','']
	],'',''],
	['PAGE','12964',jdecode('Music+News'),jdecode(''), jdecode('%2F12964%2Findex.html'), 'true',[ 
		['PAGE','12985',jdecode('Scheduled+Events'),jdecode(''), jdecode('%2F12964%2F12985.html'), 'true',[],'','']
	],'',''],
	['PAGE','13153',jdecode('Photographs'),jdecode(''), jdecode('%2F13153.html'), 'true',[],'',''],
	['PAGE','200',jdecode('Contact'),jdecode(''), jdecode('%2F200%2Findex.html'), 'true',[ 
		['PAGE','21801',jdecode('Guest+Book'),jdecode(''), jdecode('%2F200%2F21801.html'), 'true',[],'','']
	],'',''],
	['PAGE','182',jdecode('Links'),jdecode(''), jdecode('%2F182.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Beach';
theSitetree.paletteFamily='E7D794';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10469';
theSitetree.graphicsetId='10926';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E7C794';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Beach',
				paletteFamily: 	'E7D794',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10469',
				graphicsetId: 	'10926',
				contentColor: 	'000000',
				contentBGColor: 'E7C794',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF503F',
				e_color: 		'FF503F',
				f_color: 		'FF503F',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '116',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19922',
internalId:  '',
customField: '20120129-112128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20120129-102259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20120129-102413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20120129-103213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20120129-110350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12964',
internalId:  '',
customField: '20090517-155624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12985',
internalId:  '',
customField: '20090924-192214'
};
webappMappings['7060']=webappMappings['7060-af8e252a5e4e6558887fc10120a39174']={
webappId:    '7060',
documentId:  '14343',
internalId:  'af8e252a5e4e6558887fc10120a39174',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13027',
internalId:  '',
customField: '20120129-112520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13048',
internalId:  '',
customField: '20090517-155624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13069',
internalId:  '',
customField: '20090517-155624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14343',
internalId:  '',
customField: '20090517-163538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20120129-110714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14322',
internalId:  '',
customField: '20120129-112322'
};
webappMappings['7060']=webappMappings['7060-ce301d0d0f3519692b04137e377b60ae']={
webappId:    '7060',
documentId:  '13048',
internalId:  'ce301d0d0f3519692b04137e377b60ae',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-e37b06b8ec74adb4e4f4be556e73cb08']={
webappId:    '7060',
documentId:  '13069',
internalId:  'e37b06b8ec74adb4e4f4be556e73cb08',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13153',
internalId:  '',
customField: '20090517-155624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '200',
internalId:  '',
customField: '20090924-192230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182',
internalId:  '',
customField: '20090924-192418'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC24G']={
webappId:    '5003',
documentId:  '116',
internalId:  'tid:1;pid:WSCSYSSSSLYTC24G',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-21801ahw050in3ujo']={
webappId:    '1002',
documentId:  '21801',
internalId:  '21801ahw050in3ujo',
customField: 'icq=false'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3UJO';
var companyName   = 'Chuck+Finch+Music+';
var htmlTitle	  = 'Chuck+Finch+Music';
var metaKeywords  = 'Chuck+Finch+Music+Band+Gig+CD+Download+Guitar+Acoustic+Poetry+Ukulele+Ukelele+Lead+Rhythm+Singer+Songwriter+';
var metaContents  = 'Chuck+Finch+is+an+singer-songwriter+and+poet+from+East+Quogue%2C+NY+on+Long+Island.+Acoustic+music+with+big+heart.';
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();
};

