function SceneAddContactSkypeName(options) {
	this.options = options;
    
	this.AddContactSkypeNameDim =null;
//     
//     
    this.flagPWD = false;
    this.initText ="";
    this.maxStringLenght = 50;
    this.callerObj = null;
//     
//     
    this.flagResetData= true;
// 	
	this.imeBox = null;
	this.str = null;
	this.imeIsShow = false;
}

SceneAddContactSkypeName.prototype.initialize = function () {
	alert("SceneAddContactSkypeName.initialize()");
	// this function will be called only once when the scene manager show this scene first time
	// initialize the scene controls and styles, and initialize your variables here 
	// scene HTML and CSS will be loaded before this function is called
    
   this.create();
}

SceneAddContactSkypeName.prototype.handleShow = function () {
	alert("SceneAddContactSkypeName.handleShow()");
	// this function will be called when the scene manager show this scene 
	this.AddContactSkypeNameDim.show();
	
	
    if(this.flagResetData== true)
    {
        this.str="";
    }
    this.updateIMEBox();
	
}

SceneAddContactSkypeName.prototype.handleHide = function () {
	alert("SceneAddContactSkypeName.handleHide()");
	// this function will be called when the scene manager hide this scene  

	this.AddContactSkypeNameDim.hide();	
	
}

SceneAddContactSkypeName.prototype.handleFocus = function () {
	alert("SceneAddContactSkypeName.handleFocus()");
	// this function will be called when the scene manager focus this scene
    // this.highlight(this.TextInputBox);
    this.imeBox.onShow();
	this.imeIsShow = true;
}

SceneAddContactSkypeName.prototype.handleBlur = function () {
	alert("SceneAddContactSkypeName.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
	if(this.imeIsShow==true){
		this.imeBox.onClose();
	}	
	// this.highlight(null);
}

SceneAddContactSkypeName.prototype.handleKeyDown = function (keyCode) {
	alert("SceneAddContactSkypeName.handleKeyDown(" + keyCode + ")");
	// TODO : write an key event handler when this scene get focued
	if(ProcMgr.checkWidgetHighlight()==false){
		return;
	}
	switch (keyCode) {
		case sf.key.LEFT:
		case sf.key.RIGHT:

			break;
		case sf.key.UP:

			break;
		case sf.key.DOWN:

			break;

		case sf.key.ENTER:
             this.processEnterKey();
			break;
            
        case sf.key.RETURN:
            this.processReturnKey();
            //2013 modify by minseok
            sf.key.preventDefault();
			break;
            
        case sf.key.EXIT:
            //2013 modify by minseok
            sf.key.preventDefault();
			break;
            
         case 147:  //infolink
         case 261:  //contents
         case 115:  //wiselink
            ProcMgr.processInfolinkKey(); 
			break;
	}
}

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

SceneAddContactSkypeName.prototype.create = function(){
    alert("SceneAddContactSkypeName.create()");
	this.AddContactSkypeNameDim = new DimBg("AddContactSkypeNameDim", "AddContactSkypeName");
    
    
}
SceneAddContactSkypeName.prototype.onKeyCallback= function(key, str, id){
	 alert("SceneAddContactSkypeName.onKeyCallback() ===================: " + key + " ID = " + id + " STR = " + str);
	 var Scene = sf.scene.get("AddContactSkypeName");
	 Scene.imeIsShow = false;
    switch (key) {
        case sf.key.ENTER: // Enter Key
            alert("ENTER - str is "+str);
            Scene.str = str;
            Scene.SearchNewContact();
            break;
        case sf.key.RETURN:  //return
            alert("RETURN");
            Scene.processReturnKey();
            break;
        case sf.key.EXIT:  //exit
            alert("EXIT");
            Scene.processReturnKey();
            break;
    }
    sf.scene.returnFocus();
	
	
}
SceneAddContactSkypeName.prototype.updateIMEBox= function(){
	alert("SceneAddContactSkypeName.updateIMEBox()");
	this.imeBox = new IMEShell_Common();
	//this.imeBox.inputboxID = "TextEditorImeTest";
    this.imeBox.inputTitle = IDWS_MOIP_ADD_CONTACT_KEYPAD_HELP_ENTER_USER_INFORMATION;//g_String.IDWS_MOIP_SKYPE_ADD_A_CONTACT;
    //this.imeBox.context = this;
    if(this.flagPWD)
    	this.imeBox.setPasswordMode(this.flagPWD);
    //this.imeBox.setBlockSpace(this.flagBlockSpace); //첫번째 스페이스 입력 막기
    this.imeBox.setMaxlength(this.maxStringLenght); //최대값 지정
    this.imeBox.onKeyPressFunc = this.onKeyCallback; //enter,return,exit 를 반환합니다. 입력완료(enter), 취소(return)로 사용중입니다.
	this.imeBox.onCompleteFunc = this.checkFindEnable; //글자변경되었을때 사용함.(자동완성 데이터 넣어줄때 사용할수 있음)

    //document.getElementById('searchText1').setAttribute("maxlength", 20); //최대값 지정(inputbox 있을때는 이방식도 지원)
    //document.getElementById('searchText1').value ="test text123";
    this.imeBox.inputString = this.initText; //inputbox 없을때는 위해서 처음입력값 넣기
}
SceneAddContactSkypeName.prototype.setResetFlag= function(reset_flag){
     this.flagResetData = reset_flag;
}

SceneAddContactSkypeName.prototype.resetData = function()
{  
	this.isFindEnable= false;

    this.flagResetData= false;	
}

SceneAddContactSkypeName.prototype.highlight=function(obj)
{
}
SceneAddContactSkypeName.prototype.processEnterKey = function(){
	alert("SceneAddContactSkypeName.processEnterKey() ");
	this.SearchNewContact();
}
SceneAddContactSkypeName.prototype.processReturnKey = function(){
    alert("SceneAddContactSkypeName.processReturnKey() ");
	// this.highlight(null);
	
	WndMgr.BackStepAddContact();
}

SceneAddContactSkypeName.prototype.processExitKey = function(){
    alert("SceneAddContactSkypeName.processExitKey() ");
    // this.highlight(null);
    StateMgr.Stop_Add_Contact_State(true);
}



SceneAddContactSkypeName.prototype.SearchNewContact = function()
{
    alert("SceneAddContactSkypeName.SearchNewContact() ");
	var search_text = this.str;
	
	if(this.isFindEnable == true)
	{
		// this.highlight(null);
		ProcMgr.SearchNewContact(search_text);
	}  
}


SceneAddContactSkypeName.prototype.DeleteAllText = function()
{
	this.imeBox.inputString="";
	this.str="";
}

SceneAddContactSkypeName.prototype.checkFindEnable = function(string)
{
	alert("SceneAddContactSkypeName.checkFindEnable() ");
    var input_text = string;
    var Scene = sf.scene.get("AddContactSkypeName");
    
    if(input_text.length ==0)
    {
        Scene.isFindEnable = false;
    }
    else
    {
        var a=0;
        for(a=0; a<input_text.length; a++)
        {
            Scene.isFindEnable = false;
             var ch = input_text.substring(a,  a+1);
             if(ch !=" ")
             {
                 Scene.isFindEnable = true;
                 break;
}
        }
    }
        
    alert("SceneAddContactSkypeName.checkFindEnable()  :  " +this.isFindEnable);
}



SceneAddContactSkypeName.prototype.popupTimerCallback = function()
{
   alert("SceneAddContactSkypeName.popupTimerCallback() ");

	this.highlight(null);
	WndMgr.BackStepAddContact();
}




