/* [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','6139',jdecode('Accueil'),jdecode(''), jdecode('%2F6139.html'), 'true',[],'',''],
	['PAGE','43639',jdecode('Inscription+2012'),jdecode(''), jdecode('%2F43639.html'), 'true',[],'',''],
	['PAGE','9439',jdecode('Cardinals+AA'),jdecode(''), jdecode('%2F9439.html'), 'true',[],'',''],
	['ITEM','83361',jdecode('Facebook+-+Page+de+CBSL'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2FBaseballStLaurent'), 'true',[],'','_blank'],
	['PAGE','11039',jdecode('FAQ'),jdecode(''), jdecode('%2F11039%2Findex.html'), 'true',[ 
		['PAGE','11060',jdecode('Fran%C3%A7ais'),jdecode(''), jdecode('%2F11039%2F11060.html'), 'true',[],'',''],
		['PAGE','11081',jdecode('English'),jdecode(''), jdecode('%2F11039%2F11081.html'), 'true',[],'','']
	],'',''],
	['PAGE','95761',jdecode('M%C3%A9ritas+de+Lac+St-Louis'),jdecode(''), jdecode('%2F95761.html'), 'true',[],'',''],
	['ITEM','12339',jdecode('Championnats+r%C3%A9gionaux'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseball-lac-st-louis.org%2Fregion%2Fregionaux.htm'), 'true',[],'','_blank'],
	['ITEM','8839',jdecode('Parcs+%28losanges%29+de+LSL'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseball-lac-st-louis.org%2Fligue%2520mineure%2Fparcs.htm'), 'true',[],'','_blank'],
	['PAGE','6190',jdecode('%C3%80+propos+de+nous'),jdecode(''), jdecode('%2F6190%2Findex.html'), 'true',[ 
		['ITEM','7539',jdecode('R%C3%A8glements'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseballstlaurent.com%2Fpdf%2Freglements.pdf'), 'true',[],'','_blank'],
		['ITEM','7540',jdecode('Horaire+des+r%C3%A9unions'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseballstlaurent.com%2Fpdf%2Freunions.pdf'), 'true',[],'','_blank'],
		['PAGE','18239',jdecode('Sites+administratifs'),jdecode(''), jdecode('%2F6190%2F18239.html'), 'true',[],'',''],
		['ITEM','7839',jdecode('Ordre+du+jour+%28exampl.%29'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseballstlaurent.com%2Fpdf%2Fordredujour.pdf'), 'true',[],'','_blank']
	],'',''],
	['PAGE','11639',jdecode('R%C3%A8glements+de+baseball'),jdecode(''), jdecode('%2F11639.html'), 'true',[],'',''],
	['PAGE','62750',jdecode('Cages+de+frappeur+int%C3%A9rieur'),jdecode(''), jdecode('%2F62750.html'), 'true',[],'',''],
	['PAGE','10839',jdecode('%C3%89quipements+requis'),jdecode(''), jdecode('%2F10839.html'), 'true',[],'',''],
	['PAGE','44939',jdecode('Devenir+un%28e%29+entraineur%28e%29'),jdecode(''), jdecode('%2F44939%2Findex.html'), 'true',[ 
		['PAGE','12139',jdecode('Outils+pour+entraineur%28e%29s'),jdecode(''), jdecode('%2F44939%2F12139.html'), 'true',[],'',''],
		['ITEM','8039',jdecode('Entra%C3%AEnements'),jdecode(''), jdecode('http%3A%2F%2Fwww.supersaas.com%2Fschedule%2FBSL%2FLocations'), 'true',[],'','_blank'],
		['PAGE','80761',jdecode('Entraineur%28e%29s+2011'),jdecode(''), jdecode('%2F44939%2F80761.html'), 'true',[],'','']
	],'',''],
	['PAGE','111872',jdecode('Arbitres+%26+Marqueurs'),jdecode(''), jdecode('%2F111872.html'), 'true',[],'',''],
	['PAGE','9239',jdecode('Code+d%26%23x27%3B%C3%A9thique'),jdecode(''), jdecode('%2F9239.html'), 'true',[],'',''],
	['PAGE','101772',jdecode('Lac+St-Louis+-+Ass.+r%C3%A9gionale'),jdecode(''), jdecode('%2F101772.html'), 'true',[],'',''],
	['ITEM','86061',jdecode('Baseball+f%C3%A9minin'),jdecode(''), jdecode('http%3A%2F%2Fbaseballquebec.com%2Fbaseball-feminin'), 'true',[],'','_blank'],
	['ITEM','11839',jdecode('L%26%23x27%3Barrondissement+de+STL'),jdecode(''), jdecode('http%3A%2F%2Fville.montreal.qc.ca%2Fportal%2Fpage%3F_pageid%3D7937%2C87263658%26_dad%3Dportal%26_schema%3DPORTAL'), 'true',[],'','_blank'],
	['ITEM','7940',jdecode('Baseball+Qu%C3%A9bec'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseballquebec.com%2F'), 'true',[],'','_blank'],
	['ITEM','7941',jdecode('Baseball+Canada'),jdecode(''), jdecode('http%3A%2F%2Fwww.baseball.ca%2Ffrn_home.cfm'), 'true',[],'','_blank'],
	['PAGE','6505',jdecode('Liens'),jdecode(''), jdecode('%2F6505.html'), 'true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='FBB044';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32051';
theSitetree.graphicsetId='13869';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'powweb',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Grace',
				paletteFamily: 	'FBB044',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32051',
				graphicsetId: 	'13869',
				contentColor: 	'484848',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6139',
internalId:  '',
customField: '20120211-114803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6505',
internalId:  '',
customField: '20120218-000414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9239',
internalId:  '',
customField: '20101204-155707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10839',
internalId:  '',
customField: '20101205-130847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6190',
internalId:  '',
customField: '20120207-140457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9439',
internalId:  '',
customField: '20120115-174622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11039',
internalId:  '',
customField: '20120128-185307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111872',
internalId:  '',
customField: '20120219-103400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95761',
internalId:  '',
customField: '20110930-175656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101772',
internalId:  '',
customField: '20111203-113645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11060',
internalId:  '',
customField: '20120122-092956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11081',
internalId:  '',
customField: '20120122-093355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11639',
internalId:  '',
customField: '20111030-145401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12139',
internalId:  '',
customField: '20111106-090732'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6139',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-35665375']={
webappId:    '1501',
documentId:  '6139',
internalId:  '35665375',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18239',
internalId:  '',
customField: '20120211-114340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43639',
internalId:  '',
customField: '20120212-134850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44939',
internalId:  '',
customField: '20110212-092222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62750',
internalId:  '',
customField: '20110416-082402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80761',
internalId:  '',
customField: '20110924-080242'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INZ8QJ';
var companyName   = 'Bienvenue+au+Club+de+Baseball+St-Laurent+%28CBSL%29';
var htmlTitle	  = 'Baseball+St-Laurent';
var metaKeywords  = '';
var metaContents  = 'baseball';
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();
};

