<html>
<head>
<script>
function $(e){return document.getElementById(e);}
function go()
{
var reg=/^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
if(reg.test($("check").value))
{alert("ok");}
else{alert("no");}
}
</script>
</head>
<body>
<input id="check" type="text" onchange="go()" />
</body>
</html>