$ Conflict disabling other elements of site
<p>Hi I'm creating a web app but have come across a bit of a problem with a bit of coding... the web app has a side menu, much like the facebook one. As well as that it has a enquiry form which is fairly advanced and has dynamic fields which are controlled by .js files. in the form you can select a Category, then a product or service based on that category, once you have selected the field of interest the js files come into action and populates new fields within the form. Now this very file conflicts with my side menu due to the $ symbol i have tried inputting Jquery but had no luck... is there any other method like the JS No Conflict I could wrap this in? It's been killing me for weeks now and I cant seem to overcome it. Here is the code:</p>

<pre><code>    function $() {
    var elements = new Array();
    for (i = 0; i &lt; arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == 'string')
          element = document.getElementById(element);
        if (arguments.length == 1)
          return element;
        elements.push(element);
    }
    return elements;
}
</code></pre>

<p>Your thoughts regarding this would be much appreciated thank you.</p>

<p>Oh and here is the full .js</p>

<pre><code>    //++ Functions for Ajax

function GetXmlHttpObject()
{
    var xmlHttp=null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}
function ajaxOnSuccess()
{
    return xmlHttp.responseText;
}
//--
//++ Function for process element in HTML
function formSerialize(formID)
{
    var f=$(formID);
    var elem = f.elements;
    var flength = elem.length;
    var i = 0;
    var str = "";
    for(i=0;i&lt;flength;i++)
    {
        if(elem[i].type=='radio' || elem[i].type=='checkbox')
        {
            if(elem[i].checked==true)
    {
                if(i&lt;flength-1)
                {
                    str += elem[i].name + "=" + nl2br(elem[i].value) + "&amp;";
                }
                else
                {
                    str += elem[i].name + "=" + nl2br(elem[i].value);
                }
            }
        }
        else
        {
            if(i&lt;flength-1)
            {
                str += elem[i].name + "=" + nl2br(elem[i].value) + "&amp;";
            }
            else
            {
                str += elem[i].name + "=" + nl2br(elem[i].value);
            }
                }
    }
    //alert(str);
    return str;
}


function $() {
    var elements = new Array();
    for (i = 0; i &lt; arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == 'string')
          element = document.getElementById(element);
        if (arguments.length == 1)
          return element;
        elements.push(element);
    }
    return elements;
}
</code></pre>
