$(setupProfileRegistration);

function setupProfileRegistration()
{	
	var birthdate = $("input[id^=birthdate]");
	if(birthdate.length != 0) {
		var lang = birthdate.attr("id").substr(10);
		birthdate.datepicker($.extend({}, 
			$.datepicker.regional[lang], { 
		    showStatus: true, 
		    showOn: "both", 
		    buttonImage: "/images/calendar.jpg", 
		    buttonImageOnly: true 
		})); 
	}
   
    $("#location>select").change(onChangeUrban);
   
	$("#submit-reg-form, #submit-reg-form a").click(function(){
		$("#reg-update").submit();
	});
	
	$("#reg-update input").focus(function(){
		$(this).css("border", "1px solid #FDAA0A");
	}).blur(function(){
		$(this).css("border", "1px solid #B1B0AF");
	});
	
	$("#reg-update").submit(function(){
		if(!GLOBALS.alreadyPosted) {
			//alert('dddd');
			$("#post-button").text(GLOBALS.TXT_WAIT);
			GLOBALS.alreadyPosted = true;
			return true;
			
		} else {
			
			return false;
		}
	});
}
