/* [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','44',jdecode('Home'),jdecode(''),'/44.html','true',[],'',''],
	['PAGE','83',jdecode('Electric+Guitars'),jdecode(''),'/83.html','true',[],'',''],
	['PAGE','27201',jdecode('Acoustic+Guitars'),jdecode(''),'/27201.html','true',[],'',''],
	['PAGE','1168',jdecode('Amplifiers'),jdecode(''),'/1168.html','true',[],'',''],
	['PAGE','11001',jdecode('Other+Fretted+Instruments'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','1328',jdecode('Drums'),jdecode(''),'/1328.html','true',[],'',''],
	['PAGE','21101',jdecode('Software'),jdecode(''),'/21101.html','true',[],'',''],
	['PAGE','1355',jdecode('Band+Instruments'),jdecode(''),'/1355/index.html','true',[ 
		['PAGE','1364',jdecode('Clarinets'),jdecode(''),'/1355/1364.html','true',[],'',''],
		['PAGE','1373',jdecode('Trumpets'),jdecode(''),'/1355/1373.html','true',[],'',''],
		['PAGE','1382',jdecode('Flutes'),jdecode(''),'/1355/1382.html','true',[],'',''],
		['PAGE','1391',jdecode('Violins'),jdecode(''),'/1355/1391.html','true',[],'','']
	],'',''],
	['PAGE','1177',jdecode('Accessories'),jdecode(''),'/1177/index.html','true',[ 
		['PAGE','1400',jdecode('Strings'),jdecode(''),'/1177/1400.html','true',[],'',''],
		['PAGE','1409',jdecode('Guitar'),jdecode(''),'/1177/1409.html','true',[],'',''],
		['PAGE','1418',jdecode('Drum'),jdecode(''),'/1177/1418.html','true',[],'','']
	],'',''],
	['PAGE','65',jdecode('About+us'),jdecode(''),'/65/index.html','true',[ 
		['PAGE','74',jdecode('How+to+find+us'),jdecode(''),'/65/74.html','true',[],'','']
	],'',''],
	['PAGE','110',jdecode('Service'),jdecode(''),'/110.html','true',[],'',''],
	['PAGE','119',jdecode('Contact'),jdecode(''),'/119/index.html','true',[ 
		['PAGE','1150',jdecode('Adresses'),jdecode(''),'/119/1150.html','true',[],'',''],
		['PAGE','1159',jdecode('How+to+find+us'),jdecode(''),'/119/1159.html','true',[],'','']
	],'',''],
	['PAGE','1204',jdecode('Offers'),jdecode(''),'/1204.html','true',[],'',''],
	['PAGE','1222',jdecode('Tips+%26+Tricks'),jdecode(''),'/1222.html','true',[],'',''],
	['PAGE','1231',jdecode('Special+events'),jdecode(''),'/1231.html','true',[],'',''],
	['PAGE','1249',jdecode('FAQs'),jdecode(''),'/1249.html','true',[],'',''],
	['PAGE','1316',jdecode('Directions'),jdecode(''),'/1316.html','true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='9C42BD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10897';
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: 			'Alpha',
				paletteFamily: 	'9C42BD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10897',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9C42BD',
				e_color: 		'9C42BD',
				f_color: 		'9C42BD',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '44',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1316',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-1471125']={
webappId:    '1501',
documentId:  '44',
internalId:  '1471125',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44',
internalId:  '',
customField: '20100506-224356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83',
internalId:  '',
customField: '20091106-151110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20091106-150909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1168',
internalId:  '',
customField: '20090814-202038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20081120-163318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1328',
internalId:  '',
customField: '20091120-160304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1355',
internalId:  '',
customField: '20090812-211543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1364',
internalId:  '',
customField: '20081126-215041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1373',
internalId:  '',
customField: '20081126-220103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1382',
internalId:  '',
customField: '20090806-153516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1391',
internalId:  '',
customField: '20080315-051856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1177',
internalId:  '',
customField: '20100504-220022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1400',
internalId:  '',
customField: '20100504-230702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1409',
internalId:  '',
customField: '20080315-051856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1418',
internalId:  '',
customField: '20080315-051856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65',
internalId:  '',
customField: '20080403-193530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74',
internalId:  '',
customField: '20080120-233529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110',
internalId:  '',
customField: '20080315-041210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119',
internalId:  '',
customField: '20080120-233529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1150',
internalId:  '',
customField: '20080315-035019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1159',
internalId:  '',
customField: '20080315-035019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1204',
internalId:  '',
customField: '20080315-035020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1222',
internalId:  '',
customField: '20080315-035020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1231',
internalId:  '',
customField: '20080315-035020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1249',
internalId:  '',
customField: '20080315-035020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1316',
internalId:  '',
customField: '20080315-041854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20100624-152715'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN39IW';
var companyName   = 'KEYPORT+MUSIC+732+264+2652';
var htmlTitle	  = 'KEYPORT+MUSIC';
var metaKeywords  = 'MUSIC%2CGUITARS%2CLESSONS%2CINSTRUMENT+REPAIRS';
var metaContents  = 'MUSIC%2C+GUITARS%2CLESSONS%2CINSTRUMENT+REPAIRS';
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();
};
