function getPass( object, object2 ){
   var i, interval, words = "";
   words += "qwertyuiopasdfghjklzxcvbnm";
   words += "QWERTYUIOPASDFGHJKLZXCVBNM";
   words += "1234567890";

   var obj = document.getElementById(object);
   var obj2 = document.getElementById(object2);

   obj.setAttribute("type", "text");
   obj2.setAttribute("type", "text");

   obj.value = "";
   obj2.value = "";

   var new_word_timeout = 100; // время между появлением новых букв.
   var word_timeout = 10; // время между сменой букв
   var word_count = 10; // количество букв

   new function(){
       this.getNextWord = function(){
           obj.value += " ";
           obj2.value += " ";
       }
       this.getWord = function(){
           obj.value = obj.value.substring( 0, obj.value.length - 1 ) + words.charAt( getRand( 0, words.length -1 ) );
	   obj2.value = obj.value;
       }
       this.stop = function(){
           clearInterval( interval );
       }
       for( i = 0; i < word_count; i ++ ){
           setTimeout( this.getNextWord, i * new_word_timeout );
       }
       interval = setInterval( this.getWord, word_timeout );
       setTimeout( this.stop, new_word_timeout * word_count );
   }
}
function getRand( min, max ){
   return Math.round( Math.random( ) * ( max - min ) ) + min;
}
