iPhone 3G shortage to last two to four weeks, analyst says