To start, you'll want to grab a copy of amazon_lib.js and amazon_choose.htm which you can get from http://code.iamcal.com/js/amazon_lib/.
AmazonAddSite('uk', 'Amazon.co.uk', 'http://www.amazon.co.uk/exec/obidos/ASIN/#ASIN#/myreferrername'); AmazonAddSite('us', 'Amazon.com', 'http://www.amazon.com/exec/obidos/ASIN/#ASIN#/myreferrername');
You'll need one line for each site you want to link to. The first part of the line is the label for the site which you'll use - in the example uk is the label for amazon.co.uk and us is the label for amazon.com. These labels are only seen by you, so can be whatever you like.
The second part of the line give the label that users will see on the site. This should be the actual name of the site that part three points to.
In the example lines, a referal account name is included on the end, so that any sales genreated through the link earn you money. To learn dore about amazon's referral scheme, see: http://associates.amazon.com/exec/panama/associates/ntg/browse/-/567864/
Now you're all set to start adding links. For each link, you need to specify one or more site labels, along with the product id for that site. For instance, if i wanted to link to "Fight Club" on DVD, i'd find that the amazon.co.uk ASIN code was B00004W4HA and the amazon.com ASIN code was B000067J1H. Using this information, you can make the following link:
Now, when a user click on a link for the first time, a popup appears containing the amazon_choose.htm document (you can customise the style as you wish). The popup asks the user to choose a prefered site from the list of sites your entered in the configuration.
Once the user has chosen a site, it stores their choice in a cookie (so it remembers their choices in future) and takes them to the relevant site. When they click a link again in the future, they are automatically taken to their preferred site.
If you'd like your users to be able