jQuery.noConflict();

jQuery.fn.extend({
    fire: function(evttype){
        el = this.get(0);
        if (document.createEvent) {
            var evt = document.createEvent('HTMLEvents');
            evt.initEvent(evttype, false, false);
            el.dispatchEvent(evt);
        } else if (document.createEventObject) {
            el.fireEvent('on' + evttype);
        }
        return this;
    }
});

/*
jQuery(document).ready(function() {
  jQuery('#nameSubmit input.reset').click(function(){
    jQuery("#responseDisplay").html("");
  });

  // Get Senators Submit Handler
  jQuery('#nameSubmit').submit(function(){
    jQuery('.introText').remove();
    var options = {
      success: function(responseText){
        jQuery("#responseDisplay").css({
          'background': 'none',
          'display':'block'
          }).html(responseText).fadeIn("slow");
        signUpForm();
      }
    };
    jQuery('#nameSubmit').ajaxSubmit(options);
    return false;
  });

  // Sign Up Form Submit Handler
  function signUpForm() {
    if ((jQuery("td.left div.status-cosponsor-yes").length > 0) && 
        (jQuery("td.right div.status-cosponsor-yes").length > 0)) {
      jQuery("div.pelosiMessage").css("display","block");
    }
    
    jQuery('#signUp').submit(function(){
      jQuery("#signUp2").hide();
      var options = {
        success: function(responseText){
          jQuery("#signUp").hide();
          jQuery("#callInfoLeft").html(responseText).hide().fadeIn("fast");
          daySelectForm();
        }
      };
      jQuery('#signUp').ajaxSubmit(options);
      return false;
    });
    
    jQuery('#signUp2').submit(function(){
      jQuery("#signUp").hide();
      var options = {
        success: function(responseText){
          jQuery("#signUp2").hide();
          jQuery("#callInfoRight").html(responseText).hide().fadeIn("fast");
          daySelectForm();
        }
      };
      jQuery('#signUp2').ajaxSubmit(options);
      return false;
    });
  } // end signUpForm()
  
  function daySelectForm() {
    jQuery('#daySelect[class$=_1]').mouseup(function(){
      var options = {
        success: function(responseText){
          jQuery(".hour.[class$=_1]").html(responseText).hide().fadeIn("fast");
          hourSelectForm();
        }
      };
      jQuery('#daySelect[class$=_1]').ajaxSubmit(options);
      return false;
    });
    
    jQuery('#daySelect[class$=_2]').change(function(){
      var options = {
        success: function(responseText){
          jQuery(".hour.[class$=_2]").html(responseText).hide().fadeIn("fast");
          hourSelectForm();
        }
      };
      jQuery('#daySelect[class$=_2]').ajaxSubmit(options);
      return false;
    });
  } // end daySelectForm()

  function hourSelectForm() {
    jQuery('#hourSelect[class$=_1]').change(function(){
      jQuery(".min.[class$=_1]").fadeOut("slow");
      var options = {
        success: function(responseText){
          jQuery(".min.[class$=_1]").html(responseText).hide().fadeIn("fast");
          confirmTime();
        }
      };
      jQuery('#hourSelect[class$=_1]').ajaxSubmit(options);
      return false;
    });
    jQuery('#hourSelect[class$=_2]').change(function(){
      jQuery(".min.[class$=_2]").fadeOut("slow");
      var options = {
        success: function(responseText){
          jQuery(".min.[class$=_2]").html(responseText).hide().fadeIn("fast");
          confirmTime();
        }
      };
      jQuery('#hourSelect[class$=_2]').ajaxSubmit(options);
      return false;
    });
  } // end hourSelectForm()

  function confirmTime() {
    jQuery('#minSelect[class$=_1]').change(function(){
      jQuery(".confirmation").fadeOut("slow");
      var options = {
        success: function(responseText){
          jQuery(".confirmation.[class$=_1]").html(responseText).hide().fadeIn("fast");
          confirmSubmit();
        }
      };
      jQuery('#minSelect[class$=_1]').ajaxSubmit(options);
      return false;
    });
    jQuery('#minSelect[class$=_2]').change(function(){
      jQuery(".confirmation.[class$=_2]").fadeOut("slow");
      var options = {
        success: function(responseText){
          jQuery(".confirmation.[class$=_2]").html(responseText).hide().fadeIn("fast");
          confirmSubmit();
        }
      };
      jQuery('#minSelect[class$=_2]').ajaxSubmit(options);
      return false;
    });
  } // end confirmTime()

  function confirmSubmit() {
    jQuery('#confirmTime[class$=_1]').submit(function(){
      jQuery("#callInfoLeft").addClass('done');
      var completed = jQuery("#callInfoRight").attr("class");
        if (completed != "done") {
          jQuery("#signUp2").show();
        };
      jQuery("#selectMin[class$=_1]").attr("disabled",true);
      jQuery("#selectHour[class$=_1]").attr("disabled",true);
      jQuery("#selectDay[class$=_1]").attr("disabled",true);
      jQuery(".confirmation.[class$=_1]").fadeOut("slow");
      var options = {
        success: function(responseText){
          jQuery(".confirmation.[class$=_1]").html(responseText).hide().fadeIn("fast");
        }
      };
      jQuery('#confirmTime[class$=_1]').ajaxSubmit(options);
      return false;
    });
    
    jQuery('#confirmTime[class$=_2]').submit(function(){
      jQuery("#callInfoRight").addClass('done');
      var completed = jQuery("#callInfoLeft").attr("class");
        if (completed != "done") {
          jQuery("#signUp").show();
        };
      jQuery("#selectMin[class$=_2]").attr("disabled",true);
      jQuery("#selectHour[class$=_2]").attr("disabled",true);
      jQuery("#selectDay[class$=_2]").attr("disabled",true);
      jQuery(".confirmation.[class$=_2]").fadeOut("slow");
      var options = {
        success: function(responseText){
          jQuery(".confirmation.[class$=_2]").html(responseText).hide().fadeIn("fast");
        }
      };
      jQuery('#confirmTime[class$=_2]').ajaxSubmit(options);
      return false;
    });
  } // end hourSelectForm()
});*/