I have a website www.MyUncleVinny.com. We use affiliate codes for financial reporting. For example: www.MyUncleVinny.com?affiliate1

How can I write a simple JavaScript function that will look at the URL and determine if it contains "affiliate1" then do something, like display image1, if the URL contains "affiliate2", then display image2, else display image3.

Thank you SO MUCH in advance.