// Preload Images img1 = new Image(16, 16); img1.src="images/spinner.gif"; img2 = new Image(220, 19); img2.src="images/ajax-loader.gif"; // When DOM is ready $(document).ready(function(){ // Launch MODAL BOX if the Login Link is clicked $("#login_link").click(function(){ $('#login_form').modal(); }); // Launch MODAL BOX2 if the Login Link is clicked $("#login_link2").click(function(){ $('#login_form2').modal(); }); // Launch MODAL BOX3 if the Login Link is clicked $("#login_link3").click(function(){ $('#login_form3').modal(); }); // Launch MODAL BOX4 if the Login Link is clicked $("#login_link4").click(function(){ $('#login_form4').modal(); }); // Launch MODAL BOXth if the Login Link is clicked $("#login_linkth").click(function(){ $('#login_formth').modal(); }); // When the form is submitted $("#status > form").submit(function(){ // Hide 'Submit' Button $('#submit').hide(); // Show Gif Spinning Rotator $('#ajax_loading').show(); // 'this' refers to the current submitted form var str = $(this).serialize(); // -- Start AJAX Call -- $.ajax({ type: "POST", url: "do-login.php", // Send the login info to this page data: str, success: function(msg){ $("#status").ajaxComplete(function(event, request, settings){ // Show 'Submit' Button $('#submit').show(); // Hide Gif Spinning Rotator $('#ajax_loading').hide(); if(msg == 'OK') // LOGIN OK? { var login_response = '
' +
'