function SceneAddContactSearchResult(options) {

	this.options	= options;
    
	this.SearchList		= null;

	this.UpArrow		= null;
	this.DownArrow		= null;
	/*this.ScrollUpArrow		= null;
	this.ScrollDownArrow		= null;*/

    this.AddContactSearchResult	= null;
    this.AddContactSearchResultBG	= null;
	this.AddContactSearchResultDim = null;
    
    this.TitleBar 		= null;

	this.FullNameLabel	= null;
	this.SkypeNameLabel	= null;
	this.CountryLabel	= null;
	
     this.SearchResultHelpBar =null;
	 this.CloseTimer = false;

	this.WheelOperation = false;	 

}

SceneAddContactSearchResult.prototype.initialize = function () {
	alert("SceneAddContactSearchResult.initialize()");
	this.create();
}

SceneAddContactSearchResult.prototype.handleShow = function () {
	alert("SceneAddContactSearchResult.handleShow()");
    this.AddContactSearchResultDim.show();
    //this.SearchList.Show();
    this.resetData();
	
  	var callbackFunction =  function(){
  		sf.scene.get('AddContactSearchResult').popupTimerCallback();
  	};
  	
	WndMgr.startPopupHideTimer(60000,callbackFunction);

}

SceneAddContactSearchResult.prototype.handleHide = function () {
	alert("SceneAddContactSearchResult.handleHide()");
	this.AddContactSearchResultDim.hide();
	
	WndMgr.stopPopupHideTimer();
}

SceneAddContactSearchResult.prototype.handleFocus = function () {
	alert("SceneAddContactSearchResult.handleFocus()");
    
	//check exception
	this.SearchList.ResetHighlight();
	this.SearchList.highlight();
}

SceneAddContactSearchResult.prototype.handleBlur = function () {
	alert("SceneAddContactSearchResult.handleBlur()");
	
	this.SearchList.blur();
}

SceneAddContactSearchResult.prototype.handleKeyDown = function (keyCode) {	
	alert("SceneAddContactSearchResult.handleKeyDown(" + keyCode + ")");
	PluginAPIMgr.PlayAudio(keyCode);
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	
	var ridgeDirection = Math.round((keyCode - (5*10000000)) / 100000);
	
	if(ridgeDirection == 1) { // Ridge flick : Up
		if(ProcMgr.GetRidgeFlick() == false) {
			this.SearchList.PreviousPage();
			ProcMgr.StartRidgeTimer();
		}
	}
	else if(ridgeDirection == 2) { // Ridge flick : Down
		if(ProcMgr.GetRidgeFlick() == false) {
			this.SearchList.NextPage();
			ProcMgr.StartRidgeTimer();
		}
	}
	else {
		switch (keyCode) {
			case sf.key.UP:
				WndMgr.resetPopupHideTimer();
				break;
			case sf.key.DOWN:
				WndMgr.resetPopupHideTimer();
				break;
		}
		
		this.SearchList.KeyProcess(keyCode);	
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

SceneAddContactSearchResult.prototype.create = function(){
    alert("SceneAddContactSearchResult.create() ");

    this.AddContactSearchResult = new View("AddContactSearchResult");
    this.AddContactSearchResultBG = new View("AddContactSearchResultBG");
    this.AddContactSearchResultBG.CreatePopupBG(0,"AddContactSearchResult_popup_BG");
    this.AddContactSearchResultBG.SetTitleTextofPopupBG(IDWS_MOIP_SKYPE_ADD_A_SKYPE_CONTACT);
    this.AddContactSearchResultBG.CreateInnerBox("AddContactSearchResult_popup_innerbox");
    
    	
	this.AddContactSearchResultDim = new DimBg("AddContactSearchResultDim", "AddContactSearchResult");

    // this.TitleBar = new Label(null,"add_contact_search_result_title");    
    // this.TitleBar.SetText(IDWS_MOIP_SKYPE_ADD_A_SKYPE_CONTACT);
	
    this.FullNameLabel = new Label(null,"add_contact_search_result_full_name");    
    this.FullNameLabel.SetText(IDWS_MOIP_FULL_NAME);

    this.SkypeNameLabel = new Label(null,"add_contact_search_result_skype_name");    
    this.SkypeNameLabel.SetText(IDWS_MOIP_SKYPE_NAME);

    this.CountryLabel = new Label(null,"add_contact_search_result_country");    
    this.CountryLabel.SetText(IDWS_MOIP_SETTING_COUNTRY);
	
	this.SearchList = new SearchList();	
    this.SearchList.Create();


    var this_ = sf.scene.get("AddContactSearchResult");
    var list_ = this_.SearchList;

	this.SearchList.BGLayer.SetOnMouseOverCallbackFunc(this.onMouseOverFunc);
	this.SearchList.BGLayer.SetOnMouseOutCallbackFunc(this.onMouseOutFunc);


	this.UpArrow = new CompBase(); 
	this.UpArrow.CreateBG("AddContactSearchListUpArrow");
//	this.UpArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_UP_NOR);
	this.UpArrow.SetOnClickCallbackFunc(function(){list_.PreviousPage();});	
	this.UpArrow.SetOnMouseOverCallbackFunc(function(){this_.ChangeArrow(ARROW_TYPE.UP_SEL);});
	this.UpArrow.SetOnMouseOutCallbackFunc(function(){this_.ChangeArrow(ARROW_TYPE.UP_NOR);});
    
	this.DownArrow = new CompBase(); 
	this.DownArrow.CreateBG("AddContactSearchListDownArrow");
//	this.DownArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_DOWN_NOR);
	this.DownArrow.SetOnClickCallbackFunc(function(){list_.NextPage();});	
	this.DownArrow.SetOnMouseOverCallbackFunc(function(){this_.ChangeArrow(ARROW_TYPE.DOWN_SEL);});
	this.DownArrow.SetOnMouseOutCallbackFunc(function(){this_.ChangeArrow(ARROW_TYPE.DOWN_NOR);});
	

    this.TempDiv = document.getElementById("AddContactSearchResult");
   	this.TempDiv.onmousewheel = function()
   	{
   		if(this_.WheelOperation == false)
   		{
   			alert("SceneListMainContact.onmousewheel");
	   		this_.WheelOperation = true;
	   		PluginAPIMgr.StartOSDTimer("700" , function() { this_.wheelTimerCallback();}, ENUM_TIMER_TYPE.POPUP_WND);
	   		
			if(event.wheelDelta > 0)
			{
				//alert("Up Up");
				list_.PreviousPage();
			}
			else
			{
				//alert("Down Down");
				list_.NextPage();
			}
	    }		
    };
    
}


SceneAddContactSearchResult.prototype.resetData= function(){
	alert("SceneAddContactSearchResult.resetData() ");
	
	this.SearchList.Reset();
	
	if(this.SearchList.TotalPage > 1)
	{
		this.UpArrow.Show();
		this.DownArrow.Show();
	}
	else
	{
		alert("*************************HIde Arroooooooooooooooows!!!!!!");
		this.UpArrow.Hide();
		this.DownArrow.Hide();
	}	
}

SceneAddContactSearchResult.prototype.popupTimerCallback = function()
{
   alert("SceneAddContactSearchResult.popupTimerCallback() ");
   
	WndMgr.BackStepAddContact();
}

SceneAddContactSearchResult.prototype.processReturnKey = function(){
    alert("SceneAddContactSearchResult.processReturnKey() ");
    
    WndMgr.BackStepAddContact();
}

SceneAddContactSearchResult.prototype.ProcessClick = function(ItemIndex)
{
	alert("SceneAddContactSearchResult.ProcessClick() -- " + ItemIndex);		

	//this.SearchList.MoveItem(ItemIndex);

	var Name = this.SearchList.GetCurSkypeName();
	ProcMgr.SearchContactProfile(Name);			
}

SceneAddContactSearchResult.prototype.ProcessMouseOver = function(ItemIndex)
{
	alert("SceneAddContactSearchResult.ProcessMouseOver() -- " + ItemIndex);		
	this.ChangeArrow(ARROW_TYPE.UP_NOR);
	this.ChangeArrow(ARROW_TYPE.DOWN_NOR);
	this.SearchList.MoveItem(ItemIndex);

	/*var Name = this.SearchList.GetCurSkypeName();
	ProcMgr.SearchContactProfile(Name);*/			
}

SceneAddContactSearchResult.prototype.onMouseOverFunc = function(Type){
	alert("SceneAddContactSearchResult.onMouseOverFunc");
	var this_ = sf.scene.get("AddContactSearchResult");
	this_.ChangeArrow(ARROW_TYPE.UP_NOR);
	this_.ChangeArrow(ARROW_TYPE.DOWN_NOR);
}

SceneAddContactSearchResult.prototype.onMouseOutFunc = function(){
	alert("SceneAddContactSearchResult.onMouseOutFunc");
	var this_ = sf.scene.get("AddContactSearchResult");
	this_.UpArrow.SetBGImage(" ");
	this_.DownArrow.SetBGImage(" ");
}

SceneAddContactSearchResult.prototype.ChangeArrow = function(Type)
{
	alert("SceneAddContactSearchResult.GetCurPage = "+this.SearchList.GetCurPage()+",          GetTotalPage = "+this.SearchList.GetTotalPage());

	switch(Type)
	{
		case ARROW_TYPE.UP_NOR:
			if(this.SearchList.GetCurPage() <= 1)
				this.UpArrow.SetBGImage(" ");
			else
				this.UpArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_UP_NOR);
			break;
			
		case ARROW_TYPE.UP_SEL:
			if(this.SearchList.GetCurPage() <= 1) {
				this.UpArrow.SetBGImage(" ");
				this.DownArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_DOWN_NOR);
			} else if(this.SearchList.GetCurPage() >= this.SearchList.GetTotalPage()) {
				this.UpArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_UP_SEL);
				this.DownArrow.SetBGImage(" ");
			} else {
				this.UpArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_UP_SEL);
				this.DownArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_DOWN_NOR);
			}
			break;

		case ARROW_TYPE.DOWN_NOR:
			if(this.SearchList.GetCurPage() >= this.SearchList.GetTotalPage())
				this.DownArrow.SetBGImage(" ");
			else
				this.DownArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_DOWN_NOR);
			break;
			
		case ARROW_TYPE.DOWN_SEL:
			if(this.SearchList.GetCurPage() <= 1) {
				this.UpArrow.SetBGImage(" ");
				this.DownArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_DOWN_SEL);
			} else if(this.SearchList.GetCurPage() >= this.SearchList.GetTotalPage()) {
				this.UpArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_UP_NOR);
				this.DownArrow.SetBGImage(" ");
			} else {
				this.UpArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_UP_NOR);
				this.DownArrow.SetBGImage(g_Image.IMAGE_LIST_MAIN_ARROW_DOWN_SEL);
			}
			break;		
	}
}

SceneAddContactSearchResult.prototype.wheelTimerCallback=function()
{
	this.WheelOperation = false;
}
