
// $Id$
(function ($) {
Drupal.behaviors.changeNameToID = {
	attach: function (context, settings) {
		$(document).ready(function() {
			// Change and romove label 
			$('#edit-profile-main-field-state label').replaceWith('<label for="edit-profile-main-field-state-und">Voter\'s Card PU Number <span title="This field is required." class="form-required">*</span></label>');
			$('.field.field-name-field-state div.field-label').replaceWith('<div class="field-label">Voter\'s Card PU Number:&nbsp;</div>');
			$('.page-user-register #edit-profile-main-field-lga label').hide();			$('.page-user-register #edit-profile-main-field-ward label').hide();			$('.page-user-register #edit-profile-main-field-pu label').hide();						$('.page-user-register #edit-profile-main-field-state').append('<div class="code-description"><span class="state">State</span><span class="lga">LGA</span><span class="ward">Ward</span><span class="pu">PU</span></div>');
			$('#profile2-edit-main-form .form-item-profile-main-field-state-und-0-value').append('<div style="position: relative;"><div class="state-label">State</div></div>');
			
			$('.field.field-name-field-state').append('<span style="position: relative; left: 10px;">/</span>');
			$('.field.field-name-field-ward').append('<span style="position: relative; left: 10px;">/</span>');
			$('.field.field-name-field-lga').append('<span style="position: relative; left: 10px;">/</span>');
			
			
			// Remove day from date of birth, remove 5 first characters.
			text1 = $("span.date-display-single").html();
			if (text1 != null){
			// Set the text to the substring starting at the third character
			$("span.date-display-single").html(text1.substring(5)); // extract to the end of the string
			}
		});
	}
}
})(jQuery);
