/* [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','901',jdecode('home+'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','35623',jdecode('shop'),jdecode(''), jdecode('%2F35623.html'), 'true',[],'',''],
	['PAGE','5701',jdecode('photos'),jdecode(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','20201',jdecode('Contact'),jdecode(''), jdecode('%2F20201.html'), 'true',[],'',''],
	['PAGE','20222',jdecode('Comment+nous+trouver'),jdecode(''), jdecode('%2F20222.html'), 'true',[],'',''],
	['PAGE','30312',jdecode('Foires+et+salons%2FCalendrier'),jdecode(''), jdecode('%2F30312.html'), 'true',[],'',''],
	['PAGE','30205',jdecode('Mentions+l%C3%A9gales'),jdecode(''), jdecode('%2F30205.html'), 'true',[],'',''],
	['PAGE','44723',jdecode('liens'),jdecode(''), jdecode('%2F44723.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='2354B7';
theSitetree.keyvisualId='2703';
theSitetree.keyvisualName='kv_2703.jpg';
theSitetree.fontsetId='10701';
theSitetree.graphicsetId='10633';
theSitetree.contentColor='2354B7';
theSitetree.contentBGColor='C6E2FE';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'2354B7',
				keyvisualId: 	'2703',
				keyvisualName: 	'kv_2703.jpg',
				fontsetId: 		'10701',
				graphicsetId: 	'10633',
				contentColor: 	'2354B7',
				contentBGColor: 'C6E2FE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2354B7',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20110404-130928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100323-185704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20100128-183350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20222',
internalId:  '',
customField: '20091017-174933'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35623',
internalId:  '',
customField: '20091123-201300'
};
webappMappings['4001']=webappMappings['4001-30448031']={
webappId:    '4001',
documentId:  '35623',
internalId:  '30448031',
customField: 'language:fr;country:FR;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '20222',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30205',
internalId:  '',
customField: '20091105-191300'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '901',
internalId:  '1501',
customField: '1501'
};
webappMappings['1501']=webappMappings['1501-30345007']={
webappId:    '1501',
documentId:  '901',
internalId:  '30345007',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30312',
internalId:  '',
customField: '20091201-201052'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '30205',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '30312',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '20222',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '20201',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '5701',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '35623',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '901',
internalId:  '',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44723',
internalId:  '',
customField: '20110916-072842'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0INE7N1';
var companyName   = 'atoutpeche.ch';
var htmlTitle	  = '';
var metaKeywords  = 'magasin%2C+canne%2C+moulinet%2C+leurre%2C+peche%2C+neuchatel%2C+st-aubin%2C+illex%2C+sert%2C+kuusamo%2C+garbolino%2C+appat%2C+astucit%2C+poissons%2C+fils%2C+loisir%2C+suisse%2C+atout%2C+awa-shima%2C+nacre%2C+bateau%2C+lac%2C+riviere%2C+truite%2C+brochet%2C+perche%2C+plombs%2C+cuilliere%2C+zebco%2C+quantum%2C+rhino%2C+black+cat%2C+silure%2C+etang%2C+powerline%2C+sakura%2C+salmo%2C+nils%2C+master%2C+owner%2C+drachko%2C+ver%2C+asticots%2C+teigne%2C+ver%2C+farine%2C+traine%2C+deriveurs%2C+sasame%2C+zenaque%2C+tenryu%2C+rivire%2C+ruisseau%2C+toc%2C+mouche%2C+carnassier%2C+bondelle%2C+palee%2C+truite%2C+brochet%2C+sandre%2C+perche%2C+silure%2C+telereglable%2C+casting%2C+spinning%2C+2024%2C+%2B41328351851%2C+%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0Amagasin+en+ligne%2C';
var metaContents  = 'sert%2C+powerline%2C+garbolino%2C+peche%2C+moulinet%2C+lac%2C+riviere%2C+canne%2C+magasin%2C+st-aubin%2C+awa-shima%2C+illex%2C+astucit%2C+drachko%2C+pezon+et+michel%2C+truite%2C+perche%2C+brochet%2C+article%2C+silure%2C+gardon%2C+palee%2C+bondel%2C+vairon%2C+bouchon+%2C+hamecon+%2C+nils+master+%2C+owner%2C+permis%2C+kuusamo+%2Cneuchatel+%2C+tenryu+%2Csalmo+%2C+ver%2C+asticot+%2C+carnassier+%2C+sasam%2C+anniverssaire%2C+magasin+%2C+shop+%2Cligne%2Clittoral%2Cneuchatel%2Cst-aubin%2Cpeche%2Clacs%2Cspacialiste%2Clittoral%2C0328351851%2Ccasting%2Cspinnin';
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();
};

