/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','53',jdecode('Products'),jdecode(''),'/53/index.html','true',[ 
		['PAGE','62',jdecode('Guitars'),jdecode(''),'/53/62.html','true',[],''],
		['PAGE','71',jdecode('Amplifiers'),jdecode(''),'/53/71.html','true',[],''],
		['PAGE','80',jdecode('Effect+Pedals'),jdecode(''),'/53/80.html','true',[],''],
		['PAGE','1117',jdecode('Percussion'),jdecode(''),'/53/1117.html','true',[],''],
		['PAGE','1126',jdecode('Accessories'),jdecode(''),'/53/1126.html','true',[],'']
	],''],
	['PAGE','14015',jdecode('Blue+Bus+Online+Store'),jdecode(''),'/14015.html','true',[],''],
	['PAGE','1328',jdecode('Recording+Service'),jdecode(''),'/1328.html','true',[],''],
	['PAGE','8801',jdecode('Guitar+Lessons'),jdecode(''),'/8801.html','true',[],''],
	['PAGE','10201',jdecode('Setups+%26+Repairs'),jdecode(''),'/10201.html','true',[],''],
	['PAGE','116',jdecode('News%2FEvents'),jdecode(''),'/116.html','true',[],''],
	['PAGE','5801',jdecode('Photos'),jdecode(''),'/5801.html','true',[],''],
	['PAGE','1404',jdecode('Directions'),jdecode(''),'/1404.html','true',[],''],
	['PAGE','16515',jdecode('Music+Links'),jdecode(''),'/16515.html','true',[],''],
	['PAGE','89',jdecode('Contact'),jdecode(''),'/89.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='8CBBD8';
theSitetree.keyvisualId='2055';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='348';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='8CBBD8';
var theTemplate={
				name: 			'Architekt',
				paletteFamily: 	'8CBBD8',
				keyvisualId: 	'2055',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'280',
				graphicsetId: 	'348',
				contentColor: 	'000000',
				contentBGColor: '8CBBD8',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'8CBBD8',
				b_color: 		'338299',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-164861']={
webappId:    '1501',
documentId:  '32',
internalId:  '164861',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1404',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-ef1c4982deba40b593822a731d151854']={
webappId:    '7060',
documentId:  '5801',
internalId:  'ef1c4982deba40b593822a731d151854',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20100301-220728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20080527-202323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20100111-215526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20090504-100728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20090121-134107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1117',
internalId:  '',
customField: '20080823-112903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1126',
internalId:  '',
customField: '20100111-215633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1328',
internalId:  '',
customField: '20100111-215815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116',
internalId:  '',
customField: '20100301-160622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20081113-164915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1404',
internalId:  '',
customField: '20080527-203123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20080527-180649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20081113-164753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20090319-174500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14015',
internalId:  '',
customField: '20090527-181939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16515',
internalId:  '',
customField: '20100301-221742'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INXEFJ';
var companyName   = 'Blue+Bus+Music';
var htmlTitle	  = 'Blue+Bus+Music';
var metaKeywords  = 'Blue+Bus+Music%2C+guitars%2C+amplifiers%2C+recording%2C+katonah%2C+new+york%2C+percussion%2C+strings%2C+music+books%2C+fake+books%2C+photographs%2C+straps%2C+cords%2C+cables%2C+gadow%2C+hamer%2C+godin%2C+vail%2C+pigtronix%2C+creation+audio+labs%2C+capo%2C+boss%2C+roland%2C+GL%2C+fifth+avenue%2C+peerless%2C+larrivee';
var metaContents  = 'blue+bus+music%2C+katonah%2C+new+york%2C+recording%2C+guitar%2C+amplifier%2C+music+books%2C+fake+books%2C+photographs%2C+straps%2C+cords%2C+cables%2C+gadow%2C+hamer%2C+godin%2C+vail%2C+pigtronix%2C+creation+audio+labs%2C+boss%2C+roland%2C+GL%2C+fifth+avenue%2C+peerless%2C+larrivee';
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();
};
