/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','2136',jdecode('Contact+Us+%26+Directions'),jdecode(''),'/2136/index.html','true',[ 
		['PAGE','4601',jdecode('Maps+%26+Directions'),jdecode(''),'/2136/4601.html','true',[],'']
	],''],
	['PAGE','2801',jdecode('Service+Request+and+Notices'),jdecode(''),'/2801.html','true',[],''],
	['PAGE','2115',jdecode('Staff+and+Service+Dept.'),jdecode(''),'/2115.html','true',[],''],
	['PAGE','2157',jdecode('Services+%26+Fees'),jdecode(''),'/2157.html','true',[],''],
	['PAGE','2052',jdecode('Policies'),jdecode(''),'/2052.html','true',[],''],
	['PAGE','7301',jdecode('Gear+Jammin%26%23x27%3B+Music'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','8801',jdecode('Bargain%28s%29+%26+Consignments'),jdecode(''),'/8801.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Multimedia';
theSitetree.paletteFamily='98B4CA';
theSitetree.keyvisualId='11113';
theSitetree.keyvisualName='kv_11113.jpg';
theSitetree.fontsetId='32003';
theSitetree.graphicsetId='13832';
theSitetree.contentColor='262E36';
theSitetree.contentBGColor='98B4CA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Multimedia',
				paletteFamily: 	'98B4CA',
				keyvisualId: 	'11113',
				keyvisualName: 	'kv_11113.jpg',
				fontsetId: 		'32003',
				graphicsetId: 	'13832',
				contentColor: 	'262E36',
				contentBGColor: '98B4CA',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100306-113000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8801',
internalId:  '',
customField: '20081204-121428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20091118-180826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20091118-185110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2115',
internalId:  '',
customField: '20091118-184025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20081126-001215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2157',
internalId:  '',
customField: '20091118-180345'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-13504857']={
webappId:    '1501',
documentId:  '2001',
internalId:  '13504857',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-10587']={
webappId:    '7008',
documentId:  '2801',
internalId:  '10587',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20091118-182227'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '4601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20091118-183754'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEYPH';
var companyName   = 'AVALANCHE+PROAUDIO+SERVICES';
var htmlTitle	  = '';
var metaKeywords  = 'warranty+service+on+Keyboard+workstation%2C+microphone%2C+wireless+microphone%2C+guitar+amplifier%2C+Bass+amplifier%2C+floor+boards%2C+foot+pedals%2C+loud+speakers.+AMPEG%2C+BEHRINGER%2C+Bugera%2C+Crate%2C+Crest%2C+CROWN%2C+David+Eden%2C+DBX%2C+Epiphone+Guitars%2C+FENDER%2C+Gallien-Kreuger%2C+Genz+Benz%2C+GIBSON%2C+Harbinger%2C+Hartke%2C+Hughes++Kettner%2C+JBL%2C+KaySound%2C+KORG%2C+Kurzweil%2C+KUSTOM%2C+KRK+Systems%2C+LANEY%2C+LINE6%2C+MACKIE%2C+Marshall%2C+Parker+Guitars%2C+PEAVEY%2C+Phonic%2C+PolyTone%2C+QSC%2C+Randall%2C+ROLAND%2C+Samson%2C+SoundCraft%2C+SoundTech%2C+SUNN%2C+Stanton%2C+SWR%2CTube+Works%2CTrace+Elliot%2C+Vestax%2C+VOCOPRO%2C+VOX%2C+Washburn+Guitars%2C+Yamaha%2C+ZOOM';
var metaContents  = 'Repair+guitar+amplifiers%2C+keyboards%2C+midi%2C+mixers%2C+DJ+systems%2C+wireless+microphones%2C+loud+speakers.+Service+guitar+amplifiers%2C+keyboards%2C+midi%2C+mixers%2C+DJ+systems%2C+wireless+microphones%2C+loud+speakers.';
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();
};
