main = {};

main.loadXML = function(filename)
{
  (window.XMLHttpRequest)? xhttp = new XMLHttpRequest():xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  xhttp.open("GET",filename,false);
  xhttp.send();
  main.xmlDoc = xhttp.responseXML;
}


main.includeJS = function()
{
    main.loadXML("system/config/jsmodules.xml");
    var elem = document.getElementsByTagName('head')[0];
    
    var scr = main.xmlDoc.getElementsByTagName('script');
    
    for(i=0; i<scr.length; i++)
    {
      var insertionItem = document.createElement("script");
      insertionItem.src =  scr[i].firstChild.data;
      insertionItem.type = 'text/javascript';
      elem.appendChild(insertionItem);  
    } 

}

main.includeJS();


