/* [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','4556',jdecode('Accueil'),jdecode(''),'/4556.html','true',[],'',''],
	['PAGE','4613',jdecode('Historique'),jdecode(''),'/4613.html','true',[],'',''],
	['PAGE','4640',jdecode('Nos+prestations'),jdecode(''),'/4640.html','true',[],'',''],
	['PAGE','4667',jdecode('Nos+r%C3%A9f%C3%A9rences'),jdecode(''),'/4667/index.html','true',[ 
		['PAGE','12008',jdecode('Immeubles+de+logement'),jdecode(''),'/4667/12008.html','true',[],'',''],
		['PAGE','27711',jdecode('Commerce+et+industrie'),jdecode(''),'/4667/27711.html','true',[],'',''],
		['PAGE','12035',jdecode('G%C3%A9nie+civil%2C+travaux+publics'),jdecode(''),'/4667/12035.html','true',[],'',''],
		['PAGE','27738',jdecode('Villas+individuelles'),jdecode(''),'/4667/27738.html','true',[],'','']
	],'',''],
	['PAGE','29879',jdecode('Galerie+d%26%23x27%3Bimages'),jdecode(''),'/29879.html','true',[],'',''],
	['PAGE','4694',jdecode('Emploi%2C+formation'),jdecode(''),'/4694.html','true',[],'',''],
	['PAGE','4721',jdecode('Contact%2C+acc%C3%A8s'),jdecode(''),'/4721/index.html','true',[ 
		['PAGE','7602',jdecode('Contact%2C+acc%C3%A8s+%28Folgeseite%29'),jdecode(''),'/4721/7602.html','false',[],'',''],
		['PAGE','26106',jdecode('Calcul+d%26%23x27%3Bitin%C3%A9raire'),jdecode(''),'/4721/26106.html','true',[],'',''],
		['PAGE','26404',jdecode('Carte+g%C3%A9ographique'),jdecode(''),'/4721/26404.html','true',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Rectangle';
theSitetree.paletteFamily='154186';
theSitetree.keyvisualId='2505';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='451';
theSitetree.graphicsetId='505';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='154186';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rectangle',
				paletteFamily: 	'154186',
				keyvisualId: 	'2505',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'451',
				graphicsetId: 	'505',
				contentColor: 	'FFFFFF',
				contentBGColor: '154186',
				a_color: 		'154186',
				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:  '4556',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '26106',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '26404',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-2306516']={
webappId:    '1501',
documentId:  '4556',
internalId:  '2306516',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20071120-113415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20080124-170419'
};
webappMappings['7008']=webappMappings['7008-6978']={
webappId:    '7008',
documentId:  '4721',
internalId:  '6978',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4640',
internalId:  '',
customField: '20090819-094602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4667',
internalId:  '',
customField: '20071231-014532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12008',
internalId:  '',
customField: '20091126-155229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27711',
internalId:  '',
customField: '20090819-095118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12035',
internalId:  '',
customField: '20091126-155531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27738',
internalId:  '',
customField: '20080613-172804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29879',
internalId:  '',
customField: '20080124-171716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4694',
internalId:  '',
customField: '20061223-110429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4721',
internalId:  '',
customField: '20090819-100459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7602',
internalId:  '',
customField: '20041013-104009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26106',
internalId:  '',
customField: '20061223-110223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26404',
internalId:  '',
customField: '20050701-091814'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXVHP';
var companyName   = 'EGT+Construction+SA';
var htmlTitle	  = 'EGT+Construction+SA';
var metaKeywords  = 'b%C3%A2timent%3B+construction%3B+ma%C3%A7onnerie%3B+gros+oeuvre%3B+g%C3%A9nie+civil%3B+b%C3%A9ton+arm%C3%A9%3B+fondations%3B+terrassements%3B+murs%3B+chablais%3B+dionisotti%3B+horizonville%3B+EGT%2C+Entreprise+de+Grands+Travaux';
var metaContents  = 'b%C3%A2timent%3B+construction%3B+ma%C3%A7onnerie%3B+gros+oeuvre%3B+g%C3%A9nie+civil%3B+b%C3%A9ton+arm%C3%A9%3B+fondations%3B+terrassements%3B+murs%3B+chablais%3B+dionisotti%3B+horizonville%3B+EGT%2C+Entreprise+de+Grands+Travaux';
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();
};
