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("Login Successful, redirecting...")}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")})});;var eventJ;var eventN;var eventT;var eventX=0;function initE(){eventT=document.getElementById('evTime');eventT.innerHTML=eventS[eventX][0];eventN=document.getElementById('evName');eventN.innerHTML=eventS[eventX][1];eventJ=setInterval("showE(++eventX)",5000);}
function showE(){if(eventX>eventS.length-1)eventX=0;if(eventX<0)eventX=eventS.length-1;clearInterval(eventJ);initE();};function twitterCallback2(twitters){var statusHTML=[];for(var i=0;i<twitters.length;i++){var username=twitters[i].user.screen_name;var status=twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(url){return'<a href="'+url+'">'+url+'</a>';}).replace(/\B@([_a-z0-9]+)/ig,function(reply){return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>';});statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters[i].id+'">'+relative_time(twitters[i].created_at)+'</a></li>');}
document.getElementById('twitter_update_list').innerHTML=statusHTML.join('');}
function relative_time(time_value){var values=time_value.split(" ");time_value=values[1]+" "+values[2]+", "+values[5]+" "+values[3];var parsed_date=Date.parse(time_value);var relative_to=(arguments.length>1)?arguments[1]:new Date();var delta=parseInt((relative_to.getTime()-parsed_date)/1000);delta=delta+(relative_to.getTimezoneOffset()*60);if(delta<60){return'less than a minute ago';}else if(delta<120){return'about a minute ago';}else if(delta<(60*60)){return(parseInt(delta/60)).toString()+' minutes ago';}else if(delta<(120*60)){return'about an hour ago';}else if(delta<(24*60*60)){return'about '+(parseInt(delta/3600)).toString()+' hours ago';}else if(delta<(48*60*60)){return'1 day ago';}else{return(parseInt(delta/86400)).toString()+' days ago';}}