/* [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(''), jdecode('%2F4556.html'), 'true',[],'',''],
	['PAGE','60401',jdecode('Nos+prestations'),jdecode(''), jdecode('%2F60401.html'), 'true',[],'',''],
	['PAGE','4613',jdecode('objectifs'),jdecode(''), jdecode('%2F4613.html'), 'true',[],'',''],
	['PAGE','48001',jdecode('villa+Passive-Eco'),jdecode(''), jdecode('%2F48001.html'), 'true',[],'',''],
	['PAGE','39701',jdecode('projets+en+cours'),jdecode(''), jdecode('%2F39701.html'), 'true',[],'',''],
	['PAGE','4721',jdecode('histoire+d%26%23x27%3Bun+projet'),jdecode(''), jdecode('%2F4721.html'), 'true',[],'',''],
	['PAGE','60322',jdecode('Villa+DA-4.5+'),jdecode(''), jdecode('%2F60322.html'), 'true',[],'',''],
	['PAGE','60343',jdecode('Catalogue'),jdecode(''), jdecode('%2F60343%2Findex.html'), 'true',[ 
		['PAGE','28824',jdecode('villa+155+m2+-+cube'),jdecode(''), jdecode('%2F60343%2F28824.html'), 'true',[],'',''],
		['PAGE','29163',jdecode('villa+170+m2+-+pilotis'),jdecode(''), jdecode('%2F60343%2F29163.html'), 'true',[],'',''],
		['PAGE','30672',jdecode('villa+245+m2+-+cube'),jdecode(''), jdecode('%2F60343%2F30672.html'), 'true',[],'','']
	],'',''],
	['PAGE','11201',jdecode('r%C3%A9f%C3%A9rences'),jdecode(''), jdecode('%2F11201.html'), 'true',[],'',''],
	['PAGE','48801',jdecode('presse'),jdecode(''), jdecode('%2F48801.html'), 'true',[],'',''],
	['PAGE','30520',jdecode('info+diverses'),jdecode(''), jdecode('%2F30520.html'), 'true',[],'',''],
	['PAGE','60301',jdecode('Forum'),jdecode(''), jdecode('%2F60301.html'), 'true',[],'',''],
	['PAGE','4775',jdecode('contact+et+liens'),jdecode(''), jdecode('%2F4775.html'), 'true',[],'',''],
	['PAGE','48022',jdecode('nous+trouver'),jdecode(''), jdecode('%2F48022.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='69C151';
theSitetree.keyvisualId='2353';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='379';
theSitetree.graphicsetId='428';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Seifenblase',
				paletteFamily: 	'69C151',
				keyvisualId: 	'2353',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'379',
				graphicsetId: 	'428',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'339900',
				e_color: 		'33CC00',
				f_color: 		'66CC66',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30520',
internalId:  '',
customField: '20110321-225654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4556',
internalId:  '',
customField: '20111005-152606'
};
webappMappings['7008']=webappMappings['7008-3196']={
webappId:    '7008',
documentId:  '4775',
internalId:  '3196',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20110305-141531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4721',
internalId:  '',
customField: '20101031-142830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28824',
internalId:  '',
customField: '20110321-233528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29163',
internalId:  '',
customField: '20101120-171929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30672',
internalId:  '',
customField: '20110321-233559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20110321-233620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4775',
internalId:  '',
customField: '20111005-115011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48001',
internalId:  '',
customField: '20110321-231759'
};
webappMappings['1501']=webappMappings['1501-1648064']={
webappId:    '1501',
documentId:  '4556',
internalId:  '1648064',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39701',
internalId:  '',
customField: '20110321-232230'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '48022',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48022',
internalId:  '',
customField: '20101003-115150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48801',
internalId:  '',
customField: '20101120-173724'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxeif12e8615c7db']={
webappId:    '1003',
documentId:  '60301',
internalId:  'abw0x0inxeif12e8615c7db',
customField: 'fr:FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60401',
internalId:  '',
customField: '20110321-230642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60343',
internalId:  '',
customField: '20110305-135457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60301',
internalId:  '',
customField: '20110305-135457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60322',
internalId:  '',
customField: '20110305-135457'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXEIF';
var companyName   = 'La+construction+naturelle+';
var htmlTitle	  = 'constructeur+de+maisons+%C3%A9cologiques+de+A+%C3%A0+Z';
var metaKeywords  = 'maison%3B+maisons%3B+villa%3B+villas%3B+entreprise+g%C3%A9n%C3%A9rale%3B+construction%3B+r%C3%A9alisation%3B+%C3%A9colo%3B+%C3%A9cologie%3B+%C3%A9cologique%3B+g%C3%A9obiologique%3B+naturel%3B+naturelle%3B+cl%C3%A9+en+main%3B+forfaitaire%3B+forfait%3B+constructeur%3B+entrepreneur%3B+b%C3%A2tisseur%3B+coordination%3B+habitat%3B+minergie%3B+projet%3B+passive%3B+passives%3B+eco%3B+%C3%A9tude%3B+ferme%3B+transformation%3B+r%C3%A9novation%3B+maison+passive%3B+maisons+passives%3B+paille%3B+bottes+de+paille%3B+partenaires+minergie%3B+construction+en+bois%3B+construction+bois%3B+isolation+en+paille%3B+isolation+en+bottes+de+pailles%3B+passif%3B+architecte%3B+architectes%3B+enduit%3B+terre%3B+terre+crue%3B+argile%3B+chanvre%3B+bois%3B+fibre+de+bois%3B+pavatex%3B+diffutherm%3B+misapor%3B+pavatherm%3B+pavaflex%3B+pavaboard%3B+fermacell%3B+bureau+d%27%C3%A9tudes%3B+bureau+technique%3B+%C3%A9nergie+renouvelable%3B+%C3%A9nergies+renouvelables%3B+cog%C3%A9n%C3%A9ration%3B+%C3%A9tudes+techniques%3B+enveloppe+du+b%C3%A2timent%3B+bio-construction%3B';
var metaContents  = 'Constructeur%3B+Maison+%C3%A9cologique%3B+Maison+en+paille%3B+Entreprise+g%C3%A9n%C3%A9rale%3B+Constructions+cl%C3%A9s+en+mains%3B+Concept+de+construction+%C3%A9cologique+pour+maisons+familiales+et+petites+PPE%3B+Projet+et+r%C3%A9alisation%3B+Bureau+d%27%C3%A9tudes%3B+bureau+technique%3B+%C3%A9nergie+renouvelable%3B+enveloppe+du+b%C3%A2timent%3B+domotique%3B';
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();
};

