/* [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','4437',jdecode('Home'),jdecode(''), jdecode('%2F4437.html'), 'true',[],'',''],
	['PAGE','58175',jdecode('NEWS'),jdecode(''), jdecode('%2F58175%2Findex.html'), 'true',[ 
		['PAGE','92269',jdecode('Broches+haute+vitesse+FANUC'),jdecode(''), jdecode('%2F58175%2F92269.html'), 'true',[],'',''],
		['PAGE','103669',jdecode('Usinage+de+platines'),jdecode(''), jdecode('%2F58175%2F103669.html'), 'true',[],'',''],
		['PAGE','92296',jdecode('Chargement+de+pi%C3%A8ces+automatis%C3%A9'),jdecode(''), jdecode('%2F58175%2F92296.html'), 'true',[],'','']
	],'',''],
	['PAGE','40369',jdecode('Expositions'),jdecode(''), jdecode('%2F40369.html'), 'true',[],'',''],
	['PAGE','41369',jdecode('Occasions'),jdecode(''), jdecode('%2F41369.html'), 'true',[],'',''],
	['PAGE','4575',jdecode('Offres+sp%C3%A9ciales'),jdecode(''), jdecode('%2F4575%2Findex.html'), 'true',[ 
		['PAGE','115168',jdecode('Automation+Indunorm'),jdecode(''), jdecode('%2F4575%2F115168.html'), 'true',[],'','']
	],'',''],
	['PAGE','29203',jdecode('Centres+d%26%23x27%3Businage+FANUC'),jdecode(''), jdecode('%2F29203%2Findex.html'), 'true',[ 
		['PAGE','45105',jdecode('La+soci%C3%A9t%C3%A9+FANUC'),jdecode(''), jdecode('%2F29203%2F45105.html'), 'true',[],'',''],
		['PAGE','45132',jdecode('Caract%C3%A9ristiques+des+machines'),jdecode(''), jdecode('%2F29203%2F45132.html'), 'true',[],'',''],
		['PAGE','45159',jdecode('Automation'),jdecode(''), jdecode('%2F29203%2F45159.html'), 'true',[],'',''],
		['PAGE','45186',jdecode('Broches+haute+vitesse'),jdecode(''), jdecode('%2F29203%2F45186.html'), 'true',[],'',''],
		['PAGE','45213',jdecode('Usinage+en+barres'),jdecode(''), jdecode('%2F29203%2F45213.html'), 'true',[],'',''],
		['PAGE','45240',jdecode('Mecatool'),jdecode(''), jdecode('%2F29203%2F45240.html'), 'true',[],'',''],
		['PAGE','45267',jdecode('Accessoires'),jdecode(''), jdecode('%2F29203%2F45267.html'), 'true',[],'','']
	],'',''],
	['PAGE','29230',jdecode('Centres+d%26%23x27%3Businage+AWEA'),jdecode(''), jdecode('%2F29230%2Findex.html'), 'true',[ 
		['PAGE','93402',jdecode('AF-610+Swiss+%2B'),jdecode(''), jdecode('%2F29230%2F93402.html'), 'true',[],'',''],
		['PAGE','35469',jdecode('AF-1000+Swiss+%2B'),jdecode(''), jdecode('%2F29230%2F35469.html'), 'true',[],'','']
	],'',''],
	['PAGE','29257',jdecode('Centres+d%26%23x27%3Businage+TAKUMI'),jdecode(''), jdecode('%2F29257%2Findex.html'), 'true',[ 
		['PAGE','33569',jdecode('Takumi+5+axes'),jdecode(''), jdecode('%2F29257%2F33569.html'), 'true',[],'','']
	],'',''],
	['PAGE','29284',jdecode('Tours+CNC+GOODWAY'),jdecode(''), jdecode('%2F29284%2Findex.html'), 'true',[ 
		['PAGE','33957',jdecode('TA+-+32_____frontal'),jdecode(''), jdecode('%2F29284%2F33957.html'), 'true',[],'',''],
		['PAGE','34190',jdecode('GLS-150%2F200_____2+axes'),jdecode(''), jdecode('%2F29284%2F34190.html'), 'true',[],'',''],
		['PAGE','34217',jdecode('GT-25_____2-5+axes'),jdecode(''), jdecode('%2F29284%2F34217.html'), 'true',[],'',''],
		['PAGE','34244',jdecode('GS-200%2F260%2F280_____2-5+axes'),jdecode(''), jdecode('%2F29284%2F34244.html'), 'true',[],'',''],
		['PAGE','34485',jdecode('GTS-100%2F150_____6+axes'),jdecode(''), jdecode('%2F29284%2F34485.html'), 'true',[],'',''],
		['PAGE','34512',jdecode('GA-200%2F230%2F260_____2-5+axes'),jdecode(''), jdecode('%2F29284%2F34512.html'), 'true',[],'',''],
		['PAGE','34539',jdecode('GA-300%2F330%2F360_____2-5+axes'),jdecode(''), jdecode('%2F29284%2F34539.html'), 'true',[],'',''],
		['PAGE','34566',jdecode('GS-400_____2axes'),jdecode(''), jdecode('%2F29284%2F34566.html'), 'true',[],'','']
	],'',''],
	['PAGE','40423',jdecode('Ou+nous+trouver'),jdecode(''), jdecode('%2F40423.html'), 'true',[],'',''],
	['PAGE','39880',jdecode('Liaisons+fournisseurs'),jdecode(''), jdecode('%2F39880.html'), 'true',[],'','']];
var siteelementCount=33;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='DB7A7A';
theSitetree.keyvisualId='1994';
theSitetree.keyvisualName='waage2.jpg';
theSitetree.fontsetId='328';
theSitetree.graphicsetId='386';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'DB7A7A',
				keyvisualId: 	'1994',
				keyvisualName: 	'waage2.jpg',
				fontsetId: 		'328',
				graphicsetId: 	'386',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'DB7A7A',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				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:  '4437',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4437',
internalId:  '',
customField: '20100118-113506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40369',
internalId:  '',
customField: '20120201-101541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58175',
internalId:  '',
customField: '20100426-164717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92269',
internalId:  '',
customField: '20050615-145042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103669',
internalId:  '',
customField: '20120201-101312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92296',
internalId:  '',
customField: '20100426-164850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41369',
internalId:  '',
customField: '20100426-164952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4575',
internalId:  '',
customField: '20120201-101922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115168',
internalId:  '',
customField: '20110325-102614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29203',
internalId:  '',
customField: '20060912-151026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45105',
internalId:  '',
customField: '20120201-102223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45132',
internalId:  '',
customField: '20120201-102323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45159',
internalId:  '',
customField: '20120201-102421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45186',
internalId:  '',
customField: '20050615-161715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45213',
internalId:  '',
customField: '20070830-145723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45240',
internalId:  '',
customField: '20050615-162745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45267',
internalId:  '',
customField: '20030725-121714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29230',
internalId:  '',
customField: '20070216-081208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93402',
internalId:  '',
customField: '20070216-083129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35469',
internalId:  '',
customField: '20070216-083044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29257',
internalId:  '',
customField: '20081021-153814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33569',
internalId:  '',
customField: '20081021-153958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29284',
internalId:  '',
customField: '20070326-113829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33957',
internalId:  '',
customField: '20070326-113929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34190',
internalId:  '',
customField: '20070326-113951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34217',
internalId:  '',
customField: '20030422-150529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34244',
internalId:  '',
customField: '20070326-114141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34485',
internalId:  '',
customField: '20070326-114236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34512',
internalId:  '',
customField: '20070326-114348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34539',
internalId:  '',
customField: '20070326-114433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34566',
internalId:  '',
customField: '20070326-114709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40423',
internalId:  '',
customField: '20100426-181601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39880',
internalId:  '',
customField: '20081021-163007'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEWK';
var companyName   = 'MICHEL+MAHON+SA+machines+outils';
var htmlTitle	  = 'MAHON+machines+outils+CNC';
var metaKeywords  = 'Machines+outilsCentres+dusinageTours+CNCRobotsCNCFanucAweaGoodwayHartfordEagleMahon';
var metaContents  = 'Machines+outilsCentres+dusinageTours+CNCRobotsCNCFanucAweaGoodwayHartfordEagleMahon';
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();
};

