function UserViewSeach()
{
	this.Parent=null;
	this.Parent;
	var _UserViewSeachMe=this;
	this.UserArray=new Array();
	this.ViewDivId=null;
	this.OnReandOk=null;
	this.SeachTempArray=new Array();
	this.SeachTempArrayLength=0;
	this.SeachUser=function(Value)
	{
		this.UserArray=new Array();
		this.SeachTempArray=new Array();
		this.SeachTempArrayLength=0;
		for (var i=0;i<this.Parent.Parse.Groups.length;i++)
		{
			for (var ii=0; ii<this.Parent.Parse.Gusers[i].length;ii++)
			{
				this.UserArray[this.UserArray.length]=this.Parent.Parse.Gusers[i][ii];
			}
		}
		for (var i=0; i<this.UserArray.length; i++)
		{
			Value=Value.toUpperCase();
			var UserId=this.UserArray[i].Uin+"";
			UserId= UserId.toUpperCase();
			var Nickname=this.UserArray[i].Nickname;
			Nickname=Nickname.toUpperCase();
			var RemarkName= this.UserArray[i].RemarkName;
			if (RemarkName==""||typeof(RemarkName)=="undefined")
			{
				RemarkName="";
			}
			RemarkName=RemarkName.toUpperCase();
			if (UserId.indexOf(Value)!=-1  || Nickname.indexOf(Value) !=-1 || RemarkName.indexOf(Value)!=-1 ) {
				this.SeachTempArray[this.SeachTempArray.length] = this.UserArray[i];
			}
		}
		this.ReaderView(this.SeachTempArray);
	}
	this.ReaderView=function(Array)
	{
		var ReaderDiv=$(this.ViewDivId)
		if (Array.length==0)
		{
			var InnerHTML="<div style=\"text-align:right; line-height:25px;width:100%\">&nbsp;<font style=\"font-size:14px;cursor:pointer;\" onclick=\"WebIndex.WebIm.CMD.HiddenUserViewDiv()\">&nbsp;×&nbsp;</font>&nbsp;</div>";
			InnerHTML=InnerHTML+"<div style=\"text-align:center; line-height:25px;\">空记录！</div>"
			ReaderDiv.innerHTML=InnerHTML;
		}
		else
		{
			this.SeachTempArrayLength=Array.length;
			var InnerHTML="<div style=\"text-align:right; line-height:25px;width:100%\">&nbsp;<font style=\"font-size:14px;cursor:pointer;\" onclick=\"WebIndex.WebIm.CMD.HiddenUserViewDiv()\">&nbsp;×&nbsp;</font>&nbsp;</div>";
			for (var i=0;i<Array.length;i++)
			{
				var UserSign=this.Parent.Parse.GetUserSignByuid(Array[i].Uin);
				InnerHTML+="<div id=\"UserViewSeachRecord_"+i+"\" shareUin=\""+Array[i].Uin+"\" class=\"UserViewSeachRecord\" onclick=\"UserView.showChatWin('"+Array[i].Uin+"',true);WebIndex.WebIm.CMD.HiddenUserViewDiv()\" onmousemove=\"this.style.backgroundColor='#00B3E7'\" onmouseout=\"this.style.backgroundColor='#ffffff'\"><img class=\"UserViewSeachRecordFace\" align=\"absbottom\" src=\""+UserView.passFace(Array[i], 1)+"\" border=0>&nbsp;"+Array[i].Nickname+"("+Array[i].Uin+")"+"</div>";	
			}	
			ReaderDiv.innerHTML=	InnerHTML;	
		}
		if (this.OnReandOk!=null)
		{
			this.OnReandOk();
		}
		return ;
	}
	this.PassFocus=function(KeyCode)
	{
		if (this.SeachTempArrayLength==0)
		{
			return;
		}
		var NowFos=this.GetNowFouce()
		if (NowFos!="")
		{
			if (KeyCode==40)
			{
			    var NewFouce= parseInt(NowFos)+1;
			}
			if (KeyCode==38)
			{
				var NewFouce= parseInt(NowFos)-1;
			}
			if (NowFos<0)
			{
				return;
				this.FocusDiv(this.SeachTempArrayLength-1);
			}
			if (NowFos>this.SeachTempArrayLength)
			{
				this.FocusDiv(0);
				return;
			}
			this.FocusDiv(NewFouce);
		}
		else
		{
			if (KeyCode==40)
			{
				this.FocusDiv(0);
			}
			if (KeyCode==38)
			{
				this.FocusDiv(this.SeachTempArray.length-1);
			}
		}
	}
	this.OpenFocusObj=function()
	{
		for (var i=0;i<this.SeachTempArrayLength;i++)
		{
			OpenObj=$("UserViewSeachRecord_"+i);
			if (OpenObj!=null)
			{
				if (OpenObj.IsFos==1)
				{
					UserView.showChatWin(OpenObj.getAttribute("shareUin"),true);
					WebIndex.WebIm.CMD.HiddenUserViewDiv();  
				}
			}
		}
	}
	this.FocusDiv=function(Index)
	{
		if (this.SeachTempArrayLength==0)
		{
			return;
		}
		for (var i=0;i<this.SeachTempArrayLength;i++)
		{
			var Fobj=$("UserViewSeachRecord_"+i);
			if (Fobj!=null)
			{
				Fobj.className="UserViewSeachRecord"
				Fobj.IsFos=0;
				
			}
		}
		var Nobj=$("UserViewSeachRecord_"+Index);
		if (Nobj!=null)
		{
			Nobj.className="UserViewSeachRecordFouce";
			Nobj.IsFos=1;
		}
	}
	this.GetNowFouce=function()
	{
		for (var i=0;i<this.SeachTempArrayLength+1;i++)
		{
			var DivObj=$("UserViewSeachRecord_"+i);
			if (DivObj!=null)
			{
				if (DivObj.IsFos==1)
				{
					return i+"";
				}
			}
		}
		return "";
	}
}