Amusingly enough, I actually need to do pretty much exactly the same as dmay's outlined in his jsfiddle above, later this week, so a thank you from me too :)