Display different img src depending on hostname

I am trying to edit the logon.aspx file for Exchange 2010 OWA.
I have no knowledge on aspx coding, but some experience with VB, html, and php.

I'd like it to display 1 image for one domain, and a different image for another domain.

How can I achieve this?
Is there a way to set a string and use it later in aspx the aspx file?

Here is what I am trying...

<script type="text/javascript">
      if (location.hostname == 'mail.1.com')
            lgntopl = "owa/14.1.438.0/themes/resources/lgntopl-1.gif";
      if (location.hostname == 'mail.2.com')
            lgntopl = "owa/14.1.438.0/themes/resources/lgntopl-2r.gif";
<img src="<%lgntopl;%>" alt="">

When I load my page I get an error "XML Parsing Error: no element found"
So clearly, there is something wrong with my guessed logic above!

Any help, would be greatly appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pierre CorneliusCommented:
I don see you declaring the variable anywhere. Try adding var before lgntopl
antoniokingAuthor Commented:
Hi PierreC
I have added "var" but just get a blank page now.
Is there anything else wrong with my syntax? I did just guess it!
antoniokingAuthor Commented:
I replaced my the javascript with...

	string lngtopl = "14.1.438.0/themes/resources/lgntopl.gif";
	string hostUrl = Request.Url.Host;
	if (hostUrl == "mail.1.com")
		lngtopl = "14.1.438.0/themes/resources/lgntopl-1.gif";
	if (hostUrl == "mail.2.com")
		lngtopl = "14.1.438.0/themes/resources/lgntopl-2.gif";

Open in new window

and now my OWA displays a different image depending on the url entered. Perfect :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Pierre CorneliusCommented:
Great! Im glad you got it working :)
antoniokingAuthor Commented:
My solution resolves my issue, Pierre's suggestion of adding 'var' before my variable led me down my path
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.