The simple answer: Java. There are hundreds of examples of code out there for you to use - in fact a search on google gave me over 200 examples. There are several possible things to do with a cursor, so I'll let you go find the one that is right for you. That said... When I arrive at a site that changes my mouse, I leave and don't come back. If you decide to do this, do it sparingly and in good taste.
You can change the cursor to some predefined styles using CSS (styles). For instance:<BR><BR><a style="cursor:hourglass"></a><BR><BR>There are about 6-8 options. I think hourglass was an option. I don't know of a way to do a custom cursor with styles.