window.imgurl='http://img.msg.yahoo.com/avatar.php?yids=';window.buddylink='ymsgr:sendim?'
window.ajaxImage=false;function getAvatar(id){var pic=$('the_pic');if(pic){var fx=new Fx.Fade(pic);fx.start('out');}
var srcurl=window.imgurl+id;var loader=new Asset.images(srcurl,{onProgress:function(counter,index){},onComplete:function(){$('pic').empty();var img=new Element('img',{id:'the_pic',src:srcurl,width:96,style:'width:96px;height:96px;margin:0;border:0;position:relative;'});img.setOpacity(0);img.inject($('pic'));var fx=new Fx.Fade(img);fx.start('in');}});}
window.addEvent('domready',function(){var spinner='images/arrows_loading3.gif';window.ajaxImage=new Element('img',{src:spinner,'class':'the_spinner',width:40,height:40});var the_loader=loader=new Asset.images(spinner,{});window.messageFX=new Fx.Shake($('message'),{mode:'horizontal',size:5,times:6});var buddy=$('buddy');buddy.addEvent('click',function(){if(buddy.value==window.buddytitle){buddy.value='';}});buddy.addEvent('focus',function(){if(buddy.value==window.buddytitle){buddy.value='';}});buddy.addEvent('blur',function(){if(buddy.value==''){buddy.value=window.buddytitle;}});$('myForm').addEvent('submit',function(e){$('rand').value=$time();if(e){e.stop();}
if($('buddy').value.length<=3||window.buddytitle==$('buddy').value)return true;getAvatar($('buddy').value);var log=$('message').empty().addClass('ajax-loading');var the_clone=window.ajaxImage.clone();log.adopt(the_clone);this.set('send',{onComplete:function(response){log.removeClass('ajax-loading');log.set('html',response);window.messageFX.start();var headers=this.xhr.getAllResponseHeaders();if(headers.contains('xhr_status_ok')){}
else{}}});this.send();});if($('buddy').value!=''){$('myForm').fireEvent('submit',false);}});
