/* [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','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],''],
	['PAGE','14701',jdecode('E+R+B+A'),jdecode(''),'/14701.html','true',[],''],
	['PAGE','32201',jdecode('IRB+Champs+09'),jdecode(''),'/32201/index.html','true',[ 
		['PAGE','42901',jdecode('Photos'),jdecode(''),'/32201/42901.html','true',[],''],
		['PAGE','44001',jdecode('Europeans'),jdecode(''),'/32201/44001.html','true',[],'']
	],''],
	['PAGE','2352',jdecode('IRB+News'),jdecode(''),'/2352.html','true',[],''],
	['PAGE','17701',jdecode('Tours+09'),jdecode(''),'/17701/index.html','true',[ 
		['PAGE','25201',jdecode('Australia'),jdecode(''),'/17701/25201.html','true',[],''],
		['PAGE','25222',jdecode('Germany'),jdecode(''),'/17701/25222.html','true',[],''],
		['PAGE','25243',jdecode('Ireland'),jdecode(''),'/17701/25243.html','true',[],'']
	],''],
	['PAGE','44801',jdecode('Boat+Weekend+09'),jdecode(''),'/44801.html','true',[],''],
	['PAGE','31401',jdecode('IRB+Syllabus'),jdecode(''),'/31401.html','true',[],''],
	['PAGE','5201',jdecode('Calender'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','5222',jdecode('IRB+Details'),jdecode(''),'/5222.html','true',[],''],
	['PAGE','2901',jdecode('Contact'),jdecode(''),'/2901.html','true',[],''],
	['PAGE','12101',jdecode('Guestbook'),jdecode(''),'/12101.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Blog';
theSitetree.paletteFamily='666666';
theSitetree.keyvisualId='11523';
theSitetree.keyvisualName='kv_11523.jpg';
theSitetree.fontsetId='32865';
theSitetree.graphicsetId='13952';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='989696';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Blog',
				paletteFamily: 	'666666',
				keyvisualId: 	'11523',
				keyvisualName: 	'kv_11523.jpg',
				fontsetId: 		'32865',
				graphicsetId: 	'13952',
				contentColor: 	'FFFFFF',
				contentBGColor: '989696',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFB434',
				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:  '2301',
internalId:  '',
customField: '20091107-070532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20090615-124034'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20090402-173507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20090814-124132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20090408-081723'
};
webappMappings['7060']=webappMappings['7060-a55ba229d7f0f3f2c84e1fc801128296']={
webappId:    '7060',
documentId:  '42901',
internalId:  'a55ba229d7f0f3f2c84e1fc801128296',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20090812-155337'
};
webappMappings['1002']=webappMappings['1002-12101abr330inldqr']={
webappId:    '1002',
documentId:  '12101',
internalId:  '12101abr330inldqr',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25222',
internalId:  '',
customField: '20090814-124741'
};
webappMappings['7008']=webappMappings['7008-987']={
webappId:    '7008',
documentId:  '2901',
internalId:  '987',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25243',
internalId:  '',
customField: '20090812-155730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20090408-162108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20090511-120410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20090812-153146'
};
webappMappings['7060']=webappMappings['7060-f801d2788358b49bb15e823f80d8045a']={
webappId:    '7060',
documentId:  '25201',
internalId:  'f801d2788358b49bb15e823f80d8045a',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-481791ac8eb4a93b54a8919f9ed6f8ff']={
webappId:    '7060',
documentId:  '25222',
internalId:  '481791ac8eb4a93b54a8919f9ed6f8ff',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-035731c6fae35f3b15e0ba72f61124ac']={
webappId:    '7060',
documentId:  '25243',
internalId:  '035731c6fae35f3b15e0ba72f61124ac',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31401',
internalId:  '',
customField: '20090814-124053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20090921-170350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42901',
internalId:  '',
customField: '20090921-165735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44001',
internalId:  '',
customField: '20091006-123312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44801',
internalId:  '',
customField: '20091008-142802'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INLDQR';
var companyName   = 'IRB+Crew+Wales';
var htmlTitle	  = 'Rescue+Boat+Crew+Wales';
var metaKeywords  = 'IRB+Rescue+Boat+Wales';
var metaContents  = 'Rescue+Boat+Wales';
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();
};
