// Builds an address given a location name, URL, and address
function BuildAddress(location, url, address) {
  if (location == null || location.length == 0) 
  	return null;
  var result = location;
  if (url != null && url.length > 0)
	result = '<a href="' + url + '">' + result + '<\/a>';
  return result + "<br>" + address;
}// builds a "mailto:" url
// <a href="mailto:{email}?subject={subject}">{linktext}</a>
function BuildEmailLink(email, subject, linktext) {
  var result = '<a href="mailto:'+email+'?subject=';
  result = result + subject.replace(/" "/g, "%20");
  return result + '">' + linktext + "</a>";
}
function BuildHomeWidget() {
	return '	<div class="home"><a href="index.html"><img alt="home" src="media/brewmasters1-small.png"></a></div>\n';
}function WrapInDiv(html) {
	return '<div id="menu4">\n'+html+('</div>\n');
}function BuildButton(link, text) {
	return '	<div class="buttonwrapper"><a class="squarebutton" href="'+link+'"><span>'+text+'</span></a></div>\n';
}function BuildMenu() {
	html = BuildHomeWidget();
	html = html + BuildButton("info.html", "Info &amp; Rules");
	html = html + BuildButton("entry.html", "How to Enter");
	html = html + BuildButton("judges.html", "Judge &amp; Steward Info");
	html = html + BuildButton("sponsors.html", "Sponsors");
	html = html + BuildButton("2010Results.html", "2010 Results");
	html = html + BuildButton("prior_results.html", "Prior Years' Results");
	html = html + BuildButton("contactus.html", "Contact Us");	html = WrapInDiv(html);
	return html;
}