How to embed antispam script

Hi I'm using an online javascript generator to obfuscate an email address; but I need to use that on a hotspot map to trigger the action. My problem is that I don't know how to "embed" the script into the href tag from the hotspot, or there is another way to do it?
The script states that needs to be inserted into the body section of the page, and from there just runs great, but is not really how I need to use it.
This is the code from the html document...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<p align="center"><img src="logo.jpg" alt="RockyPointBillPay" width="750" height="417" border="0" usemap="#Map"/>
<map name="Map" id="Map"><area shape="rect" coords="342,134,704,173" href="" /></map></p>
This is the script to obfuscate the email address...
<script type='text/javascript'><!--
var v2="52AAGQPM4GR43NUCKENMDVKKVY";var v7=unescape("%5C%5C%27.%07%23%3F._%3E%22%5BZ%20%21%21%22%29%22%3D%25/e%2894");var v5=v2.length;var v1="";for(var v4=0;v4<v5;v4++){v1+=String.fromCharCode(v2.charCodeAt(v4)^v7.charCodeAt(v4));}document.write('<a href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+v1+'?subject='+'\'">'+'email<\/a>');
//--></script><noscript><a href=''>email (spam protection)</a></noscript>

Open in new window

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.

Michel PlungjanIT ExpertCommented:
Just remove
document.write('<a href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+v1+'?subject='+'\'">'+'email<\/a>');

and put

<a href="#" onClick="this.href= 'mail\u0074o\u003a'+v1+'?subject=Email%20from%20my%20site';">email</a>


<area href="#" onClick="this.href= 'mail\u0074o\u003a'+v1+'?subject=Email%20from%20my%20site';" />

where you have your hotspot

This link must be after the code that generates the link
luigi382006Author Commented:
Thank you for your response, but this is not working, or I don't know how to implement your advice.
Right now only the html code is on the page, the script is generated online and I only copy and paste that to the page, but like I said, works like a text link, and I need that to work on a invisible hotspot that is covering the real email address that is an image.
Michel PlungjanIT ExpertCommented:
Not knowing the code you want to replace, I cannot help you
luigi382006Author Commented:
I found a solution on another website, and my code looks like this:
<map name="Map" id="Map"><area shape="rect" coords="342,134,704,173" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;%69%6E%66%6F%40%72%6F%63%6B%79%70%6F%69%6E%74%62%69%6C%6C%70%61%79%2E%63%6F%6D"/>

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
Michel PlungjanIT ExpertCommented:

My version would have been

<map name="Map" id="Map"><area shape="rect" coords="342,134,704,173" href="#"
onClick="this.href='mailto'+':'+'rockypointbillpay'+'.'+'com'" />

but yours works too
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.