/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','23147',jdecode('President%26%23x27%3Bs+Message'),jdecode(''),'/23147.html','true',[],'',''],
	['PAGE','452',jdecode('About+us'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','473',jdecode('Executive+board'),jdecode(''),'/452/473.html','true',[],'',''],
		['PAGE','494',jdecode('Becoming+a+member'),jdecode(''),'/452/494.html','true',[],'',''],
		['PAGE','21836',jdecode('History'),jdecode(''),'/452/21836.html','true',[],'','']
	],'',''],
	['PAGE','18785',jdecode('Rose+Photo+Gallery'),jdecode(''),'/18785/index.html','true',[ 
		['PAGE','18794',jdecode('Reception+and+Judging'),jdecode(''),'/18785/18794.html','true',[],'',''],
		['PAGE','18803',jdecode('Toronto+Rose+of+Tralee'),jdecode(''),'/18785/18803.html','true',[],'',''],
		['PAGE','18812',jdecode('Sarah+Sullivan'),jdecode(''),'/18785/18812.html','true',[],'','']
	],'',''],
	['PAGE','536',jdecode('News'),jdecode(''),'/536.html','true',[],'',''],
	['PAGE','24947',jdecode('Rose+Pub+Nite'),jdecode(''),'/24947.html','true',[],'',''],
	['PAGE','6801',jdecode('Rose+of+Tralee+Info'),jdecode(''),'/6801.html','true',[],'',''],
	['PAGE','7801',jdecode('Rose+Criteria'),jdecode(''),'/7801.html','true',[],'',''],
	['PAGE','8901',jdecode('Rose+Prizes'),jdecode(''),'/8901.html','true',[],'',''],
	['PAGE','19198',jdecode('Rose+Afternoon+Tea'),jdecode(''),'/19198.html','true',[],'',''],
	['PAGE','18190',jdecode('Interesting+Links'),jdecode(''),'/18190.html','true',[],'',''],
	['PAGE','26847',jdecode('Webmaster'),jdecode(''),'/26847.html','true',[],'',''],
	['PAGE','27447',jdecode(''),jdecode(''),'/27447.html','true',[],'',''],
	['PAGE','27847',jdecode(''),jdecode(''),'/27847.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Roses';
theSitetree.paletteFamily='FFFBF2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10444';
theSitetree.graphicsetId='10823';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFBF2';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Roses',
				paletteFamily: 	'FFFBF2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10444',
				graphicsetId: 	'10823',
				contentColor: 	'000000',
				contentBGColor: 'FFFBF2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'787878',
				e_color: 		'9D584B',
				f_color: 		'9D584B',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100722-073451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100318-221320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100315-152406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100311-205510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27847',
internalId:  '',
customField: '20100318-221418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20091124-211927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20100509-212546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20100310-212540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20100504-210821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18190',
internalId:  '',
customField: '20100424-121244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18785',
internalId:  '',
customField: '20100520-200014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18812',
internalId:  '',
customField: '20100407-221623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18794',
internalId:  '',
customField: '20091124-182935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18803',
internalId:  '',
customField: '20091124-193334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19198',
internalId:  '',
customField: '20100722-074215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21836',
internalId:  '',
customField: '20100426-170739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23147',
internalId:  '',
customField: '20100511-171314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24947',
internalId:  '',
customField: '20100314-165456'
};
webappMappings['7008']=webappMappings['7008-7176']={
webappId:    '7008',
documentId:  '26847',
internalId:  '7176',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26847',
internalId:  '',
customField: '20100318-215355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27447',
internalId:  '',
customField: '20100318-215802'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INERSY';
var companyName   = '++++++++++++++++++++++++++++++++++++++++++++++++';
var htmlTitle	  = 'Irish+Cultural+Society';
var metaKeywords  = 'Irish+Cultural+Society+of+Toronto+Canadian+Deirdre+McKenna+Mike+Mullen++Margaret+Friel+Norita+Fleming+Rose+of+Tralee+2007+Kathleen+Conway+St+Patrick++Luncheon+43rd+Annual+Ontario+Canada+Mississauga+Brampton+Etobicoke+North+York+CN+Tower+Scarborough+Pickering+Oakville+Milton+Ireland+County+GTA+gta+South+Republic+School+Dance+Gaelic+Niagara+Hamilton+British+Nova+Scotia+Newfoundland+Halifax+Montreal+York+Police+1916+Michael+Patsy+Dolan+Cork+Meath+Liz+football+beer+Guiness+Dublin+Belfast+Saint+Kevin+Haigney+';
var metaContents  = 'Irish+Cultural+Society+of+Toronto+-+Proud+sponsor+of+the+2010+Toronto+Rose+of+Tralee';
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();
};
