jQuery('document').ready(
	function(){
		//jQuery('form#Careers').validate();

		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 });
				}
				$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();
						var newW = me - w;
						$(this).css({ width: newW + 'px' });
					}
					$(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('input.File').bind('change',
			function (e)
			{
				var $span = $(this).siblings('.fileReplace').children(':first');
				$span.html( $(this).val() );
			}
		);
		/*
		jQuery('#fileReplace span.button').hover(
			function (e)
			{
					alert('hover');
				$(this).css({ cursor: 'hand' });
			},
			function (e)
			{
				$(this).css({ cursor: 'auto' });
			}
		);
		*/
		
		//jQuery('input').bind('click',function(e){ alert('click'); });

		jQuery('.Text, textarea').focus();
		jQuery('.Text, textarea').blur();
		jQuery('input.File').change();
	}
);
