xmlhttp request in javsacript file causing errors
<p>i have a javascript file which has some code somewhat like this;</p>

<pre><code>var Slide =     
{   

    init: function()
    {
     var thumbs = new Array();
     thumbs = Core.getElementsByClass("thumb-img");
     var i;
     for (i=0; i&lt;thumbs.length; i++)
     {
      Core.addEventListener(thumbs[i], "click",  (function( j){return function(){Slide.showImage(j);/*alert(j);*/};})(i));

     }
    },
</code></pre>

<p>now i am trying to pass xmlhttp objects in this javascript file.
i am adding the following just above the <code>init: function()</code></p>

<pre><code>var xmlhttp;

function getVote(int)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var value = int;
alert(value);
var url="user_submit.php";
url=url+"?vote="+int;
url=url+"&amp;sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
  if (xmlhttp.readyState==4)
  {
  document.getElementById("captionbox").innerHTML=xmlhttp.responseText;
  }
}

function GetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
return objXMLHttp;
}
</code></pre>

<p>but firebug gives me error:
<code> missing : after property id var xmlhttp;\n</code></p>

<p>what am i doing wrong?</p>
