/**
 * 
 */
var _b1, _b2, timer;
var _rotateSeconds = (1000 * 5);

$(function()
{
	new ASApplication();

	AS_FORM.ignoreForm('copage');

	$('#username')
		.focus(hideUsernameText)
		.blur(checkForEmptyUsernameField);
	$('#login-button').click(handleLoginButtonClick);
	
	_b1 = $('#banner1');
	_b2 = $('#banner2');

	rotateBanner();
});

function checkForEmptyUsernameField(evt)
{
	if ('' == $(this).val())
	{
		$(this).val('email address');
	}
}

function handleLoginButtonClick(evt)
{
	$('#copage').submit();
}

function hideUsernameText(evt)
{
	$(this).val('');
}

function rotateBanner()
{
	if ('inline' == _b1.css('display'))
	{
		_b1.hide();
		_b2.fadeIn();
	}
	else
	{
		_b2.hide();
		_b1.fadeIn();
	}

	timer = setTimeout("rotateBanner()", _rotateSeconds);
}
