the check that you need to have for the validation should be something like this:
if(document.getElementById('accounttype').options[document.getElementById('accounttype').selectedIndex].value == "a")
or
if(document.getElementById('accounttype').options[document.getElementById('accounttype').selectedIndex].value == "m")
You could use that to check which validation to use.
I was not able to test this with your page. But if you post your file and any related sub folders (in a zip file), i can try to see where you exactly you need to place that code.