<div>
<input type="password" size="5" maxlength="5" /><br />
<input type="password" size="5" maxlength="5" /><br />
<input type="password" size="5" maxlength="5" /><br />
<input type="password" size="5" maxlength="5" /><br />
<input type="password" size="5" maxlength="5" /><br />
</div>
<script type="text/javascript">
document.getElementsByTagName('div')[0].onkeyup=function(e){
var t=e?e.target:window.event.srcElement;
if(t.tagName=='INPUT'&&t.value.length==t.maxLength) {
while(t=t.nextSibling)if(t.tagName=='INPUT'){t.focus();break}
}
}
</script>