function SceneReturnIcon (options) {
	this.options = options;
    
    this.MainView=null;
   
	this.Icon=null;
	
	this.ToolTipBgId ="ReturnIcon_tooltip";
	this.ToolTipHTML="";
	this.isShownToolTip = false;
	this.TooltipTimer = null;
}

SceneReturnIcon.prototype.initialize = function () {
	alert("SceneReturnIcon.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();
}

SceneReturnIcon.prototype.handleShow = function () {
	alert("SceneReturnIcon.handleShow()");
	// this function will be called when the scene manager show this scene 
	
}

SceneReturnIcon.prototype.handleHide = function () {
	alert("SceneReturnIcon.handleHide()");
	// this function will be called when the scene manager hide this scene  
	this.Icon.SetBgImage(g_Image.IMAGE_RETURN_ICON_NOR);
	this.hideToolTip();
}

SceneReturnIcon.prototype.handleFocus = function () {
	alert("SceneReturnIcon.handleFocus()");
	// this function will be called when the scene manager focus this scene
    
}

SceneReturnIcon.prototype.handleBlur = function () {
	alert("SceneReturnIcon.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene

}

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

			break;
		case $.sfKey.UP:

			break;
		case $.sfKey.DOWN:

			break;

		case $.sfKey.ENTER:

			break;
            
        case $.sfKey.RETURN:

			break;
            
        case $.sfKey.RED:

			break;
            
        case $.sfKey.EXIT:

			break;
            
         case 147:  //infolink
         case 261:  //contents
         case 115:  //wiselink

			break;
            
        default:

            break;  
	}
}

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

SceneReturnIcon.prototype.create = function(){
    alert("SceneReturnIcon.create()");
    this.MainView = new View("ReturnICon");
    
    var this_ = sf.scene.get('ReturnIcon');
    var clickCF = function(obj){this_.processClickEvent(obj);};
    var mouseoverCF = function(obj){this_.processMouseOverEvent(obj);};
    var mouseoutCF = function(obj){this_.processMouseOutEvent(obj);};
    
    this.Icon= new Label("ReturnIcon_bg", null);
    this.Icon.SetBgImage(g_Image.IMAGE_RETURN_ICON_NOR);
    this.Icon.SetOnClickCallbackFunc(clickCF);
    this.Icon.SetOnMouseOutOverImage(g_Image.IMAGE_RETURN_ICON_NOR, g_Image.IMAGE_RETURN_ICON_OVER);
    this.Icon.SetOnMouseOverCallbackFunc(mouseoverCF);
    this.Icon.SetOnMouseOutCallbackFunc(mouseoutCF);
    
    /*$('#ReturnIcon_tooltip').sfTooltip({
		text : SID_RETURN,
		orientation : 'down'
	});*/
	
	this.ToolTipHTML = this.getToolTipHTML();
	$("#ReturnIcon").append(this.ToolTipHTML);
}

SceneReturnIcon.prototype.processClickEvent = function(obj){
	alert("SceneReturnIcon.processClickEvent() ");
	WndMgr.ProcessRerutnIconClick();
}

SceneReturnIcon.prototype.processMouseOverEvent = function(obj){
	alert("SceneReturnIcon.processMouseOverEvent() ");
	//$('#ReturnIcon_tooltip').sfTooltip('show')
	this.showToolTip();
}

SceneReturnIcon.prototype.processMouseOutEvent = function(obj){
	alert("SceneReturnIcon.processMouseOutEvent() ");
	//$('#ReturnIcon_tooltip').sfTooltip('hide')
	this.hideToolTip();
}

SceneReturnIcon.prototype.showToolTip=function()
{	
	$("#"+this.ToolTipBgId).css("display","block");
	
	var _This = sf.scene.get('ReturnIcon');
	this.TooltipTimer = setTimeout("CloseTimerCF()", 7000);	
	CloseTimerCF = function(){
		alert("HelpBar -> tooltip time out");
		_This.hideToolTip();
	} 
}

SceneReturnIcon.prototype.hideToolTip=function()
{
	alert("SceneReturnIcon.prototype.hideToolTip");

	$("#"+this.ToolTipBgId).css("display","none");
	
	if(this.TooltipTimer !=null)
	{
		clearTimeout(this.TooltipTimer);
		this.TooltipTimer=null;
	}
}
   
SceneReturnIcon.prototype.getToolTipHTML = function()
{
	alert("SceneReturnIcon.prototype.getToolTipHTML");
	
	var wrapHTML = "";
	wrapHTML += "<div id ='"+this.ToolTipBgId+"'>"
	wrapHTML += "<table cellpadding='0px' cellspacing='0px' align='right' style='table-layout:fixed; height:80px;'>";
	wrapHTML += "<tr valign='middle'>";
	wrapHTML += "<td style='width: 20px; background-image :url(images/720p/tooltip/tooltip_left.png); background-repeat: no-repeat;'></td>";
	wrapHTML += "<td style='background-image :url(images/720p/tooltip/tooltip_center.png); background-repeat: repeat-x;'>";
	wrapHTML += "<div id ='ReturnIcon_tooltip_text' class='ReturnIcon_tooltip_style'>"+SID_RETURN+"</div>";
	wrapHTML += "</td>"
	wrapHTML += "<td style='width: 20px; background-image :url(images/720p/tooltip/tooltip_right.png); background-repeat: no-repeat;'></td>";
	wrapHTML += "<td style='width: 5px;'></td>";
	wrapHTML += "</tr>";
	wrapHTML += "</table>";
	wrapHTML += "<div id='ReturnIcon_tooltip_arrow' style='background-image :url(images/720p/tooltip/tooltip_point_bottom.png);'></div>";
	wrapHTML += "</div>";
	
	return wrapHTML;
}

