var check = function() {
  if (document.getElementById('newPassword').value == document.getElementById('newPasswordRepeat').value) {
    document.getElementById('message').innerHTML = '';
    document.querySelector('#login').disabled = false;
    document.getElementById('login').style.cursor = "pointer";
    document.getElementById('newPasswordRepeat').style.border = "1px solid #8C2671";
  } else {
    document.getElementById('message').style.color = '#FF3333';
    document.getElementById('message').innerHTML = 'Lozinke se ne podudaraju.';
    document.querySelector('#login').disabled = true;
    document.getElementById('login').style.cursor = "default";
    document.getElementById('newPasswordRepeat').style.border = "1px solid #FF3333";
    event.preventDefault();
  }
}

function showPass1() {
  var x = document.getElementById("password");
  if (x.type === "password") {
    x.type = "text";
  } else {
    x.type = "password";
  }
}

function showPass2() {
  var x = document.getElementById("newPassword");
  if (x.type === "password") {
    x.type = "text";
  } else {
    x.type = "password";
  }
}

function showPass3() {
  var x = document.getElementById("newPasswordRepeat");
  if (x.type === "password") {
    x.type = "text";
  } else {
    x.type = "password";
  }
}