/* [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','2601',jdecode('++CONTACTOLOGIE+++++++++++++MEDICALE+sp%C3%A9cialiste+en+lentilles+de+contact'),jdecode(''), jdecode('%2F2601.html'), 'true',[],'',''],
	['PAGE','4001',jdecode('++CABINET+MEDICAL'),jdecode(''), jdecode('%2F4001.html'), 'true',[],'',''],
	['PAGE','4043',jdecode('++CONTACT++++++++++++++++++++Contactologie+M%C3%A9dicale'),jdecode(''), jdecode('%2F4043.html'), 'true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Fields';
theSitetree.paletteFamily='0D0D0D';
theSitetree.keyvisualId='11286';
theSitetree.keyvisualName='kv_11286.jpg';
theSitetree.fontsetId='31969';
theSitetree.graphicsetId='13806';
theSitetree.contentColor='F5F3F3';
theSitetree.contentBGColor='0D0D0D';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Fields',
				paletteFamily: 	'0D0D0D',
				keyvisualId: 	'11286',
				keyvisualName: 	'kv_11286.jpg',
				fontsetId: 		'31969',
				graphicsetId: 	'13806',
				contentColor: 	'F5F3F3',
				contentBGColor: '0D0D0D',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20111231-115126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20110331-174139'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4043',
internalId:  '',
customField: '20101006-094234'
};
webappMappings['7008']=webappMappings['7008-9350']={
webappId:    '7008',
documentId:  '4043',
internalId:  '9350',
customField: 'language:fr;country:FR;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEUBZ';
var companyName   = '+++++++++++++CONTACTOLOGIE++MEDICALE+++Verres+de+contact+++Cabinet+du+Prof.+M.+Deller++++++++++Pierre-Alain+Blanchoud+lentilles+de+contact+';
var htmlTitle	  = 'Contactologie+m%C3%A9dicale+verres+de+contact';
var metaKeywords  = 'lentilles+de+contact+sp%C3%A9cialiste%2C+verres+de+contact+lausanne%2C+lentilles+de+contact+sp%C3%A9cialiste+lausanne%2C+contactologie+m%C3%A9dicale%2C+ophtalmologue%2C+optom%C3%A9trie%2C+myopie%2C+astigmatisme%2C+specialiste+keratocone%2C+lentilles+pour+les+yeux+%2Csp%C3%A9cialiste+k%C3%A9ratoc%C3%B4ne+en+Suisse%2Ck%C3%A9ratoplastie%2C+sp%C3%A9cialiste+lentilles+de+contact%2Cverre+de+contact%2C+fabrication+sur+mesure%2C+lentilles+de+contact+progressives%2C+sp%C3%A9cialiste+en+lentilles+de+contact%2C+Pierre-Alain+Blanchoud%2C+contact+lens%2C+contact+lenses+switzerland%2C+lentilles+de+contact%2C+verres+de+contact%2C+sp%C3%A9cialiste+k%C3%A9ratoc%C3%B4ne%2C+myopie%2C+astigmatisme%2C+hyperm%C3%A9tropie%2Ckeratocone%2COptom%C3%A9trie%2COphtalmologue%2CDr+Pierre-Alain+Blanchoud%2Ccontact+lens+%2Clentilles+progressives%2C+presbytie%2C+contact+lenses+switzerland%2C+lausanne%2Ccontact+lens+swiss+made%2Cverres+de+contact+sur+mesure%2C1003+lausanne%2C+switzerland%2C+acuit%C3%A9+visuelle%2Ccontact+lenses+specialist%2Ccontact+lens+lausanne%2Ccontact+lens+switzerland%2Csp%C3%A9cialiste+du+k%C3%A9ratoc%C3%B4ne%2Ccontact+lenses+expert%2Clentilles+de+contact+Lausanne%2C+verres+de+contact+Lausanne%2Ck%C3%A9ratoc%C3%B4ne+expert%2CL%27+Oeil+le+reflet+de+l%27%C3%A2me+%21%2Clentilles+de+contact+lausanne%2Ckeratocone+specialiste%2C+k%C3%A9ratoc%C3%B4ne+pour+les+deux+yeux%2Ckeratoconus+specialist%2Cverres+ophtalmiques%2Ckontaktlinsen+1003+lausanne%2Cvaud%2Crenens%2Clutry%2Cpully%2Cromanel%2Ccheseaux%2Cmorges%2Cbussigny%2Cvevey%2Cmontreux%2Cprilly%2Ccrissier%2Cechallens%2Cvilleneuve%2C';
var metaContents  = 'La+CONTACTOLOGIE+MEDICALE+permet+lors+d%27une+consultation+par+votre+sp%C3%A9cialiste+en+lentilles+de+contact+sur+prescription+m%C3%A9dicale%2C+une+adaptation+en+lentilles+de+contact+sur+mesure+dans+les+cas+les+plus+complexes.+L%27+Oeil+le+reflet+de+l%27%C3%A2me+%21+lentilles+de+contact%2C+verres+de+contact%2C+sp%C3%A9cialiste+k%C3%A9ratoc%C3%B4ne%2C+keratocone+specialiste%2Ckeratoconus+specialist%2C+myopie%2Castigmatisme%2Chyperm%C3%A9tropie%2C+k%C3%A9ratoc%C3%B4ne%2COptom%C3%A9trie%2COphtalmologue%2C+Pierre-Alain+Blanchoud%2Ccontact+lens+lausanne%2Clentilles+de+contact+progressives%2Cpresbytie%2Ccontactologie+m%C3%A9dicale%2Ccontact+lenses+switzerland%2Cswiss+made%2Cverres+de+contact+sur+mesure%2C1003+lausanne%2C+switzerland%2Ccontact+lenses+specialist%2Csp%C3%A9cialiste+du+k%C3%A9ratoc%C3%B4ne+en+suisse%2Ccontact+lenses+expert+lausanne%2Ck%C3%A9ratoc%C3%B4ne+expert%2Clentilles+de+contact+lausanne%2Cverres+de+contact+lausanne%2Clentilles+de+contact+lausanne%2Ckeratoconus+specialist%2CLa+consultation+par+votre+sp%C3%A9cialiste+en+lentilles+de+contact+sur+prescription+m%C3%A9dicale%2C+la+Contactologie+M%C3%A9dicale+permet+une+adaptation+sur+mesure+en+verres+de+contact+complexes+suisses%2Ckontaktlinsen+1003+lausanne%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();
};

