/* [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','4482',jdecode('Home+%2C+liens'),jdecode(''),'/4482.html','true',[],'',''],
	['PAGE','10767',jdecode('Sponsors'),jdecode(''),'/10767.html','true',[],'',''],
	['PAGE','10794',jdecode('Coupole%2Cmat%C3%A9riels'),jdecode(''),'/10794.html','true',[],'',''],
	['PAGE','17172',jdecode('Soleil+%2C+Lune'),jdecode(''),'/17172.html','true',[],'',''],
	['PAGE','10821',jdecode('Plan%C3%A8tes'),jdecode(''),'/10821.html','true',[],'',''],
	['PAGE','10848',jdecode('N%C3%A9buleuses'),jdecode(''),'/10848.html','true',[],'',''],
	['PAGE','4829',jdecode('Galaxies'),jdecode(''),'/4829.html','true',[],'',''],
	['PAGE','24201',jdecode('Amas%2C+Com%C3%A8tes'),jdecode(''),'/24201.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='1243CC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10587';
theSitetree.graphicsetId='10562';
theSitetree.contentColor='37C976';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'1243CC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10587',
				graphicsetId: 	'10562',
				contentColor: 	'37C976',
				contentBGColor: '000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4482',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4482',
internalId:  '',
customField: '20100421-172712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10848',
internalId:  '',
customField: '20100425-140415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4829',
internalId:  '',
customField: '20100411-171935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10767',
internalId:  '',
customField: '20100522-183121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10794',
internalId:  '',
customField: '20090411-175514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17172',
internalId:  '',
customField: '20070801-121610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10821',
internalId:  '',
customField: '20090807-182640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20100411-154801'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXXNB';
var companyName   = 'CIEL+POUR+TOUS';
var htmlTitle	  = 'astroderamocielpourtous.CH';
var metaKeywords  = '+construction+coupoleconstruction+coupole+%2C+construction+observatoire+%2C+construction+observatoire+amateur+%2C+observatoires+%2C+astrophoto+%2C+astrophographie+%2C+webcam%2CSbig%2C+CCD%2C+ST+8+XME%2C+Filtre+RVB%2C+Deep+%2C+d%3Fme+%2C+arc+%2C+arche+%2C+toucam+pro+%2C+cerle+%2C+taches+solaire+%2C+mars+%2C+jupiter+%2C+saturne+%2C+coupole+motoris%3Fe+%2C+entra%3Fnement+coupole+%2Centra%3Fnement+d%3Fme+%2C+galaxies%2Cn%3Fbuleuses%2Ccom%3Ftes%2CM%2CNGC%2CTakahashi+TSA+102%2CTakahashi+FS+60%2Crobofocus+%2Cmonture+Losmandy+Titan%2C+Titan';
var metaContents  = 'construction+coupole+%2C+construction+observatoire+%2C+construction+observatoire+amateur+%2C+observatoires+%2C+astrophoto+%2C+astrophographie+%2C+webcam%2CSbig%2C+CCD%2C+ST+8+XME%2C+Filtre+RVB%2C+Deep+%2C+d%3Fme+%2C+arc+%2C+arche+%2C+toucam+pro+%2C+cerle+%2C+taches+solaire+%2C+mars+%2C+jupiter+%2C+saturne+%2C+coupole+motoris%3Fe+%2C+entra%3Fnement+coupole+%2Centra%3Fnement+d%3Fme+%2Cgalaxies%2Cn%3Fbuleuses%2Ccom%3Ftes%2CM%2CNGC%2CTakahashi+TSA+102%2CTakahashi+FS+60%2Crobofocus+%2Cmonture+Losmandy+Titan%2C+Titan';
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();
};
