jQuery(document).ready(function($){$('#LoginWithAjax_Form').submit(function(event){event.preventDefault();$('<div class="LoginWithAjax_Loading" id="LoginWithAjax_Loading"></div>').prependTo('#LoginWithAjax');url=$('#LoginWithAjax_Form').attr('action');url+=(url.match(/\?/)!=null)?'&callback=?':'?callback=?';url+="&log="+encodeURIComponent($("#lwa_user_login").attr('value'));url+="&pwd="+encodeURIComponent($("#lwa_user_pass").attr('value'));url+="&rememberme="+encodeURIComponent($("#lwa_rememberme").attr('value'));url+="&login-with-ajax=login";$.getJSON(url,function(data,status){$('#LoginWithAjax_Loading').remove();if(data.result===true||data.result===false){if(data.result===true){if($('#LoginWithAjax_Status').length>0){$('#LoginWithAjax_Status').attr('class','confirm').html(data.message);}else{$('<span id="LoginWithAjax_Status" class="confirm">'+data.message+'</span>').prependTo('#login-with-ajax');}
if(data.widget!=null){$.get(data.widget,function(widget_result){$('#LoginWithAjax').replaceWith(widget_result);$('#LoginWithAjax_Title').replaceWith($('#LoginWithAjax_Title_Substitute').text());});}else{if(data.redirect==null){window.location.reload();}else{window.location=data.redirect;}}}else{if($('#LoginWithAjax_Status').length>0){$('#LoginWithAjax_Status').attr('class','invalid').html(data.error);}else{$('<span id="LoginWithAjax_Status" class="invalid">'+data.error+'</span>').prependTo('#login-with-ajax');}
$('#LoginWithAjax_Status').click(function(event){event.preventDefault();$('#LoginWithAjax_Remember').show('slow');});}}else{if($('#LoginWithAjax_Status').length>0){$('#LoginWithAjax_Status').attr('class','invalid').html('An error has occured. Please try again.'+status);}else{$('<span id="LoginWithAjax_Status" class="invalid">An error has occured. Please try again.</span>').prependTo('#login-with-ajax');}}});});$('#LoginWithAjax_Remember').submit(function(event){event.preventDefault();$('<div class="LoginWithAjax_Loading" id="LoginWithAjax_Loading"></div>').prependTo('#LoginWithAjax');url=$('#LoginWithAjax_Remember').attr('action');url+=(url.match(/\?/)!=null)?'&callback=?':'?callback=?';url+="&user_login="+$("#lwa_user_remember").attr('value');url+="&login-with-ajax=remember";$.getJSON(url,function(data,status){$('#LoginWithAjax_Loading').remove();if(data.result===true||data.result===false){if(data.result=='1'){if($('#LoginWithAjax_Status').length>0){$('#LoginWithAjax_Status').attr('class','confirm').html(data.message);}else{$('<span id="LoginWithAjax_Status" class="confirm">'+data.message+'</span>').prependTo('#login-with-ajax');}}else{if($('#LoginWithAjax_Status').length>0){$('#LoginWithAjax_Status').attr('class','invalid').html(data.error);}else{$('<span id="LoginWithAjax_Status" class="invalid">'+data.error+'</span>').prependTo('#login-with-ajax');}}}else{if($('#LoginWithAjax_Status').length>0){$('#LoginWithAjax_Status').attr('class','invalid').html('An error has occured. Please try again.'+status);}else{$('<span id="LoginWithAjax_Status" class="invalid">An error has occured. Please try again.</span>').prependTo('#login-with-ajax');}}});});$('#LoginWithAjax_Remember').hide();$('#LoginWithAjax_Links_Remember').click(function(event){event.preventDefault();$('#LoginWithAjax_Remember').show('slow');});$('#LoginWithAjax_Links_Remember_Cancel').click(function(event){event.preventDefault();$('#LoginWithAjax_Remember').hide('slow');});});addComment={moveForm:function(d,f,i,c){var m=this,a,h=m.I(d),b=m.I(i),l=m.I("cancel-comment-reply-link"),j=m.I("comment_parent"),k=m.I("comment_post_ID");if(!h||!b||!l||!j){return}m.respondId=i;c=c||false;if(!m.I("wp-temp-form-div")){a=document.createElement("div");a.id="wp-temp-form-div";a.style.display="none";b.parentNode.insertBefore(a,b)}h.parentNode.insertBefore(b,h.nextSibling);if(k&&c){k.value=c}j.value=f;l.style.display="";l.onclick=function(){var n=addComment,e=n.I("wp-temp-form-div"),o=n.I(n.respondId);if(!e||!o){return}n.I("comment_parent").value="0";e.parentNode.insertBefore(o,e);e.parentNode.removeChild(e);this.style.display="none";this.onclick=null;return false};try{m.I("comment").focus()}catch(g){}return false},I:function(a){return document.getElementById(a)}};
<!-- CopyLeft &copy; Unicorn@Works -->
