$(document).ready(function(){fadePhones=function(){setTimeout(function(){$('#phone_holding_img').fadeOut(500,function(){new_i=i=parseInt($(this).attr('class').substr(1));new_i++;if(new_i>9){new_i=1;}
$(this).removeClass().addClass('p'+new_i).fadeIn(500,function(){fadePhones();});});},10000);};(function fadeLights(elem){if($.browser.msie)
{elem.show(1,function(){if($(this).next().length){var _this=this;setTimeout(function(){fadeLights($(_this).next())},450);}});}else{elem.fadeIn(350,function(){if($(this).next().length){fadeLights($(this).next());}});}
$(elem).next().length==0&&fadePhones();})($('.light1'));var animTimer=[];animStart=function(t,time){animTimer[t]=setTimeout(function animBird(type){if(typeof type!='string'){type=t||'flap';}
$('#bird').toggleClass(type);animTimer[type]=setTimeout(animBird,50);setTimeout(function(){animStop(type)},1000);},time||3000);};animStart('flap');animStop=function(t){clearTimeout(animTimer[t||'flap']);$('#bird').removeClass('flap talk');if(t=='flap'){animStart('flap');}};twitterUpdate=function(user){$('#twitter .follow').attr('href','http://twitter.com/'+user);$.getJSON('http://frudoo.com/'+user+'.json?callback=?',{count:'1'},function(json){$('#twitter p').html(json[0].text.replace(/(http:\/\/[\w\.\/]+)/g,'<a href="$1">$1</a>').replace(/#(\w+)/g,'<a href="http://twitter.com/#search?q=%23$1">#$1</a>').replace(/@(\w+)/g,'<a href="http://twitter.com/$1">@$1</a>')).removeClass('loading');animStart('talk',1);});setTimeout(function(){twitterUpdate(user);},30000);};twitterUpdate('frudoo');$('input.email, input.name').focus(function(){if(this.value==this.className){$(this).val('');}}).blur(function(){if(this.value==''){$(this).val(this.className);}});});

