/* [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','4437',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/4437.html','true',[],'',''],
	['PAGE','6682',jdecode('Set+pour+villas'),jdecode(''),'/6682.html','true',[],'',''],
	['PAGE','8001',jdecode('Stations+d%26%23x27%3Bappartement'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','8109',jdecode('Portiers'),jdecode(''),'/8109.html','true',[],'',''],
	['PAGE','8217',jdecode('Claviers+de+Code'),jdecode(''),'/8217.html','true',[],'',''],
	['PAGE','13741',jdecode('Sch%C3%A9mas+'),jdecode(''),'/13741/index.html','true',[ 
		['PAGE','13768',jdecode('Sch%C3%A9ma+MX+90+base'),jdecode(''),'/13741/13768.html','true',[],'',''],
		['PAGE','13795',jdecode('Sch%C3%A9ma+T-940+Stadio'),jdecode(''),'/13741/13795.html','true',[],'',''],
		['PAGE','13822',jdecode('Sch%C3%A9ma+Code+3301+Stadio'),jdecode(''),'/13741/13822.html','true',[],'','']
	],'',''],
	['PAGE','18900',jdecode('Interphone+simple'),jdecode(''),'/18900.html','true',[],'',''],
	['PAGE','18663',jdecode('Portrait'),jdecode(''),'/18663.html','true',[],'',''],
	['PAGE','11602',jdecode('Acc%C3%A8s'),jdecode(''),'/11602.html','true',[],'',''],
	['PAGE','6952',jdecode('Contact'),jdecode(''),'/6952/index.html','true',[ 
		['PAGE','16941',jdecode('Contact+%28Form+followup+page%29'),jdecode(''),'/6952/16941.html','false',[],'','']
	],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '11602',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['1009']=webappMappings['1009-4907807']={
webappId:    '1009',
documentId:  '16941',
internalId:  '4907807',
customField: 'isFollowupPage:true;documentId:6952;'
};
webappMappings['7008']=webappMappings['7008-1035']={
webappId:    '7008',
documentId:  '6952',
internalId:  '1035',
customField: 'language:fr;country:FR;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4437',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1771175']={
webappId:    '1501',
documentId:  '4437',
internalId:  '1771175',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4437',
internalId:  '',
customField: '20090203-105059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6682',
internalId:  '',
customField: '20100527-162950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20081223-111801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8109',
internalId:  '',
customField: '20080109-155316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8217',
internalId:  '',
customField: '20080610-105450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13741',
internalId:  '',
customField: '20040318-094635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13768',
internalId:  '',
customField: '20050304-110453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13795',
internalId:  '',
customField: '20041230-094429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13822',
internalId:  '',
customField: '20041230-094503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18900',
internalId:  '',
customField: '20050204-111805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18663',
internalId:  '',
customField: '20050223-090001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11602',
internalId:  '',
customField: '20040218-104614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6952',
internalId:  '',
customField: '20050204-103351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16941',
internalId:  '',
customField: '20050202-102053'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX3K2';
var companyName   = 'ALTHAUS+SA++Interphones+altex+et+golmar';
var htmlTitle	  = 'Althaus+SA+-+Interphones+altex+et+golmar';
var metaKeywords  = 'golmar+altex+interphone+interphones+vid%C3%A9o+codes+Gegensprechanlagen+Video+Zutrittscode+Eingangscode+parlophone+T%C3%BCrstationen+platines+platine+syst%C3%A8mes+T%C3%BCrsprechstelle+Torstelle+portier+vid%C3%A9os+Gegensprechanlage+Sonceboz';
var metaContents  = 'Althaus+SA+interphones+altex+et+golmar';
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();
};

