function init_over_labels() {	
	var labels, id, field;
	labels = $('.over_label');	
	labels.each(function(){
  		id = $(this).attr("for");
		field = $('#'+id);
     	if (id && field) {
      		this.className = 'overlabel_apply'; 
      		if (field.val() != '') {hide_label(field.attr('id'), true);}
	   		field.focus(function(){hide_label($(this).attr('id'), true);});
	   		field.blur(function(){if ($(this).val() == ''){hide_label($(this).attr('id'), false);}});			
		};      		
	});
	labels_autocomplete_fix();
};
function hide_label(field_id, hide) {
  	var field_for;
  	var labels = $('label');
	labels.each(function(){
		id = $(this).attr("for");
    	if (id == field_id) {
      		this.style.textIndent = (hide) ? '-2000px' : '0px';
      		return true;
    	}
  	});
}

function labels_autocomplete_fix(){
	username_handler = setInterval(function(){if ($("#user_session_login").val() != '') {hide_label("user_session_login", true);}}, 100);
	password_handler = setInterval(function(){if ($("#user_session_password").val() != '') {hide_label("user_session_password", true);}}, 100);
}
