function writeClimSumRHS(place, period) {
// write the right hand block for a climate summary
	document.write('<div class="right-block shifted-down" >', climSumRHS(place, period),  '</div>');
}

function climSumRHS(place, period) {
//-----------------------------------------------------------------------------
// Create the right hand column for a Climate Summary
//
//	place	a (coded) place : nsw, syd, nt, qld, bne, sa, adl, tas, vic, wa, per, aus
//	period	'month', 'season', 'annual'
//
//	Returns the HTML
//
//	ibk	10 Sep 2009
//	ibk	11 Nov 2009 - extend to "aus", but don't show link to "latest year in aus"
//-----------------------------------------------------------------------------
	// some constants
	var ROOT = "/climate/current/";
	var SUFFIX = '.shtml';
	var SUMMARY = 'summary';
	var ARCHIVE = '/archive/';
	var ARCHIVEINDEX = '/statement_archives.shtml';
	
	// link a place to its displayed name
	var placeNames = {'nsw' : 'New South Wales', 'syd' : 'Sydney'
					, 'nt' : 'Northern Territory'
					, 'qld' : 'Queensland', 'bne' : 'Brisbane'
					, 'sa' : 'South Australia', 'adl' : 'Adelaide'
					, 'tas' : 'Tasmania'
					, 'vic' : 'Victoria', 'mel' : 'Melbourne'
					, 'wa' : 'Western Australia', 'per' : 'Perth'
					, 'aus' : 'Australia'
					};
	// link a city to its state
	var cityStates = {'syd' : 'nsw'
					, 'mel' : 'vic'
					, 'bne' : 'qld'
					, 'adl' : 'sa'
					, 'per' : 'wa'
					};
	// link a city abbreviation to its summary file name
	var cityLinks = {'syd' : 'sydney'
					, 'mel' : 'melbourne'
					, 'bne' : 'brisbane'
					, 'adl' : 'adelaide'
					, 'per' : 'perth'
					};
	// link a state to the AWAP map area abbreviation
	var stateAreas = {'nsw' : 'ns'
					, 'nt' : 'nt'
					, 'qld' : 'qd'
					, 'sa' : 'sa'
					, 'vic' : 'vc'
					, 'wa' : 'wa'
					, 'tas' : 'ta'
					, 'aus' : 'nat'
					};
	// link a state to the relevant SCO
	var stateSCOs = {'nsw' : 'seaus'
					, 'nt' : 'naus'
					, 'qld' : 'naus'
					, 'sa' : 'seaus'
					, 'vic' : 'seaus'
					, 'wa' : 'wa'
					, 'tas' : 'seaus'
					, 'aus' : 'nat'
					};

	var html = '';					// the results will be built in here
	var placeDisplay = '';			// displayed name for current place
	place = place.toLowerCase();	// force to lower, just in case
	var state = 'aus';				// default to this
	var isPlace = !(placeNames[place] == undefined);	// every place must have a name, otherwise malformed
	var isNational = (place == 'aus');	// national ones are different

	
	if ( isPlace ) {	// skip this (main) bit if place is malformed
		
		var isCity = !(cityStates[place] == undefined);
		if (isCity) { 
			state = cityStates[place];
		} else {
			state = place;
		}

		html += '<h2>Other climate summaries</h2>';
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		// Links to latest summaries for the same place
		placeDisplay = placeNames[place];
		html += "<ul>";
		if (isCity) {
			placeLink = cityStates[place] + '/' + cityLinks[place] + SUFFIX;
		} else {
			placeLink = place + '/' + SUMMARY + SUFFIX;
		}
		if (period != 'month')  { html += '<li><a href="' + ROOT + 'month/' + placeLink + '">Latest month in ' + placeDisplay + '</a></li>'; }
		if (period != 'season') { html += '<li><a href="' + ROOT + 'season/' + placeLink + '">Latest season in ' + placeDisplay + '</a></li>'; }
		if (period != 'annual' & place != 'aus') { html += '<li><a href="' + ROOT + 'annual/' + placeLink + '">Latest year in ' + placeDisplay + '</a></li>'; }

		if (isCity) {
			// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
			// Links to latest summaries for the state
			placeLink = cityStates[place] + '/' + SUMMARY + SUFFIX;
			placeDisplay = placeNames[cityStates[place]]; 
			html += '<li><a href="' + ROOT + 'month/' + placeLink + '">Latest month in ' + placeDisplay + '</a></li>'; 
			html += '<li><a href="' + ROOT + 'season/' + placeLink + '">Latest season in ' + placeDisplay + '</a></li>'; 
			html += '<li><a href="' + ROOT + 'annual/' + placeLink + '">Latest year in ' + placeDisplay + '</a></li>'; 
		}
		html += "</ul>";
		
		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		// Links to archives
		html += '<h2>Climate Summary archive</h2>';
		if (isCity) {
			placeLink = cityStates[place] + ARCHIVE;
		} else {
			placeLink = place + ARCHIVE;
		}
		var monthA = '<li><a href="' + ROOT + 'month/' + placeLink + '">Earlier months in ' + placeDisplay + '</a></li>';
		var seasonA = '<li><a href="' + ROOT + 'season/' + placeLink + '">Earlier seasons in ' + placeDisplay + '</a></li>'; 
		var annualA = '<li><a href="' + ROOT + 'annual/' + placeLink + '">Earlier years in ' + placeDisplay + '</a></li>'; 
		html += '<ul>';
		switch (period) {	// order the links appropriately
		case 'month' :	html += monthA + seasonA + annualA; break;
		case 'season' :	html += seasonA + monthA + annualA; break;
		case 'annual' :	html += annualA  + monthA + seasonA; break;
		}
		html += '<li><a href="' + ROOT + ARCHIVEINDEX + '">All Climate Summary archives</a></li>';
		html += '</ul>';
	
	} else {	// the place is malformed, but give something back anyway
		html += '<h2>Climate Summary archive</h2>';
		html += '<ul>';
		html += '<li><a href="' + ROOT + ARCHIVEINDEX + '">All Climate Summary archives</a></li>';
		html += '</ul>';
	}
	
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	// Links to "related information"
	var AWAPopts = '&amp;colour=colour&amp;time=latest&amp;step=0&amp;period=month&amp;area=' + stateAreas[state]; 
	html += '<h2>Related information</h2>';
	html += '<ul>';
	if (! isNational) {
		html += '<li><a href="/climate/mwr/">Monthly Weather Review</a></li>';
	}
	html += '<li><a href="/climate/current/special-statements.shtml">Special Climate Statements</a></li>';
    html += '<li><a href="/jsp/awap/rain/index.jsp?map=totals' + AWAPopts + '">Recent rainfall maps</a></i>';
    html += '<li><a href="/jsp/awap/temp/index.jsp?map=meanave' + AWAPopts + '">Recent temperature maps</a></i>';
	if (isPlace & ! isNational) {
		html += '<li><a href="/climate/ahead/rain.' + stateSCOs[state] + '.shtml">Seasonal rainfall outlook</a></i>';
		html += '<li><a href="/climate/ahead/temp.' + stateSCOs[state] + '.shtml">Seasonal temperature outlook</a></i>';
	} else {
		html += '<li><a href="/climate/ahead/rain_ahead.shtml">Seasonal rainfall outlook</a></i>';
		html += '<li><a href="/climate/ahead/temps_ahead.shtml">Seasonal temperature outlook</a></i>';
	}
    html += '<li><a href="/climate/data/">Climate Data Online</a></li>';
	html += '</ul>';
	
	return(html);
}


