/* [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','2401',jdecode('Comptabilit%C3%A9+Terrebonne'),jdecode(''),'/2401.html','true',[],'',''],
	['PAGE','56223',jdecode('In+English'),jdecode(''),'/56223.html','true',[],'',''],
	['PAGE','2452',jdecode('%C3%80+qui+s%26%23x27%3Badresse+mes+services'),jdecode(''),'/2452.html','true',[],'',''],
	['PAGE','3601',jdecode('Services+comptables'),jdecode(''),'/3601.html','true',[],'',''],
	['PAGE','59723',jdecode('Imp%C3%B4ts+Terrebonne'),jdecode(''),'/59723.html','true',[],'',''],
	['PAGE','3706',jdecode('Profil+et+Coordonn%C3%A9es'),jdecode(''),'/3706.html','true',[],'',''],
	['PAGE','45712',jdecode('Video+Blog+-+Vos+Livres'),jdecode(''),'/45712.html','true',[],'',''],
	['PAGE','56244',jdecode('Courriel+%2F+E-mail'),jdecode(''),'/56244.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='52504D';
theSitetree.keyvisualId='11356';
theSitetree.keyvisualName='kv_11356.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13784';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='52504D';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'52504D',
				keyvisualId: 	'11356',
				keyvisualName: 	'kv_11356.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13784',
				contentColor: 	'000000',
				contentBGColor: '52504D',
				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:  '2401',
internalId:  '',
customField: '20100317-124914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20090410-080818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20090410-081056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3706',
internalId:  '',
customField: '20090828-152128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59723',
internalId:  '',
customField: '20100317-125853'
};
webappMappings['7008']=webappMappings['7008-8320']={
webappId:    '7008',
documentId:  '56244',
internalId:  '8320',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56223',
internalId:  '',
customField: '20090610-174643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56244',
internalId:  '',
customField: '20090605-084301'
};
webappMappings['7050']=webappMappings['7050-2840']={
webappId:    '7050',
documentId:  '45712',
internalId:  '2840',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45712',
internalId:  '',
customField: '20100317-113102'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHCI6';
var companyName   = 'Comptabilit%C3%A9+Terrebonne';
var htmlTitle	  = '';
var metaKeywords  = 'compta+terrebonne%2Ccomptabilit%C3%A9+terrebonne%2Ccomptables+terrebonne%2Ccomptable+terrebonne%2Cservices+comptables+terrebonne%2Cservices+de+comptabilit%C3%A9+terrebonne%2Cblog+comptabilit%C3%A9%2C+blog+tenue+de+livres%2Ccomptabilit%C3%A9%2Ccomptables%2Cterrebonne%2Ctenues+de+livres+terrebonne%2Cservcies+tenues+de+livres+terrebonne%2Centreprises+tenues+de+livres+terrebonne%2Cgestions%2Canalytiques%2Clanaudi%C3%A8re%2CPME%2Cpetites+entreprises%2Ctravailleurs+autonomes%2Cfins+de+mois%2Caides+pour+fins+de+mois%2Ccycles+comptables%2Ccycles-comptables%2Ccomplets%2Cservices+de+paies%2Csalaires%2Cremises%2Cd%C3%A9ductions+%C3%A0+la+sources%2CDAS%2CCCQ%2CDAS%2Caides+cr%C3%A9ation%2Clistes+de+prix%2Cr%C3%A9daction+proc%C3%A8s+verbaux%2Csoutiens%2Csupports%2Cservices%2Cadministrations%2Cinformatiques%2Crapports%2C%C3%A9tats+financiers%2Caides+budgets%2Cbudgets+pr%C3%A9visionnels%2Ccashflows%2Ctr%C3%A9sories%2Cbudgets+de+caisses%2C%C3%A9tats+des+r%C3%A9sultats%2Cbilans%2Caides%2Cplans+daffaires%2Cfinances%2Cfinanciers%2Cprogrammations+feuilles+excel%2Centreprises+manufacturi%C3%A8res%2Centreprises+de+services%2Centrepreneurs%2Cconstructions%2Cmanufacturiers%2Corganisations%2Cassociations%2Caides+r%C3%A9daction+de+lettres%2Cimplantations+syst%C3%A8mes+comptables%2CAVANTAGE%2Cdbf%2Ccr%C3%A9ations+de+formulaires%2Cformations%2Crecrutements';
var metaContents  = 'Chez+La+Comptable.Com+-++Sp%C3%A9cialis%C3%A9e+en+comptabilit%C3%A9%2C+en+budgets+et+en+structure+des+op%C3%A9rations+pour+PME%2C+PE+et+travailleurs+autonomes.+Terrebonne+et+environs.';
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();
};

