$(function() {  
   
   $(".mainmenu a").click(function(e)
   {
      $("#signupForm").append('<input type="hidden" name="url" value="'+this.href+'" />');
      $("#signupForm")[0].submit();
      e.preventDefault();
   });

   //these should really have their own function for each page

   $("#accordion2 div div h3").prepend("<span class='sall'>Select All</span>").
      find('.sall').click(function(e){
         if ( $(this).html() == 'Select All' ) {
            $(this).parent().parent().find('input[type=checkbox]').attr('checked', 'checked');
            $(this).html('Unselect All');
         }
         else {
            $(this).parent().parent().find('input[type=checkbox]').attr('checked', false);
            $(this).html('Select All');
         }
         e.stopPropagation();
      });

   $(".service-content").show();

   $(".budget-list input[type=radio]").click(function(){
      $("#budvalue").html("$"+$(this).siblings('label').html());
   });

   $("#submitbtn").click(function(e)
   {
      $("#signupForm")[0].submit();
      e.preventDefault();
   });

   $(".type").click(function(){
      $(".individual").toggle($(this).val() == '0');
      $(".company").toggle($(this).val() == '1');
   });
});

// fix issue with IE fading

var _fadeIn = jQuery.fn.fadeIn;
jQuery.fn.fadeIn = function(speed, callback) {
   return _fadeIn.call(this, speed, function() {
      if (jQuery.browser.msie)
         this.style.removeAttribute('filter');

      if (jQuery.isFunction(callback))
         callback();
   });
}
