/* [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','2301',jdecode('Home'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','2373',jdecode('School+of+Music'),jdecode(''), jdecode('%2F2373.html'), 'true',[],'',''],
	['PAGE','6001',jdecode('School+of+Rock'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'',''],
	['PAGE','46301',jdecode('School+of+Strings'),jdecode(''), jdecode('%2F46301.html'), 'true',[],'',''],
	['PAGE','2394',jdecode('Instrument+Repair'),jdecode(''), jdecode('%2F2394.html'), 'true',[],'',''],
	['PAGE','2415',jdecode('Instruments+%2F+Accessories'),jdecode(''), jdecode('%2F2415.html'), 'true',[],'',''],
	['PAGE','26801',jdecode('Consignment'),jdecode(''), jdecode('%2F26801.html'), 'true',[],'',''],
	['PAGE','2436',jdecode('Cafe%60+Menu'),jdecode(''), jdecode('%2F2436.html'), 'true',[],'',''],
	['PAGE','2457',jdecode('LIVE+MUSIC'),jdecode(''), jdecode('%2F2457.html'), 'true',[],'',''],
	['PAGE','2478',jdecode('Hours'),jdecode(''), jdecode('%2F2478.html'), 'true',[],'',''],
	['PAGE','2499',jdecode('About+Us'),jdecode(''), jdecode('%2F2499.html'), 'true',[],'',''],
	['PAGE','8201',jdecode('Students'),jdecode(''), jdecode('%2F8201.html'), 'true',[],'',''],
	['PAGE','51001',jdecode('Job+Opportunities'),jdecode(''), jdecode('%2F51001.html'), 'true',[],'',''],
	['PAGE','27901',jdecode('Join+our+email+list'),jdecode(''), jdecode('%2F27901.html'), 'true',[],'',''],
	['PAGE','27922',jdecode('Contact+Us'),jdecode(''), jdecode('%2F27922.html'), 'true',[],'',''],
	['ITEM','48801',jdecode('Like+us+on+Facebook'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2Fpages%2FLapeer-MI%2FRiver-Street-Music-Cafe%2F119281764781320%3Fref%3Dsgm'), 'true',[],'','_blank']];
var siteelementCount=16;
theSitetree.topTemplateName='Card';
theSitetree.paletteFamily='669900';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='427';
theSitetree.graphicsetId='481';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Card',
				paletteFamily: 	'669900',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'427',
				graphicsetId: 	'481',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20120114-235004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2499',
internalId:  '',
customField: '20120114-235143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2478',
internalId:  '',
customField: '20120104-025244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2436',
internalId:  '',
customField: '20120115-002215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2457',
internalId:  '',
customField: '20120125-105048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20111219-005908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2373',
internalId:  '',
customField: '20120115-002528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2394',
internalId:  '',
customField: '20110620-232129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2415',
internalId:  '',
customField: '20110704-135059'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-3130400']={
webappId:    '1501',
documentId:  '2301',
internalId:  '3130400',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20120125-165737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20100816-121634'
};
webappMappings['7008']=webappMappings['7008-17746']={
webappId:    '7008',
documentId:  '27922',
internalId:  '17746',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20110620-233553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27922',
internalId:  '',
customField: '20110620-233624'
};
webappMappings['7008']=webappMappings['7008-17747']={
webappId:    '7008',
documentId:  '27901',
internalId:  '17747',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46301',
internalId:  '',
customField: '20111205-122356'
};
webappMappings['7008']=webappMappings['7008-22071']={
webappId:    '7008',
documentId:  '51001',
internalId:  '22071',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51001',
internalId:  '',
customField: '20110113-113758'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7C3CD';
var companyName   = 'River+Street+Music+%26+Cafe%60';
var htmlTitle	  = 'River+Street+Music+%26+Cafe%60';
var metaKeywords  = 'Guitar+Lessons%2C+Piano+Lessons%2C+Restaurant%2C+Music+Lessons%2C+Drum+Lessons%2C+Violin+Lessons%2C+Flute+Lessons%2C+Voice+Lessons%2C+School+of+Rock%2C+Guitar+Repair%2C+Violin+Repair%2C+Luthier%2C+String+Instrument+Repair%2C+Guitar+Strings%2C+Instrument+Cables%2C+Music+Books%2C+River+Street+Cafe%2C+Lunch%2C';
var metaContents  = 'Music+Lessons+for+All+Ages.++Beginner+to+Advanced+Guitar+Lessons%2C+Piano+Lessons%2C+Drum+Lessons%2C+Violin+Lessons%2C+Flute+Lessons%2C+Voice+Lessons%2C+and+School+of+Rock.++We+also+offer+Expert+String+Instrument+Repair+on+site+including+Guitar+Repair+and+Violin+Repair.++We+are+a+convenient+source+for+all+your+accessories+including+Guitar+Strings%2C+Cables%2C+Music+Books%2C+and+more.++Located+within+our+facility+is+our+River+Street+Cafe%60+and+Sound+Stage%2C+providing+the+perfect+opportunity+to+enjoy+a+delicious+lunch+or+snack%2C+and+on+Friday+nights+we+have+live+music+performances+by+local+musicians.++';
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();
};

