var cs=true;function q(how){$("#rrr").slideDown('slow');var a=document.getElementById("query").value;ajaxQ=new sack("dyn/a.aspx");if(ajaxQ.failed){return true}ajaxQ.method="POST";document.getElementById("gads").style.top="70px";if (how){document.getElementById("rm").innerHTML="<img width='96' height='96' alt='"+a+"' src='http://img.msg.yahoo.com/avatar.php?format=jpg&yids="+a+"' />"}else{document.getElementById("rm").innerHTML = "<img height='96' width='96' src='i/a.png' alt='Avatar'/>";};document.getElementById("st").innerHTML="";document.getElementById("sn").innerHTML="";document.getElementById("sa").innerHTML="";document.getElementById("sp").style.display="block";ajaxQ.onCompletion=function(){myArray=ajaxQ.response.split("#");document.getElementById("sp").style.display="none";document.getElementById("st").innerHTML="<a title='send Instant Message to this user' href='ymsgr:sendIM?"+a+"&m=Hi ;)' class='x'>"+a+"</a>"+myArray[3]+" is <span>"+myArray[1]+"</span>";document.getElementById("sn").innerHTML="It has been checked <b>"+myArray[0]+"</b> times so far.";document.getElementById("sa").innerHTML="Add <a class='z' href='ymsgr:addfriend?"+a+"'>"+a+"</a> to your buddy list"};ajaxQ.runAJAX("i="+a);v();return false}function r(a){document.getElementById("query").value=a;q(false)}function openChild(a,b){childWindow=open(a,b,"resizable=no,width=300,height=260");if(childWindow.opener==null){childWindow.opener=self}}function clearSearch(){if(cs){document.getElementById("query").value="";document.getElementById("query").style.color="#3274a6";cs=false}};
function v() {
    var id = document.getElementById("query").value;
    vajaxQ = new sack('dyn/v.aspx');
    if (vajaxQ.failed)
        return true;

    vajaxQ.method = 'POST';

    vajaxQ.onCompletion = function() {
        myV = vajaxQ.response.split("#");
        var i = parseInt(myV[0]);
        if (i > 1) {
            document.getElementById("acontainer").style.top = "0px";
            document.getElementById("hcontainer").style.display = "block";
            document.getElementById("hcontainer").innerHTML = "<a onclick=\"openChild('Avatars.aspx?i=" + myV[1] + "', '')\" href=\"javascript:void(0)\" class=\"m\">History (" + myV[0] + ")</a>";
        } else {
            document.getElementById("acontainer").style.top = "10px";
            document.getElementById("hcontainer").style.display = "none";
        }
    };
    vajaxQ.runAJAX('i=' + id);
    return false;
}
