/* [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','4607',jdecode('Home'),jdecode(''),'/4607.html','true',[],'',''],
	['PAGE','4955',jdecode('Maisons'),jdecode(''),'/4955.html','true',[],'',''],
	['PAGE','4982',jdecode('Appartements'),jdecode(''),'/4982.html','true',[],'',''],
	['PAGE','16702',jdecode('Immeubles'),jdecode(''),'/16702.html','true',[],'',''],
	['PAGE','7971',jdecode('Commercial'),jdecode(''),'/7971.html','true',[],'',''],
	['PAGE','5009',jdecode('Terrains'),jdecode(''),'/5009.html','true',[],'',''],
	['PAGE','14202',jdecode('Locations'),jdecode(''),'/14202.html','true',[],'',''],
	['PAGE','15076',jdecode('Nous+cherchons'),jdecode(''),'/15076.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='FADE8A';
theSitetree.keyvisualId='2657';
theSitetree.keyvisualName='architekt.jpg';
theSitetree.fontsetId='220';
theSitetree.graphicsetId='261';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FADE8A';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportive',
				paletteFamily: 	'FADE8A',
				keyvisualId: 	'2657',
				keyvisualName: 	'architekt.jpg',
				fontsetId: 		'220',
				graphicsetId: 	'261',
				contentColor: 	'000066',
				contentBGColor: 'FADE8A',
				a_color: 		'FADE8A',
				b_color: 		'D0B976',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4607',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4607',
internalId:  '',
customField: '20100613-090349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4982',
internalId:  '',
customField: '20100826-085323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4955',
internalId:  '',
customField: '20100820-101247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16702',
internalId:  '',
customField: '20100803-101728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14202',
internalId:  '',
customField: '20090419-105158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5009',
internalId:  '',
customField: '20100507-155530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7971',
internalId:  '',
customField: '20100320-173813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15076',
internalId:  '',
customField: '20090419-105331'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSZB';
var companyName   = 'Agence+de+Gestion+%26+de+Courtage+S%C3%A0rl';
var htmlTitle	  = 'Agence+de+Gestion+et+de+Courtage+S%C3%A0rl+-+immobilier+en+Suisse+romande';
var metaKeywords  = 'immobilier%2C+courtage%2C+vente%2C+achat%2C+appartement%2C+villa%2C+immeuble%2C+terrain%2C+g%C3%A9rance%2C+courtage%2C+b%C3%A2timent%2C+promotion%2C+Vaud%2C+Valais%2C+Gen%C3%A8ve%2C+Fribourg%2C+villa+de+luxe%2C+contigues%2C+jumelles%2C+maison%2C+bien+immobilier%2C+halles%2C+industriel%2C+artisanal%2C+courtier%2C+biens+fonds%2C+hoirie%2C+propri%C3%A9taire%2C+acheteur%2C+copropri%C3%A9t%C3%A9%2C+PPE%2C+SI%2C+SA%2CSIAL%2C+en+nom%2C+comission%2C+notaire%2C+commodit%C3%A9%2C+bus%2C+train%2C+route%2C+autoroute%2C+vue%2C+calme%2C+soleil%2C+pi%C3%A8ces%2C+cuisine%2C+wc%2C+cave%2C+grenier%2C+garage%2C+chemin%C3%A9e%2C+salon%2C+salle+%C3%A0+manger%2C+prix%2C+surface%2C+volume%2C+habitation%2C+habitable%2C+COS%2C+CUS%2C+IOS%2C+IUS%2C+rendement%2C+loyer%2C+locataire%2C+chauffage%2C+piscine%2C+sauna%2C+jacuzzi%2C+salle+de+fitness%2C+parc%2C+arbor%C3%A9%2C+arboris%C3%A9%2C+jardin%2C+terrasse%2C+place+de+jeu%2C+famille%2C+enfant%2C+acheteur%2C+vendeur%2C+notaire%2C+simple%2C+direct%2C+souple%2C+clair%2C+soign%C3%A9%2C++';
var metaContents  = 'immobilier%2C+courtage%2C+vente%2C+achat%2C+appartement%2C+villa%2C+immeuble%2C+terrain%2C+g%C3%A9rance%2C+courtage%2C+b%C3%A2timent%2C+promotion%2C+Vaud%2C+Valais%2C+Gen%C3%A8ve%2C+Fribourg%2C+villa+de+luxe%2C+contigues%2C+jumelles%2C+maison%2C+bien+immobilier%2C+halles%2C+industriel%2C+artisanal%2C+courtier%2C+biens+fonds%2C+hoirie%2C+propri%C3%A9taire%2C+acheteur%2C+copropri%C3%A9t%C3%A9%2C+PPE%2C+SI%2C+SA%2CSIAL%2C+en+nom%2C+comission%2C+notaire%2C+commodit%C3%A9%2C+bus%2C+train%2C+route%2C+autoroute%2C+vue%2C+calme%2C+soleil%2C+pi%C3%A8ces%2C+cuisine%2C+wc%2C+cave%2C+grenier%2C+garage%2C+chemin%C3%A9e%2C+salon%2C+salle+%C3%A0+manger%2C+prix%2C+surface%2C+volume%2C+habitation%2C+habitable%2C+COS%2C+CUS%2C+IOS%2C+IUS%2C+rendement%2C+loyer%2C+locataire%2C+chauffage%2C+piscine%2C+sauna%2C+jacuzzi%2C+salle+de+fitness%2C+parc%2C+arbor%C3%A9%2C+arboris%C3%A9%2C+jardin%2C+terrasse%2C+place+de+jeu%2C+famille%2C+enfant%2C+acheteur%2C+vendeur%2C+notaire%2C+simple%2C+direct%2C+souple%2C+clair%2C+soign%C3%A9%2C++';
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();
};
