/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','2252',jdecode('Violins'),jdecode(''), jdecode('%2F2252.html'), 'true',[],'',''],
	['PAGE','42739',jdecode('Electric+violins'),jdecode(''), jdecode('%2F42739.html'), 'true',[],'',''],
	['PAGE','44439',jdecode('Cellos'),jdecode(''), jdecode('%2F44439.html'), 'true',[],'',''],
	['PAGE','74640',jdecode('Bows'),jdecode(''), jdecode('%2F74640.html'), 'true',[],'',''],
	['PAGE','8301',jdecode('This+Week%26%23x27%3Bs+Special'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'',''],
	['PAGE','54512',jdecode('Accessories'),jdecode(''), jdecode('%2F54512.html'), 'true',[],'',''],
	['PAGE','55312',jdecode('What+is+it%3F%3F%3F%3F'),jdecode(''), jdecode('%2F55312.html'), 'true',[],'',''],
	['PAGE','2273',jdecode('Service'),jdecode(''), jdecode('%2F2273.html'), 'true',[],'',''],
	['PAGE','2294',jdecode('About+us'),jdecode(''), jdecode('%2F2294%2Findex.html'), 'true',[ 
		['PAGE','2315',jdecode('Our+team'),jdecode(''), jdecode('%2F2294%2F2315.html'), 'true',[],'',''],
		['PAGE','2336',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2294%2F2336.html'), 'true',[],'','']
	],'',''],
	['PAGE','2357',jdecode('Online+order'),jdecode(''), jdecode('%2F2357.html'), 'true',[],'',''],
	['PAGE','2378',jdecode('Contact'),jdecode(''), jdecode('%2F2378.html'), 'true',[],'',''],
	['PAGE','35141',jdecode('Talk+to+us'),jdecode(''), jdecode('%2F35141.html'), 'true',[],'',''],
	['PAGE','35641',jdecode('Shop+Shots'),jdecode(''), jdecode('%2F35641.html'), 'true',[],'',''],
	['PAGE','97394',jdecode('Early+memories'),jdecode(''), jdecode('%2F97394.html'), 'true',[],'',''],
	['PAGE','87164',jdecode('Videos'),jdecode(''), jdecode('%2F87164.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20110625-194037'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20110721-112151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2273',
internalId:  '',
customField: '20101130-183405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20100101-203155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20100101-203227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20100101-203413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20090628-120849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20100101-203559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20111012-184936'
};
webappMappings['1002']=webappMappings['1002-35141ahw050inlycy']={
webappId:    '1002',
documentId:  '35141',
internalId:  '35141ahw050inlycy',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35141',
internalId:  '',
customField: '20090926-212058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35641',
internalId:  '',
customField: '20100624-191753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42739',
internalId:  '',
customField: '20100122-125621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44439',
internalId:  '',
customField: '20110906-092954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54512',
internalId:  '',
customField: '20110321-140359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55312',
internalId:  '',
customField: '20110721-110642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74640',
internalId:  '',
customField: '20100308-140749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87164',
internalId:  '',
customField: '20100512-184159'
};
webappMappings['7060']=webappMappings['7060-c086f9de94ed73bd3ea3e27aa27b4a77']={
webappId:    '7060',
documentId:  '87164',
internalId:  'c086f9de94ed73bd3ea3e27aa27b4a77',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97394',
internalId:  '',
customField: '20100809-191532'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLYCY';
var companyName   = 'C+Bout+Music+Inc.';
var htmlTitle	  = 'C+Bout+Music+Inc.';
var metaKeywords  = 'violin%2C+bows%2C+bow+hair%2C+chin+rests%2C+viola%2C+bass%2C+cello%2C+music%2C+electric+violin%2C+repairs%2C+rental';
var metaContents  = 'violins%2Cviolin+accessories%2C+music%2C+cello%2C+bass%2C+viola%2C+electric+violin%2C+repairs%2C+rental%0Aolivette%2C+creve+couer%2Coverland%2C+University+City%2C+Clayton%2C++';
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();
};

