function resize()
{
	addbuttons();
var navigation = document.getElementById("navigation");
	var main = document.getElementById("main");
	var spacer = document.getElementById("spacer");
	var lHeight = navigation.offsetHeight;
	var rHeight = main.offsetHeight;
	var minimumHeight = 800;
	  // Find the maximum height
  var maxCurrent = Math.max(lHeight, rHeight);
  var maxHeight = Math.max(minimumHeight, maxCurrent);
	navigation.style.height = maxHeight + 'px';
	main.style.height = maxHeight + 'px';
	spacer.style.height = maxHeight + 'px';
}

function addbuttons()
{
	var navigation = document.getElementById("navigation");	
	navigation.innerHTML += '<div style="padding:10px 2px 10px 2px"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="190" height="190" id="slideshow_as2" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="slideshow_as2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="slideshow_as2.swf" quality="high" bgcolor="#000000" width="190" height="190" name="slideshow_as2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div><a href="index.html"><img src="images/buttons/home.jpg" alt="Home"></a><img src="images/buttons/events.jpg" alt="Events" onClick="addEvents()"><span id="events"></span><a href="results2010.html"><img src="images/buttons/results.jpg" alt="Results"></a><img src="images/buttons/photos.jpg" alt="Photos" onClick="addPhotos()"><span id="photos"></span><a href="newsletters.html"><img src="images/buttons/newsletters.jpg" alt="Newsletters"></a><a href="membership.html"><img src="images/buttons/membership.jpg" alt="Membership"></a><a href="coaching.html"><img src="images/buttons/coaching.jpg" alt="Coaching"></a><a href="training.html"><img src="images/buttons/training.jpg" alt="Training Runs"></a><a href="history.html"><img src="images/buttons/history.jpg" alt="History"></a><img src="images/buttons/profiles.jpg" alt="Profiles" onClick="addProfiles()"><span id="profiles"></span><a href="links.html"><img src="images/buttons/links.jpg" alt="Links"></a><a href="contact.html"><img src="images/buttons/contact.jpg" alt="Contact"></a>';
}

function addEvents()
{
	var events = document.getElementById("events");
	if(events.innerHTML == '')
	{
		clearAll();
		events.innerHTML = '<table background="images/fader.jpg" border="0" width="200"><tr><td><a href="calender2010.html" class="sub">2010 Calender</a></td></tr><tr><td><a href="everyonesrun.html" class="sub">Everyones Run &amp; Walk</a></td></tr><tr><td><a href="taurangaopen.html" class="sub">Tauranga Open</a></td></tr><tr><td><a href="kingmountain.html" class="sub">King/Queen of the Mountain</a></td></tr><tr><td><a href="taurangatwilight.html" class="sub">Tauranga Twilight</a></td></tr></table>'
	}
	else
			clearAll();
}

function addProfiles()
{
	var profiles = document.getElementById("profiles");
	if(profiles.innerHTML == '')
	{
		clearAll();
		profiles.innerHTML = '<table background="images/fader.jpg" border="0" width="200"><tr><td><a href="profilemonth.html" class="sub">Profile of the Month</a></td></tr><tr><td><a href="profilearchives.html" class="sub">Profile Archives</a></td></tr></table>'
	}
		else
			clearAll();
}

function addPhotos()
{
	var photos = document.getElementById("photos");
	if(photos.innerHTML == '')
	{
		clearAll();
		photos.innerHTML = '<table background="images/fader.jpg" border="0" width="200"><tr><td><a href="albumtaurangaopen.html" class="sub">Tauranga Open `10</a><tr><td><a href="albumtaurangatwilight.html" class="sub">Tauranga Twilight `10</a></td></tr><tr><td><a href="albumkingmountain.html" class="sub">King of the Mountain `09</a></td></tr><tr><td><a href="album2009highlights.html" class="sub">2009 Highlights</a></td></tr><tr><td><a href="album2008highlights.html" class="sub">2008 Highlights</a></td></tr><tr><td><a href="album2007highlights.html" class="sub">2007 Highlights</a></td></tr><tr><td><a href="album2006highlights.html" class="sub">2006 Highlights</a></td></tr></table>'
	}
		else
			clearAll();
}

function clearAll()
{
		var profiles = document.getElementById("profiles");
			var photos = document.getElementById("photos");
				var events = document.getElementById("events");
				events.innerHTML = '';
				photos.innerHTML = '';
				profiles.innerHTML = '';
}