$(document).ready(function()
{
	//Make legend behave like an label (since it looks like a label)
	$('.zipCodeForm legend').css('cursor','pointer');
	$('.zipCodeForm legend').click(function()
	{
		$(this).parent().find('.zipCodeText').focus();
	})
	//input[text] functions
	var zipLabelText = 'Your Zip Code';
	var $zipInput = $('.zipCodeForm .zipCodeText')
		//set zipInput color to light gray on page load
		$zipInput.each(function()
		{
			if ($(this).val().toLowerCase() == zipLabelText.toLowerCase())
			{
				$(this).css('color','#999');
			}
		});
		//On Focus set clear zipInput, change color, set maxlength
		$zipInput.focus(function()
		{
			if ($(this).val().toLowerCase() == zipLabelText.toLowerCase())
			{
				$(this).val('').css('color','#555').attr('maxlength','5');
			}
		});
		//On Blur
		$zipInput.blur(function() //on blur, if left blank reset input[value] and color
		{
			if ($(this).val() == '')
			{
				$(this).css('color','#999').attr('maxlength','20').val(zipLabelText);
			}
		});
});
