javascript / jquery : problem calling a function inside an object (function undefined)
<p>I'm getting an error of "buildXML is not defined" when I run this code:</p>

<pre><code>var c = {

  updateConsumer:function (cid,aid,sid,survey){
    var surveyXML = buildSurveyXML(survey);
  },

  buildSurveyXML: function(survey) { 
    var surveyResults = survey.split("|");
    var surveyXML = '';

    for (var i=0;i&lt;surveyResults.length;i++){
       ...
    }

    return surveyXML;
  }
}
</code></pre>

<p>And the html that includes this JS and calls the updateConsumer function:</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en"&gt;
    &lt;head&gt;
        &lt;title&gt;Web Service Test&lt;/title&gt;
        &lt;meta charset="utf-8"&gt;
        &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="../../shared/js/consumerSoap.js"&gt;&lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;script type="text/javascript"&gt;
             $(document).ready(function() {
              c.insertConsumer("First","Last","55555","name@url.com","76:1139");
             });
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
