/* [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','31001',jdecode('Accueil'),jdecode(''), jdecode('%2F31001.html'), 'true',[],'',''],
	['PAGE','457412',jdecode('Mes+formations'),jdecode(''), jdecode('%2F457412.html'), 'true',[],'',''],
	['PAGE','56601',jdecode('Mes+activit%C3%A9s'),jdecode(''), jdecode('%2F56601.html'), 'true',[],'',''],
	['PAGE','36001',jdecode('Service+pr%C3%A9visions+VS'),jdecode(''), jdecode('%2F36001.html'), 'true',[],'',''],
	['PAGE','536612',jdecode('Meteoval'),jdecode(''), jdecode('%2F536612.html'), 'true',[],'',''],
	['PAGE','538812',jdecode('Temps+actuel+%28Meteoval%29'),jdecode(''), jdecode('%2F538812.html'), 'true',[],'',''],
	['PAGE','542912',jdecode('Webcam'),jdecode(''), jdecode('%2F542912.html'), 'true',[],'',''],
	['PAGE','100601',jdecode('Lutte+contre+la+gr%C3%AAle'),jdecode(''), jdecode('%2F100601.html'), 'true',[],'',''],
	['PAGE','101601',jdecode('Protection+foudre'),jdecode(''), jdecode('%2F101601.html'), 'true',[],'',''],
	['PAGE','459412',jdecode('Eletcro-Smog'),jdecode(''), jdecode('%2F459412.html'), 'true',[],'',''],
	['PAGE','103001',jdecode('Incendies+de+for%C3%AAt'),jdecode(''), jdecode('%2F103001.html'), 'true',[],'',''],
	['PAGE','103701',jdecode('Recherche+d%26%23x27%3Beau'),jdecode(''), jdecode('%2F103701.html'), 'true',[],'',''],
	['PAGE','104001',jdecode('Modification+du+temps'),jdecode(''), jdecode('%2F104001.html'), 'true',[],'',''],
	['PAGE','99801',jdecode('Climatologie+souterraine'),jdecode(''), jdecode('%2F99801.html'), 'true',[],'',''],
	['PAGE','174801',jdecode('Energie+%C3%A9olienne'),jdecode(''), jdecode('%2F174801.html'), 'true',[],'',''],
	['PAGE','175401',jdecode('Energie+solaire'),jdecode(''), jdecode('%2F175401.html'), 'true',[],'',''],
	['PAGE','107801',jdecode('Cours+de+m%C3%A9t%C3%A9orologie'),jdecode(''), jdecode('%2F107801.html'), 'true',[],'',''],
	['PAGE','513512',jdecode('GeoTerrain+Suisse'),jdecode(''), jdecode('%2F513512.html'), 'true',[],'',''],
	['PAGE','36022',jdecode('Conditions+g%C3%A9n%C3%A9rales'),jdecode(''), jdecode('%2F36022.html'), 'true',[],'',''],
	['PAGE','49001',jdecode('Co%C3%BBt+des+services'),jdecode(''), jdecode('%2F49001.html'), 'true',[],'',''],
	['PAGE','36085',jdecode('Liens+m%C3%A9t%C3%A9o+et+plus'),jdecode(''), jdecode('%2F36085.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='423';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'423',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '459412',
internalId:  '',
customField: '20110226-133452'
};
webappMappings['1501']=webappMappings['1501-10878291']={
webappId:    '1501',
documentId:  '31001',
internalId:  '10878291',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '538812',
internalId:  '-',
customField: '20120123-163712'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '542912',
internalId:  '-',
customField: '20120206-161820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31001',
internalId:  '',
customField: '20111003-170322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56601',
internalId:  '',
customField: '20111003-174105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20120206-110815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100601',
internalId:  '',
customField: '20080522-141700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101601',
internalId:  '',
customField: '20111005-155149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103001',
internalId:  '',
customField: '20100127-154451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103701',
internalId:  '',
customField: '20120109-153026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104001',
internalId:  '',
customField: '20090306-143812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99801',
internalId:  '',
customField: '20090306-143855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174801',
internalId:  '',
customField: '20091009-115753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '175401',
internalId:  '',
customField: '20091009-115658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107801',
internalId:  '',
customField: '20111116-113011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36022',
internalId:  '',
customField: '20090306-144126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49001',
internalId:  '',
customField: '20120201-144852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36085',
internalId:  '',
customField: '20111229-161639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '457412',
internalId:  '',
customField: '20111116-111543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '513512',
internalId:  '',
customField: '20120120-170155'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '31001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '536612',
internalId:  '-',
customField: '20120109-145738'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2RRI';
var companyName   = 'Daniel+Masotti%2C+www.meteo-assistance.ch';
var htmlTitle	  = '';
var metaKeywords  = 'meteo+valais+suisse++previsions+meteo+montagne+atmosphere+champs+electromagnetiques+lignes+%C3%A0+hautes+tensions+%C3%A9lectrosmog+sources+eau+souterraine+hydrog%C3%A9ologie+g%C3%A9ologie+gr%C3%AAle+foudre+modification+du+temps+incendie+for%C3%AAt+conf%C3%A9rence+assistance+cours+%C3%A9nergie+eolienne+%C3%A9nergie+solaire+intemp%C3%A9ries+climatologie+webcam+sant%C3%A9+orages+travaux+tourisme+assistance+protection+civile+paratonnerre+parafoudre+minage+geoterrain+Suisse+%C3%A9letcrosmog.';
var metaContents  = 'La+meteo+du+Valais++Previsions+%C3%A0+6+jours.++Le+specialiste+de+votre+atmosphere++Champs+electromagn%C3%A9tiques%2C+m%C3%A9t%C3%A9o+g%C3%A9n%C3%A9rale%2C+lutte+contre+les+ph%C3%A9nom%C3%A8nes+m%C3%A9t%C3%A9o+violents%2C+expert+foudre.';
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();
};

