





	var defaultText = "Enter the yahoo id...";	
	Event.observe(window, 'load', function() {
	xout();
});
function xout(){
			$('yid').removeClassName('sf_active').addClassName('sf_inactive');
			if($F('yid') != "" || $F('yid') != defaultText) {
			$('yid').removeClassName('sf_text')
			}
			else{
			$('yid').addClassName('sf_text');
 			$('yid').value= defaultText;
			}

			
		};
function xin(){
			$('yid').removeClassName('sf_inactive sf_text').addClassName('sf_active');
			$('yid').value = ($F('yid') == "" || $F('yid') == defaultText) ?   "" : $F('yid');
		};		
function getinfo()
		{ 
			
			var url = 'check.php?nick=' + $('yid').value;
			var opt = {
				method:'post',
				onCreate: function() {
				$('results').update('<img src="load.gif">'); 
				$('res').show();
				
				},
				onSuccess: function(t) {
		var res='';
		var haspic=false;
		xid=  $F('yid');
		if(t.responseText == "Error/Busy!")
		{
			res = "Server is busy. Please try again.<br /><span style='font-size: 14px;'>(it may take 5-10 tries)</span>";
		}
		else
		{
			res = xid+" is <span style='color: #fff;'>"+t.responseText + "</span>";
		}
		haspic=true;
	var avatar='/avatar.php?yids='+$F('yid')+'&format=png&size=96&nocache=1&r=1101';
	
if(haspic==true && (t.responseText=='Online' || t.responseText=='Offline' || t.responseText=='Invisible')){
	$('results').update('<h3>'+res+'</h3><br/><img class="bimg" src="'+avatar+'" />'+"<br><a href='download.php?id="+$F('yid')+"'>Download Avatar</a><br><ul><li>Add <a href=\"ymsgr:addfriend?"+$F('yid')+"\">"+$F('yid')+"</a> to friend list</li><li>Send a message to <a href=\"ymsgr:sendim?"+$F('yid')+"\">"+$F('yid')+"</a></li><li>View <a href=\"/"+$F('yid')+"\" target=\"_blank\">"+$F('yid')+"</a>\'s profile</li></ul>");
	window.scrollBy(0,[SCROOL]);
	}
	else {
		$('results').update('<h3>'+res+'</h3>'); 
		}
	$('res').show();
				}
				} 
				new Ajax.Request(url, opt); 
		}
