/* [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','4598',jdecode('History+of+the+P-51+design'),jdecode(''),'/4598.html','true',[],''],
	['PAGE','59692',jdecode('Swiss+Mustangs+-+Intro'),jdecode(''),'/59692.html','true',[],''],
	['PAGE','4655',jdecode('Swiss+Mustangs+-+History'),jdecode(''),'/4655/index.html','true',[ 
		['PAGE','4736',jdecode('Internees+during+WW2'),jdecode(''),'/4655/4736.html','true',[],''],
		['PAGE','4682',jdecode('Service+1948+-+1958'),jdecode(''),'/4655/4682.html','true',[],''],
		['PAGE','49092',jdecode('Pilot+training'),jdecode(''),'/4655/49092.html','true',[],'']
	],''],
	['PAGE','46492',jdecode('Swiss+Mustangs+-+Gallery'),jdecode(''),'/46492/index.html','true',[ 
		['PAGE','5203',jdecode('Service+Period+1948+-+1958'),jdecode(''),'/46492/5203.html','true',[],''],
		['PAGE','47092',jdecode('Out+of+service+%2F+scrapping'),jdecode(''),'/46492/47092.html','true',[],''],
		['PAGE','47119',jdecode('Warbirds+in+Switzerland'),jdecode(''),'/46492/47119.html','true',[],'']
	],''],
	['PAGE','40492',jdecode('Walkaround+Galleries'),jdecode(''),'/40492/index.html','true',[ 
		['PAGE','31566',jdecode('J-2113+Museum'),jdecode(''),'/40492/31566.html','true',[],''],
		['PAGE','40519',jdecode('Double+Trouble+Two'),jdecode(''),'/40492/40519.html','true',[],''],
		['PAGE','44592',jdecode('Indonesian+F-51+%22F-338%22'),jdecode(''),'/40492/44592.html','true',[],''],
		['PAGE','44619',jdecode('Indonesian+F-51+%22F-347%22'),jdecode(''),'/40492/44619.html','true',[],''],
		['PAGE','51092',jdecode('Daddy%26%23x27%3Bs+Girl'),jdecode(''),'/40492/51092.html','true',[],''],
		['PAGE','70120',jdecode('MM4323+Vigna+di+Valle'),jdecode(''),'/40492/70120.html','true',[],'']
	],''],
	['PAGE','7215',jdecode('Swiss+Mustangs+-+Details'),jdecode(''),'/7215.html','true',[],''],
	['PAGE','7566',jdecode('Swiss+Mustangs+-+Book'),jdecode(''),'/7566.html','true',[],''],
	['PAGE','86618',jdecode('Occupation+in+Germany'),jdecode(''),'/86618.html','true',[],''],
	['PAGE','20214',jdecode('Worldwide+military+use'),jdecode(''),'/20214/index.html','true',[ 
		['PAGE','20241',jdecode('Korean+War'),jdecode(''),'/20214/20241.html','true',[],''],
		['PAGE','20268',jdecode('USAF%2C+USANG+%26+RCAF'),jdecode(''),'/20214/20268.html','true',[],''],
		['PAGE','20295',jdecode('Europe'),jdecode(''),'/20214/20295.html','true',[],''],
		['PAGE','20322',jdecode('Latin+America'),jdecode(''),'/20214/20322.html','true',[],''],
		['PAGE','20349',jdecode('Australia+%26+New+Zealand'),jdecode(''),'/20214/20349.html','true',[],''],
		['PAGE','20376',jdecode('Middle+East+%26+Asia'),jdecode(''),'/20214/20376.html','true',[],'']
	],''],
	['PAGE','35872',jdecode('Worldwide+civil+use'),jdecode(''),'/35872.html','true',[],''],
	['PAGE','32128',jdecode('Cavalier+Mustangs'),jdecode(''),'/32128.html','true',[],''],
	['PAGE','35899',jdecode('Racing+Mustangs'),jdecode(''),'/35899.html','true',[],''],
	['PAGE','75849',jdecode('Mustang+Bits+%26+Pieces'),jdecode(''),'/75849.html','true',[],''],
	['PAGE','72468',jdecode('Dean+R.+Gilmore+Tribute'),jdecode(''),'/72468.html','true',[],''],
	['PAGE','5703',jdecode('Thanks%2C+Links+%26+News'),jdecode(''),'/5703.html','true',[],''],
	['PAGE','32155',jdecode('Updates'),jdecode(''),'/32155.html','true',[],''],
	['PAGE','33550',jdecode('Bibliography'),jdecode(''),'/33550.html','true',[],''],
	['PAGE','69092',jdecode('NEW+%21+Forthcoming+Books'),jdecode(''),'/69092.html','true',[],''],
	['PAGE','75321',jdecode('NEW+%21+Artwork'),jdecode(''),'/75321.html','true',[],''],
	['PAGE','31593',jdecode('For+Sale+%2F+Wanted'),jdecode(''),'/31593.html','true',[],''],
	['PAGE','36584',jdecode('Contact+%2F+Disclaimer'),jdecode(''),'/36584.html','true',[],'']];
var siteelementCount=39;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2411';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='394';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2411',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'394',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20081106-200720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32155',
internalId:  '',
customField: '20070625-094308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36584',
internalId:  '',
customField: '20080810-181940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59692',
internalId:  '',
customField: '20081106-200801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20081106-200834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20081106-200858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20081106-200929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49092',
internalId:  '',
customField: '20081106-201025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46492',
internalId:  '',
customField: '20081106-201045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5203',
internalId:  '',
customField: '20081106-201126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47092',
internalId:  '',
customField: '20081106-201156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47119',
internalId:  '',
customField: '20081106-201215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7566',
internalId:  '',
customField: '20081106-201644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7215',
internalId:  '',
customField: '20081106-201605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86618',
internalId:  '',
customField: '20081106-201715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20214',
internalId:  '',
customField: '20081106-201742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20241',
internalId:  '',
customField: '20081106-201816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20268',
internalId:  '',
customField: '20071205-171829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20295',
internalId:  '',
customField: '20070612-130558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20322',
internalId:  '',
customField: '20070601-165356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20349',
internalId:  '',
customField: '20071203-154212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20376',
internalId:  '',
customField: '20071105-121914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35872',
internalId:  '',
customField: '20071205-112707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32128',
internalId:  '',
customField: '20070625-094143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35899',
internalId:  '',
customField: '20070807-102325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75849',
internalId:  '',
customField: '20070122-171020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72468',
internalId:  '',
customField: '20070122-171038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5703',
internalId:  '',
customField: '20070122-171056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33550',
internalId:  '',
customField: '20070122-171134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69092',
internalId:  '',
customField: '20070122-171149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75321',
internalId:  '',
customField: '20070122-171212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31593',
internalId:  '',
customField: '20070307-121115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40492',
internalId:  '',
customField: '20081106-201238'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXE1W';
var companyName   = 'SWISS+MUSTANGS';
var htmlTitle	  = 'Swiss+Mustangs';
var metaKeywords  = 'Swiss+Air+Force+Mustang+P-51+North+American+F-51';
var metaContents  = 'North+American+P-51+Mustang+with+the+Swiss+Air+Force+and+all+over+the+WOrld';
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();
};
