/* [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','5601',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','6601',jdecode('Nos+produits'),jdecode(''),'/6601/index.html','true',[ 
		['PAGE','20401',jdecode('Cam%C3%A9ra+%2F+Enregistreur'),jdecode(''),'/6601/20401.html','true',[],'',''],
		['PAGE','21501',jdecode('Syst%C3%A8me+d%26%23x27%3Balarme'),jdecode(''),'/6601/21501.html','true',[],'','']
	],'',''],
	['PAGE','5673',jdecode('Services'),jdecode(''),'/5673/index.html','true',[ 
		['PAGE','5715',jdecode('Conseil'),jdecode(''),'/5673/5715.html','true',[],'',''],
		['PAGE','5736',jdecode('Planification'),jdecode(''),'/5673/5736.html','true',[],'',''],
		['PAGE','6622',jdecode('Maintenance'),jdecode(''),'/5673/6622.html','true',[],'','']
	],'',''],
	['PAGE','5652',jdecode('Installation'),jdecode(''),'/5652.html','true',[],'',''],
	['PAGE','5778',jdecode('Trucs+et+astuces'),jdecode(''),'/5778.html','true',[],'',''],
	['PAGE','5820',jdecode('Contact'),jdecode(''),'/5820.html','true',[],'',''],
	['PAGE','17301',jdecode('Shop'),jdecode(''),'/17301.html','false',[],'',''],
	['PAGE','19501',jdecode('Pour+nous+trouver'),jdecode(''),'/19501.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Mazy';
theSitetree.paletteFamily='96958D';
theSitetree.keyvisualId='11098';
theSitetree.keyvisualName='kv_11098.jpg';
theSitetree.fontsetId='31988';
theSitetree.graphicsetId='13823';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mazy',
				paletteFamily: 	'96958D',
				keyvisualId: 	'11098',
				keyvisualName: 	'kv_11098.jpg',
				fontsetId: 		'31988',
				graphicsetId: 	'13823',
				contentColor: 	'3C3D3C',
				contentBGColor: 'FFFFFF',
				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:  '5601',
internalId:  '',
customField: '20110106-140710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100907-100106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5673',
internalId:  '',
customField: '20110626-112601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6622',
internalId:  '',
customField: '20100825-081900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5736',
internalId:  '',
customField: '20100825-081948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5715',
internalId:  '',
customField: '20100825-082334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20100825-082246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5778',
internalId:  '',
customField: '20100825-082228'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5820',
internalId:  '',
customField: '20100825-082534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20401',
internalId:  '',
customField: '20100907-153148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20100810-133424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20100825-082600'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '19501',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:true;'
};
webappMappings['1501']=webappMappings['1501-31831573']={
webappId:    '1501',
documentId:  '5601',
internalId:  '31831573',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20100825-082504'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEIJY';
var companyName   = 'Votre+partenaire+pour+la+s%C3%A9curit%C3%A9';
var htmlTitle	  = 'Alarme+et+vid%C3%A9o';
var metaKeywords  = 'syst%C3%A8me+d%27alarme%2C+alarme%2C+particuliers%2C+entreprises%2C+vid%C3%A9o%2C+vid%C3%A9o+surveillance%2C+vid%C3%A9osurveillance%2C+contr%C3%B4le+d%27acc%C3%A8s%2C+alarme+sans+fils%2C+alarme+filaire%2C+audit+s%C3%A9curit%C3%A9';
var metaContents  = 'Vente+et+installation+de+syst%C3%A8me+d%27alarme+et+de+vid%C3%A9osurveillance+en+Suisse%2C+conseils+et+offres+sans+engagements.';
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();
};

