jQuery(document).ready(function(a){a("#LoginWithAjax_Form").submit(function(b){b.preventDefault();if(a("#LoginWithAjax").length>0){a('<div class="LoginWithAjax_Loading" id="LoginWithAjax_Loading"></div>').prependTo("#LoginWithAjax")}else{a('<div class="LoginWithAjax_Loading" id="LoginWithAjax_Loading"></div>').prependTo("#login-with-ajax")}url=a("#LoginWithAjax_Form").attr("action");url+=(url.match(/\?/)!=null)?"&callback=?":"?callback=?";url+="&log="+a("#lwa_user_login").attr("value");url+="&pwd="+a("#lwa_user_pass").attr("value");url+="&login-with-ajax=login";a.getJSON(url,function(d,c){a("#LoginWithAjax_Loading").remove();if(d.result===true||d.result===false){if(d.result=="1"){if(a("#LoginWithAjax_Status").length>0){a("#LoginWithAjax_Status").attr("class","confirm").html("")}else{a('<span id="LoginWithAjax_Status" class="confirm">Login Successful, redirecting...</span>').prependTo("#login-with-ajax")}if(d.redirect==null){window.location.reload()}else{window.location=d.redirect}}else{if(a("#LoginWithAjax_Status").length>0){a("#LoginWithAjax_Status").attr("class","invalid").html(d.error)}else{a('<span id="LoginWithAjax_Status" class="invalid">'+d.error+"</span>").prependTo("#login-with-ajax")}a("#LoginWithAjax_Status").click(function(e){e.preventDefault();a("#LoginWithAjax_Remember").show("slow")})}}else{if(a("#LoginWithAjax_Status").length>0){a("#LoginWithAjax_Status").attr("class","invalid").html("An error has occured. Please try again."+c)}else{a('<span id="LoginWithAjax_Status" class="invalid">An error has occured. Please try again.</span>').prependTo("#login-with-ajax")}}})});a("#LoginWithAjax_Remember").submit(function(b){b.preventDefault();a('<div id="LoginWithAjax_Loading"></div>').prependTo("#LoginWithAjax");url=a("#LoginWithAjax_Remember").attr("action");url+=(url.match(/\?/)!=null)?"&callback=?":"?callback=?";url+="&user_login="+a("#lwa_user_remember").attr("value");url+="&login-with-ajax=remember";a.getJSON(url,function(d,c){a("#LoginWithAjax_Loading").remove();if(d.result===true||d.result===false){if(d.result=="1"){if(a("#LoginWithAjax_Status").length>0){a("#LoginWithAjax_Status").attr("class","confirm").html("We have sent you an email")}else{a('<span id="LoginWithAjax_Status" class="confirm">We have sent you an email</span>').prependTo("#login-with-ajax")}}else{if(a("#LoginWithAjax_Status").length>0){a("#LoginWithAjax_Status").attr("class","invalid").html(d.error)}else{a('<span id="LoginWithAjax_Status" class="invalid">'+d.error+"</span>").prependTo("#login-with-ajax")}}}else{if(a("#LoginWithAjax_Status").length>0){a("#LoginWithAjax_Status").attr("class","invalid").html("An error has occured. Please try again."+c)}else{a('<span id="LoginWithAjax_Status" class="invalid">An error has occured. Please try again.</span>').prependTo("#login-with-ajax")}}})});a("#LoginWithAjax_Remember").hide();a("#LoginWithAjax_Links_Remember").click(function(b){b.preventDefault();a("#LoginWithAjax_Remember").show("slow")});a("#LoginWithAjax_Links_Remember_Cancel").click(function(b){b.preventDefault();a("#LoginWithAjax_Remember").hide("slow")})});