Image preview? You should be able to build something easy. The general idea is that when you hover over an element, you want some image to show somewhere.
When you hover over the thubmnail (in this case its an image, but it could be any element), the mouseover/hover event is triggered and a function is called. In that function, you change the source attribute of your image.
So in the examples you provided above, it should be the same approach that they are using. As you hover over the elements, you are executing a function. Depending on what paramater your are passing to the function will result in a different image appearing.
hope this helps, or at least gets you in the right direction.