There is no official 'rule'. In the two words you mention, the words function like consonants in that, if they are preceded by an indefinite article, it must be 'a' not 'an'. However, to a phonetician, they are very close to vowels in that there is no obstruction in the air-flow when they are produced. DSme resolve this problem by calling them semi-vowels.
Last edited by Tdol; 19-Nov-2012 at 11:57.
Please do not edit your question after it has received a response. Such editing can make the response hard for others to understand.