/* [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 theSitetree=[ 
	['PAGE','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','10943',jdecode('News'),jdecode(''),'/10943.html','true',[],''],
	['PAGE','51401',jdecode('Nouvelles'),jdecode(''),'/51401.html','true',[],''],
	['PAGE','54001',jdecode('Inscription+-+Registration'),jdecode(''),'/54001/index.html','true',[ 
		['PAGE','56201',jdecode('Registration+%28follow+up+page%29'),jdecode(''),'/54001/56201.html','false',[],'']
	],''],
	['PAGE','52701',jdecode('History'),jdecode(''),'/52701.html','true',[],''],
	['PAGE','62501',jdecode('Historique'),jdecode(''),'/62501.html','true',[],''],
	['PAGE','10901',jdecode('L%26%23x27%3B%C3%A9quipe+-+The+Team'),jdecode(''),'/10901.html','true',[],''],
	['PAGE','52722',jdecode('Commanditaires+-+Sponsors'),jdecode(''),'/52722.html','true',[],''],
	['PAGE','10964',jdecode('Contact'),jdecode(''),'/10964.html','true',[],''],
	['PAGE','22701',jdecode('Club+de+Golf+Verch%C3%A8res'),jdecode(''),'/22701.html','true',[],''],
	['PAGE','26201',jdecode('Photos+2008+'),jdecode(''),'/26201.html','true',[],''],
	['PAGE','79592',jdecode('Video+-+Telethon+of+Stars'),jdecode(''),'/79592.html','true',[],''],
	['PAGE','17606',jdecode('Guestbook'),jdecode(''),'/17606/index.html','true',[ 
		['PAGE','17601',jdecode('Read+Guestbook'),jdecode(''),'/17606/17601.html','false',[],'']
	],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Kalkutta';
theSitetree.paletteFamily='5A5EB5';
theSitetree.keyvisualId='6182';
theSitetree.keyvisualName='kv_6182.jpg';
theSitetree.fontsetId='11142';
theSitetree.graphicsetId='11947';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B2B4E6';
var theTemplate={
				name: 			'Kalkutta',
				paletteFamily: 	'5A5EB5',
				keyvisualId: 	'6182',
				keyvisualName: 	'kv_6182.jpg',
				fontsetId: 		'11142',
				graphicsetId: 	'11947',
				contentColor: 	'000000',
				contentBGColor: 'B2B4E6',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10943',
internalId:  '',
customField: '20090310-153239'
};
webappMappings['1002']=webappMappings['1002-17606AHW050INE6YL']={
webappId:    '1002',
documentId:  '17606',
internalId:  '17606AHW050INE6YL',
customField: 'icq=false'
};
webappMappings['1001']=webappMappings['1001-ahw050ine6ylbd419d0b910396f1']={
webappId:    '1001',
documentId:  '54001',
internalId:  'ahw050ine6ylbd419d0b910396f1',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050ine6ylbd419d0b910396f1']={
webappId:    '1001',
documentId:  '56201',
internalId:  'ahw050ine6ylbd419d0b910396f1',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100123-111342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51401',
internalId:  '',
customField: '20090310-153451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79592',
internalId:  '',
customField: '20091006-212022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52722',
internalId:  '',
customField: '20091008-095830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54001',
internalId:  '',
customField: '20090213-173635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56201',
internalId:  '',
customField: '20071201-124051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52701',
internalId:  '',
customField: '20090312-101029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62501',
internalId:  '',
customField: '20090310-144932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20090214-113403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10964',
internalId:  '',
customField: '20080315-122445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20080507-141718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26201',
internalId:  '',
customField: '20091006-211952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17606',
internalId:  '',
customField: '20071009-200349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20071009-200349'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INE6YL';
var companyName   = 'Tournoi+de+Golf+-+San+Giovanni+Bosco+-+Golf+Tournament+5th+Anniversary';
var htmlTitle	  = 'Tounoi+de+Golf+San+Giovanni+Bosco+Standard+Life+Golf+Tournament';
var metaKeywords  = 'San+Giovanni+Bosco%2C+Standard+Life%2C+Step+up+for+the+children';
var metaContents  = 'Tournoi+de+Golf+-+San+Giovanni+Bosco++Standard+Life+Golf+Tournament++';
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();
};

