<!-- show month_links -->

var mthCalled = 0;
var yrCalled = 0;
function showActiveMonth(y,m) {

	var month_links_ID = document.getElementById('month_links');
	var year_link_ID = document.getElementById('year_'+ y);
	var active_year_link = document.getElementById('active_year_link');
	if (!mthCalled) {
		mthCalled = 1;
		month_links_ID.style.display = '';
		year_link_ID.style.background = '#bdbdbd';
	} else {
		month_links_ID.removeChild(month_links_ID.lastChild);
		if (y == yrCalled) {
			year_link_ID.style.background = '';
			active_year_link.style.background = '#000000';
			mthCalled = 0;
			return ;
		}
		year_link_ID.style.background = '#bdbdbd';
		var last_year_call_link_ID = document.getElementById('year_'+ yrCalled);
		last_year_call_link_ID.style.background = '';
		mthCalled = 1;
	}
	yrCalled = y;
	active_year_link.style.background = '#000000';
	
	var mthsTxt = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
	mthsTxt.reverse();
	var mths = new Array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
	mths.reverse();
	var ul = document.createElement('ul');
	// ul.className = 'selectReplacement';
	// collect our object’s options
	// iterate through them, creating <li>s
	for (var i=0; i<mths.length; i++) {
		var li = document.createElement('li');
		if (m==mths[i]) { 
			var div = document.createElement('div'); 
			div.setAttribute('id','active_month_link');
		}
		var a = document.createElement('a');
		a.setAttribute('href','http://www.burleighcam.com.au/report/history/'+y+'-'+mths[i]+'.php?a='+y+'-'+mths[i]);
		var txt = document.createTextNode(mthsTxt[i]+' '+y);
		if (m==mths[i]) { li.appendChild(div); div.appendChild(a); }
		else { li.appendChild(a); }
		// a.setAttribute('id','active_month_link');
		// if (m==mths[i]) { a.className='con'; }		
		a.appendChild(txt);
		ul.appendChild(li);
	}
	// add the ul to the div
	month_links_ID.appendChild(ul);
}

<!-- end month_links -->