Multiple $(function () { on one page

Multiple $(function () { on one page

I have been searching and searching for this, but I have yet to find anything. I have a jquery function that is loaded in the header of my home page. That header is loaded for every page on my site, and when I visit a page with another $(function () { on it, that pages script doesn't work. 
Here is my home page code:
  1. <script type="text/javascript">
  2. $(function () {
  3. $("#basic-combo").sexyCombo();
  4. $("#basic-combo1").sexyCombo();
  5.     });     
  6. </script>

Below is an example of the second $(function(){  that will not load because of the one in the header.
  1. <script type="text/javascript">
  2. window.output = [];
  3.  $(function(){
  4. $.ajax({                                      
  5.  url: '<?php echo base_url().'jqueryDB/jquery';?>',      
  6.  type:'POST',    
  7.  async: false,  
  8.  dataType: 'json',    
  9.  success: function(output_string){
  10. $("#result").append(output_string['name'][0]);
  11. output = output_string['name'];
  12. test();
  13.  }
  14. });
  15.  });   
  16.   </script>
I've tried to change the name of the header function and then do window.load plus along with a few other techniques, but none worked. Does anyone have an idea to what I might need to do?