
var Winery = new Object();
Winery.images = new Object();
var $j = jQuery.noConflict();

$j(document).ready(function(){
	
	// Checkout step 1
	if ($j("#cart-step1").attr("method") == "post")
	{
		$j('#firstName').click(function(){
			if ($j('#firstName').val() == 'First Name')
			{
				$j('#firstName').val('');
			}
		});
		
		$j('#firstName').blur(function(){
			if ($j('#firstName').val() == '')
			{
				$j('#firstName').val('First Name');
			}
		});
			
		$j('#lastName').click(function(){
			if ($j('#lastName').val() == 'Last Name')
			{
				$j('#lastName').val('');
			}
		});
		
		$j('#lastName').blur(function(){
			if ($j('#lastName').val() == '')
			{
				$j('#lastName').val('Last Name');
			}
		});
		
		el_giftAddress = document.getElementById('giftAddress');
		if (el_giftAddress != null && el_giftAddress.checked)
		{
			$j('#divGiftAddress').show();
		}
		
		$j('[name=addressType]').click(function(){
			if (this.value == 'giftAddress')
			{
				$j('#divGiftAddress').show();
			}
			else
			{
				$j('#divGiftAddress').hide();
			}
		});
	}

});
