window.addEvent('domready',function(){
	
	var clickBtn = $('checkAvailability');
	
	
	clickBtn.addEvent('mouseover', function()
		{
			clickBtn.className = 'hover';
		}
	);
	clickBtn.addEvent('mouseout', function()
		{
			clickBtn.className = '';
		}
	);
	clickBtn.addEvent('click', function(evt) {
		
			new Event(evt).stop();
		
		var log = $('availabilityResults').empty().setHTML('Checking..');

		new Ajax('http://www.autographink.co.uk/sign-in/is-username-available/?q='+$('Username').value, {
				method: 'get',
				update: $('availabilityResults')

			}).request();
	})
});


function toggleLayer(whichLayer)
{
        if (document.getElementById)
        {
                // this is the way the standards work
                var style2 = document.getElementById(whichLayer).style;
                style2.display = style2.display? "":"block";
        }
        else if (document.all)
        {
                // this is the way old msie versions work
                var style2 = document.all[whichLayer].style;
                style2.display = style2.display? "":"block";
        }
        else if (document.layers)
        {
                // this is the way nn4 works
                var style2 = document.layers[whichLayer].style;
                style2.display = style2.display? "":"block";
        }
}

