/* [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','501',jdecode('HOME'),jdecode(''),'/501.html','true',[],''],
	['PAGE','9185',jdecode('GEAR'),jdecode(''),'/9185/index.html','true',[ 
		['PAGE','19501',jdecode('DRUMS%2F+PERCUSSION'),jdecode(''),'/9185/19501.html','true',[],''],
		['PAGE','9227',jdecode('MICROPHONE%2F+PRE-AMPS'),jdecode(''),'/9185/9227.html','true',[],''],
		['PAGE','9206',jdecode('GUITAR%2F+BASS%2F+AMPS'),jdecode(''),'/9185/9206.html','true',[],''],
		['PAGE','9248',jdecode('PIANO%2F+KEYS%2F+SAMPLERS'),jdecode(''),'/9185/9248.html','true',[],''],
		['PAGE','18701',jdecode('EFFECTS%2F+PROCESSORS'),jdecode(''),'/9185/18701.html','true',[],'']
	],''],
	['PAGE','53401',jdecode('RATES'),jdecode(''),'/53401.html','true',[],''],
	['PAGE','9164',jdecode('RECORDING+TIPS'),jdecode(''),'/9164.html','true',[],''],
	['PAGE','58601',jdecode('STUDIO+GALLERY'),jdecode(''),'/58601.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Stone';
theSitetree.paletteFamily='952A2A';
theSitetree.keyvisualId='9726';
theSitetree.keyvisualName='kv_9726.jpg';
theSitetree.fontsetId='10805';
theSitetree.graphicsetId='11237';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='9C9B9B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Stone',
				paletteFamily: 	'952A2A',
				keyvisualId: 	'9726',
				keyvisualName: 	'kv_9726.jpg',
				fontsetId: 		'10805',
				graphicsetId: 	'11237',
				contentColor: 	'000000',
				contentBGColor: '9C9B9B',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-b276ae368570420e34021872acdf388d']={
webappId:    '7060',
documentId:  '58601',
internalId:  'b276ae368570420e34021872acdf388d',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-9933695']={
webappId:    '1501',
documentId:  '501',
internalId:  '9933695',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20080323-223314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9185',
internalId:  '',
customField: '20080320-143443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20090701-153923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9227',
internalId:  '',
customField: '20090701-154631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9206',
internalId:  '',
customField: '20090701-162832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9248',
internalId:  '',
customField: '20090701-161358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20090701-163132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53401',
internalId:  '',
customField: '20090701-163307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9164',
internalId:  '',
customField: '20090701-153541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58601',
internalId:  '',
customField: '20090218-231257'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '501',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9185',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '19501',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9227',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9206',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9248',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '18701',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '53401',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9164',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '58601',
internalId:  '',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INVAEC';
var companyName   = 'North+Chicago+Professional+Recording+Studio++312.371.8693';
var htmlTitle	  = 'REDLINE+RECORDING+STUDIO';
var metaKeywords  = 'Chicago%2C+Recording%2C+Michael+Rashid%2C+Mic%2C+microphone%2C+guitar%2C+amp%2C+amps%2C+amplifier%2C+studio+a%2C+project+studio%2C+studio%2C+music%2C+musical+recording%2C+production%2C+producer%2C+Michael+Rashid%2C+Michael+J.+Rashid%2C+recording+studio%2C+rates%2C+Chicago+Recording+Studio';
var metaContents  = 'Professional+Chicago+Recording+Studio%2C+Chicago%2C+Recording%2C+Michael+Rashid%2C+Mic%2C+microphone%2C+guitar%2C+amp%2C+amps%2C+amplifier%2C+studio+a%2C+project+studio%2C+studio%2C+music%2C+musical+recording%2C+production%2C+producer%2C+recording+studio%2C+Michael+Rashid%2C+Michael+J.+Rashid%2C+rates%2C+Chicago+Recording+Studio';
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();
};
