Write a JavaScript function - included in a XHTML document - to validate a text field on a form which is to contain an integer, eg 2, 4567, 87612 etc ... without using any built functions like IsNaN an so fourth. If the text field contains a valid number then the JavaScript function can return "true", otherwise it returns "false" as well as displaying a popup error message.