jQuery.ajaxSetup({
  'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
});

$(document).ready(function(){
	 $(".fade_img").hover(function(){
		$(this).fadeTo("fast", 0.6); // opacity to 30% on hover
			},function(){
				$(this).fadeTo("fast", 1.0); // opacity back to 100% on mouseout
				});
		 });
                 
$(document).ready(function(){
		$('dropdown').hover(
			function() { $('ul', this).css('display', 'block'); },
			function() { $('ul', this).css('display', 'none'); });
	});

jQuery.fn.submitWithAjax = function() {
  this.submit(function() {
    //alert('Thanks! We are processing your loan...');
    $("body").append('<div id="loading">"Processing..."</div>').show();
    //$('#loading').show();
    return true;
  })
  return this;
};

jQuery.fn.welcomeWithAjax = function() {
  this.ready(function() {
    alert('Thanks! We are processing your loan...');
    return true;
  })
  return this;
};

jQuery.fn.clickWithAjax = function() {
  this.click(function() {
    //alert('Thanks! We are processing your loan...');
    $("#loading").remove();
    $("body").append('<div id="loading">"Processing..."</div>').show();
    //$('#loading').show();
    return true;
  })
  return this;
};

$(document).ready(function() {
  $("#loan-application-form").submitWithAjax();
});

$(document).ready(function() {
  $("#no-thanks-colorado").clickWithAjax();
});

//$(document).ready(function() {
//  $("#main").welcomeWithAjax();
//});
