Javascript: Passing a variable to another page

I’m working on passing a variable from a menu link to another HTML page which contains a Flash object. I need Flash to read the variable. But first, I need to know how to strip some quotes from around the value that is passed.

The first HTML page has links that look like this:


<a href='GetParam_2.html?element=Antimony'>Antimony</a><br>
<a href='GetParam_2.html?element=Barium'>Barium</a><br>
<a href='GetParam_2.html?element=Cadmium'>Cadmium</a><br>

The receiving HTML page has some JS script between the HEAD tags that looks like this:


<script type="text/javascript">
function GetParam(elem)
{
  var start=location.search.indexOf("?"+elem+"=");
  if (start<0) start=location.search.indexOf("&"+elem+"=");
  if (start<0) return '';
  start += elem.length+2;
  var end=location.search.indexOf("&",start)-1;
  if (end<0) end=location.search.length;
  var result='';
  for(var i=start;i<=end;i++) {
    var c=location.search.charAt(i);
    result=result+(c=='+'?' ':c);
  }
  return unescape(result);
  //Pass the data to Flash
  window.document.movie.SetVariable("element", elem);
}
</script>       

And between the BODY tags:


<p>'<script type="text/javascript"><!--
//document.write(location.search)
document.write(GetParam('element'));
// --></script>'</p>

(This is just to test that the variable has been received. I can’t remove the single quotes from ‘element’ and have it work. But document.write wants to print ‘Antimony’ (in quotes). I need to remove the quotes from that string. Suggestions please!