I need some urgent advice

Our company has sold an advertisement that 301 redirects our domain to an advert which then uses a javascript redirect to our homepage which now has a new url

So ....

www.mydomain.com now redirects via a 301 to www.mydomain.com/index which is a flash ad. This has a javascript url to our homepage which is now www.mydomain.com/defaulthome

My only solution is to remove this as for SEO we have basically told search engines our homepage no longer exists(pagerank 7) because we are 301ing to an www.mydomain.com/index which is using a javascript redirect to a new homepage url

Am i correct? The effects could be that we loose all inbound links to our homepage (www.mydomain.com). We now have new homepage url which has no inbound links

I would love to hear your opinion