$(function() {

// login form
$('.login_form').find(':text').focus(function() {
    $('.hint', this.parentNode).css('visibility', 'hidden');
}).blur(function() {
    if (!this.value) {
      $('.hint', this.parentNode).css('visibility', 'visible');
    }
}).each(function() {
    $('.hint', this.parentNode).css('visibility', this.value ? 'hidden' : 'visible');
}).end().find('.openid-select').change(function() {
    var $s = $(':selected', this);
    $('label.login .hint', this.form).html( ($s.val() == 'oi' || $s.val() == 'ma') ? locale.address : locale.login);
    $('label.login', this.form)[$s.hasClass('login') ? 'show' : 'hide']();
}).change().niceSelect({className: 'openid-select'});

// my map form
$('.mymap legend').click(function() {
    $(this.parentNode).toggleClass('open');
});
inputs=$('input[name^=c]').click(function() {
    $(this).closest('dl')[this.checked ? 'addClass' : 'removeClass']('open');
}).filter(function(){return this.checked;}).parents('fieldset, dl').addClass('open');
});


