/* [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','701',jdecode('Our+Club'),jdecode(''), jdecode('%2F701.html'), 'true',[],'',''],
	['PAGE','44301',jdecode('Our+History'),jdecode(''), jdecode('%2F44301.html'), 'true',[],'',''],
	['PAGE','132501',jdecode('Our+Members'),jdecode(''), jdecode('%2F132501.html'), 'true',[],'',''],
	['PAGE','215123',jdecode('2011-2012'),jdecode(''), jdecode('%2F215123%2Findex.html'), 'true',[ 
		['PAGE','215144',jdecode('Photo'),jdecode(''), jdecode('%2F215123%2F215144.html'), 'true',[],'',''],
		['PAGE','215165',jdecode('Meeting'),jdecode(''), jdecode('%2F215123%2F215165.html'), 'true',[],'','']
	],'',''],
	['PAGE','192712',jdecode('2010-2011'),jdecode(''), jdecode('%2F192712%2Findex.html'), 'true',[ 
		['PAGE','192733',jdecode('Photo'),jdecode(''), jdecode('%2F192712%2F192733.html'), 'true',[],'',''],
		['PAGE','192754',jdecode('Meeting'),jdecode(''), jdecode('%2F192712%2F192754.html'), 'true',[],'','']
	],'',''],
	['PAGE','176512',jdecode('2009-2010'),jdecode(''), jdecode('%2F176512%2Findex.html'), 'true',[ 
		['PAGE','176533',jdecode('Photo'),jdecode(''), jdecode('%2F176512%2F176533.html'), 'true',[],'',''],
		['PAGE','176554',jdecode('Meeting'),jdecode(''), jdecode('%2F176512%2F176554.html'), 'true',[],'','']
	],'',''],
	['PAGE','149801',jdecode('2008-2009'),jdecode(''), jdecode('%2F149801%2Findex.html'), 'true',[ 
		['PAGE','164712',jdecode('Photo'),jdecode(''), jdecode('%2F149801%2F164712.html'), 'true',[],'',''],
		['PAGE','167112',jdecode('Meeting'),jdecode(''), jdecode('%2F149801%2F167112.html'), 'true',[],'','']
	],'',''],
	['PAGE','133001',jdecode('2007-2008'),jdecode(''), jdecode('%2F133001.html'), 'true',[],'',''],
	['PAGE','857',jdecode('2006-2007'),jdecode(''), jdecode('%2F857.html'), 'true',[],'',''],
	['PAGE','36001',jdecode('Our+Sister%2FFriendship+Clubs'),jdecode(''), jdecode('%2F36001.html'), 'true',[],'',''],
	['PAGE','22601',jdecode('R.I.+D3480'),jdecode(''), jdecode('%2F22601.html'), 'true',[],'',''],
	['PAGE','25022',jdecode('R.I.+D3480+Clubs'),jdecode(''), jdecode('%2F25022.html'), 'true',[],'',''],
	['PAGE','752',jdecode('About+Rotary'),jdecode(''), jdecode('%2F752.html'), 'true',[],'',''],
	['PAGE','28301',jdecode('Rotary+Names+%26+Abbreviations'),jdecode(''), jdecode('%2F28301.html'), 'true',[],'',''],
	['PAGE','1004',jdecode('Join+Us'),jdecode(''), jdecode('%2F1004.html'), 'true',[],'',''],
	['PAGE','128001',jdecode('Membership+Fees'),jdecode(''), jdecode('%2F128001.html'), 'true',[],'',''],
	['PAGE','102201',jdecode('I.O.U.%2FDonations'),jdecode(''), jdecode('%2F102201.html'), 'true',[],'',''],
	['PAGE','1046',jdecode('Contact+Us'),jdecode(''), jdecode('%2F1046%2Findex.html'), 'true',[ 
		['PAGE','142801',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''), jdecode('%2F1046%2F142801.html'), 'false',[],'','']
	],'',''],
	['PAGE','983',jdecode('Other+Links'),jdecode(''), jdecode('%2F983.html'), 'true',[],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1976';
theSitetree.keyvisualName='kuehlung.jpg';
theSitetree.fontsetId='328';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'1976',
				keyvisualName: 	'kuehlung.jpg',
				fontsetId: 		'328',
				graphicsetId: 	'383',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215123',
internalId:  '',
customField: '20110704-052935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192754',
internalId:  '',
customField: '20110629-074531'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '176533',
internalId:  '',
customField: '20100703-093753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '176554',
internalId:  '',
customField: '20100818-112317'
};
webappMappings['1501']=webappMappings['1501-4408047']={
webappId:    '1501',
documentId:  '701',
internalId:  '4408047',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192733',
internalId:  '',
customField: '20110629-074410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20120213-212417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20100124-132336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132501',
internalId:  '',
customField: '20120209-203002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149801',
internalId:  '',
customField: '20100429-102416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164712',
internalId:  '',
customField: '20100220-051808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167112',
internalId:  '',
customField: '20100818-113631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '176512',
internalId:  '',
customField: '20100703-093648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133001',
internalId:  '',
customField: '20100125-043723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20100125-042359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20100124-133458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20110327-020541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25022',
internalId:  '',
customField: '20110327-013736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100124-133643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28301',
internalId:  '',
customField: '20080513-092231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1004',
internalId:  '',
customField: '20100124-133223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128001',
internalId:  '',
customField: '20111107-023017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102201',
internalId:  '',
customField: '20100125-042546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1046',
internalId:  '',
customField: '20100125-042612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '142801',
internalId:  '',
customField: '20070707-121758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '983',
internalId:  '',
customField: '20110704-075148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192712',
internalId:  '',
customField: '20110629-074011'
};
webappMappings['7008']=webappMappings['7008-1518']={
webappId:    '7008',
documentId:  '1046',
internalId:  '1518',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215144',
internalId:  '',
customField: '20111118-065642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '215165',
internalId:  '',
customField: '20120213-212542'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN020INEQGS';
var companyName   = 'Rotary+Club+of+Taipei+Tin+Harbour';
var htmlTitle	  = 'Rotary+Club+of+Taipei+Tin+Harbour';
var metaKeywords  = '%E5%8F%B0%E5%8C%97%E9%8C%AB%E5%8F%A3%E6%89%B6%E8%BC%AA%E7%A4%BE+Rotary+Club+of+Taipei+Tin+Harbour';
var metaContents  = '%E5%8F%B0%E5%8C%97%E9%8C%AB%E5%8F%A3%E6%89%B6%E8%BC%AA%E7%A4%BE+Rotary+Club+of+Taipei+Tin+Harbour';
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();
};

