/* [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','1701',jdecode('*The+Organette*'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','530950',jdecode('Whats+New%3F'),jdecode(''), jdecode('%2F530950.html'), 'true',[],'',''],
	['PAGE','56426',jdecode('Restoration+Service'),jdecode(''), jdecode('%2F56426.html'), 'true',[],'',''],
	['PAGE','94115',jdecode('For+Sale'),jdecode(''), jdecode('%2F94115%2Findex.html'), 'true',[ 
		['PAGE','142051',jdecode('Tournaphone+'),jdecode(''), jdecode('%2F94115%2F142051.html'), 'true',[],'',''],
		['PAGE','149107',jdecode('Musical+Casket+%232'),jdecode(''), jdecode('%2F94115%2F149107.html'), 'true',[],'',''],
		['PAGE','538150',jdecode('Organita+Organette'),jdecode(''), jdecode('%2F94115%2F538150.html'), 'true',[],'',''],
		['PAGE','532250',jdecode('Arpanetta+Zither'),jdecode(''), jdecode('%2F94115%2F532250.html'), 'true',[],'',''],
		['PAGE','142451',jdecode('Musette'),jdecode(''), jdecode('%2F94115%2F142451.html'), 'true',[],'',''],
		['PAGE','156477',jdecode('The+Improved+Celestina'),jdecode(''), jdecode('%2F94115%2F156477.html'), 'false',[],'','']
	],'',''],
	['PAGE','439617',jdecode('Buy-Sell-Trade'),jdecode(''), jdecode('%2F439617%2Findex.html'), 'true',[ 
		['PAGE','446317',jdecode('Buy%2FSell%2FTrade+Form'),jdecode(''), jdecode('%2F439617%2F446317.html'), 'true',[],'','']
	],'',''],
	['PAGE','535150',jdecode('Roller+Organ+Cobs'),jdecode(''), jdecode('%2F535150.html'), 'true',[],'',''],
	['PAGE','534950',jdecode('Organette+Rolls+'),jdecode(''), jdecode('%2F534950.html'), 'true',[],'',''],
	['ITEM','457128',jdecode('Gem+Parts'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage29.html'), 'true',[],'','_blank'],
	['ITEM','471028',jdecode('Concert+Parts'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage56.html'), 'true',[],'','_blank'],
	['ITEM','471128',jdecode('Autophone+Parts'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage69.html'), 'true',[],'','_blank'],
	['ITEM','471329',jdecode('Clariona+Parts'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage81.html'), 'true',[],'','_blank'],
	['ITEM','520250',jdecode('Melodia+Parts'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage80.html'), 'true',[],'','_blank'],
	['ITEM','471328',jdecode('Stencils'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage28.html'), 'true',[],'','_blank'],
	['ITEM','471428',jdecode('Direction+Labels'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage74.html'), 'true',[],'','_blank'],
	['ITEM','471228',jdecode('Restoration+Supplies'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage62.html'), 'true',[],'','_blank'],
	['ITEM','471528',jdecode('Books'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage30.html'), 'true',[],'','_blank'],
	['ITEM','471828',jdecode('Advertising+Prints'),jdecode(''), jdecode('http%3A%2F%2Fwww.organetterepair.com%2Fstore%2Fpage52.html'), 'true',[],'','_blank'],
	['PAGE','42394',jdecode('Organette+Photo%26%23x27%3Bs'),jdecode(''), jdecode('%2F42394.html'), 'true',[],'',''],
	['ITEM','240117',jdecode('Organette+Video%26%23x27%3Bs'),jdecode(''), jdecode('http%3A%2F%2Fwww.youtube.com%2Fuser%2Fhdraperz%3Ffeature%3Dmhum'), 'true',[],'','_blank'],
	['PAGE','1752',jdecode('Questions%2FContact'),jdecode(''), jdecode('%2F1752.html'), 'true',[],'',''],
	['PAGE','500328',jdecode('Mailing+List'),jdecode(''), jdecode('%2F500328.html'), 'true',[],'',''],
	['PAGE','1794',jdecode('Links'),jdecode(''), jdecode('%2F1794.html'), 'true',[],'',''],
	['PAGE','29541',jdecode('About+Me'),jdecode(''), jdecode('%2F29541.html'), 'true',[],'',''],
	['PAGE','176577',jdecode('Guestbook'),jdecode(''), jdecode('%2F176577.html'), 'true',[],'',''],
	['PAGE','28471',jdecode('Recent+Restorations'),jdecode(''), jdecode('%2F28471.html'), 'false',[],'','']];
var siteelementCount=32;
theSitetree.topTemplateName='Stucco';
theSitetree.paletteFamily='D8BF90';
theSitetree.keyvisualId='11998';
theSitetree.keyvisualName='kv_11998.jpg';
theSitetree.fontsetId='33259';
theSitetree.graphicsetId='14135';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F4EDE0';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'powweb',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stucco',
				paletteFamily: 	'D8BF90',
				keyvisualId: 	'11998',
				keyvisualName: 	'kv_11998.jpg',
				fontsetId: 		'33259',
				graphicsetId: 	'14135',
				contentColor: 	'000000',
				contentBGColor: 'F4EDE0',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20111127-232918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20110905-171439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '439617',
internalId:  '',
customField: '20120115-233806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20111220-150005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28471',
internalId:  '',
customField: '20101126-214656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29541',
internalId:  '',
customField: '20110131-000416'
};
webappMappings['7060']=webappMappings['7060-e26fa42ec03be99a7232c068c8fb1652']={
webappId:    '7060',
documentId:  '42394',
internalId:  'e26fa42ec03be99a7232c068c8fb1652',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-11068']={
webappId:    '7008',
documentId:  '1752',
internalId:  '11068',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42394',
internalId:  '',
customField: '20110820-235527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56426',
internalId:  '',
customField: '20111224-011220'
};
webappMappings['1002']=webappMappings['1002-176577aendu0in2fv0']={
webappId:    '1002',
documentId:  '176577',
internalId:  '176577aendu0in2fv0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142051',
internalId:  '',
customField: '20110930-120735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142451',
internalId:  '',
customField: '20120120-155615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149107',
internalId:  '',
customField: '20120120-155650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94115',
internalId:  '',
customField: '20120131-211903'
};
webappMappings['7008']=webappMappings['7008-34068']={
webappId:    '7008',
documentId:  '446317',
internalId:  '34068',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156477',
internalId:  '',
customField: '20111120-170838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '176577',
internalId:  '',
customField: '20110820-235743'
};
webappMappings['7008']=webappMappings['7008-5077']={
webappId:    '7008',
documentId:  '500328',
internalId:  '5077',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '446317',
internalId:  '',
customField: '20110823-003815'
};
webappMappings['7008']=webappMappings['7008-33635']={
webappId:    '7008',
documentId:  '446317',
internalId:  '33635',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '530950',
internalId:  '',
customField: '20120131-014120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '500328',
internalId:  '',
customField: '20110831-115006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '532250',
internalId:  '',
customField: '20120119-221124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '534950',
internalId:  '',
customField: '20120131-112808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '535150',
internalId:  '',
customField: '20120131-112643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '538150',
internalId:  '',
customField: '20120202-002458'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2FV0';
var companyName   = 'Roller+Organ+Repair+%26+Restorations';
var htmlTitle	  = 'http%3A%2F%2Fwww.organetterepair.com%2F';
var metaKeywords  = 'repair%2Croller+organ%2Crestoration%2Corganette%2Cautophone%2Cgem%2Cconcert%2Cariston%2Camorette%2Cmelodia%2Cherophon%2C%0Acelestina%2C+mandolina%2Cmechanical+orguinette%2Corganina%2Cbijou%2Corchestrone%2Cchautauqua%2Cparts';
var metaContents  = 'roller+organ+repair%2C+roller+organ+restoration';
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();
};

