Bit of actionscript help

Hi fellow flashaters!

heres a challenge

I have a flash banner with a flash menu, within flash how do you detect the current page your on and display a different colour menu button to let users know your on that page. (without having to create a different swf for each page)

something like this

if pagename = “index”

then play frame 15 of home-btn

or sumin like

if url = “…co.uk/contact.asp”

then gotoAndPlay frame 2 of contact-btn

if you want i could explain a little more, as you can see im a newbie of actionscript :block:

thanks in advance

matt