If you're already including jQuery, use $.inArray(), like this:
if($.inArray(num, data[l][m]) > -1) {
number = data[l][0];
document.form.options[l-1] = new Option(number,number,true,true);
}
The shorter vanilla JS version is a direct .indexOf() on the Array, but IE doesn't have this by default.