/* [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','6701',jdecode('Home'),jdecode(''),'/6701.html','true',[],''],
	['PAGE','6752',jdecode('About+us'),jdecode(''),'/6752.html','true',[],''],
	['PAGE','19401',jdecode('Schedule'),jdecode(''),'/19401.html','true',[],''],
	['PAGE','6836',jdecode('Photographs'),jdecode(''),'/6836.html','true',[],''],
	['PAGE','33101',jdecode('Press+Page'),jdecode(''),'/33101.html','true',[],''],
	['PAGE','19422',jdecode('Music'),jdecode(''),'/19422.html','true',[],''],
	['PAGE','6857',jdecode('Links'),jdecode(''),'/6857.html','true',[],''],
	['PAGE','28801',jdecode('Guestbook'),jdecode(''),'/28801.html','true',[],''],
	['PAGE','29301',jdecode('Contact+Us+'),jdecode(''),'/29301.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='365';
theSitetree.graphicsetId='415';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='93A6CC';
var theTemplate={
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'365',
				graphicsetId: 	'415',
				contentColor: 	'A00000',
				contentBGColor: '93A6CC',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20081029-230804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6752',
internalId:  '',
customField: '20081030-014050'
};
webappMappings['1002']=webappMappings['1002-28801aendu0ine7gf']={
webappId:    '1002',
documentId:  '28801',
internalId:  '28801aendu0ine7gf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20090106-163742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6836',
internalId:  '',
customField: '20081029-040308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6857',
internalId:  '',
customField: '20081031-214115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19422',
internalId:  '',
customField: '20081222-200256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33101',
internalId:  '',
customField: '20081129-214117'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20081030-211436'
};
webappMappings['7008']=webappMappings['7008-10099']={
webappId:    '7008',
documentId:  '29301',
internalId:  '10099',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20081030-003031'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INE7GF';
var companyName   = 'The+Hagar%27s+Mountain+Boys';
var htmlTitle	  = 'The+Hagar%27s+Mountain+Boys';
var metaKeywords  = 'Ricky+Stroud%2C+Cliff+Waddell%2C+Cliff+Smith%2C+Blake+Johnson%2C+Hagars+Boys%2C+Hagars+Boys%2C+Hagars+Mountain+Boys%2C+Hagar+Mountain+Boys%2C+The+Hagars+Mountain+Boys';
var metaContents  = 'We+have+recorded+two+CD%E2%80%99s%3A+%E2%80%98In+the+Hills+of+Caroline%E2%80%99+and+%E2%80%98A+Better+Way.%E2%80%99+These+two+CD%E2%80%99s+are+available+on+www.cdbaby.com.++The+title+track%2C+%E2%80%98A+Better+Way%E2%80%99+was+released+on+Primecuts+of+Bluegrass%2C+Vol.+94.++Deejays+across+the+country+have+been+playing+the+song+%E2%80%98A+Better+Way%E2%80%99+along+with+other+tracks+from+the+CD.++Our+hard-driving+style+of+bluegrass%2C+our+bluesy+style+ballads+and+our+tight+harmony+gospel+singing+make+The+Hagar%E2%80%99s+Mountain+Boys+a+crowd+pleaser.';
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();
};
