Is there a better way to write these functions?
<p>I'm not a javascript programmer by any means, but this has been annoying me for the longest while,</p>

<p>is there a better way to write these two seperate functions.
As in a single function?</p>

<pre><code>function showAll()
{
   var collection = getElementsByClassName("dealHolder");
   for (var x = 0; x &lt; collection.length; x++) 
   {
      setParentTrue(collection[x].parentNode);                    
   }
}

function setParentTrue(obj) {
     if (obj.id != "deal") 
     {
          obj.id = "true";
          setParentTrue(obj.parentNode);
     }
     else
     {
        obj.style.display = 'block';
     }
}
</code></pre>

<p>Can I declare a function within another and recursively call it? any time I need to recurse I always seem to be creating a separate function specifically for it</p>

<p>Cheers for the advice</p>
