/* [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','701',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''), jdecode('%2F701.html'), 'true',[],'',''],
	['PAGE','752',jdecode('Pr%C3%A9sentation'),jdecode(''), jdecode('%2F752.html'), 'true',[],'',''],
	['PAGE','773',jdecode('Pr%C3%A9stations'),jdecode(''), jdecode('%2F773.html'), 'true',[],'',''],
	['PAGE','7401',jdecode('Projets'),jdecode(''), jdecode('%2F7401%2Findex.html'), 'true',[ 
		['PAGE','815',jdecode('Projets+en+cours'),jdecode(''), jdecode('%2F7401%2F815.html'), 'true',[],'',''],
		['PAGE','7422',jdecode('Projets+futurs'),jdecode(''), jdecode('%2F7401%2F7422.html'), 'true',[],'',''],
		['PAGE','7443',jdecode('Projets+termin%C3%A9s'),jdecode(''), jdecode('%2F7401%2F7443.html'), 'true',[],'','']
	],'',''],
	['PAGE','7464',jdecode('Ventes+%26+locations'),jdecode(''), jdecode('%2F7464%2Findex.html'), 'true',[ 
		['PAGE','7485',jdecode('En+cours'),jdecode(''), jdecode('%2F7464%2F7485.html'), 'true',[],'',''],
		['PAGE','7506',jdecode('Futures'),jdecode(''), jdecode('%2F7464%2F7506.html'), 'true',[],'','']
	],'',''],
	['PAGE','36501',jdecode('Concours'),jdecode(''), jdecode('%2F36501.html'), 'true',[],'',''],
	['PAGE','836',jdecode('R%C3%A9f%C3%A9rences'),jdecode(''), jdecode('%2F836.html'), 'true',[],'',''],
	['PAGE','878',jdecode('Adresse%2C+T%C3%A9l%C3%A9phone'),jdecode(''), jdecode('%2F878%2Findex.html'), 'true',[ 
		['PAGE','899',jdecode('Plan+de+situation'),jdecode(''), jdecode('%2F878%2F899.html'), 'true',[],'','']
	],'',''],
	['PAGE','7548',jdecode('Jobs+%2F+Liens'),jdecode(''), jdecode('%2F7548.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='994';
theSitetree.keyvisualName='dachdecker2.jpg';
theSitetree.fontsetId='168';
theSitetree.graphicsetId='197';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'660000',
				keyvisualId: 	'994',
				keyvisualName: 	'dachdecker2.jpg',
				fontsetId: 		'168',
				graphicsetId: 	'197',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'660000',
				c_color: 		'000000',
				d_color: 		'990000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20110802-235654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7464',
internalId:  '',
customField: '20110728-182338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20110724-233920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7443',
internalId:  '',
customField: '20110415-170711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20110724-231204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20110415-160210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20110724-234305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7422',
internalId:  '',
customField: '20110724-234148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7485',
internalId:  '',
customField: '20110929-223946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7506',
internalId:  '',
customField: '20110724-233220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20101223-103707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20110724-233302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '899',
internalId:  '',
customField: '20070112-190933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7548',
internalId:  '',
customField: '20110929-224559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36501',
internalId:  '',
customField: '20110415-161212'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2R8H';
var companyName   = 'ADAS+S.A.+Bureau+d%27Architecture';
var htmlTitle	  = '';
var metaKeywords  = 'Adas%2C+architecte%2C+architectes%2C+architecture%2C+Gen%C3%A8ve%2C+Duparc%2C+Verjus%2C+1er-Ao%C3%BBt%2C%2C+Bernex%2C+Communes-R%C3%A9unies%2C+Semailles%2C+route+dAnnecy%2C+Versoix%2C+Pinchat%2C+Lancy%2C+Grand-Lancy%2C+Grand-Pr%C3%A9%2C+Erne%2C+ventes%2C+PPE%2C+locations';
var metaContents  = 'Adas%2C+architecte%2C+architectes%2C+architecture%2C+Gen%C3%A8ve%2C+Duparc%2C+Verjus%2C+1er-Ao%C3%BBt%2C%2C+Bernex%2C+Communes-R%C3%A9unies%2C+Semailles%2C+route+dAnnecy%2C+Versoix%2C+Pinchat%2C+Lancy%2C+Grand-Lancy%2C+Grand-Pr%C3%A9%2C+Erne%2C+ventes%2C+PPE%2C+locations';
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();
};

