//javascript for the site goes here

function checkIfAccepted()
{
	if ($('accepted').checked)
	{
		return true;
	}
	else
	{
		$('accept-warning').setStyle('display', 'block');
		return false;
	}
}

function clearFieldDefault(whichField, defaultText, isPassword)
{
	if ($(whichField).value == defaultText)
	{
		$(whichField).value = "";
		if (isPassword)
		{
			$(whichField).type = "password";
		}
	}
}

function restoreFieldDefault(whichField, defaultText, isPassword)
{
	if ($(whichField).value == "")
	{
		$(whichField).value = defaultText;
		if (isPassword)
		{
			$(whichField).type = "text";
		}
	}
}

// Clear prompt from password field, if required.
function clearPasswordPrompt()
{
	$("passwordPrompt").style.display = "none";
	var password = $("password");
	password.style.display = "inline";
	password.focus();
}

// Set the prompt for the password field, if required.
function checkPasswordPrompt()
{
	var password = $("password");
	if (password.value == "")
	{
		password.style.display = "none";
		$("passwordPrompt").style.display = "inline";
	}
}

function chooseAvatar(newAvatar)
{
	previouslyChosen = $('FldRider').value;
	if (previouslyChosen != "")
		$(previouslyChosen).className = "";
	newAvatar.className = "selected";
	$('FldRider').value = newAvatar.id;
}

function openClubWindow(which)
{
	window.open("/club/" + which, "", "location=no, status=no, width=800, height=650, resizable=yes, scrollbars=yes");
}

function openTourWindow()
{
	window.open("/club/tour", "", "location=no, status=no, width=880, height=510, resizable=yes, scrollbars=yes");
}

