Source: Yahoo Answers
First decide if you want to place A on the ends or in the middle somewhere.
If on the ends (2 ways to do this): place B in one of the remaining 4 spots. Place C, D, F, and G in sequence in the remaining 4 spots, 3 spots, 2 spots, and 1 spot. This method gives 2*4*4*3*2*1 arrangements.
If you place A in the middle somewhere (4 ways to do this), place B in one of the remaining 3 spots. Place C, D, F, and G as before in the remaining 4 spots. This method gives 4*3*4*3*2*1 arrangements.
In total, you have 4*3*2*1 * (8 + 12) = 480 ways.
First decide if you want to place A on the ends or in the middle somewhere.
If on the ends (2 ways to do this): place B in one of the remaining 4 spots. Place C, D, F, and G in sequence in the remaining 4 spots, 3 spots, 2 spots, and 1 spot. This method gives 2*4*4*3*2*1 arrangements.
If you place A in the middle somewhere (4 ways to do this), place B in one of the remaining 3 spots. Place C, D, F, and G as before in the remaining 4 spots. This method gives 4*3*4*3*2*1 arrangements.
In total, you have 4*3*2*1 * (8 + 12) = 480 ways.