// CreateEmail -- Creates a mailto link from the specified name and domain, with subject and linktext optional
function CreateEmail (name, domain, subject, linktext)
{
	if(domain == "rsa")
		domain = "richardsonsoccer.org";
	
	email = (name + '@' + domain);
	
	if(!linktext)
		linktext = (name + '@' + domain);
	
	if(subject)
		document.write('<a href="mailto:' + email + '?subject=' + subject + '">' + linktext + '</a>');
	else
		document.write('<a href="mailto:' + email + '">' + linktext + '</a>');
}


// ChangeImage -- Changes the map image to the specified filename
function ChangeImage (filename)
{
	i = document.getElementById("map-image");
	i.src = ('maps/' + filename);
}


// DisplayHeaderPics -- Display three randomly selected header iamges
function DisplayHeaderPics ()
{
	var num = new Array(3);
	
	num[0] = Math.floor(Math.random()*10);
	num[1] = Math.floor(Math.random()*10);
	
	while(num[1] == num[0])
	{
		num[1] = Math.floor(Math.random()*10);
	}
	
	num[2] = Math.floor(Math.random()*10);
	
	while(num[2] == num[0] || num[2] == num[1])
	{
		num[2] = Math.floor(Math.random()*10);
	}
	
	document.write('<img class="first-header-img" src="images/header-pic'+num[0]+'.jpg"><img class="header-img" src="images/header-pic'+num[1]+'.jpg"><img class="header-img" src="images/header-pic'+num[2]+'.jpg">');

}


