/* [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','501',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','92901',jdecode('R%C3%A9sultats+expos'),jdecode(''),'/92901.html','true',[],'',''],
	['PAGE','552',jdecode('M%C3%A2les'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Femelles'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','594',jdecode('Chatons'),jdecode(''),'/594/index.html','true',[ 
		['PAGE','27964',jdecode('British'),jdecode(''),'/594/27964.html','true',[],'','']
	],'',''],
	['PAGE','50701',jdecode('Mariages'),jdecode(''),'/50701.html','true',[],'',''],
	['PAGE','54301',jdecode('Nos+anciens+chatons'),jdecode(''),'/54301.html','true',[],'',''],
	['PAGE','28027',jdecode('Conditions+de+vente'),jdecode(''),'/28027.html','true',[],'',''],
	['PAGE','5501',jdecode('Nos+Amis'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','5522',jdecode('Contact'),jdecode(''),'/5522.html','true',[],'',''],
	['PAGE','5906',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/5906/index.html','true',[ 
		['PAGE','5901',jdecode('Entr%C3%A9es'),jdecode(''),'/5906/5901.html','false',[],'','']
	],'',''],
	['PAGE','44601',jdecode('Acc%C3%A8s'),jdecode(''),'/44601.html','true',[],'',''],
	['PAGE','44701',jdecode('Comment+nous+trouver'),jdecode(''),'/44701.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Charm';
theSitetree.paletteFamily='E1D5F2';
theSitetree.keyvisualId='11066';
theSitetree.keyvisualName='kv_11066.jpg';
theSitetree.fontsetId='31948';
theSitetree.graphicsetId='13791';
theSitetree.contentColor='1F1F1F';
theSitetree.contentBGColor='E1D5F2';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Charm',
				paletteFamily: 	'E1D5F2',
				keyvisualId: 	'11066',
				keyvisualName: 	'kv_11066.jpg',
				fontsetId: 		'31948',
				graphicsetId: 	'13791',
				contentColor: 	'1F1F1F',
				contentBGColor: 'E1D5F2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100429-213949'
};
webappMappings['1002']=webappMappings['1002-5906abw0x0in2va5']={
webappId:    '1002',
documentId:  '5906',
internalId:  '5906abw0x0in2va5',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100617-172425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100614-205910'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '44601',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '44701',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20090621-184556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27964',
internalId:  '',
customField: '20100617-172826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50701',
internalId:  '',
customField: '20100429-211124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92901',
internalId:  '',
customField: '20100428-202405'
};
webappMappings['1501']=webappMappings['1501-20425828']={
webappId:    '1501',
documentId:  '501',
internalId:  '20425828',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54301',
internalId:  '',
customField: '20100428-204204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28027',
internalId:  '',
customField: '20100428-204304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20090519-204447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20080621-203224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5906',
internalId:  '',
customField: '20070611-193751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20070611-193751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44601',
internalId:  '',
customField: '20080402-191815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20080402-191830'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2VA5';
var companyName   = 'Le+r%C3%AAve+d%27Adrian';
var htmlTitle	  = '';
var metaKeywords  = 'chat+chatons+british+';
var metaContents  = 'Elevage+familliale+de+british+shorthair+et+longhair+et+fold';
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();
};
