I've got a piece of javascript that throws up an alert if a text box input matches a certain value (in this case it's a postcode) however I need it to only check the first couple of characters of the input field rather than matching the whole lot.
Here's the code
Code:
$(window).load(function(){
jQuery('#zipc').focusout(function () {
    var _val = jQuery(this).val();
    var _array = ["BF1 3AA", "SA11 3PD"];
    for (var i = 0; i < _array.length; i++) {
        if (_val.indexOf(_array[i]) != -1) {
            alert('Your postcode shows you live in a remote location.\nDepending on how bulky or heavy your purchase is, this may require us to contact you for a shipping surcharge.\r\nThis will be no more than 65 and is often much less');
            jQuery('#zipc').val("");
        }
    }
});
});
The codes I need to check for are

AB,DD,FK,IV,KW,KY,PA,PH,SA,TR

so if someone entered AB11 1ND then the alert message would be triggered but NOT if they entered GL11 1AB (with the letters matching later in the string)

Can someone suggest the mod I need to make to the script for this?!

Cheers

Jos