 jQuery(function() {
	jQuery.support.placeholder = false;
	test = document.createElement('input');
	if('placeholder' in test) jQuery.support.placeholder = true;	
});
 
 jQuery(function() {
		if(!jQuery.support.placeholder) { 
			//First part, code from the net to enable placeholders on non-compliant browsers
			var active = document.activeElement;
			jQuery(':text').focus(function () {
				if (jQuery(this).attr('placeholder') != '' && jQuery(this).val() == jQuery(this).attr('placeholder')) {
					jQuery(this).val('').removeClass('hasPlaceholder');
				}
			}).blur(function () {
				if (jQuery(this).attr('placeholder') != '' && (jQuery(this).val() == '' || jQuery(this).val() == jQuery(this).attr('placeholder'))) {
					jQuery(this).val(jQuery(this).attr('placeholder')).addClass('hasPlaceholder');
				}
			});
			jQuery(':text').blur();
			jQuery(active).focus();
			jQuery('form').submit(function () {
				jQuery(this).find('.hasPlaceholder').each(function() { jQuery(this).val(''); });
			});

			//Password fields are different, can't show normal text, shows as ****
			//Instead show and hide a negative top margin div that's over top of the field
			jQuery('#signup_password').focus(function () {
					jQuery("#IEPass").hide();
			}).blur(function () {
					if(jQuery("#signup_password").val().length === 0)
						jQuery("#IEPass").show();
			});
			jQuery('#signup_password').blur();

			jQuery('#signup_password_confirm').focus(function () {
					jQuery("#IEPassConfirm").hide();
			}).blur(function () {
					if(jQuery("#signup_password_confirm").val().length === 0)
						jQuery("#IEPassConfirm").show();
			});
			jQuery('#signup_password_confirm').blur();
			
			//Cover label is hidden by default, show on load.
			jQuery("#IEPass").show();
			jQuery("#IEPassConfirm").show();
			//jQuery(active).focus();
			//jQuery('form').submit(function () {
			//	jQuery(this).find('.hasPlaceholder').each(function() { jQuery(this).val(''); });
			//});
		}
	}); 
