for(var i = 0; i < encrypted_msg.length; i++){
encrypted_msg[i].setAttribute('id', 'decrypt_'+i); // ids are created here because there are more than one.
encrypted_msg[i].innerHTML+=' <i>(id = '+'decrypt_'+i+')</i>'; // just to make sure everything works
decrypt_click(encrypted_msg[i]);
}
});//]]>