jQuery('document').ready(
	function()
	{
		//jQuery('form#ContactUs').validate();
		
		/*jQuery('#ddState span').toggle(
			function (e)
			{
				e.stopPropagation();
				$('#statelist').animate(
					{
						height: '100px',
						opacity: 'toggle'
					},
					{
						duration:300
					}
				);
			},
			function (e)
			{
				e.stopPropagation();
				var val = $('#State').val();
				if('' != val)
				{
					$('#State-div label').css({ display: 'none' });
				}
				else
				{
					$('#State-div label').css({ display: 'inline-block' });
				}
				$('#statelist').animate(
					{
						height: '0px',
						opacity: 'toggle'
					},
					{
						duration:300
					}
				);
			}
		);
		
		jQuery('#statelist li').hover(
			function (e)
			{
				$(this).css(
					{
						background:'#1a5cab'
					}
				);
			},
			function (e)
			{
				$(this).css(
					{
						background:'#000000'
					}
				);
			}
		);
		
		jQuery('#statelist li').bind('click',
			function (e)
			{
				var val = $(this).html();
				
				var $img = $('#ddState span img');
				
				$('#ddState span').html(val).append($img);
				
				$('#State').val(val);
				
				if('' != val)
				{
					$('#State-div label').css({ display: 'none' });
				}
				else
				{
					$('#State-div label').css({ display: 'inline-block' });
				}
				$('#ddState span').click();
				e.stopPropagation();
			}
		);*/
		
		jQuery('.Text').bind('focus',
			function (e)
			{
				var $label = $(this).prev('label');
				if('none' != $label.css('display'))
				{
					var w = $label.width();
					var me = $(this).width();
					$(this).css({ width: me + w + 8 });
				}
				$label.css({ display: 'none' });
			}
		);
		
		jQuery('.Text').bind('blur',
			function (e)
			{
				var val = $(this).val();
				if('' != val)
				{
					$(this).prev('label').css({ display: 'none' });
				}
				else
				{
					if('none' == $(this).prev('label').css('display'))
					{
						var $label = $(this).prev('label');
						var w = $label.width();
						var me = $(this).width();
						$(this).css({ width: me - w - 8 });
					}
					$(this).prev('label').css({ display: 'inline-block' });
				}
			}
		);
		
		jQuery('textarea').bind('focus',
			function (e)
			{
				var $label = $(this).prev('label');
				if('none' != $label.css('display'))
				{
					var w = $label.height();
					var me = $(this).height();
					$(this).css({ height: me + w + 4 });
				}
				$label.css({ display: 'none' });
			}
		);
		
		jQuery('textarea').bind('blur',
			function (e)
			{
				var val = $(this).val();
				if('' != val)
				{
					$(this).prev('label').css({ display: 'none' });
				}
				else
				{
					if('none' == $(this).prev('label').css('display'))
					{
						var $label = $(this).prev('label');
						var w = $label.height();
						var me = $(this).height();
						$(this).css({ height: me - w - 4 });
					}
					$(this).prev('label').css({ display: 'block' });
				}
			}
		);
		
		jQuery('.Text, textarea').focus();
		jQuery('.Text, textarea').blur();
		
		/*
		var val = $('#State').val();
		
		var $img = $('#ddState span img');
		
		$('#ddState span').html(val).append($img);
		*/
	}
);
