/* [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 theSitetree=[ 
	['PAGE','1801',jdecode('Pr%C3%A9sentation+Halieutique+Journal'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','15364',jdecode('Le+journal'),jdecode(''),'/15364.html','true',[],''],
	['PAGE','16901',jdecode('Instructions+aux+auteurs'),jdecode(''),'/16901.html','true',[],''],
	['PAGE','17501',jdecode('Comit%C3%A9+d%26%23x27%3B%C3%A9dition'),jdecode(''),'/17501.html','true',[],''],
	['PAGE','15385',jdecode('La+Tribune'),jdecode(''),'/15385.html','false',[],''],
	['PAGE','31001',jdecode('Ev%C3%A9nements'),jdecode(''),'/31001.html','true',[],''],
	['PAGE','15406',jdecode('Liens'),jdecode(''),'/15406.html','true',[],''],
	['PAGE','23201',jdecode('Rechercher+'),jdecode(''),'/23201.html','true',[],''],
	['PAGE','15427',jdecode('Contact'),jdecode(''),'/15427.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Porthole';
theSitetree.paletteFamily='064B91';
theSitetree.keyvisualId='6726';
theSitetree.keyvisualName='kv_6726.jpg';
theSitetree.fontsetId='11200';
theSitetree.graphicsetId='12013';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E9F3FF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Porthole',
				paletteFamily: 	'064B91',
				keyvisualId: 	'6726',
				keyvisualName: 	'kv_6726.jpg',
				fontsetId: 		'11200',
				graphicsetId: 	'12013',
				contentColor: 	'000000',
				contentBGColor: 'E9F3FF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20091122-114028'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-11076']={
webappId:    '7008',
documentId:  '16901',
internalId:  '11076',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '31001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15406',
internalId:  '',
customField: '20100117-103155'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '16901',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '17501',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1801',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '23201',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31001',
internalId:  '',
customField: '20100111-184934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15427',
internalId:  '',
customField: '20091122-114201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15385',
internalId:  '',
customField: '20090201-153733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15364',
internalId:  '',
customField: '20091122-105737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20100116-111252'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '23201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20100116-110602'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15364',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15385',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15406',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15427',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20100110-172322'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2UYL';
var companyName   = 'Le+JOURNAL+des+sciences+Halieutique+et+Aquatique';
var htmlTitle	  = 'Halieutique+Journal%2C+le+Journal+des+sciences+halieutiques+et+Aquatiques';
var metaKeywords  = 'halieutique%2C+journal+halieutique%2C+halieutique+journal%2C+journal+d+halieutique%2C+p%C3%AAche%2C+poisson%2C+poissons%2C+journal%2C+bancs+de+poissons%2C+thon%2C+sardine%2C+p%C3%AAcheur%2C+%C3%A9valuation+des+stocks%2C+ressource+vivante%2C+mer%2C+oc%C3%A9an%2C+Patrice+Brehmer%2C+anchois%2C+requin%2C+sonar%2C+sondeurs%2C+%C3%A9cologie+marine%2C+%C3%A9cologie+des+p%C3%AAches%2C+aquatique%2C+mod%C3%A8le%2C+brehmer%2C+omnidirectionnel%2C+oceanraise%2C+m%C3%A9c%C3%A9nat%2C+don%2C+forum%2C+scientifique%2C+gestion%2C+durable%2C+rationnel%2C+%C3%A9cosyst%C3%A8me+marin%2C+ecosystemique%2C+observation+in+situ%2C+chinchard%2C+maquereau%2C+merlu%2C+approche+directe%2C+';
var metaContents  = 'Halieutique+Journal%2C+le+Journal+des+Sciences+Halieutique+et+Aquatique.+Halieutique.org%2C+journal+scientifique+offre+une+tribune+francophone+d+information+g%C3%A9n%C3%A9raliste+sur+les+sciences+aquatiques+et+plus+particuli%C3%A8rement+sur+les+sciences+de+la+p%C3%AAche.';
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();
};
