function check(){
 if (!checking){
	checking = true;
	yahid = $('#aidi').val();
	$('#results').slideDown('slow');
	$('#status').html('<img style="width: 31px; height: 31px" src="images/loader.gif" />');
	$.ajax({
	url: 'checkstatus.php',
	data: 'id=' + yahid,
	cache: false,
	success: function(html){ 
	checking = false;
	if (html === '1') { $('#status').html('<img border="0" src="/images/available.gif" width="32" height="32"><span style="text-decoration: none"><font color="#000000" face="Arial" style="font-size: 12pt"><strong>Online</strong></span></font><br><div class="links"><p>add <a href="ymsgr:addfriend?'+ yahid +'" id="addlink"><span class="ymid">'+ yahid +'</span></a> to your buddy list</p><p><a href="http://profiles.yahoo.com/'+ yahid +'" id="avatarlink">view Y! profile</a></p><p><a href="ymsgr:sendim?'+ yahid +'&m=Find+out+who+is+invisible+on+Yahoo+Messenger+<b>+www.labtu.com" id="sendlink">send Instant Message</a> to this ym user</p></div><div id="theavatar" style="width:94px;height:94px;"><div style="background:url(/imgs/loader.gif) no-repeat 31px 31px;width:90px;height:90px;"><img id="avatar" src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'&format=jpg" alt="avatar" /></div></div>'); }
	else if (html === '2') { $('#status').html('<img border="0" src="/images/invisible.gif" width="32" height="32"><span style="text-decoration: none"><font color="#000000" face="Arial" style="font-size: 12pt"><strong>invisible</strong></span></font><br><div class="links"><p>add <a href="ymsgr:addfriend?'+ yahid +'" id="addlink"><span class="ymid">'+ yahid +'</span></a> to your buddy list</p><p><a href="http://profiles.yahoo.com/'+ yahid +'" id="avatarlink">view Y! profile</a></p><p><a href="ymsgr:sendim?'+ yahid +'&m=Find+out+who+is+invisible+on+Yahoo+Messenger+<b>+www.labtu.com" id="sendlink">send Instant Message</a> to this ym user</p></div><div id="theavatar" style="width:94px;height:94px;"><div style="background:url(/imgs/loader.gif) no-repeat 31px 31px;width:90px;height:90px;"><img id="avatar" src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'&format=jpg" alt="avatar" /></div></div>'); }
	else if (html === '0') { $('#status').html('<img border="0" src="/images/offline.gif" width="32" height="32"><span style="text-decoration: none"><font color="#000000" face="Arial" style="font-size: 12pt"><strong>offline</strong></span></font><br><div class="links"><p>add <a href="ymsgr:addfriend?'+ yahid +'" id="addlink"><span class="ymid">'+ yahid +'</span></a> to your buddy list</p><p><a href="http://profiles.yahoo.com/'+ yahid +'" id="avatarlink">view Y! profile</a></p><p><a href="ymsgr:sendim?'+ yahid +'&m=Find+out+who+is+invisible+on+Yahoo+Messenger+<b>+www.labtu.com" id="sendlink">send Instant Message</a> to this ym user</p></div><div id="theavatar" style="width:94px;height:94px;"><div style="background:url(/imgs/loader.gif) no-repeat 31px 31px;width:90px;height:90px;"><img id="avatar" src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'&format=jpg" alt="avatar" /></div></div>'); }
	else if (html === '3') { $('#status').html('<font color="#000000" face="Arial" style="font-size: 12pt"><strong>SERVER BUSY</strong></span></font><br><div class="links"><p>add <a href="ymsgr:addfriend?'+ yahid +'" id="addlink"><span class="ymid">'+ yahid +'</span></a> to your buddy list</p><p><a href="http://profiles.yahoo.com/'+ yahid +'" id="avatarlink">view Y! profile</a></p><p><a href="ymsgr:sendim?'+ yahid +'&m=Find+out+who+is+invisible+on+Yahoo+Messenger+<b>+www.labtu.com" id="sendlink">send Instant Message</a> to this ym user</p></div><div id="theavatar" style="width:94px;height:94px;"><div style="background:url(/imgs/loader.gif) no-repeat 31px 31px;width:90px;height:90px;"><img id="avatar" src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'&format=jpg" alt="avatar" /></div></div>'); }
	else if (html === '4') { $('#status').html('<span style="text-decoration: none"><font color="#CCCCFF" face="Verdana" style="font-size: 9pt">Invalid ID<img src="http://img.msg.yahoo.com/avatar.php" style="border: 1px outset #000080" title=""></font></span>'); }
	else if (html === '6') { $('#status').html('<span style="text-decoration: none"><font color="#CCCCFF" face="Verdana" style="font-size: 9pt"><img src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'&format=jpg" style="border: 1px outset #000080" title="">Too many checks.</font></span>');}
	else { $('#status').html('<span style="text-decoration: none"><font color="#CCCCFF" face="Verdana" style="font-size: 9pt">Server Busy<img src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'&format=jpg" style="border: 1px outset #000080" title=""></font></span>'); }
	},
	error: function(html) { checking = false; $("#status").html('<span style="text-decoration: none"><font color="#CCCCFF" face="Verdana" style="font-size: 9pt">Error.<img src="http://img.msg.yahoo.com/avatar.php?yids='+ yahid +'" style="border: 1px outset #000080" title=""></font></span>'); }
	})
	
 }
}



var checking =  false;
ecking =  false;
