var browser = navigator.userAgent.toLowerCase();
var tip = ''
if (browser.indexOf('msie') > 0 || browser.indexOf('opera') > 0) { tip = 'MSIE' }
if (browser.indexOf('gecko') > 0) { tip = 'Gecko' }

function dajenter(e){
 if (tip=='Gecko') { 
    var kod=e.which
    } 
 else{
    var kod=e.keyCode
    }
 if(kod==13) {
    proveriLogin()
    }
}

function proveriLogin(){
     var vrednosti = new Array("--","'","select","update","drop","delete","insert");

  if (document.login.username.value == ''){
     window.alert('Please enter username!');
     document.login.username.focus();
     return;
  }
  if (document.login.password.value == ''){
     window.alert ('Please enter password!');
     document.login.password.focus();
     return;
  }  
  for(var i=0;i<7;i++){
    if (document.login.username.value == vrednosti[i]){
        window.alert('You can not use that words or characters for Your username. Please change them. Thank you!');
        document.login.username.focus();
        return;
        }
  }
  for(var i=0;i<7;i++){
    if (document.login.password.value == vrednosti[i]){
        window.alert('You can not use that words or characters for Your password. Please change them. Thank you!');
        document.login.password.focus();
        return;
        }
  }
document.login.submit();
}
