try{
if(configure){
console_log("pkg_toolbars configure loaded.");}
}catch(e){
var path=APPLI_PATH+"0077777700140002/gadget/";
add_package_load_path("configure",path+"configure.js");
require("configure");}
var DEF_4K2K=configure.DEF_4K;
var DEF_CHANGE_SCREEN=configure.DEF_CHANGE_SCREEN;var DEF_SIDE_TV=configure.DEF_SIDE_TV;var DEF_TOOLTIP=configure.DEF_TOOLTIP;
var DEF_MULTI_USER=configure.DEF_MULTI_USER;

var BING_CODE="FORM=PANSSB&PC=PANS&";

var SEARCH_URL={
0:
[
"http://www.google."+SEARCH_DOMAIN+"/search?ie=UTF-8&oe=UTF-8&q=",
"http://www.google."+SEARCH_DOMAIN+"/search?ie=UTF-8&oe=UTF-8&tbm=isch&q=",
"http://www.google."+SEARCH_DOMAIN+"/search?ie=UTF-8&oe=UTF-8&tbm=vid&q=",
"http://www.google."+SEARCH_DOMAIN+"/search?ie=UTF-8&oe=UTF-8&tbm=nws&q=",
"http://maps.google.com/maps?q=",
"http://www.youtube."+SEARCH_DOMAIN+"/results?search_query="
],
1:
[
"http://www.bing.com/search?"+BING_CODE+"q=",
"http://www.bing.com/images/search?"+BING_CODE+"q=",
"http://www.bing.com/videos/search?"+BING_CODE+"q=",
"http://www.bing.com/news/search?"+BING_CODE+"q=",
"http://www.bing.com/maps/?"+BING_CODE+"q=",
"http://www.bing.com/videos/search?"+BING_CODE+"q="
],
2:
[
"http://www.baidu.com/s?word=",
"http://image.baidu.com/i?word=",
"http://video.baidu.com/v?word=",
"http://news.baidu.com/ns?word=",
"http://map.baidu.com/m?word=",
"http://video.baidu.com/v?word="
]
};
var SEARCH_CAT={
0:
[
[["www.google.","/search",""]],
[["www.google.","/search","tbm=isch"],
["www.google.","/imghp",""]],
[["www.google.","/search","tbm=vid"],
["www.google.","/videohp",""]],
[["www.google.","/search","tbm=nws"],
["news.google.","/nwshp",""]],
[["maps.google.","",""],
["www.google.","/maps",""]],
[["www.youtube.","",""]]
],
1:
[
[["www.bing.com","/search",""]],
[["www.bing.com","/images",""],
["www.bing.com","","scope=images"]],
[["www.bing.com","/videos",""],
["www.bing.com","","scope=video"]],
[["www.bing.com","/news",""],
["www.bing.com","","scope=news"]],
[["www.bing.com","/maps",""]],
[["www.bing.com","/videos",""],
["www.bing.com","","scope=video"]]
],
2:
[
[["www.baidu.com","",""]],
[["image.baidu.com","",""]],
[["video.baidu.com","",""]],
[["news.baidu.com","",""]],
[["map.baidu.com","",""]],
[["video.baidu.com","",""]]
]
};
var get_nv_search_data=function(){
nv_search_data_flag=false;
try{
var ret=apps_nvram_file.read({"filename":"SEARCH_DATA",
async:false,finished:function(){},product_id:"home"});
if(ret!=null){
var tmp=sysutil.tconv.binary_to_string(ret);
var search_data=eval(tmp);
if(("default_search_engine" in search_data)&&
("search_url" in search_data)){
ENGINE_LIST=search_data.default_search_engine;
SEARCH_URL=search_data.search_url;
nv_search_data_flag=true;}
}
}catch(e){
console_log("NV SEARCH DATA GET ERROR");}
};
get_nv_search_data();
var conv_search_id_to_idx=function(search_id){
var index=null;
for(var i=0;i<ENGINE_LIST.length;i++){
if(search_id==ENGINE_LIST[i].id){
index=i;
break;}
}
if(index==null){
SEARCH_ENGINE=0;
apps_nvram.clear("SEARCH_ENGINE","home");
display_search_engine_name=false;}else{
SEARCH_ENGINE=index;
display_search_engine_name=true;}
};
if(apps_nvram.read("SEARCH_ENGINE","home")!=null){
conv_search_id_to_idx(apps_nvram.read("SEARCH_ENGINE","home"));}
var search_engine_update=function(){
var search_id=apps_nvram.read("SEARCH_ENGINE","home");
var sv_search_version=Server_json.get_search_engine_version();
if(sv_search_version==null){
if(search_id!=null){
conv_search_id_to_idx(search_id);}
return;}
var update_flag=false;
var nv_search_version=apps_nvram.read("SEARCH_VER","home");
if((nv_search_version==null)||(nv_search_version<sv_search_version)){
var sv_search_data=Server_json.get_search_engine_data();
if(sv_search_data==null){
console_log("SERVER SEARCH DATA GET ERROR");
return;}
if(("default_search_engine" in sv_search_data)&&
("search_url" in sv_search_data)){
if(ENGINE_LIST.length==sv_search_data.default_search_engine.length){
for(var i=0;i<ENGINE_LIST.length;i++){
if((ENGINE_LIST[i].id!=sv_search_data.default_search_engine[i].id)||
(ENGINE_LIST[i].name!=sv_search_data.default_search_engine[i].name)){
update_flag=true;
break;}
}
}else{
update_flag=true;}
ENGINE_LIST=sv_search_data.default_search_engine;
SEARCH_URL=sv_search_data.search_url;
apps_nvram_file.write({"filename":"SEARCH_DATA","data":sv_search_data.toSource(),
async:false,finished:function(){},product_id:"home"});}else{
update_flag=true;}
if(update_flag&&nv_search_version!=null){
apps_nvram.write("SEARCH_UPDATE",1,"home");}
apps_nvram.write("SEARCH_VER",sv_search_version,"home");}else{
get_nv_search_data();}
if(search_id!=null){
conv_search_id_to_idx(search_id);}
};
var SetSearchCategoryByUrl=function(url)
{
var key,j,k;
for(key in SEARCH_CAT){
for(j=1;j<=4;j++){for(k=0;k<SEARCH_CAT[key][j].length;k++){
if(pkg_common.MatchUrl(SEARCH_CAT[key][j][k][0],SEARCH_CAT[key][j][k][1],
SEARCH_CAT[key][j][k][2],url)){
return j;}
}
}
}
return 0;
}
var HELP_URL=[
"http://panasonic.jp/support/viera_connect/web_browser/#main",
"http://panasonic.jp/support/global/cs/viera_connect/web_browser/#idx"
];
var long_count=0;
var FUNC_POS_Y=4.5;
var FUNC_ITEM_WIDTH=71;
var FUNC_ITEM_HIGHT=71;
var TEXT_HEIGHT=54;
var TOU_PANEL_MODE_MENU=2;
var TOU_TXT_MARGIN=3;
var TOU_TXT_SCRLSIZE=46;
var TOU_COVER_T_MARGIN=46;
var TOU_COVER_B_MARGIN=44;
if(PLATINUM_LANGUAGE=="th-TH"){
TOU_TXT_MARGIN=6;
TOU_TXT_SCRLSIZE=49;
TOU_COVER_T_MARGIN=30;
TOU_COVER_B_MARGIN=30;}
var get_bing_logo=function(){
var rgb=system.fdp_color.WIDGET_SUB[0]+
system.fdp_color.WIDGET_SUB[1]+
system.fdp_color.WIDGET_SUB[2];
var src=(rgb/3<128)?
PALTINUM_PATH_IMG+"Bing_Logo_General_Orange_RGB.png":
PALTINUM_PATH_IMG+"Bing_Logo_General_DarkGray_RGB.png";
return src;};
add_default_stage_event_hook(system.fdp_color,function (stg,obj,ev){
switch(ev){
case system.fdp_color.EV_UPDATE:
function_bar.search_engine_logo.src=get_bing_logo();
break;
default:
break;}
return false;});
pop_show_url=new container({translate:[0,0,0],visible_p:false});
pop_show_url.create=function(){
if(this.components.length!=0)return;
this.img_pop_url_back=new gbox({translate:[0,0,0],
width:810,
height:DEF_SUBM_H*BOOKMARK_SBM_LIST.length,
color:system.fdp_color.POP});
this.text_url=new gtextbox({translate:[0,5,0],
width:this.img_pop_url_back.width-20,
height:this.img_pop_url_back.height-20,
color:system.fdp_color.TEXT_ONBASE,align:LEFT});
this.components.push(this.img_pop_url_back,this.text_url);
};
pop_show_url.appear=function(){
this.create();
this.translate[0]=submenu.translate[0]+DEF_SUBM_W/2+this.img_pop_url_back.width/2+1;
this.translate[1]=submenu.translate[1];
setf_text(this.text_url,
bookmark.data.bookmarkpanel[bookmark.index].url);
this.visible_p=true;
};
pop_show_url.disappear=function(){
this.visible_p=false;
this.free();
};
pop_show_url.free=function(){
if(this.components.length==0)return;
setf_text(this.text_url,"");
this.components.splice(0,this.components.length);
};
var function_item=function(param){
this.translate=param.translate;
this.width=param.width;
this.height=param.height;
this.point_x=param.point_x?param.point_x:param.width/2-5;
this.point_y=param.point_y?param.point_y:-param.height/2+10;
this.enable=true;
if((param.index==FUNC_LOCATION)||(param.index==FUNC_SEARCH)){
this.components=[
this.img=new gbox({width:param.width,height:param.height,
visible_p:true,color:system.fdp_color.WIDGET_SUB}),
this.img_base=new gbox({width:param.width,height:param.height,visible_p:false}),
this.img_act=new item_focus(),
this.img_prs=new gimage({width:param.width,height:param.height,
visible_p:false,color:system.fdp_color.FCS}),
this.img_shdw=new gbox({width:param.width,height:param.height,
visible_p:false,color:system.fdp_color.WIDGET_SUB}),
this.img_act_shdw=new gbox({width:param.width,height:param.height,
visible_p:false,color:system.fdp_color.WIDGET_SUB}),
];
if(param.index==FUNC_SEARCH){
this.img_base.width=45;
this.img_base.height=45;
this.img_base.translate=[param.width/2-(54/2+1),-0.5,0.1];
this.img_base.color=[255,185,0,255];
this.components.push(
this.img=new gimage({width:54,height:54,src:param.src,draw_type:param.draw_type,
translate:[param.width/2-(54/2+1),0,0.1],
visible_p:true,color:system.fdp_color.ICON_ONBASE}));}
this.img_act.setSize(param.width-6,param.height-8);}else{
this.components=[
this.img_base=new gbox({width:param.width,height:param.height,visible_p:false}),
this.img=new gimage({width:param.width,height:param.height,src:param.src,draw_type:param.draw_type,
visible_p:true,color:system.fdp_color.ICON_ONBASE}),
this.img_act=new item_focus(),
this.img_prs=new gimage({width:param.width,height:param.height,src:param.src,draw_type:param.draw_type,
visible_p:false,color:system.fdp_color.FCS}),
this.img_shdw=new gimage({width:param.width,height:param.height,src:param.src,draw_type:param.draw_type,
visible_p:false,color:system.fdp_color.WIDGET_SUB}),
this.img_act_shdw=new gimage({width:param.width,height:param.height,src:param.src,draw_type:param.draw_type,
visible_p:false,color:system.fdp_color.WIDGET_SUB}),
];
this.img_act.setSize(param.width-16,param.height-16);
if(param.index==FUNC_GUIDE){
this.img_base.width=param.width-16;
this.img_base.height=param.height-16;}
}
this.img_act.setTranslate(0,0,0);
var cover_x=Math.round((ItemPosList[param.index].right+ItemPosList[param.index].left)/2-this.translate[0]);
var cover_y=-this.translate[1];
var cover_w=Math.round(ItemPosList[param.index].right-ItemPosList[param.index].left);
var cover_h=FUNC_BAR_HEIGHT;
this.components.push(this.cover=new gbox({translate:[cover_x,cover_y,0],width:cover_w,height:cover_h,color:[0,0,0,0]}));
console_log("[item]["+param.index+"]"+this.cover.translate+" w:"+this.cover.width+" h:"+this.cover.height);
this.pos_u=this.translate[1]+cover_y+cover_h/2;
this.pos_l=this.translate[1]+cover_y-cover_h/2;
this.index=param.index;
this.parent=param.parent;
this.action_cb=param.action;
this.right_action_cb=param.right_action;
this.tooltip_text="";
if(DEF_TOOLTIP&&param.tooltip_text)
this.tooltip_text=param.tooltip_text;
this.tooltip_timer={};};
function_item.prototype=new container({});
function_item.prototype.action=function(obj){
if(sft_kbd.visible_p)return;
if(submenu.visible_p)return;
if(search_engine.visible_p)return;
if(guide_menu.visible_p)return;
if(popup_disp_mgr.is_disp())return;
if(tou_panel.is_disp())return;
if(this.enable){
this.done_focus();
return this.action_cb();}
return false;};
function_item.prototype.right_mousedown=function(obj){
if(sft_kbd.visible_p)return;
if(submenu.visible_p)return;
if(search_engine.visible_p)return;
if(guide_menu.visible_p)return;
if(popup_disp_mgr.is_disp())return;
if(tou_panel.is_disp())return;
if(this.enable&&this.right_action_cb){
this.done_focus();
return this.right_action_cb();}
return false;};
function_item.prototype.mouseover=function(obj){
console_log("[function_item.mouseover]index:"+obj.index);
if(sft_kbd.visible_p)return;
if(submenu.visible_p)return;
if(search_engine.visible_p)return;
if(guide_menu.visible_p)return;
if(popup_disp_mgr.is_disp())return;
if(tou_panel.is_disp())return;
if(function_bar.pos_current!=obj.index){
function_bar.pos_current=obj.index;
common_key.set_cursor(platinum_main,function_bar);
common_key.set_cursor(function_bar,obj);}else{
common_key.set_cursor(platinum_main,function_bar);}
force_redraw();};
function_item.prototype.mouseout=function(obj){
console_log("[function_item.mouseout]index:"+obj.index);
if(sft_kbd.visible_p)return;
if(submenu.visible_p)return;
if(search_engine.visible_p)return;
if(guide_menu.visible_p)return;
if(popup_disp_mgr.is_disp())return;
if(tou_panel.is_disp())return;
this.leave_focus();
common_key.set_cursor(function_bar,null);
common_key.set_cursor(platinum_main,brw_disp);
function_bar.pos_current=FUNC_INVALID;
force_redraw();};
function_item.prototype.enter_focus=function(){
delete_timer(this.tooltip_timer);
this.tooltip_timer.tooltip_text=this.tooltip_text;
append_timer(this.tooltip_timer,200,function(obj,count){
console_log("[function_item.enter_focus]end timer");
delete_timer(obj);
tooltip_item.appear({
translate:[system.cursor_pointer.get_pos_x(),system.cursor_pointer.get_pos_y(),0],
text:obj.tooltip_text
});
force_redraw();});
this.img_shdw.visible_p=false;
if(this.enable){
this.img_act.visible_p=true;}else{
this.img_act_shdw.visible_p=true;}
this.img_prs.visible_p=false;
force_redraw();};
function_item.prototype.leave_focus=function(){
delete_timer(this.tooltip_timer);
if(DEF_TOOLTIP)
tooltip_item.disappear();
if(!this.enable){
this.img_shdw.visible_p=true;}
this.img_act.visible_p=false;
this.img_act_shdw.visible_p=false;};
function_item.prototype.done_focus=function(){
this.img_act.visible_p=false;
this.img_prs.visible_p=true;
force_redraw();
append_timer(this,200,function(obj,count){
console_log("[function_item.done_focus]end timer");
delete_timer(obj);
if(obj.parent.cursor==obj){
if(obj.enable){
obj.img_act.visible_p=true;}else{
obj.img_act_shdw.visible_p=true;}
}else{
if(!obj.enable){
obj.img_shdw.visible_p=true;}
}
obj.img_prs.visible_p=false;
force_redraw();});};
function_item.prototype.set_enable=function(){
this.enable=true;
if(this.img_prs.visible_p)return;
if(this.img_act_shdw.visible_p){
this.img_act.visible_p=true;}
this.img_shdw.visible_p=false;
this.img_act_shdw.visible_p=false;};
function_item.prototype.set_disable=function(){
this.enable=false;
if(this.img_prs.visible_p)return;
if(this.img_act.visible_p){
this.img_act_shdw.visible_p=true;}else{
this.img_shdw.visible_p=true;}
this.img_act.visible_p=false;};
function_item.prototype.free=function(){
this.img.src="";
this.img_prs.src="";
this.img_shdw.src="";
this.img_act_shdw.src="";
if(DEF_TOOLTIP)
tooltip_item.disappear();
this.components.splice(0,this.components.length);};
var function_toggle_item=function(param){
this.translate=param.translate;
this.width=param.width;
this.height=param.height;
this.mode=param.mode?param.mode:1;this.ary_img=param.ary_img;
var icon_img_src;
if(this.mode==1){
this.color_1=system.fdp_color.WIDGET_SUB;
this.color_2=system.fdp_color.ICON_ONBASE;}else{
this.color_1=system.fdp_color.ICON_ONBASE;
this.color_2=system.fdp_color.WIDGET_SUB;}
this.components=[
this.img_icon_1=new gimage({translate:[-13,0,0],width:param.width,height:param.height,
color:this.color_1,
src:this.ary_img[0],draw_type:param.draw_type}),
this.img_icon_2=new gimage({translate:[18,0,0],width:param.width,height:param.height,
color:this.color_2,
src:this.ary_img[1],draw_type:param.draw_type}),
];
var cover_x=Math.round((param.area_r+param.area_l)/2-this.translate[0]);
var cover_y=-this.translate[1];
var cover_w=Math.round(param.area_r-param.area_l);
var cover_h=FUNC_BAR_HEIGHT;
this.components.push(this.cover=new gbox({translate:[cover_x,cover_y,0],width:cover_w,height:cover_h,color:[0,0,0,0]}));
this.index=param.index;
this.action_cb=param.action;
this.tooltip_text="";
if(DEF_TOOLTIP&&param.tooltip_text)
this.tooltip_text=param.tooltip_text;};
function_toggle_item.prototype=new container({});
function_toggle_item.prototype.action=function(obj){
if(obj)return;
return this.action_cb();};
function_toggle_item.prototype.mouseover=function(obj){
console_log("[function_toggle_item.mouseover]index:"+obj.index);
if(sft_kbd.visible_p)return;
if(submenu.visible_p)return;
if(search_engine.visible_p)return;
if(guide_menu.visible_p)return;
if(popup_disp_mgr.is_disp())return;
if(tou_panel.is_disp())return;
if(function_bar.pos_current!=obj.index){
function_bar.pos_current=obj.index;
common_key.set_cursor(platinum_main,function_bar);
common_key.set_cursor(function_bar,obj);}else{
common_key.set_cursor(platinum_main,function_bar);}
force_redraw();};
function_toggle_item.prototype.mouseout=function(obj){
console_log("[function_toggle_item.mouseout]index:"+obj.index);
if(sft_kbd.visible_p)return;
if(submenu.visible_p)return;
if(search_engine.visible_p)return;
if(guide_menu.visible_p)return;
if(popup_disp_mgr.is_disp())return;
if(tou_panel.is_disp())return;
this.leave_focus();
common_key.set_cursor(function_bar,null);
common_key.set_cursor(platinum_main,brw_disp);
function_bar.pos_current=FUNC_INVALID;
force_redraw();};
function_toggle_item.prototype.enter_focus=function(){
if(DEF_TOOLTIP&&this.tooltip_text){
tooltip_item.appear({
translate:[system.cursor_pointer.get_pos_x(),system.cursor_pointer.get_pos_y(),0],
text:this.tooltip_text
});}
force_redraw();};
function_toggle_item.prototype.leave_focus=function(){
if(DEF_TOOLTIP)
tooltip_item.disappear();};
function_toggle_item.prototype.done_focus=function(){
};
function_toggle_item.prototype.set_mode=function(mode){
console_log("[function_toggle_item.set_mode]mode:"+mode);
this.mode=mode;
if(this.mode==1){
this.img_icon_1.color=system.fdp_color.WIDGET_SUB;
this.img_icon_2.color=system.fdp_color.POINT_ONBASE;
delete_timer(this);
append_timer(this,1000,function(obj){
delete_timer(obj);
obj.img_icon_2.color=system.fdp_color.ICON_ONBASE;
force_redraw();});}else{
this.img_icon_1.color=system.fdp_color.POINT_ONBASE;
this.img_icon_2.color=system.fdp_color.WIDGET_SUB;
delete_timer(this);
append_timer(this,1000,function(obj){
delete_timer(obj);
obj.img_icon_1.color=system.fdp_color.ICON_ONBASE;
force_redraw();});}
force_redraw();};
function_toggle_item.prototype.free=function(){
this.img_icon_1.src="";
this.img_icon_2.src="";
this.components.splice(0,this.components.length);};
set_ItemPosList=function(){
ItemPosList=[
{left:-SCREEN_WIDTH/2,
right:(COLOR_POS_LIST[FUNC_BACK]+COLOR_POS_LIST[FUNC_NEXT])/2,
item:FUNC_BACK},
{left:(COLOR_POS_LIST[FUNC_BACK]+COLOR_POS_LIST[FUNC_NEXT])/2+1,
right:(COLOR_POS_LIST[FUNC_NEXT]+COLOR_POS_LIST[FUNC_REDUNTION])/2,
item:FUNC_NEXT},
{left:(COLOR_POS_LIST[FUNC_NEXT]+COLOR_POS_LIST[FUNC_REDUNTION])/2+1,
right:(COLOR_POS_LIST[FUNC_REDUNTION]+COLOR_POS_LIST[FUNC_ENLARGE])/2,
item:FUNC_REDUNTION},
{left:(COLOR_POS_LIST[FUNC_REDUNTION]+COLOR_POS_LIST[FUNC_ENLARGE])/2+1,
right:(COLOR_POS_LIST[FUNC_ENLARGE]+COLOR_POS_LIST[FUNC_BOOKMARK_PLUS])/2,
item:FUNC_ENLARGE},
{left:(COLOR_POS_LIST[FUNC_ENLARGE]+COLOR_POS_LIST[FUNC_BOOKMARK_PLUS])/2+1,
right:COLOR_POS_LIST[FUNC_BOOKMARK_PLUS]+FUNC_WIDTH/2+FUNC_W_MARGIN/2,
item:FUNC_BOOKMARK_PLUS},
{left:COLOR_POS_LIST[FUNC_LOCATION]+LOCATION_WIDTH/2-60,
right:COLOR_POS_LIST[FUNC_LOCATION]+LOCATION_WIDTH/2,
item:FUNC_RELOAD},
{left:COLOR_POS_LIST[FUNC_BOOKMARK_PLUS]+FUNC_WIDTH/2+FUNC_W_MARGIN/2+1,
right:COLOR_POS_LIST[FUNC_LOCATION]+LOCATION_WIDTH/2,
item:FUNC_LOCATION},
{left:COLOR_POS_LIST[FUNC_LOCATION]+LOCATION_WIDTH/2+1,
right:COLOR_POS_LIST[FUNC_SEARCH]+SEARCH_WIDTH/2,
item:FUNC_SEARCH},
{left:COLOR_POS_LIST[FUNC_SEARCH]+SEARCH_WIDTH/2+1,
right:(COLOR_POS_LIST[FUNC_GUIDE]+COLOR_POS_LIST[FUNC_END])/2,
item:FUNC_GUIDE},
{left:(COLOR_POS_LIST[FUNC_GUIDE]+COLOR_POS_LIST[FUNC_END])/2+1,
right:COLOR_POS_LIST[FUNC_END]+FUNC_WIDTH/2,
item:FUNC_END}
];
if(DEF_TOOLTIP){
ItemPosList.push({
left:(COLOR_POS_LIST[FUNC_END]+COLOR_POS_LIST[FUNC_DRAG])/2+1,
right:COLOR_POS_LIST[FUNC_DRAG]+FUNC_WIDTH/2,
item:FUNC_DRAG
});}
if(DEF_CHANGE_SCREEN){
ItemPosList.splice(0,1,
{left:COLOR_POS_LIST[FUNC_CHANGE_SCREEN]-FUNC_WIDTH/2,
right:(COLOR_POS_LIST[FUNC_CHANGE_SCREEN]+COLOR_POS_LIST[FUNC_BACK])/2,
item:FUNC_CHANGE_SCREEN},
{left:(COLOR_POS_LIST[FUNC_CHANGE_SCREEN]+COLOR_POS_LIST[FUNC_BACK])/2+1,
right:(COLOR_POS_LIST[FUNC_BACK]+COLOR_POS_LIST[FUNC_NEXT])/2,
item:FUNC_BACK});
ItemPosList.splice(6,1,
{left:COLOR_POS_LIST[FUNC_RELOAD]-15,
right:COLOR_POS_LIST[FUNC_RELOAD]+15,
item:FUNC_RELOAD});
}
}
var FUNCTION_BAR_Y=SCREEN_HEIGHT/2-FUNC_BAR_HEIGHT/2;
function_bar=new container({translate:[0,FUNCTION_BAR_Y,0.1]});
function_bar.create=function(){
console_log("[START][function_bar.create]");
set_ItemPosList();
if(this.components.length==0){
var display_mode=check_display_mode();
switch(display_mode){
case DEF_NAGARA_COMN:
var key_pos=FUNC_LEFT_POS+FUNC_WIDTH*4+FUNC_W_MARGIN*2+FUNC_WIDTH/2+LOCATION_WIDTH/2-180-22;
break;
case DEF_NAGARA_4K2K:
case DEF_NAGARA_COMN_CHANGE:
var key_pos=COLOR_POS_LIST[FUNC_LOCATION]-LOCATION_WIDTH/2+25;
break;
case DEF_FULL_4K2K:
case DEF_FULL_COMN_CHANGE:
var key_pos=COLOR_POS_LIST[FUNC_LOCATION]-LOCATION_WIDTH/2+25;
break;}
this.img_base=new container({
components:[
new gbox({width:SCREEN_WIDTH,height:FUNC_BAR_HEIGHT,
color:system.fdp_color.BASE}),
new gimage({translate:[0,0,0],
width:SCREEN_WIDTH,height:FUNC_BAR_HEIGHT,color:system.fdp_color.ICON_ONBASE,
src:PALTINUM_PATH_IMG+"apps_back_gradation.png",draw_type:DIRECT})
],
});
if(!DEF_CHANGE_SCREEN){
this.guide_clr_1=new container({translate:[0,-38,0.1],components:[
new gbox({width:FUNC_ITEM_WIDTH-1,height:7,
color:get_COLOR_KEY(0).color})
]});}else{
this.guide_clr_1=new container({
translate:[COLOR_POS_LIST[FUNC_CHANGE_SCREEN],-38,0.1],components:[
new gbox({width:FUNC_ITEM_WIDTH-1,height:7,
color:get_COLOR_KEY(0).color})
]});}
this.guide_clr_2=new container({
translate:[COLOR_POS_LIST[FUNC_REDUNTION],-38,0.1],components:[
new gbox({width:FUNC_ITEM_WIDTH-1,height:7,
color:get_COLOR_KEY(1).color})
]});
this.guide_clr_3=new container({
translate:[COLOR_POS_LIST[FUNC_ENLARGE],-38,0.1],components:[
new gbox({width:FUNC_ITEM_WIDTH-1,height:7,
color:get_COLOR_KEY(2).color})
]});
this.guide_clr_4=new container({
translate:[COLOR_POS_LIST[FUNC_DRAG],-38,0.1],components:[
new gbox({width:FUNC_ITEM_WIDTH-1,height:7,
color:get_COLOR_KEY(3).color})
]});
var img_src=null
if((display_mode==DEF_NAGARA_4K2K)||(display_mode==DEF_NAGARA_COMN_CHANGE)){
img_src=PALTINUM_PATH_IMG+"fullbrowse01_2k.png";}else if((display_mode==DEF_FULL_4K2K)||(display_mode==DEF_FULL_COMN_CHANGE)){
img_src=PALTINUM_PATH_IMG+"fullbrowser02_2k.png";}
if(img_src){
this.change_screen=new function_item({
translate:[COLOR_POS_LIST[FUNC_CHANGE_SCREEN],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:img_src,
draw_type:INSCRIBED,index:FUNC_CHANGE_SCREEN,
tooltip_text:W_TEXT.WB_LT_TIPS_CHANGE_SCREEN,
parent:this,action:this.change_screen_action});
this.change_screen_tips();}
this.next=new function_item({
translate:[COLOR_POS_LIST[FUNC_NEXT],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"next_2k.png",
draw_type:INSCRIBED,index:FUNC_NEXT,
tooltip_text:W_TEXT.WB_LT_TIPS_HISTORY_FORWARD,
parent:this,action:this.next_action});
this.back=new function_item({
translate:[COLOR_POS_LIST[FUNC_BACK],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"back_2k.png",
draw_type:INSCRIBED,index:FUNC_BACK,
tooltip_text:W_TEXT.WB_LT_TIPS_HISTORY_BACK,
parent:this,action:this.back_action});
this.reduction=new function_item({
translate:[COLOR_POS_LIST[FUNC_REDUNTION],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"reduction_2k.png",
draw_type:INSCRIBED,index:FUNC_REDUNTION,
tooltip_text:W_TEXT.WB_LT_TIPS_ZOOM_OUT,
parent:this,action:this.reduction_action});
this.enlarge=new function_item({
translate:[COLOR_POS_LIST[FUNC_ENLARGE],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"enlarge_2k.png",
draw_type:INSCRIBED,index:FUNC_ENLARGE,
tooltip_text:W_TEXT.WB_LT_TIPS_ZOOM_IN,
parent:this,action:this.enlarge_action});
if(NAGARA_LAUNCH){
this.reload=new function_item({
translate:[COLOR_POS_LIST[FUNC_RELOAD],FUNC_POS_Y,0.1],
width:54,height:54,
src:PALTINUM_PATH_IMG+"reload_2k.png",
draw_type:INSCRIBED,index:FUNC_RELOAD,
tooltip_text:W_TEXT.WB_LT_TIPS_RELOAD,
parent:this,action:this.reload_action});}else{
this.reload=new function_item({
translate:[COLOR_POS_LIST[FUNC_RELOAD],FUNC_POS_Y,0.1],
width:54,height:54,
src:PALTINUM_PATH_IMG+"reload_2k.png",
draw_type:INSCRIBED,index:FUNC_RELOAD,
tooltip_text:W_TEXT.WB_LT_TIPS_RELOAD,
parent:this,action:this.reload_action});}
this.favorite_plus=new function_item({
translate:[COLOR_POS_LIST[FUNC_BOOKMARK_PLUS],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"favorite_plus_2k.png",
draw_type:INSCRIBED,index:FUNC_BOOKMARK_PLUS,
tooltip_text:W_TEXT.WB_LT_TIPS_ADD_BOOKMARK,
parent:this,action:this.add_bookmark_action});
if((display_mode==DEF_NAGARA_COMN)||(display_mode==DEF_NAGARA_4K2K)||
(display_mode==DEF_NAGARA_COMN_CHANGE)){
this.locate_bar=new function_item({
translate:[COLOR_POS_LIST[FUNC_LOCATION],FUNC_POS_Y,0.1],
width:LOCATION_WIDTH-10,height:TEXT_HEIGHT,
point_x:720/2-20,point_y:-TEXT_HEIGHT/2,
draw_type:DIRECT,index:FUNC_LOCATION,
tooltip_text:W_TEXT.WB_LT_TIPS_URL_BAR,
parent:this,action:this.enter_location_action});
this.img_key=new gimage({translate:[key_pos,FUNC_POS_Y+4,0.1],color:system.fdp_color.BASE,
width:36,height:54,src:PALTINUM_PATH_IMG+"key_2k.png",draw_type:DIRECT});
this.img_key_act=new gimage({translate:[key_pos,FUNC_POS_Y+4,0.1],visible_p:false,color:system.fdp_color.FCS,
width:36,height:54,src:PALTINUM_PATH_IMG+"key_active_2k.png",draw_type:DIRECT});
this.search_bar=new function_item({
translate:[COLOR_POS_LIST[FUNC_SEARCH],FUNC_POS_Y,0.1],
width:SEARCH_WIDTH-10,height:TEXT_HEIGHT,
point_x:360/2-38,point_y:-TEXT_HEIGHT/2,
src:PALTINUM_PATH_IMG+"search_2k.png",
draw_type:DIRECT,index:FUNC_SEARCH,
tooltip_text:W_TEXT.WB_LT_TIPS_SEARCH_BAR,
parent:this,action:this.enter_search_action,right_action:this.right_search_action});}else{
this.locate_bar=new function_item({
translate:[COLOR_POS_LIST[FUNC_LOCATION],FUNC_POS_Y,0.1],
width:LOCATION_WIDTH,height:TEXT_HEIGHT,
point_x:LOCATION_WIDTH/2-20,point_y:-TEXT_HEIGHT/2,
draw_type:DIRECT,index:FUNC_LOCATION,
tooltip_text:W_TEXT.WB_LT_TIPS_URL_BAR,
parent:this,action:this.enter_location_action});
this.img_key=new gimage({translate:[key_pos,FUNC_POS_Y+4,0.1],
width:36,height:54,src:PALTINUM_PATH_IMG+"key_2k.png",draw_type:DIRECT});
this.img_key_act=new gimage({translate:[key_pos,FUNC_POS_Y+4,0.1],visible_p:false,
width:36,height:54,src:PALTINUM_PATH_IMG+"key_active_2k.png",draw_type:DIRECT});
this.search_bar=new function_item({
translate:[COLOR_POS_LIST[FUNC_SEARCH],FUNC_POS_Y,0.1],
width:SEARCH_WIDTH-10,height:TEXT_HEIGHT,
point_x:360/2-38,point_y:-TEXT_HEIGHT/2,
src:PALTINUM_PATH_IMG+"search_2k.png",
draw_type:INSCRIBED,index:FUNC_SEARCH,
tooltip_text:W_TEXT.WB_LT_TIPS_SEARCH_BAR,
parent:this,action:this.enter_search_action,right_action:this.right_search_action});}
this.end=new function_item({
translate:[COLOR_POS_LIST[FUNC_END],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"end_2k.png",
draw_type:INSCRIBED,index:FUNC_END,
tooltip_text:W_TEXT.WB_LT_TIPS_EXIT_WEB_BROWSER,
parent:this,action:this.end_action});
this.guide=new function_item({
translate:[COLOR_POS_LIST[FUNC_GUIDE],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH,height:FUNC_ITEM_HIGHT,
src:PALTINUM_PATH_IMG+"setup_2k.png",
draw_type:INSCRIBED,index:FUNC_GUIDE,
tooltip_text:W_TEXT.WB_LT_TIPS_SETTINGS,
parent:this,action:this.guide_appear_action});
this.guide_tips();
this.cursor_img=new function_toggle_item({
translate:[COLOR_POS_LIST[FUNC_DRAG],FUNC_POS_Y,0.1],
width:FUNC_ITEM_WIDTH/2,height:FUNC_ITEM_HIGHT,
ary_img:[PALTINUM_PATH_IMG+"allow_2k.png",PALTINUM_PATH_IMG+"grab_2k.png"],
mode:2,draw_type:INSCRIBED,index:FUNC_DRAG,
area_l:980-154,area_r:960,
tooltip_text:W_TEXT.WB_LT_TIPS_DRAG_MODE_ENAGLE,
action:function_bar.set_drag_mode});
var width_dt;
if((display_mode==DEF_NAGARA_COMN)||(display_mode==DEF_NAGARA_4K2K)||
(display_mode==DEF_NAGARA_COMN_CHANGE)){
width_dt=((display_mode==DEF_NAGARA_4K2K)||
(display_mode==DEF_NAGARA_COMN_CHANGE))?LOCATION_WIDTH-115:360;
this.text_locate=new gtext({
translate:[COLOR_POS_LIST[FUNC_LOCATION]-4,FUNC_POS_Y,0.2],font_size:28,
width:width_dt+16,margin:[-2,0,0,0],text:"http://",color:system.fdp_color.TEXT_ONBASE});
this.search_engine=new gtext({
translate:[COLOR_POS_LIST[FUNC_SEARCH]-10,FUNC_POS_Y,0.2],font_size:28,
width:163,margin:[-2,0,5,10],color:system.fdp_color.TEXT_ONBASE_A,
text:display_search_engine_name?ENGINE_LIST[SEARCH_ENGINE].name:""});
this.search_txt=new gtext({
translate:[COLOR_POS_LIST[FUNC_SEARCH]-15,FUNC_POS_Y,0.2],font_size:28,
width:165,margin:[-2,0,5,10],text:"",omitter:"...",
color:system.fdp_color.TEXT_ONBASE});}else{
width_dt=((display_mode==DEF_FULL_4K2K)||
(display_mode==DEF_FULL_COMN_CHANGE))?LOCATION_WIDTH-115:650-126;
this.text_locate=new gtext({
translate:[COLOR_POS_LIST[FUNC_LOCATION],FUNC_POS_Y,0.2],
width:width_dt,margin:[-2,0,10,10],text:"http://",color:system.fdp_color.TEXT_ONBASE});
this.search_engine=new gtext({
translate:[COLOR_POS_LIST[FUNC_SEARCH]-10,FUNC_POS_Y,0.2],
width:266,margin:[-2,0,5,10],color:system.fdp_color.TEXT_ONBASE_A,
text:display_search_engine_name?ENGINE_LIST[SEARCH_ENGINE].name:""});
this.search_txt=new gtext({
translate:[COLOR_POS_LIST[FUNC_SEARCH]-10,FUNC_POS_Y,0.2],
width:266,margin:[-2,0,5,10],text:"",omitter:"...",
color:system.fdp_color.TEXT_ONBASE});}
this.search_engine_logo=new gimage({
translate:[COLOR_POS_LIST[FUNC_SEARCH]-SEARCH_WIDTH/2+83/2+20,FUNC_POS_Y,0.2],
width:88,height:34,src:"",draw_type:DIRECT,visible_p:false});
this.search_engine_logo.src=get_bing_logo();
this.ary_item=new Array();
switch(display_mode){
case DEF_NAGARA_COMN:
this.components.push(this.img_base,this.guide_clr_1,this.guide_clr_2,this.guide_clr_3,this.guide_clr_4,
this.next,this.back,this.enlarge,this.reduction,this.favorite_plus,this.locate_bar,
this.img_key,this.img_key_act,this.reload,this.search_bar,this.end,this.guide,this.cursor_img,
this.text_locate,this.search_engine,this.search_txt,this.search_engine_logo);
this.ary_item.push(this.back,this.next,this.reduction,this.enlarge,
this.favorite_plus,this.reload,this.locate_bar,
this.search_bar,this.guide,this.end,this.cursor_img);
break;
case DEF_NAGARA_4K2K:
case DEF_NAGARA_COMN_CHANGE:
this.components.push(this.img_base,this.guide_clr_1,this.guide_clr_2,this.guide_clr_3,this.guide_clr_4,
this.change_screen,
this.next,this.back,this.enlarge,this.reduction,this.favorite_plus,this.locate_bar,
this.img_key,this.img_key_act,this.reload,this.search_bar,this.end,this.guide,this.cursor_img,
this.text_locate,this.search_engine,this.search_txt,this.search_engine_logo);
this.ary_item.push(this.change_screen,this.back,this.next,this.reduction,this.enlarge,
this.favorite_plus,this.reload,this.locate_bar,
this.search_bar,this.guide,this.end,this.cursor_img);
break;
case DEF_FULL_4K2K:
case DEF_FULL_COMN_CHANGE:
this.components.push(this.img_base,this.guide_clr_1,this.guide_clr_2,this.guide_clr_3,this.guide_clr_4,
this.change_screen,
this.next,this.back,this.enlarge,this.reduction,this.favorite_plus,this.locate_bar,
this.img_key,this.img_key_act,this.reload,this.search_bar,this.end,this.guide,this.cursor_img,
this.text_locate,this.search_engine,this.search_txt,this.search_engine_logo);
this.ary_item.push(this.change_screen,this.back,this.next,this.reduction,this.enlarge,
this.favorite_plus,this.reload,this.locate_bar,
this.search_bar,this.guide,this.end,this.cursor_img);
break;}
this.moveTo=MoveTo;
this.pos_current=FUNC_INVALID;
this.search_engine_logo_set();}else{
if(DEF_CHANGE_SCREEN)this.guide_clr_1.translate=[COLOR_POS_LIST[FUNC_CHANGE_SCREEN],-38,0.1];
this.guide_clr_2.translate=[COLOR_POS_LIST[FUNC_REDUNTION],-38,0.1];
this.guide_clr_3.translate=[COLOR_POS_LIST[FUNC_ENLARGE],-38,0.1];
this.guide_clr_4.translate=[COLOR_POS_LIST[FUNC_DRAG],-38,0.1];}
if(!DEF_CHANGE_SCREEN){
this.guide_clr_1.visible_p=false;}else{
this.guide_clr_1.visible_p=true;}
this.guide_clr_2.visible_p=true;
this.guide_clr_3.visible_p=true;
this.guide_clr_4.visible_p=true;
this.drag_mode=false;
this.favorite_plus_action=false;
set_pointer_obj(function_bar.ary_item,0);
console_log("[END][function_bar.create]");};
function_bar.back_action=function(){
console_log("[START][function_bar.back_action]");
var ret=false;
if(brw_disp.brw.is_connect()){
if(BRW_INFO.url){
brw_disp.brw.back_action();}else{
if(NAGARA_LAUNCH){
delete_timer(this);
append_timer(this,50,function(obj,count){
delete_timer(obj);
brw_disp.brw.load_stop_req();
brw_disp.show_exit_popup();});}
else if(DIRECT_LAUNCH){
brw_disp.brw.load_stop_req();
brw_disp.disappear();
common_effect_out(TXK_RETURN);}
else {
brw_disp.brw.load_stop_req();
brw_disp.disappear();
if(!popup_disp_mgr.is_disp())
common_key.set_cursor(platinum_main,function_bar);}
}
ret=true;}else{
common_effect_out(TXK_RETURN);
ret=true;}
return ret;};
function_bar.change_screen_tips=function(){
this.change_screen.tooltip_text=
(side_w_mode)?W_TEXT.WB_LT_TIPS_CHANGE_SCREEN_FULL:W_TEXT.WB_LT_TIPS_CHANGE_SCREEN_BOOKMARK;};
function_bar.change_screen_action=function(){
if(brw_disp.brw.is_fullscreen()||!function_bar.visible_p)return;
side_w_mode=!side_w_mode;
function_bar.change_screen_tips();
brw_disp.change_screen_func(side_w_mode);

var locate_text=function_bar.get_locate_text();
var search_text=function_bar.get_search_text();
function_bar.free();
function_bar.create();
function_bar.set_btn_state();
if(side_w_mode){
side_window.visible_p=true;
if(DEF_MULTI_USER)
MultiUserSelection.set_visible(true);
side_window.update_data();
set_base_pointer_obj();}else{
side_window.visible_p=false;
if(DEF_MULTI_USER)
MultiUserSelection.set_visible(false);}
setf_text(function_bar.text_locate,locate_text);
setf_text(function_bar.search_txt,search_text);
if(search_text!=""){
setf_text(function_bar.search_engine,"");
function_bar.search_engine_logo.visible_p=false;}
force_redraw();
return true;};
function_bar.next_action=function(){
var ret=false;
if(brw_disp.brw.get_page_foward()!=0){
brw_disp.brw.next_action();
ret=true;}
return ret;};
function_bar.enlarge_action=function(){
brw_disp.brw.enlarge_action();
return true;};
function_bar.reduction_action=function(){
brw_disp.brw.reduction_action();
return true;};
function_bar.disp_bookmark_action=function(){
brw_disp.disappear();
return true;};
function_bar.add_bookmark_action=function(){
if(bookmark.all_data.bookmarkpanel.length>=BOOK_MARK_MAX){
brw_disp.show_popup_cb({type:BROWSER_ERROR_EV},9990);
return false;}else{
if(function_bar.favorite_plus_action)return true;
function_bar.favorite_plus_action=true;
brw_disp.fg_capture=true;
brw_disp.capture_url=BRW_INFO.url;
brw_disp.brw.stop_capture_req();
brw_disp.brw.get_pixmap();}
return true;};
function_bar.reload_action=function(){
brw_disp.reload_func();
return true;};
function_bar.enter_location_action=function(){
console_log("[START][function_bar.enter_location_action]");
if(sft_kbd.visible_p)return false;
textarea_box.create({translate:[0,-620,0.1],width:1430,height:56,font_size:32,mode:"location"});
textarea_box.textarea.set_unconf_bg_param({height:50,force_visible:false,color:[0,0,0,0]});
textarea_box.appear(function_bar.get_locate_text());
sft_kbd.appear({text:"",
skin_path:kbd_skin_path,
textarea:textarea_box.textarea,
done_cb:function_bar.set_locate_done_cb,
cancel_cb:function_bar.set_locate_cancel_cb});
sft_kbd.set_input_char("ALPHABET");
return true;};
function_bar.enter_search_action=function(){
if(apps_nvram.read("SEARCH_UPDATE","home")!=1){
pkg_toolbars.search_engine_update();}
if(apps_nvram.read("SEARCH_UPDATE","home")==1){
search_engine.appear();
apps_nvram.write("SEARCH_UPDATE",0,"home");
return true;}
console_log("[START][function_bar.enter_search_action]");
if(sft_kbd.visible_p)return false;
textarea_box.create({translate:[0,-620,0.1],width:1300,height:65,font_size:42,mode:"search"});
textarea_box.textarea.set_unconf_bg_param({height:70,force_visible:false,color:[0,0,0,0]});
textarea_box.appear(function_bar.get_search_text());
SEARCH_TYPE=0;
sft_kbd.appear({text:"",
skin_path:kbd_skin_path,
textarea:textarea_box.textarea,
done_cb:function_bar.search_done_cb,
cancel_cb:function_bar.search_cancel_cb});
return true;};
function_bar.right_search_action=function(){
search_engine.appear();
return true;};
function_bar.set_locate_text=function(text){
if(text){
if((text.substring(0,7)=="http://")||(text.substring(0,8)=="https://")){
}else if(text.search("://")<0){
var tmp="http://";
text=tmp.concat(text);}else{
}
setf_text(this.text_locate,text);
URL_STR=text;
brw_disp.appear(text);}
};
function_bar.set_search_text=function(text){
search_engine_update();
setf_text(this.search_engine,"");
this.search_engine_logo.visible_p=false;
setf_text(this.search_txt,text);
var url_str="";
url_str=SEARCH_URL[ENGINE_LIST[SEARCH_ENGINE].id][SEARCH_TYPE];
url_str=url_str+encodeURIComponent(text);
switch(ENGINE_LIST[SEARCH_ENGINE].name){
case "Google":
if((PLATINUM_LANGUAGE.substr(0,2)=="pt")||(PLATINUM_LANGUAGE.substr(0,2)=="zh")){
url_str=url_str+"&hl="+PLATINUM_LANGUAGE;}else{
url_str=url_str+"&hl="+PLATINUM_LANGUAGE.substr(0,2);}
break;
case "bing":
url_str=url_str+"&Market="+PLATINUM_LANGUAGE;
break;
case "Baidu":
break;}
brw_disp.appear(url_str);};
function_bar.get_locate_text=function(){
return this.text_locate.text;};
function_bar.get_search_text=function(){
return this.search_txt.text;};
function_bar.set_key=function(text){
if(text.substr(0,5)=="https"){
this.img_key.visible_p=false;
this.img_key_act.visible_p=true;}else{
this.img_key.visible_p=true;
this.img_key_act.visible_p=false;}
};
function_bar.set_locate_done_cb=function(text){
var locate=textarea_box.getText();
if(locate){
function_bar.set_locate_text(locate);
textarea_box.disappear();
sft_kbd.disappear();
common_key.set_cursor(platinum_main,function_bar);
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
}else{
function_bar.set_locate_cancel_cb();}
};
function_bar.set_locate_cancel_cb=function(){
textarea_box.disappear();
sft_kbd.disappear();
common_key.set_cursor(platinum_main,function_bar);
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
};
function_bar.search_done_cb=function(text){
var search=textarea_box.getText();
function_bar.set_search_text(search);
textarea_box.disappear();
sft_kbd.disappear();
common_key.set_cursor(platinum_main,function_bar);
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
};
function_bar.search_cancel_cb=function(){
textarea_box.disappear();
sft_kbd.disappear();
common_key.set_cursor(platinum_main,function_bar);
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
};
function_bar.guide_tips=function(){
this.guide.tooltip_text=
(brw_disp.brw.get_private_browsing())?W_TEXT.WB_LT_SETTINGS_WITH_PRIVATE_BROWSING:W_TEXT.WB_LT_TIPS_SETTINGS;}
function_bar.guide_appear_action=function(){
guide_menu.appear();
return true;};
function_bar.end_action=function(){
common_effect_out(TXK_RETURN);
return true;};
function_bar.set_drag_mode=function(){
console_log("[function_bar.set_drag_mode]old:"+function_bar.drag_mode);
if((!function_bar.drag_mode)&&(!brw_disp.brw.is_disp()))return;
if(function_bar.drag_mode){
function_bar.drag_mode=false;
function_bar.ary_item[FUNC_DRAG].set_mode(0);}else{
function_bar.drag_mode=true;
function_bar.ary_item[FUNC_DRAG].set_mode(1);}
console_log("[function_bar.set_drag_mode]new:"+function_bar.drag_mode);
brw_disp.brw.set_drag_mode(function_bar.drag_mode);};
function_bar.clear_drag_mode=function(){
if(this.drag_mode)this.set_drag_mode();};
function_bar.set_btn_state=function(){
var display_mode=check_display_mode();
if((display_mode==DEF_NAGARA_4K2K)||(display_mode==DEF_FULL_4K2K)||
(display_mode==DEF_NAGARA_COMN_CHANGE)||(display_mode==DEF_FULL_COMN_CHANGE)){
this.ary_item[FUNC_CHANGE_SCREEN].set_enable();}
this.ary_item[FUNC_ENLARGE].set_enable();
this.ary_item[FUNC_REDUNTION].set_enable();
this.ary_item[FUNC_BACK].set_enable();
this.ary_item[FUNC_NEXT].set_enable();
this.ary_item[FUNC_BOOKMARK_PLUS].set_enable();
this.ary_item[FUNC_RELOAD].set_enable();
this.ary_item[FUNC_END].set_enable();
if(!brw_disp.brw.is_disp()){
this.ary_item[FUNC_NEXT].set_disable();
this.ary_item[FUNC_RELOAD].set_disable();}
if(!brw_disp.brw.is_loaded()){
this.ary_item[FUNC_ENLARGE].set_disable();
this.ary_item[FUNC_REDUNTION].set_disable();
this.ary_item[FUNC_BOOKMARK_PLUS].set_disable();
if((display_mode==DEF_NAGARA_4K2K)||(display_mode==DEF_FULL_4K2K)||
(display_mode==DEF_NAGARA_COMN_CHANGE)||(display_mode==DEF_FULL_COMN_CHANGE)){
this.ary_item[FUNC_CHANGE_SCREEN].set_disable();}
}
if(brw_disp.brw.get_page_foward()==0){
this.ary_item[FUNC_NEXT].set_disable();}
if(brw_disp.brw.get_zoom_level()>3){
this.ary_item[FUNC_ENLARGE].set_disable();}else if(DEF_4K2K){
if(brw_disp.brw.get_zoom_level()<1){
this.ary_item[FUNC_REDUNTION].set_disable();}
}else if(brw_disp.brw.get_zoom_level()<=1){
this.ary_item[FUNC_REDUNTION].set_disable();}
if(brw_disp.brw.get_private_browsing()){
this.ary_item[FUNC_GUIDE].img_base.visible_p=true;
this.ary_item[FUNC_GUIDE].img_base.color=[130,30,185,255];
this.ary_item[FUNC_GUIDE].img.color=[210,210,210,255];}else{
this.ary_item[FUNC_GUIDE].img_base.visible_p=false;
this.ary_item[FUNC_GUIDE].img.color=system.fdp_color.ICON_ONBASE;}
this.search_engine_logo.src=get_bing_logo();
if(ENGINE_LIST[SEARCH_ENGINE].name=="bing"){
setf_text(this.search_engine,"");
this.ary_item[FUNC_SEARCH].img_base.visible_p=true;
this.ary_item[FUNC_SEARCH].img.color=[80,80,80,255];}else{
this.search_engine_logo.visible_p=false;
this.ary_item[FUNC_SEARCH].img_base.visible_p=false;
this.ary_item[FUNC_SEARCH].img.color=system.fdp_color.ICON_ONBASE;}
if(this.get_search_text()!=""){
setf_text(this.search_engine,"");
this.search_engine_logo.visible_p=false;}
force_redraw();
};
function_bar.get_item_from_pos=function(x,y){
var max=ItemPosList.length;
var item=-1;
if(y<(SCREEN_HEIGHT/2-(FUNC_BAR_HEIGHT-20)))
return item;
for(var i=0;i<max;i++){
if((x>=ItemPosList[i].left)&&(x<=ItemPosList[i].right)){
item=ItemPosList[i].item;
break;}
}
return item;};
function_bar.appear=function(){
function_bar.visible_p=true;
if(sft_kbd.visible_p)sft_kbd.disappear();};
function_bar.free=function(){
for(var i=0,max=this.components.length;i<max;i++){
if(this.components[i] instanceof gimage)this.components[i].src="";
if(this.components[i] instanceof gtext)setf_text(this.components[i],"");
if(this.components[i].free)this.components[i].free();}
this.components.splice(0,this.components.length);};
function_bar.set_pos=function(pos){
this.pos_current=pos;};
function_bar.enter_focus=function(){
console_log("[START][function_bar.enter_focus]");
var mouse_pos_x=system.cursor_pointer.get_pos_x();
var mouse_pos_y=system.cursor_pointer.get_pos_y();
var func=function_bar.get_item_from_pos(mouse_pos_x,mouse_pos_y);
if(this.pos_current>=0)this.ary_item[this.pos_current].leave_focus();
if(this.pos_current<0){
if(func>FUNC_INVALID){
this.pos_current=func;}else{
this.pos_current=0;}
common_key.set_cursor(this,this.ary_item[this.pos_current]);}else{
common_key.set_cursor(this,this.ary_item[this.pos_current]);}
console_log("[END][function_bar.enter_focus]"+this.pos_current);};
function_bar.leave_focus=function(){
console_log("[START][function_bar.leave_focus]");
common_key.set_cursor(this,null);
key_flag=false;};
function_bar.set_free_focus=function(){
var mouse_pos_x=system.cursor_pointer.get_pos_x();
var mouse_pos_y=system.cursor_pointer.get_pos_y();
console_log("[function_bar.set_free_focus]x:"+mouse_pos_x+" y:"+mouse_pos_y);
var func=SearchFunc({x:mouse_pos_x,y:mouse_pos_y});
console_log("[function_bar.set_free_focus]current:"+this.pos_current);
if(this.pos_current>=0)common_key.set_cursor(this,null);
console_log("[function_bar.set_free_focus]next:"+func);
if(func!=FUNCTION_NUM){
this.pos_current=func;
common_key.set_cursor(platinum_main,this);
common_key.set_cursor(this,this.ary_item[this.pos_current]);
return true;}
return false;};
var SearchFunc=function(param){
var x=param.x-function_bar.translate[0];
var y=param.y-function_bar.translate[1];
console_log("[SearchFunc]x:"+x+" y:"+y);
var func=FUNCTION_NUM;
var item;
for(var i=0;i<(FUNCTION_NUM-1);i++){
item=function_bar.ary_item[i];
if(((x>=ItemPosList[i].left)&&(x<=ItemPosList[i].right))
&&((y>=item.pos_l)
&&(y<=item.pos_u))){
func=i;
console_log("[SearchFunc]func:"+func);
break;}
}
return func;};
function_bar.set_disable=function(){
common_key.set_cursor(function_bar,null);};
function_bar.key_hook=function(up_down,key){
if(up_down==KEY_DOWN){
key_flag=true;
long_count=0;
return false;}
if(long_count>3){
}else{
long_count++;}
if(key==TXK_ENTER){
if(key_flag){
if(up_down==KEY_UP){
console_log("[ROOT][function_bar.key_hook]up");
key_flag=false;
this.ary_item[this.pos_current].action();
return true;}else{
if(long_count==4){
console_log("[ROOT][function_bar.key_hook]long");
if(this.pos_current==FUNC_SEARCH){
search_engine.appear();}
key_flag=false;
return true;}
}
}
return false;}
if((up_down==KEY_UP)&&(key==TXK_SUBMENU)){
if(this.pos_current==FUNC_SEARCH){
search_engine.appear();
return true;}
return false;}
if(up_down!=KEY_PRESS)return;
switch(key){
case TXK_ENTER:
break;
case TXK_LEFT:
if(this.pos_current>0){
this.pos_current--;
common_key.set_cursor(this,this.ary_item[this.pos_current]);}else{
}
return true;
case TXK_RIGHT:
if(this.pos_current<this.ary_item.length-1){
this.pos_current++;
if(this.pos_current==FUNC_DRAG)this.pos_current--;
common_key.set_cursor(this,this.ary_item[this.pos_current]);}else{
}
return true;
case TXK_UP:
this.ary_item[this.pos_current].enter_focus();
return true;
case TXK_DOWN:
if((brw_disp.brw.is_disp())||(brw_disp.brw.is_loading())){
InputDevManager.set_move_mode("free");
common_key.set_cursor(platinum_main,brw_disp);}
return true;
case TXK_CONTEXT_MENU:
if(this.pos_current==FUNC_SEARCH){
search_engine.appear();}
return true;
case TXK_RETURN:
case get_COLOR_KEY(0).symbol:
case get_COLOR_KEY(1).symbol:
case get_COLOR_KEY(2).symbol:
case get_COLOR_KEY(3).symbol:
return false;
default:
return false;}
};
function_bar.set_item_pos_list=function(){
set_ItemPosList();}
function_bar.search_engine_logo_set=function(){
if(function_bar.search_txt.text!=""){
function_bar.search_engine_logo.visible_p=false;
setf_text(function_bar.search_engine,"");
if(ENGINE_LIST[SEARCH_ENGINE].name=="bing"){
function_bar.ary_item[FUNC_SEARCH].img_base.visible_p=true;
this.ary_item[FUNC_SEARCH].img.color=[80,80,80,255];}else{
function_bar.ary_item[FUNC_SEARCH].img_base.visible_p=false;
this.ary_item[FUNC_SEARCH].img.color=system.fdp_color.ICON_ONBASE;}
}else{
if(ENGINE_LIST[SEARCH_ENGINE].name=="bing"){
if(display_search_engine_name){
function_bar.search_engine_logo.visible_p=true;
function_bar.ary_item[FUNC_SEARCH].img_base.visible_p=true;
this.ary_item[FUNC_SEARCH].img.color=[80,80,80,255];}
setf_text(function_bar.search_engine,"");}else{
function_bar.search_engine_logo.visible_p=false;
function_bar.ary_item[FUNC_SEARCH].img_base.visible_p=false;
this.ary_item[FUNC_SEARCH].img.color=system.fdp_color.ICON_ONBASE;
if(display_search_engine_name){
setf_text(function_bar.search_engine,ENGINE_LIST[SEARCH_ENGINE].name);}
}
}
};
var scroll_btn=function(param){
var self=this;
this.translate=param.translate;
this.direction=param.direction;
this.action_cb=param.action_cb?param.action_cb:null;
this.parent=param.parent;
this.enable=false;
this.fg_scroll=false;
this.cobj=param.cobj;
this.components=[
this.btn=new container({components:[
this.img=new gimage({src:PALTINUM_PATH_IMG+"btn_arrow.png",
rotation:[-90,0,0,1],
width:23,height:23,draw_type:DIRECT}),
this.img_act=new gimage({src:PALTINUM_PATH_IMG+"btn_arrow.png",
rotation:[-90,0,0,1],
width:23,height:23,draw_type:DIRECT,
visible_p:false}),
this.img_prs=new gimage({src:PALTINUM_PATH_IMG+"btn_arrow.png",
rotation:[-90,0,0,1],
width:23,height:23,draw_type:DIRECT,
visible_p:false}),
this.img_shdw=new gimage({src:PALTINUM_PATH_IMG+"btn_arrow.png",
rotation:[-90,0,0,1],
width:23,height:23,draw_type:DIRECT,
visible_p:false})
]})
];
if(this.direction=="down"){
this.img.rotation=[90,0,0,1];
this.img_act.rotation=[90,0,0,1];
this.img_prs.rotation=[90,0,0,1];
this.img_shdw.rotation=[90,0,0,1];}else if(this.direction=="left"){
this.img.rotation=[0,0,0,1];
this.img_act.rotation=[0,0,0,1];
this.img_prs.rotation=[0,0,0,1];
this.img_shdw.rotation=[0,0,0,1];}else if(this.direction=="right"){
this.img.rotation=[180,0,0,1];
this.img_act.rotation=[180,0,0,1];
this.img_prs.rotation=[180,0,0,1];
this.img_shdw.rotation=[180,0,0,1];}
this.btn.action=function(obj){
self.cobj.action_func(self);};
this.btn.mouseover=function(obj){
switch(self.direction){
case "up":
common_key.set_cursor(self.cobj,self.cobj.scroll_bar.bar_h.btn_t);
break;
case "down":
common_key.set_cursor(self.cobj,self.cobj.scroll_bar.bar_h.btn_b);
break;
default:
break;}
};
this.btn.mouseout=function(obj){
};};
scroll_btn.prototype=new container({});
scroll_btn.prototype.set_scroll_enable=function(mode){
console_log("[scroll_btn][set_scroll_enable][START]");
this.fg_scroll=true;
this.img_shdw.visible_p=false;
this.img.visible_p=true;};
scroll_btn.prototype.set_scroll_disable=function(mode){
this.fg_scroll=false;
this.img_shdw.visible_p=true;
this.img_prs.visible_p=false;
this.img_act.visible_p=false;
this.img.visible_p=false;};
scroll_btn.prototype.action_func=function(obj){
this.img_prs.visible_p=true;
this.img_act.visible_p=false;
this.img.visible_p=false;
var self=this;
append_timer(self,300,function(obj,count){
delete_timer(obj);
this.img_act.visible_p=true;
this.img_prs.visible_p=false;
this.img.visible_p=false;
force_redraw();});
force_redraw();
if(this.direction=="up"){
brw_obj.scroll_action_hook("up","anim",-80);}else if(this.direction=="down"){
brw_obj.scroll_action_hook("down","anim",80);}else if(this.direction=="left"){
brw_obj.scroll_action_hook("left","anim",-80);}else if(this.direction=="right"){
brw_obj.scroll_action_hook("right","anim",80);}
};
scroll_btn.prototype.enter_focus=function(){
if(this.fg_scroll){
this.enable=true;
this.img_act.visible_p=true;
this.img_prs.visible_p=false;
this.img.visible_p=false;
force_redraw();
Cursor.moveTo({
x:this.parent.translate[0]+this.parent.offset_x+this.translate[0],
y:this.parent.translate[1]+this.parent.offset_y+this.translate[1],
z:this.parent.translate[2]+this.translate[2]+0.1,
w:this.img_act.width-6,
h:this.img_act.height-6});}
};
scroll_btn.prototype.leave_focus=function(){
this.enable=false;
this.img.visible_p=true;
this.img_act.visible_p=false;
this.img_prs.visible_p=false;
force_redraw();};
scroll_btn.prototype.free=function(){
this.img.src="";
this.img_act.src="";
this.img_prs.src="";
this.img_shdw.src="";
this.components.splice(0,this.components.length);};
var scroll_bar=function(param){
this.translate=param.translate;
var height=param.height;
this.offset_x=param.offset_x;
this.offset_y=param.offset_y;
this.direction=param.direction;
this.enable=false;
if(this.direction=="VERTICAL"){
console_log("[scroll_bar]direction="+this.direction);
this.components=[
this.img_base=new gbox({width:30,height:height-72,color:system.fdp_color.WIDGET_SUB}),
this.img_bar_c=new gbox({width:30,height:0,color:system.fdp_color.ICON_ONBASE,
visible_p:false}),
this.btn_t=new scroll_btn({translate:[0,height/2-18,0],
direction:"up",action_cb:param.action_up,parent:this,cobj:param.cobj}),
this.btn_b=new scroll_btn({translate:[0,-height/2+18,0],
direction:"down",action_cb:param.action_down,parent:this,cobj:param.cobj})
];}else{
this.components=[
this.img_base=new gbox({width:DEF_BROWSER_WIDTH-40,height:30,color:system.fdp_color.BASE_SUB,
rotation:[90,0,0,1]}),
this.img_bar_c=new gbox({width:30,height:0,color:system.fdp_color.ICON_ONBASE,
rotation:[90,0,0,1],visible_p:false}),
this.btn_t=new scroll_btn({translate:[-DEF_BROWSER_WIDTH/2+20,0,0],
direction:"left",action_cb:param.action_left,parent:this,cobj:param.cobj}),
this.btn_b=new scroll_btn({translate:[DEF_BROWSER_WIDTH/2-20,0,0],
direction:"right",action_cb:param.action_right,parent:this,cobj:param.cobj})
];}
};
scroll_bar.prototype=new container({});
scroll_bar.prototype.set_enable=function(){
console_log("[scroll_bar][set_enable][START]");
this.enable=true;
this.img_bar_c.visible_p=true;
this.btn_t.set_scroll_enable();
this.btn_b.set_scroll_enable();};
scroll_bar.prototype.set_disable=function(){
this.enable=false;
this.img_bar_c.visible_p=false;
this.btn_t.set_scroll_disable();
this.btn_b.set_scroll_disable();};
scroll_bar.prototype.set_size=function(pos,length){
console_log("[scroll_bar][set_size][START]");
this.img_bar_c.height=length;
if(this.direction=="VERTICAL"){
console_log("[scroll_bar][set_size]vertical");
this.img_bar_c.translate[1]=pos;}else{
this.img_bar_c.translate[0]=pos;}
};
scroll_bar.prototype.free=function(){
this.img_bar_c.src="";
this.btn_t.free();
this.btn_b.free();
this.components.splice(0,this.components.length);};
var scroll_bar_obj=function(param){
this.height=param.height;
this.contents_h=param.contents_h;
var offset_x=param.offset_x?param.offset_x:0;
var offset_y=param.offset_y?param.offset_y:0;
this.components=[
this.bar_h=new scroll_bar({translate:param.translate,height:this.height,
offset_x:offset_x,offset_y:offset_y,
direction:"VERTICAL",parent:this,
action_up:param.action_up,
action_down:param.action_down,
cobj:param.cobj})
];};
scroll_bar_obj.prototype=new container({});
scroll_bar_obj.prototype.appear_bar_h=function(){
if(this.height<this.contents_h){
delete_timer(this.bar_h);
this.bar_h.visible_p=true;
this.bar_h.set_enable();}else{
this.bar_h.visible_p=true;
this.bar_h.set_disable();}
};
scroll_bar_obj.prototype.update=function(param){
var bar_h;
var bar_y;
bar_h=Math.floor((this.height-72)*(this.height/this.contents_h));
if(bar_h<41){
var tmp=41-bar_h;
bar_h=41;
bar_y=Math.floor(param.TotalScrlSize*((this.height-72-tmp)/this.contents_h));}else{
bar_y=Math.floor(param.TotalScrlSize*((this.height-72)/this.contents_h));
}
var bar_center_y=Math.floor(bar_y+bar_h/2);
this.bar_h.set_size(this.height/2-bar_center_y-36,bar_h);
force_redraw();};
scroll_bar_obj.prototype.free=function(){
this.bar_h.free();
this.components.splice(0,this.components.length);};
var big_gtextbox=function(param){
this.translate=param.translate;
this.height=param.height;
this.width=param.width;
var font_size=param.font_size;
var align=param.align;
var margin_leading=param.margin_leading;
this.visible_p=param.visible_p;
var text_color=param.color?param.color:[0,0,0,255];
this.frame=new container({});
this.frame.move_to=MoveTo;
this.components.push(this.frame);
this.size_ary_text=4;
this.ary_text=[];
for(var i=0;i<this.size_ary_text;i++){
this.ary_text[i]=new gtextbox({
translate:[0,this.height-i*this.height,0],
width:this.width,height:this.height,font_size:font_size,
align:align,color:text_color,margin_leading:margin_leading,
depth_test:true});
this.frame.components.push(this.ary_text[i]);}
};
big_gtextbox.prototype=new container({});
big_gtextbox.prototype.set_text=function (word){
this.line_index=0;
this.word=word;
this.data_index=0;
var word_one_line_size=get_text_font_height(this.ary_text[0],"A")-1;
var word_height=get_text_font_height(this.ary_text[0],this.word)-1;
this.line_num=Math.ceil(word_height/word_one_line_size);
this.disp_line_num=Math.ceil(this.height/word_one_line_size);
for(var i=0;i<this.size_ary_text-1;i++){
if(i==0){
this.ary_text[i+1].margin[0]=0;}else{
this.ary_text[i+1].margin[0]=-i*this.height;}
setf_text(this.ary_text[i+1],this.word);}
};
big_gtextbox.prototype.get_disp_line_num=function (){
return this.disp_line_num;};
big_gtextbox.prototype.get_line_num=function (){
return this.line_num;};
big_gtextbox.prototype.get_line_index=function (){
return this.line_index;};
big_gtextbox.prototype.up_move=function (move_line){
if(this.line_index>0){
this.line_index-=move_line;
this.frame.move_to({
x:this.frame.translate[0],
y:tou_panel.pos_tou_text_next_y,
z:this.frame.translate[2],
angle:0,
end_func:null,
rate:0.6});
if((Math.floor(this.line_index/this.disp_line_num)!=this.data_index)&&
(this.line_index!=0)){
this.data_index=Math.floor(this.line_index/this.disp_line_num);
this.data_pop_unsh();}
}
return true;};
big_gtextbox.prototype.down_move=function (move_line){
if(this.line_index<this.line_num-this.disp_line_num){
this.line_index+=move_line;
this.frame.move_to({
x:this.frame.translate[0],
y:tou_panel.pos_tou_text_next_y,
z:this.frame.translate[2],
angle:0,
end_func:null,
rate:0.6});
if(Math.floor(this.line_index/this.disp_line_num)!=this.data_index){
this.data_index=Math.floor(this.line_index/this.disp_line_num);
this.data_sh_pu();}
}
};
big_gtextbox.prototype.data_pop_unsh=function (){
var tmp=this.ary_text.pop();
tmp.margin[0]=-(this.data_index-1)*this.height;
if(tmp.margin[0]==0)tmp.margin[0]=1;
tmp.translate[1]=-(this.data_index-1)*this.height;
setf_text(tmp,this.word);
this.ary_text.unshift(tmp);
};
big_gtextbox.prototype.data_sh_pu=function (){
var tmp=this.ary_text.shift();
tmp.margin[0]=-(this.data_index+this.size_ary_text-2)*this.height;
tmp.translate[1]=-(this.data_index+this.size_ary_text-2)*this.height;
setf_text(tmp,this.word);
this.ary_text.push(tmp);
};
big_gtextbox.prototype.init=function (){
if(this.components.length==0)return;
this.frame.translate[1]=0;
for(var i=0;i<this.size_ary_text;i++){
setf_text(this.ary_text[i],"");
this.ary_text[i].translate[1]=this.height-i*this.height;}
};
big_gtextbox.prototype.free=function (){
if(this.components.length==0)return;
for(var i=0;i<this.size_ary_text;i++){
setf_text(this.ary_text[i],"");}
this.components.splice(0,this.components.length);
};
tou_panel=new container({translate:[0,-50,0],visible_p:false});
tou_panel.starting_disp=false;
tou_panel.state_disp=false;
tou_panel.version="0.0";
tou_panel.fg_disp_first=false;
tou_panel.display=false;
tou_panel.create=function(){
console_log("[START][tou_panel][create]");
if(this.components.length!=0){
this.display=true;
this.visible_p=true;
return;}
var self=this;
var width=1802;
var height=908;
this.pos_scroll=0;
var draw_count=0;
this.onload_func=function(){
draw_count++;
if(draw_count>=1){
if(tou_panel.display)
self.visible_p=true;
force_redraw();}
};
this.components=[
this.back=new gbox({translate:[0,10,0],
width:width,height:height,color:system.fdp_color.POP}),
new gbox({translate:[0,this.back.translate[1]+this.back.height/2,0],
width:this.back.width,height:2,color:system.fdp_color.POP_BORDER}),
new gbox({translate:[0,this.back.translate[1]-this.back.height/2,0],
width:this.back.width,height:2,color:system.fdp_color.POP_BORDER}),
new gbox({translate:[this.back.width/2,this.back.translate[1],0],
width:2,height:this.back.height,color:system.fdp_color.POP_BORDER}),
new gbox({translate:[-this.back.width/2,this.back.translate[1],0],
width:2,height:this.back.height,color:system.fdp_color.POP_BORDER}),
this.title=new gtext({translate:[0,height/2-45,0],align:CENTER,width:900,
font_size:45,text:W_TEXT.W_TOU_TITLE,color:system.fdp_color.TEXT_ONBASE}),
this.tou_text_box=new gbox({translate:[0,60,0],width:width-118,
height:height-310,color:system.fdp_color.BASE_SUB_A}),

this.scroll_bar=new scroll_bar_obj({
translate:[this.tou_text_box.width/2-22,this.tou_text_box.translate[1],0],
height:this.tou_text_box.height-4,
offset_x:this.translate[0],offset_y:this.translate[1],
action_up:this.scroll_up,action_down:this.scroll_down,cobj:this}),
this.checkbox=new container({translate:
[(-this.tou_text_box.width/2)+50,
(this.tou_text_box.translate[1]-this.tou_text_box.height/2)-40,0]}),
this.btn_ok=new container({translate:[0,-height/2+70,0]}),
this.btn_return =new container({translate:[-275,-height/2+70,0]}),
this.btn_accept=new container({translate:[275,-height/2+70,0]}),
this.cover_t=new gbox({translate:[0,0,0.1],
width:this.tou_text_box.width,height:0,color:[255,255,255,0],depth_test:true}),
this.cover_b=new gbox({translate:[0,0,0.1],
width:this.tou_text_box.width,height:0,color:[255,255,255,0],depth_test:true}),
this.list_tou_text=new big_gtextbox({translate:[0,60,0],
width:width-230,
height:height-310,
font_size:36,margin_leading:TOU_TXT_MARGIN,align:LEFT,
color:system.fdp_color.TEXT_ONBASE,
visible_p:true
}),
this.tou_text_1=new gtextbox({translate:[0,0,0],
width:width-230,height:height-310,font_size:36,margin_leading:TOU_TXT_MARGIN,
color:system.fdp_color.TEXT_ONBASE
})
];
this.cover_t.height=540
-(this.translate[1]+this.tou_text_box.translate[1]+this.tou_text_box.height/2)
+TOU_COVER_T_MARGIN;
this.cover_t.translate[1]=540-this.cover_t.height/2-this.translate[1];
this.cover_b.height=540
+(this.translate[1]+this.tou_text_box.translate[1]-this.tou_text_box.height/2)
+TOU_COVER_B_MARGIN;
this.cover_b.translate[1]=-540+this.cover_b.height/2-this.translate[1];
this.back.action=function(){};
this.checkbox.components=[
this.checkbox.btn_normal=new gbox({color:system.fdp_color.ICON_ONBASE,
width:51,height:50}),
this.checkbox.img_act=new gbox({color:system.fdp_color.ICON_ONPOINT,
width:51,height:50,visible_p:false}),
this.checkbox.check=new gimage({src:PALTINUM_PATH_IMG+"check.png",width:41,height:40,
onload:this.onload_func}),
this.checkbox.text=new gtext({translate:[540,0,0],width:1000,
text:W_TEXT.W_TOU_DISPLAY_CHECK,font_size:36,color:system.fdp_color.TEXT_ONBASE})
];
this.checkbox.enter_focus=function(){
tou_panel.enter_focus_btn(this);};
this.checkbox.leave_focus=function(){
this.btn_normal.visible_p=true;
this.img_act.visible_p=false;};
this.checkbox.action=function(obj){
self.checkbox.check.visible_p=!self.checkbox.check.visible_p;
force_redraw();};
this.checkbox.mouseover=function(obj){
common_key.set_cursor(self,self.checkbox);};
this.checkbox.mouseout=function(obj){
};
this.btn_ok.components=[
this.btn_ok.btn_shadow=new gbox({width:442,height:82,color:system.fdp_color.BTN_BORDER}),
this.btn_ok.btn_normal=new gbox({translate:[-0.5,0.5,0],color:system.fdp_color.BTN,
width:442-1,height:82-1}),
this.btn_ok.img_act=new gbox({color:system.fdp_color.BTN,
width:442,height:82,visible_p:false}),
this.btn_ok.text=new gtext({width:400,align:CENTER,font_size:40,
text:W_TEXT.W_OK,color:system.fdp_color.TEXT_ONBASE})
];
this.btn_ok.enter_focus=function(){
tou_panel.enter_focus_btn(this);};
this.btn_ok.leave_focus=function(){
this.btn_normal.visible_p=true;
this.img_act.visible_p=false;};
this.btn_ok.action=function(obj){
tou_panel.disappear();
if(tou_panel.state_disp!=tou_panel.checkbox.check.visible_p){
tou_panel.state_disp=tou_panel.checkbox.check.visible_p;
apps_nvram.write("TOU_DISP",tou_panel.checkbox.check.visible_p,"home");}
if(tou_panel.version!=TOU_VERSION){
tou_panel.version=TOU_VERSION;
apps_nvram.write("TOU_VER",TOU_VERSION,"home");}
};
this.btn_ok.mouseover=function(obj){
common_key.set_cursor(self,self.btn_ok);};
this.btn_ok.mouseout=function(obj){
};
this.btn_return.components=[
this.btn_return.btn_shadow=new gbox({width:442,height:82,color:system.fdp_color.BTN_BORDER}),
this.btn_return.btn_normal=new gbox({translate:[-0.5,0.5,0],color:system.fdp_color.BTN,
width:442-1,height:82-1}),
this.btn_return.img_act=new gbox({color:system.fdp_color.BTN,
width:442,height:82,visible_p:false}),
this.btn_return.text=new gtext({width:400,align:CENTER,font_size:40,
text:W_TEXT.W_TOU_RETURN,color:system.fdp_color.TEXT_ONBASE})
];
this.btn_return.enter_focus=function(){
tou_panel.enter_focus_btn(this);};
this.btn_return.leave_focus=function(){
this.btn_normal.visible_p=true;
this.img_act.visible_p=false;};
this.btn_return.action=function(obj){
tou_panel.disappear();
common_effect_out(TXK_RETURN);};
this.btn_return.mouseover=function(obj){
common_key.set_cursor(self,self.btn_return);};
this.btn_return.mouseout=function(obj){
};
this.btn_accept.components=[
this.btn_accept.btn_shadow=new gbox({width:442,height:82,color:system.fdp_color.BTN_BORDER}),
this.btn_accept.btn_normal=new gbox({translate:[-0.5,0.5,0],color:system.fdp_color.BTN,
width:442-1,height:82-1}),
this.btn_accept.img_act=new gbox({color:system.fdp_color.BTN,
width:442,height:82,visible_p:false}),
this.btn_accept.text=new gtext({width:400,align:CENTER,font_size:40,
text:W_TEXT.W_TOU_ACCEPT,color:system.fdp_color.TEXT_ONBASE})
];
this.btn_accept.enter_focus=function(){
tou_panel.enter_focus_btn(this);};
this.btn_accept.leave_focus=function(){
this.btn_normal.visible_p=true;
this.img_act.visible_p=false;};
this.btn_accept.action=function(obj){
tou_panel.fg_disp_first=false;
browser_disp_starting();
if(tou_panel.state_disp!=tou_panel.checkbox.check.visible_p){
tou_panel.state_disp=tou_panel.checkbox.check.visible_p;
apps_nvram.write("TOU_DISP",tou_panel.checkbox.check.visible_p,"home");}
if(tou_panel.version!=TOU_VERSION){
tou_panel.version=TOU_VERSION;
apps_nvram.write("TOU_VER",TOU_VERSION,"home");}
tou_panel.starting_disp=false;
tou_panel.disappear();};
this.btn_accept.mouseover=function(obj){
common_key.set_cursor(self,self.btn_accept);};
this.btn_accept.mouseout=function(obj){
};
var W_TOU_TEXT=tou_panel.server_text;
this.contents_h=get_text_font_height(this.tou_text_1,W_TOU_TEXT);
this.list_tou_text.init();
this.list_tou_text.visible_p=true;
this.list_tou_text.set_text(W_TOU_TEXT);
this.list_tou_text.translate[1]-=Math.floor((this.list_tou_text.height/2
-(SCREEN_HEIGHT-this.cover_t.height-this.cover_b.height)/2));
this.pos_text_y_t=0;
this.pos_text_y_b=this.pos_text_y_t+this.contents_h
-(this.tou_text_box.height
-(TOU_COVER_T_MARGIN+TOU_COVER_B_MARGIN+4));
this.pos_tou_text_next_y=this.list_tou_text.translate[1];
this.scroll_bar.contents_h=this.contents_h;
this.scroll_bar.appear_bar_h();
this.scroll_bar.bar_h.btn_t.action=function(obj){
tou_panel.action_func(obj);};
this.scroll_bar.bar_h.btn_t.mouseover=function(obj){
common_key.set_cursor(self,self.scroll_bar.bar_h.btn_t);};
this.scroll_bar.bar_h.btn_t.mouseout=function(obj){
};
this.scroll_bar.bar_h.btn_b.action=function(obj){
tou_panel.action_func(obj);};
this.scroll_bar.bar_h.btn_b.mouseover=function(obj){
common_key.set_cursor(self,self.scroll_bar.bar_h.btn_b);};
this.scroll_bar.bar_h.btn_b.mouseout=function(obj){
};
this.list_tou_text.moveto=MoveTo;
this.fg_done=false;
console_log("[END][tou_panel][create]");};
tou_panel.enter_focus_btn=function(obj){
obj.btn_normal.visible_p=false;
obj.img_act.visible_p=true;
console_log("[tou_panel.enter_focus_btn]w:"+obj.img_act.width+" h:"+obj.img_act.height);
Cursor.moveTo({
x:tou_panel.translate[0]+obj.translate[0],
y:tou_panel.translate[1]+obj.translate[1],
z:tou_panel.translate[2]+obj.translate[2]+0.1,
w:obj.img_act.width-18,
h:obj.img_act.height-18,
end_func:function(){Cursor.appear();}});};
tou_panel.appear=function(param){
console_log("[START][tou_panel][appear]");
this.mode_disp=param.mode;
if(this.mode_disp==TOU_PANEL_MODE_STARTING){
pointer_table=get_pointer_table("TOU_2");}else{
pointer_table=get_pointer_table("TOU_1");}
InputDevManager.set_move_mode("hybrid");
Cursor.set_mode(0);
this.display=true;
this.create();
this.ary_item=new Array();
if(this.mode_disp==TOU_PANEL_MODE_STARTING){
this.ary_item.push(this.scroll_bar.bar_h.btn_t,this.scroll_bar.bar_h.btn_b,
this.checkbox,this.btn_return,this.btn_accept);
this.btn_ok.visible_p=false;
this.btn_return.visible_p=true;
this.btn_accept.visible_p=true;}
else{
this.ary_item.push(this.scroll_bar.bar_h.btn_t,this.scroll_bar.bar_h.btn_b,
this.checkbox,this.btn_ok);
this.btn_ok.visible_p=true;
this.btn_return.visible_p=false;
this.btn_accept.visible_p=false;}
set_pointer_obj(this.ary_item,0);
this.InitializeDrawing();
common_key.set_cursor(platinum_main,tou_panel);
console_log("[END][tou_panel][appear]");};
tou_panel.is_disp=function(){
return this.display;};
tou_panel.disappear=function(){
this.visible_p=false;
this.display=false;
if(tou_panel.mode_disp==TOU_PANEL_MODE_STARTING){
Cursor.disappear();
set_base_pointer_obj();}else{
Cursor.disappear();
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(this,null);
common_key.set_cursor(platinum_main,brw_disp);}
set_base_pointer_obj();}
tou_panel.free();
};
tou_panel.InitializeDrawing=function(){
this.pos_tou_text_next_y=this.pos_text_y_t;
this.scroll_bar.update({TotalScrlSize:0});
this.pos_scroll=0;
this.back.color=(this.mode_disp==TOU_PANEL_MODE_STARTING)?
system.fdp_color.POP_A:system.fdp_color.POP;
this.checkbox.check.visible_p=
(this.state_disp||this.fg_disp_first)?true:false;};
tou_panel.action_func=function(obj){
switch(obj.direction){
case "up":
tou_panel.scroll_up();
break;
case "down":
tou_panel.scroll_down();
break;
default:
break;}
};
tou_panel.enter_focus=function(){
console_log("[START][tou_panel][enter_focus]");
if(this.mode_disp==TOU_PANEL_MODE_STARTING){
common_key.set_cursor(this,this.btn_accept);}else{
common_key.set_cursor(this,this.btn_ok);}
};
tou_panel.leave_focus=function(){
console_log("[START][tou_panel][leave_focus]");
common_key.set_cursor(this,null);};
tou_panel.free=function(){
if(this.components.length==0)return;
setf_text(this.title,"");
setf_text(this.tou_text_1,"");
this.checkbox.check.src="";
setf_text(this.checkbox.text,"");
setf_text(this.btn_ok.text,"");
this.btn_return.btn_normal.src="";
this.btn_return.img_act.src="";
setf_text(this.btn_return.text,"");
this.btn_accept.btn_normal.src="";
this.btn_accept.img_act.src="";
setf_text(this.btn_accept.text,"");
this.scroll_bar.free();
if(this.list_tou_text){
this.list_tou_text.free();}
this.components.splice(0,this.components.length);};
tou_panel.scroll_up=function(){
if(tou_panel.list_tou_text){
tou_panel.pos_tou_text_next_y=(tou_panel.pos_tou_text_next_y-TOU_TXT_SCRLSIZE
<tou_panel.pos_text_y_t)?
tou_panel.pos_text_y_t:
tou_panel.pos_tou_text_next_y-TOU_TXT_SCRLSIZE;
tou_panel.list_tou_text.up_move(1);
force_redraw();}
if(tou_panel.pos_scroll-1>=0){
tou_panel.pos_scroll--;
tou_panel.scroll_bar.update({
TotalScrlSize:tou_panel.pos_scroll*TOU_TXT_SCRLSIZE});}
};
tou_panel.scroll_down=function(){
if(tou_panel.list_tou_text){
var line_index=tou_panel.list_tou_text.get_line_index();
var line_num=tou_panel.list_tou_text.get_line_num();
var disp_line_num=tou_panel.list_tou_text.get_disp_line_num();
if(line_index<line_num-disp_line_num){
tou_panel.pos_tou_text_next_y=(tou_panel.pos_tou_text_next_y+TOU_TXT_SCRLSIZE
>tou_panel.pos_text_y_b)?
tou_panel.pos_tou_text_next_y:
tou_panel.pos_tou_text_next_y+TOU_TXT_SCRLSIZE;
tou_panel.list_tou_text.down_move(1);}
force_redraw();}
if(tou_panel.pos_scroll*TOU_TXT_SCRLSIZE
<tou_panel.contents_h-tou_panel.tou_text_box.height){
tou_panel.pos_scroll++;
tou_panel.scroll_bar.update({
TotalScrlSize:tou_panel.pos_scroll*TOU_TXT_SCRLSIZE});}
};
tou_panel.key_hook=function(up_down,key){
console_log("[START][tou_panel.key_hook]"+up_down);
if((this.cursor==this.accept)||(this.cursor==this.btn_ok)){
if(up_down==KEY_DOWN)this.fg_done=true;
if((up_down!=KEY_UP)||(!this.fg_done))return true;
this.fg_done=false;}else{
if(up_down!=KEY_PRESS)return true;}
switch(key){
case TXK_RETURN:
tou_panel.disappear();
if(tou_panel.mode_disp==TOU_PANEL_MODE_STARTING){
common_effect_out(TXK_RETURN);}else{
if(tou_panel.state_disp!=tou_panel.checkbox.check.visible_p){
tou_panel.state_disp=tou_panel.checkbox.check.visible_p;
apps_nvram.write("TOU_DISP",tou_panel.checkbox.check.visible_p,"home");}
}
break;
case TXK_ENTER:
switch(this.cursor){
case this.btn_accept:
this.fg_disp_first=false;
browser_disp_starting();
case this.btn_ok:
if(tou_panel.state_disp!=tou_panel.checkbox.check.visible_p){
tou_panel.state_disp=tou_panel.checkbox.check.visible_p;
apps_nvram.write("TOU_DISP",tou_panel.checkbox.check.visible_p,"home");}
if(tou_panel.version!=TOU_VERSION){
tou_panel.version=TOU_VERSION;
apps_nvram.write("TOU_VER",TOU_VERSION,"home");}
tou_panel.starting_disp=false;
tou_panel.disappear();
break;
case this.btn_return:
tou_panel.disappear();
common_effect_out(TXK_RETURN);
break;
case this.checkbox:
this.checkbox.check.visible_p=!this.checkbox.check.visible_p;
force_redraw();
break;
case this.scroll_bar.bar_h.btn_b:
tou_panel.scroll_down();
break;
case this.scroll_bar.bar_h.btn_t:
tou_panel.scroll_up();
break;
default:
break;}
break;
case TXK_UP:
switch(this.cursor){
case this.btn_ok:
case this.btn_return:
case this.btn_accept:
common_key.set_cursor(this,this.checkbox);
break;
case this.checkbox:
common_key.set_cursor(this,this.scroll_bar.bar_h.btn_b);
break;
case this.scroll_bar.bar_h.btn_b:
common_key.set_cursor(this,this.scroll_bar.bar_h.btn_t);
break;
default:
break;}
break;
case TXK_DOWN:
switch(this.cursor){
case this.scroll_bar.bar_h.btn_t:
common_key.set_cursor(this,this.scroll_bar.bar_h.btn_b);
break;
case this.scroll_bar.bar_h.btn_b:
common_key.set_cursor(this,this.checkbox);
break;
case this.checkbox:
if(this.mode_disp==TOU_PANEL_MODE_STARTING){
common_key.set_cursor(this,this.btn_accept);}
else{
common_key.set_cursor(this,this.btn_ok);}
break;
default:
break;}
break;
case TXK_LEFT:
if(this.cursor==this.btn_accept){
common_key.set_cursor(this,this.btn_return);}
break;
case TXK_RIGHT:
if(this.cursor==this.btn_return){
common_key.set_cursor(this,this.btn_accept);}
break;}
return true;
console_log("[END][tou_panel.key_hook]");};
tou_panel.mouse_hook=function(arguments){
var button=arguments[3];
var diff_z=arguments[6];
var diff_y=arguments[8];
var modifier1=(button&ebus.mouse.DOWN_MODIFIER1_BUTTON);
if(diff_z){
if(modifier1){
console_log("[tou_panel.mouse_hook]PINCH");}else{
console_log("[tou_panel.mouse_hook]WHEEL");
if(tou_panel.is_panel_area()){
if(diff_z!=0){
if(diff_z>0){
tou_panel.scroll_down();}else{
tou_panel.scroll_up();}
}
}
}
}else{
if(modifier1){
console_log("[tou_panel.mouse_hook]SCROLL");
if(tou_panel.is_panel_area()){
if(diff_y!=0){
if(diff_y>0){
tou_panel.scroll_down();}else{
tou_panel.scroll_up();}
}
}
}
}
return false;};
tou_panel.is_panel_area=function(arguments){
var x=system.cursor_pointer.get_pos_x();
var y=system.cursor_pointer.get_pos_y();
if((x>=(this.tou_text_box.translate[0]-this.tou_text_box.width/2))
&&(x<=(this.tou_text_box.translate[0]+this.tou_text_box.width/2))
&&(y<=(this.tou_text_box.translate[1]+this.tou_text_box.height/2))
&&(y>=(this.tou_text_box.translate[1]-this.tou_text_box.height/2))){
return true;}
return false;};
var submenu_btn_item=function(param){
this.translate=param.translate;
this.index=param.index;
this.enable=true;
this.components=[
this.img=new container({
components:[
this.img_shdw=new gbox({width:param.width,height:param.height,
color:system.fdp_color.POP}),
],
}),
this.img_act=new item_focus(),
this.text=new gtext({width:param.width-25,text:param.text,
font_size:25,color:system.fdp_color.TEXT_ONBASE,margin:[-1,0,0,0]})
];
this.img_act.setSize(param.width-12,param.height-12);
this.img_act.setTranslate(0,0,0);
CHANGE_FONT_SIZE(this.text);
};
submenu_btn_item.prototype=new container({});
submenu_btn_item.prototype.mouseover=function(obj){
if(this.index!=0){
pop_show_url.disappear();}
common_key.set_cursor(submenu,obj);
force_redraw();};
submenu_btn_item.prototype.mouseout=function(obj){
};
submenu_btn_item.prototype.enter_focus=function(){
this.img_act.visible_p=true;
};
submenu_btn_item.prototype.leave_focus=function(){
this.img_act.visible_p=false;};
submenu_btn_item.prototype.free=function(){
this.img.src="";
this.img_act.src="";
setf_text(this.text,"");
this.components.splice(0,this.components.length);
};
submenu_btn_item.prototype.action=function(obj){
common_key.set_cursor(submenu,obj);
submenu.enter(obj.index);};
submenu_btn_item.prototype.set_enable=function(b){
if(this.enable!=b){
if(b){
this.text.color=[0,0,0,255];}else{
this.text.color=[100,100,100,150];}
this.enable=b;}
};
if(DEF_MULTI_USER){
BOOKMARK_SBM_LIST=[
W_TEXT.W_DISPLAY_URL,
W_TEXT.W_MOVE_BOOKMARK,
W_TEXT.W_BOOKMARK_DELETE,
W_TEXT.WB_LT_BOOKMARK_USERS
];}else{
BOOKMARK_SBM_LIST=[
W_TEXT.W_DISPLAY_URL,
W_TEXT.W_MOVE_BOOKMARK,
W_TEXT.W_BOOKMARK_DELETE
];}
var X_1=-295;
var X_2=160;
var X_3=655;
var Y_1=155;
var Y_2=-100;
var Y_3=-360;
var Z_1=0;
var DEF_SUBM_W=278;
var DEF_SUBM_H=56;
var DEF_SUBM_M=0;var DEF_SUBM_S=0;
submenu=new container({translate:[0,0,0],visible_p:false});
submenu.create=function(){
if(this.components.length!=0)return;
this.ary_submenu_btn=new Array();
this.num_submenu_item=BOOKMARK_SBM_LIST.length;
this.box_w=DEF_SUBM_W+DEF_SUBM_M*2;
this.box_h=DEF_SUBM_H*this.num_submenu_item+DEF_SUBM_M*2+DEF_SUBM_S*(this.num_submenu_item-1);
for(var i=0;i<this.num_submenu_item;i++){
var t_y=(DEF_SUBM_H*this.num_submenu_item+DEF_SUBM_S*(this.num_submenu_item-1))/2
-DEF_SUBM_H/2-i*(DEF_SUBM_H+DEF_SUBM_S);
this.ary_submenu_btn.push(
new submenu_btn_item({translate:[0,t_y,0],width:DEF_SUBM_W,height:DEF_SUBM_H,
text:BOOKMARK_SBM_LIST[i],index:i})
);
this.components.push(this.ary_submenu_btn[i]);}
for(var i=0;i<this.num_submenu_item-1;i++){
var l_y=(DEF_SUBM_H*this.num_submenu_item+DEF_SUBM_S*(this.num_submenu_item-1))/2
-DEF_SUBM_H-i*(DEF_SUBM_H+DEF_SUBM_S);
this.img_line=new gbox({translate:[0,l_y,0],
width:DEF_SUBM_W-15,height:1,color:system.fdp_color.POP_BORDER});
this.components.push(this.img_line);}
this.pos_current=0;
common_key.set_cursor(this,this.ary_submenu_btn[this.pos_current]);
};
submenu.disappear=function(){
this.visible_p=false;
set_base_pointer_obj();
submenu.free();
if(!function_bar.set_free_focus()){
common_key.set_cursor(this,null);
common_key.set_cursor(platinum_main,brw_disp);}
pop_show_url.disappear();
if(DEF_MULTI_USER){
if(MultiUserFavorite.is_visible)
MultiUserFavorite.destroy();}
force_redraw();
};
if(DEF_SIDE_TV){
var SX_1=-SCREEN_WIDTH/2+SIDE_WINDOW_WIDTH+(DEF_SUBM_W+DEF_SUBM_M*2)/2+1;
if(DEF_MULTI_USER){
var SY_1=-3;
var SY_2=-141;
var SY_3=-279;
var SY_4=-417;}else{
var SY_1=46;
var SY_2=-98;
var SY_3=-242;
var SY_4=-386;}
var SY_5=0;var SY_6=0;var SZ_1=0.1;}else if(!DEF_SIDE_TV){
var SX_1=-SCREEN_WIDTH/2+SIDE_WINDOW_WIDTH+(DEF_SUBM_W+DEF_SUBM_M*2)/2+1;
var SY_1=360;
var SY_2=216;
var SY_3=72;
var SY_4=-72;
var SY_5=-216;
var SY_6=-360;
var SZ_1=0.1;}
submenu.appear_from_side=function(index){
this.pos_current=0;
this.index=index;
pointer_table=get_pointer_table("submenu_side"+index);
this.create();
set_pointer_obj(this.ary_submenu_btn,0);
this.move_tr_arr=[[SX_1,SY_1,SZ_1],
[SX_1,SY_2,SZ_1],
[SX_1,SY_3,SZ_1],
[SX_1,SY_4,SZ_1],
[SX_1,SY_5,SZ_1],
[SX_1,SY_6,SZ_1]
];
this.translate=this.move_tr_arr[index-1];
if(bookmark.data.bookmarkpanel.length==1)
this.ary_submenu_btn[1].set_enable(false);
if(DEF_MULTI_USER){
if(MultiUserSelection.get_length()<1)
this.ary_submenu_btn[3].set_enable(false);}
this.visible_p=true;
this.fg_key=false;
common_key.set_cursor(platinum_main,submenu);
common_key.set_cursor(this,this.ary_submenu_btn[this.pos_current]);
};
submenu.move_up=function(){
if(this.pos_current>0){
this.pos_current--;
common_key.set_cursor(this,this.ary_submenu_btn[this.pos_current]);}
};
submenu.move_down=function(){
if(this.pos_current<this.num_submenu_item-1){
this.pos_current++;
common_key.set_cursor(this,this.ary_submenu_btn[this.pos_current]);}
};
submenu.enter=function(pos){
this.pos_current=pos;
switch(this.pos_current){
case 0:
pop_show_url.appear();
break;
case 1:
if(this.ary_submenu_btn[this.pos_current].enable){
this.disappear();
if(side_window.is_disp()){
side_window.start_move_bookmark_mode();}
}
break;
case 2:
this.visible_p=false;
submenu.free();
submenu.show_del_bm_popup();
break;
case 3:
if(this.ary_submenu_btn[this.pos_current].enable){
this.ary_submenu_btn[this.pos_current].text.color=system.fdp_color.POINT_ONBASE;
var bookmark_index=bookmark.get_index();
var translate=[];
translate[0]=this.translate[0]+DEF_SUBM_W/2+1;
translate[1]=this.translate[1]-DEF_SUBM_H*2;
translate[2]=this.translate[2];
MultiUserFavorite.create();
var current_user={};
current_user.id=USER_PROFILE_ID;
MultiUserFavorite.setShow({
view:true,
translate:translate,
current_user:current_user,
submenu_index:this.index,
bookmark_index:bookmark_index,
return_action:function(info){
bookmark.update_profile_id(bookmark_index,info);
bookmark.get_bookmark_req();
side_window.update_data();
side_window.reset_data();},
});}
break;
default:
break;}
};
submenu.key_hook=function(up_down,key){
var ret=false;
if(up_down==KEY_DOWN){
this.fg_key=true;
return true;}
if(up_down==KEY_UP){
this.fg_key=false;}
if(this.fg_key==true){
switch(key){
case TXK_ENTER:
submenu.enter(this.pos_current);
ret=true;
break;
case TXK_UP:
submenu.move_up();
ret=true;
break;
case TXK_DOWN:
submenu.move_down();
ret=true;
break;
case TXK_RETURN:
submenu.disappear();
ret=true;
break;
case get_COLOR_KEY(0).symbol:
case get_COLOR_KEY(1).symbol:
case get_COLOR_KEY(2).symbol:
case get_COLOR_KEY(3).symbol:
ret=true;
break;
default:
ret=false;
break;}
if(ebus.asr&&ebus.asr.supported){
if((key==TXK_MIC_TP)||(key==TXK_MIC_NRC)||(key==TXK_MIC_EMB)){
submenu.disappear();}
}
if(ret==true){
}
return ret;}
return false;};
submenu.free=function(){
if(this.components.length==0)return;
for(var i=0;i<this.num_submenu_item;i++){
this.ary_submenu_btn[i].free();}
this.ary_submenu_btn.splice(0,this.ary_submenu_btn.length);
this.move_tr_arr.splice(0,this.move_tr_arr.length);
this.components.splice(0,this.components.length);
};
submenu.show_del_cookie_popup=function(){
console_log("[submenu.show_del_cookie_popup]");
if(common_popup.visible_p)return;
var wording=W_TEXT.WB_LT_CONFIRM_DELETE_COOKIES;
var text_yes=W_TEXT.W_YES;
var text_no=W_TEXT.W_NO;
var param={
text:wording,
translate:[0,0,1],
width:740,
height:380,
appear_cb:function(){
common_key.set_cursor(platinum_main,common_popup);
Cursor.appear();
enable_keyhook=true;},
focus_obj:Cursor,
focus_offset:[0.0,0,1],
offset_text_w:-80,
offset_btn_x:0,
offset_btn_y:-20
};
param.return_cb=submenu.del_cookie_popup_cancel;
param.btn_cb=[submenu.del_cookie_popup_ok,submenu.del_cookie_popup_cancel];
param.btn_text=[text_yes,text_no];
param.text_font_size=26;
param.title="";
param.cur_pos=1;
Cursor.set_mode(2);
InputDevManager.set_move_mode("hybrid");
function_bar.clear_drag_mode();
common_popup.appear(param);
var list=common_popup.get_btn_obj();
pointer_table=get_pointer_table("del_cookie_popup");
set_pointer_obj(list,0);};
submenu.del_cookie_popup_ok=function(){
console_log("[submenu.del_cookie_popup_ok]");
brw_disp.brw.all_clear_cookie();
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
set_base_pointer_obj();};
submenu.del_cookie_popup_cancel=function(){
console_log("[submenu.del_cookie_popup_cancel]");
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
set_base_pointer_obj();};
submenu.show_del_bm_popup=function(){
console_log("[submenu.show_del_bm_popup]");
if(common_popup.visible_p)return;
var wording=W_TEXT.W_CONFIRM_DELETE_BOOKMARK;
if(DEF_MULTI_USER){
var profile_id=bookmark.data.bookmarkpanel[bookmark.get_index()].profile_id;
for(var i in profile_id){
if(profile_id[i]!=USER_PROFILE_ID){
var user_list=MultiUserFavorite.get_all_user_info();
for(var j in user_list){
if(user_list[j].id==profile_id[i]){
wording=(W_TEXT.WB_LT_CONFIRM_DELETE_USERS_BOOKMARK.indexOf("%s")==-1)?
user_list[j].name.concat(" "+W_TEXT.WB_LT_CONFIRM_DELETE_USERS_BOOKMARK):
W_TEXT.WB_LT_CONFIRM_DELETE_USERS_BOOKMARK.replace("%s",user_list[j].name);
break;}
}
break;}
}
}
var text_yes=W_TEXT.W_YES;
var text_no=W_TEXT.W_NO;
var param={
text:wording,
translate:[0,0,1],
width:740,
height:380,
appear_cb:function(){
common_key.set_cursor(platinum_main,common_popup);
Cursor.appear();
enable_keyhook=true;},
focus_obj:Cursor,
focus_offset:[0.0,0,1],
offset_text_w:-80,
offset_btn_x:0,
offset_btn_y:-20
};
param.return_cb=submenu.del_bm_popup_cancel;
param.btn_cb=[submenu.del_bm_popup_ok,submenu.del_bm_popup_cancel];
param.btn_text=[text_yes,text_no];
param.text_font_size=26;
param.title="";
param.cur_pos=1;
Cursor.set_mode(2);
InputDevManager.set_move_mode("hybrid");
function_bar.clear_drag_mode();
common_popup.appear(param);
var list=common_popup.get_btn_obj();
pointer_table=get_pointer_table("del_bm_popup");
set_pointer_obj(list,0);};
submenu.del_bm_popup_ok=function(){
console_log("[submenu.del_bm_popup_ok]");
bookmark.delete_bookmark(bookmark.get_index());
if(side_window.is_disp()){
side_window.update_data();}
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
set_base_pointer_obj();};
submenu.del_bm_popup_cancel=function(){
console_log("[submenu.del_bm_popup_cancel]");
InputDevManager.set_move_mode("free");
if(!function_bar.set_free_focus()){
common_key.set_cursor(platinum_main,brw_disp);}
set_base_pointer_obj();};
var engine_item=function(param){
this.translate=param.translate;
this.index=param.index;
this.components=[
this.img=new gimage({width:param.width,height:param.height,
src:param.src,draw_type:DIRECT}),
this.img_act=new gimage({width:param.width,height:param.height+24,
src:param.src_act,draw_type:DIRECT,visible_p:false}),
this.text=new gtext({width:param.width-40,color:[100,100,100,150],
text:param.text,margin:[0,0,10,10]})
];
CHANGE_FONT_SIZE(this.text);
};
engine_item.prototype=new container({});
engine_item.prototype.mouseover=function(obj){
common_key.set_cursor(search_engine,obj);
force_redraw();};
engine_item.prototype.mouseout=function(obj){
};
engine_item.prototype.enter_focus=function(){
this.img.visible_p=false;
this.img_act.visible_p=true;
this.text.color=[0,0,0,255];};
engine_item.prototype.leave_focus=function(){
this.img.visible_p=true;
this.img_act.visible_p=false;
this.text.color=[100,100,100,150];};
engine_item.prototype.free=function(){
if(this.components.length==0)return;
this.img.src="";
this.img.src_act="";
setf_text(this.text,"");
this.components.splice(0,this.components.length);};
engine_item.prototype.action=function(obj){
console_log("[engine_item.action]");
common_key.set_cursor(search_engine,obj);
search_engine.done_action(obj.index);};
search_engine=new container({translate:[COLOR_POS_LIST[FUNC_SEARCH],SCREEN_HEIGHT/2-FUNC_BAR_HEIGHT-25,0.3],visible_p:false});
search_engine.create=function(){
if(this.components.length!=0)return;
search_engine.translate[0]=COLOR_POS_LIST[FUNC_SEARCH];
this.total=ENGINE_LIST.length;
var pos_y=20-54*(this.total+1);
this.img_notify_1=new gbox({translate:[0,pos_y,0],width:100,height:160,
color:[200,200,200,120],visible_p:false});
this.img_notify_2=new gbox({translate:[0,pos_y,0],width:100,height:150,
color:[255,255,255,120],visible_p:false});
this.text_notify=new gtextbox({translate:[0,pos_y,0],width:1,height:1,
margin:[0,0,10,10],font_size:26,color:[0,0,0,255],align:LEFT,valign:MIDDLE,
text:W_TEXT.W_SEARCH_ENGINE_UPDATE_NOTIFY,visible_p:false});
var text_w=get_text_width(this.text_notify,W_TEXT.W_SEARCH_ENGINE_UPDATE_NOTIFY);
this.img_notify_1.width=text_w+40;
this.img_notify_2.width=text_w+30;
this.text_notify.width=text_w+30;
setf_text(this.text_notify,W_TEXT.W_SEARCH_ENGINE_UPDATE_NOTIFY);
var text_wh=get_dimension_textbox(this.text_notify);
var text_h=text_wh[1];
this.img_notify_1.height=text_h+20;
this.img_notify_2.height=text_h+10;
this.text_notify.height=text_h+10;
setf_text(this.text_notify,W_TEXT.W_SEARCH_ENGINE_UPDATE_NOTIFY);
var pos_x=this.img_notify_1.width/2-(SCREEN_WIDTH/2-this.translate[0]);
this.img_notify_1.translate[0]-=(pos_x+70);
this.img_notify_2.translate[0]-=(pos_x+70);
this.text_notify.translate[0]-=(pos_x+70);
this.components.push(this.img_notify_1,this.img_notify_2,this.text_notify);
this.pos_current;};
search_engine.selected_popup_done_action=function(){
InputDevManager.set_move_mode("free");
search_engine.done_action(common_popup.pos_current);};
search_engine.selected_popup_cancel=function(){
InputDevManager.set_move_mode("free");
if(apps_nvram.read("SEARCH_ENGINE","home")!=null){
conv_search_id_to_idx(apps_nvram.read("SEARCH_ENGINE","home"));}
search_engine.disappear();};
search_engine.show_select_popup=function(){
this.btn_text=new Array();
this.btn_cb=new Array();
for(var i=0;i<ENGINE_LIST.length;i++){
this.btn_text.push(ENGINE_LIST[i].name);
this.btn_cb.push(search_engine.selected_popup_done_action);}
Cursor.set_mode(2);
InputDevManager.set_move_mode("hybrid");
function_bar.clear_drag_mode();
common_popup.appear({
text:"",
translate:[COLOR_POS_LIST[FUNC_SEARCH],SCREEN_HEIGHT/2-FUNC_BAR_HEIGHT-75,0.2],
width:1,
height:1,
appear_cb:function(){
common_key.set_cursor(platinum_main,common_popup);
Cursor.appear();
enable_keyhook=true;},
focus_obj:Cursor,
focus_offset:[0.0,0,1],
offset_text_w:-80,
offset_btn_x:0,
offset_btn_y:60,
btn_place:"vertical",
return_cb:search_engine.selected_popup_cancel,
btn_cb:this.btn_cb,
btn_text:this.btn_text,
text_font_size:26,
title:"",
cur_pos:SEARCH_ENGINE,
});
var list=common_popup.get_btn_obj();
pointer_table=get_pointer_table("engine");
set_pointer_obj(list,0);};
search_engine.appear=function(){
this.pos_current=SEARCH_ENGINE;
this.create();
this.show_select_popup();
if(apps_nvram.read("SEARCH_UPDATE","home")==1){
this.img_notify_1.visible_p=true;
this.img_notify_2.visible_p=true;
this.text_notify.visible_p=true;}
this.visible_p=true;};
search_engine.disappear=function(){
InputDevManager.set_move_mode("free");
this.visible_p=false;
set_base_pointer_obj();
search_engine.free();
if(!function_bar.set_free_focus()){
common_key.set_cursor(this,null);
common_key.set_cursor(platinum_main,brw_disp);}
};
search_engine.free=function(){
if(this.components.length==0)return;
for(var i=0,max=this.components.length;i<max;i++){
if(this.components[i].free)this.components[i].free();}
this.components.splice(0,this.components.length);};
search_engine.enter_focus=function(){
};
search_engine.leave_focus=function(){
common_key.set_cursor(this,null);
key_flag=false;};
search_engine.done_action=function(pos){
this.pos_current=pos;
SEARCH_ENGINE=this.pos_current;
apps_nvram.write("SEARCH_ENGINE",ENGINE_LIST[this.pos_current].id,"home");
display_search_engine_name=true;
function_bar.search_engine_logo_set();
this.disappear();};
var menu_item=function(param){
this.translate=param.translate;
this.index=param.index;
this.tips_w=500;
this.tips_h=200;
this.components=[
this.img_act=new container({components:[
this.img_line_1=
new gimage({width:param.width,height:16,src:PALTINUM_PATH_IMG+"focus_line.png",
draw_type:DIRECT,rotation:[0,0,0,1],color:COL_FCS}),
this.img_line_2=
new gimage({width:param.width,height:16,src:PALTINUM_PATH_IMG+"focus_line.png",
draw_type:DIRECT,rotation:[90,0,0,1],color:COL_FCS}),
this.img_line_3=
new gimage({width:param.width,height:16,src:PALTINUM_PATH_IMG+"focus_line.png",
draw_type:DIRECT,rotation:[-180,0,0,1],color:COL_FCS}),
this.img_line_4=
new gimage({width:param.width,height:16,src:PALTINUM_PATH_IMG+"focus_line.png",
draw_type:DIRECT,rotation:[-90,0,0,1],color:COL_FCS}),
this.img_angle_1=
new gimage({width:16,height:16,src:PALTINUM_PATH_IMG+"focus_angle.png",
draw_type:DIRECT,rotation:[-90,0,0,1],color:COL_FCS}),
this.img_angle_2=
new gimage({width:16,height:16,src:PALTINUM_PATH_IMG+"focus_angle.png",
draw_type:DIRECT,rotation:[0,0,0,1],color:COL_FCS}),
this.img_angle_3=
new gimage({width:16,height:16,src:PALTINUM_PATH_IMG+"focus_angle.png",
draw_type:DIRECT,rotation:[90,0,0,1],color:COL_FCS}),
this.img_angle_4=
new gimage({width:16,height:16,src:PALTINUM_PATH_IMG+"focus_angle.png",
draw_type:DIRECT,rotation:[180,0,0,1],color:COL_FCS}),
]}),
this.img_prs=new gbox({width:param.width,height:param.height,color:system.fdp_color.POINT,visible_p:false}),
this.text=new gtext({width:param.width-50,color:system.fdp_color.TEXT_ONBASE,
text:param.text,margin:[0,0,5,10],font_size:26}),
this.text2=new gtext({width:param.width-100,color:system.fdp_color.TEXT_ONBASE,
translate:[param.width/2+100,0,0],
text:param.text2,margin:[0,0,5,10],font_size:26}),
this.tips_img=new gbox({translate:[-param.width/2-this.tips_w/2-20,param.height/2-this.tips_h/2,0],
width:this.tips_w,height:this.tips_h,color:system.fdp_color.POP,
visible_p:false}),
this.tips_text=new gtextbox({translate:[-param.width/2-this.tips_w/2-5-20,param.height/2-this.tips_h/2-5,0],
width:this.tips_w-10,height:this.tips_h-10,margin:[10,10,15,10],
text:param.tips_text,color:system.fdp_color.TEXT_ONBASE,align:LEFT,
font_size:26,visible_p:false}),
];
this.img_line_1.width=param.width-8;
this.img_line_2.width=param.height-8;
this.img_line_3.width=param.width-8;
this.img_line_4.width=param.height-8;
this.img_line_1.translate[1]=param.height/2+4;
this.img_line_2.translate[0]=-param.width/2-4;
this.img_line_3.translate[1]=-param.height/2-4;
this.img_line_4.translate[0]=param.width/2+4;
this.img_angle_1.translate[1]=param.height/2+4;
this.img_angle_2.translate[0]=-param.width/2-4;
this.img_angle_3.translate[1]=-param.height/2-4;
this.img_angle_4.translate[0]=param.width/2+4;
this.img_angle_1.translate[0]=param.width/2+4;
this.img_angle_2.translate[1]=param.height/2+4;
this.img_angle_3.translate[0]=-param.width/2-4;
this.img_angle_4.translate[1]=-param.height/2-4;
this.img_act.visible_p=false;
CHANGE_FONT_SIZE(this.text);
CHANGE_FONT_SIZE(this.text2);
};
menu_item.prototype=new container({});
menu_item.prototype.mouseover=function(obj){
common_key.set_cursor(guide_menu,obj);
this.enter_focus();};
menu_item.prototype.mouseout=function(obj){
delete_timer(this);};
menu_item.prototype.enter_focus=function(){
this.img_act.visible_p=true;
var self=this;
delete_timer(self);
append_timer(self,300,function (obj,count){
delete_timer(obj);
obj.tips_img.visible_p=true;
obj.tips_text.visible_p=true;
force_redraw();});
force_redraw();};
menu_item.prototype.leave_focus=function(){
this.img_act.visible_p=false;
this.tips_img.visible_p=false;
this.tips_text.visible_p=false;};
menu_item.prototype.free=function(){
if(this.components.length==0)return;
setf_text(this.text,"");
setf_text(this.text2,"");
setf_text(this.tips_text,"");
this.img_line_1.src="";
this.img_line_2.src="";
this.img_line_3.src="";
this.img_line_4.src="";
this.img_angle_1.src="";
this.img_angle_2.src="";
this.img_angle_3.src="";
this.img_angle_4.src="";
this.components.splice(0,this.components.length);};
menu_item.prototype.action=function(obj){
common_key.set_cursor(guide_menu,obj);
guide_menu.done_action(obj.index);};
GUIDE_MENU_LIST=[
W_TEXT.WB_LT_SETTINGS_SEARCH_ENGINE,
W_TEXT.WB_LT_SETTINGS_PRIVATE_BROWSING,
W_TEXT.WB_LT_SETTINGS_DO_NOT_TRACK,
W_TEXT.WB_LT_SETTINGS_DELETE_COOKIE,
W_TEXT.W_TOU_TITLE
];
GUIDE_MENU_TIPS_LIST=[
W_TEXT.WB_LT_TIPS_SEARCH_ENGINE,
W_TEXT.WB_LT_TIPS_PRIVATE_BROWSING,
W_TEXT.WB_LT_TIPS_DO_NOT_TRACK,
W_TEXT.WB_LT_TIPS_DELETE_COOKIE,
W_TEXT.WB_LT_TIPS_TERMS_OF_USE
];
var GUIDE_MENU_BGTOP_H=93;
var DEF_MENU_H=70;
guide_menu=new container({translate:[0,0,0.3],visible_p:false});
guide_menu.create=function(){
if(this.components.length!=0)return;
this.width=pointer_table[0].x2-pointer_table[0].x1;
this.height=pointer_table[0].y1-pointer_table[0].y2;
guide_menu.translate[0]=this.width/2+pointer_table[0].x1;
guide_menu.translate[1]=pointer_table[0].y1;
this.total=GUIDE_MENU_LIST.length;
this.center=this.height*this.total/2;
this.img_base=new gbox({translate:[0,-this.center,0],width:this.width,height:this.height*this.total,
color:system.fdp_color.POP});
this.components.push(this.img_base);
for(var i=1;i<this.total;i++){
this.img_line=new gbox({translate:[0,-i*this.height,0],width:this.width-20,height:1,
color:system.fdp_color.POP_BORDER});
this.components.push(this.img_line);}
this.ary_nemu=new Array();
for(var i=0;i<this.total;i++){
switch(i){
case 0:
this.text2=ENGINE_LIST[SEARCH_ENGINE].name;
break;
case 1:
this.text2=(brw_disp.brw.get_private_browsing())?W_TEXT.WB_LT_SETTINGS_ON:W_TEXT.WB_LT_SETTINGS_OFF;
break;
case 2:
this.text2=(brw_disp.brw.get_do_not_tracking())?W_TEXT.WB_LT_SETTINGS_ON:W_TEXT.WB_LT_SETTINGS_OFF;
break;
default:
this.text2="";
break;}
this.ary_nemu.push(
new menu_item({translate:[0,i*-this.height-this.height/2,0],width:this.width-10,height:this.height-10,
text:GUIDE_MENU_LIST[i],index:i,
tips_text:GUIDE_MENU_TIPS_LIST[i],text2:this.text2})
);
this.components.push(this.ary_nemu[i]);}
this.pos_current=0;
};
guide_menu.appear=function(){
this.pos_current=0;
pointer_table=get_pointer_table("menu");
this.create();
set_pointer_obj(this.ary_nemu,0);
this.visible_p=true;
common_key.set_cursor(platinum_main,guide_menu);};
guide_menu.disappear=function(){
this.visible_p=false;
guide_menu.free();};
guide_menu.free=function(){
if(this.components.length==0)return;
for(var i=0,max=this.components.length;i<max;i++){
if(this.components[i].free)this.components[i].free();}
this.components.splice(0,this.components.length);};
guide_menu.enter_focus=function(){
common_key.set_cursor(this,this.ary_nemu[this.pos_current]);};
guide_menu.leave_focus=function(){
common_key.set_cursor(this,null);
key_flag=false;};
guide_menu.move_up=function(){
if(this.pos_current>0){
this.pos_current--;
common_key.set_cursor(this,this.ary_nemu[this.pos_current]);}
};
guide_menu.move_down=function(){
if(this.pos_current<this.total-1){
this.pos_current++;
common_key.set_cursor(this,this.ary_nemu[this.pos_current]);}
};
guide_menu.done_action=function(pos){
set_base_pointer_obj();
switch(pos){
case 0:this.pos_current=pos;
this.ary_nemu[pos].img_prs.visible_p=true;
this.btn_text=new Array();
this.btn_cb=new Array();
for(var i=0;i<ENGINE_LIST.length;i++){
this.btn_text.push(ENGINE_LIST[i].name);
this.btn_cb.push(guide_menu.selected_popup_done_action);}
this.show_selected_popup({
translate:[800,385,1],
btn_text:this.btn_text,
btn_cb:this.btn_cb,
table:"selected_popup1",
cur_pos:SEARCH_ENGINE,
});
break;
case 1:this.pos_current=pos;
this.ary_nemu[pos].img_prs.visible_p=true;
this.show_selected_popup({
translate:[800,315,1],
btn_text:[W_TEXT.WB_LT_SETTINGS_ON,W_TEXT.WB_LT_SETTINGS_OFF],
btn_cb:[guide_menu.private_browsing_on,guide_menu.private_browsing_off],
table:"selected_popup2",
cur_pos:(brw_disp.brw.get_private_browsing())?0:1,
});
break;
case 2:this.pos_current=pos;
this.ary_nemu[pos].img_prs.visible_p=true;
this.show_selected_popup({
translate:[800,245,1],
btn_text:[W_TEXT.WB_LT_SETTINGS_ON,W_TEXT.WB_LT_SETTINGS_OFF],
btn_cb:[guide_menu.do_not_traking_on,guide_menu.do_not_traking_off],
table:"selected_popup3",
cur_pos:(brw_disp.brw.get_do_not_tracking())?0:1,
});
break;
case 3:this.visible_p=false;
submenu.show_del_cookie_popup();
this.disappear();
break;
case 4:this.pos_current=pos;
this.ary_nemu[pos].img_prs.visible_p=true;
guide_menu.start_TOU();
this.disappear();
break;
default:
this.disappear();
break;}
};
guide_menu.cancel_action=function(pos){
set_base_pointer_obj();
this.disappear();
if(!function_bar.set_free_focus()){
common_key.set_cursor(this,null);
common_key.set_cursor(platinum_main,brw_disp);}
};
guide_menu.start_TOU=function(){
tou_panel.server_version=Server_json.get_tou_version();
if(tou_panel.server_version){
TOU_VERSION=tou_panel.server_version;}
tou_panel.server_text=Server_json.get_tou_text();
if(tou_panel.server_text==null){
var status=1111;
brw_disp.show_popup_cb({type:BROWSER_ERROR_EV},status);}else{
tou_panel.appear({mode:TOU_PANEL_MODE_MENU});}
};
guide_menu.key_hook=function(up_down,key){
if(this.ary_nemu[this.pos_current].img_prs.visible_p)return false;
var ret=false;
if(up_down==KEY_DOWN){
key_flag=true;
return true;}
if(up_down==KEY_UP){
key_flag=false;}
if(key_flag==true){
switch(key){
case TXK_ENTER:
guide_menu.done_action(this.pos_current);
key_flag=false;
ret=true;
break;
case TXK_UP:
guide_menu.move_up();
ret=true;
break;
case TXK_DOWN:
guide_menu.move_down();
ret=true;
break;
case TXK_RETURN:
guide_menu.cancel_action();
ret=true;
break;
case get_COLOR_KEY(0).symbol:
case get_COLOR_KEY(1).symbol:
case get_COLOR_KEY(2).symbol:
case get_COLOR_KEY(3).symbol:
ret=true;
break;
default:
ret=false;
break;}
if(ebus.asr&&ebus.asr.supported){
if((key==TXK_MIC_TP)||(key==TXK_MIC_NRC)||(key==TXK_MIC_EMB)){
guide_menu.cancel_action();
force_redraw();}
}
return ret;}
return false;};
guide_menu.show_selected_popup=function(param){
if(common_popup.visible_p)return;
Cursor.set_mode(2);
InputDevManager.set_move_mode("hybrid");
function_bar.clear_drag_mode();
common_popup.appear({
text:"",
translate:param.translate,
width:1,
height:1,
appear_cb:function(){
common_key.set_cursor(platinum_main,common_popup);
Cursor.appear();
enable_keyhook=true;},
focus_obj:Cursor,
focus_offset:[0.0,0,1],
offset_text_w:-80,
offset_btn_x:0,
offset_btn_y:60,
btn_place:"vertical",
return_cb:guide_menu.selected_popup_cancel,
btn_cb:param.btn_cb,
btn_text:param.btn_text,
text_font_size:26,
title:"",
cur_pos:param.cur_pos,
});
var list=common_popup.get_btn_obj();
pointer_table=get_pointer_table(param.table);
set_pointer_obj(list,0);};
guide_menu.selected_popup_done_action=function(){
SEARCH_ENGINE=common_popup.pos_current;
apps_nvram.write("SEARCH_ENGINE",ENGINE_LIST[SEARCH_ENGINE].id,"home");
setf_text(guide_menu.ary_nemu[0].text2,ENGINE_LIST[SEARCH_ENGINE].name);
display_search_engine_name=true;
function_bar.search_engine_logo_set();
force_redraw();
guide_menu.selected_popup_cancel();}
guide_menu.private_browsing_on=function(){
if(!brw_disp.brw.get_private_browsing()){
guide_menu.selected_popup_cancel();
guide_menu.cancel_action();
brw_disp.private_browsing_func(true);
function_bar.guide_tips();}else{
guide_menu.selected_popup_cancel();}
};
guide_menu.private_browsing_off=function(){
if(brw_disp.brw.get_private_browsing()){
guide_menu.selected_popup_cancel();
guide_menu.cancel_action();
brw_disp.private_browsing_func(false);
function_bar.guide_tips();}else{
guide_menu.selected_popup_cancel();}
};
guide_menu.do_not_traking_on=function(){
if(!brw_disp.brw.get_do_not_tracking()){
brw_disp.do_not_tracking_func(true);
setf_text(guide_menu.ary_nemu[2].text2,W_TEXT.WB_LT_SETTINGS_ON);
force_redraw();}
guide_menu.selected_popup_cancel();};
guide_menu.do_not_traking_off=function(){
if(brw_disp.brw.get_do_not_tracking()){
brw_disp.do_not_tracking_func(false);
setf_text(guide_menu.ary_nemu[2].text2,W_TEXT.WB_LT_SETTINGS_OFF);
force_redraw();}
guide_menu.selected_popup_cancel();};
guide_menu.selected_popup_cancel=function(){
InputDevManager.set_move_mode("free");
guide_menu.ary_nemu[guide_menu.pos_current].img_prs.visible_p=false;
pointer_table=get_pointer_table("menu");
guide_menu.create();
set_pointer_obj(guide_menu.ary_nemu,0);
this.visible_p=true;
common_key.set_cursor(platinum_main,guide_menu);}
guide_menu.selected_popup_yes=function(){
guide_menu.selected_popup_cancel();}
guide_menu.selected_popup_no=function(){
guide_menu.selected_popup_cancel();}
function item_focus(img_line,img_angle){
this.superClass=container;
this.superClass({
visible_p:false,
translate:[0,0,100],
rotation:[0,0,1,0],
components:[]
});
var color=system.fdp_color.FCS;
this.ary_loaded_img=[];
var img_l=img_line?img_line:item_focus.prototype.IMG_PATH+"focus_line.png";
var img_a=img_angle?img_angle:item_focus.prototype.IMG_PATH+"focus_angle.png";

this.components=[
new gimage({width:1920,height:16,src:img_l,
draw_type:DIRECT,rotation:[0,0,0,1],color:color,
onload:this.onload,onerror:this.onload}),
new gimage({width:1920,height:16,src:img_l,
draw_type:DIRECT,rotation:[90,0,0,1],color:color,
onload:item_focus.prototype.NULL_FUNCTION,}),
new gimage({width:1920,height:16,src:img_l,
draw_type:DIRECT,rotation:[180,0,0,1],color:color,
onload:item_focus.prototype.NULL_FUNCTION,}),
new gimage({width:1920,height:16,src:img_l,
draw_type:DIRECT,rotation:[-90,0,0,1],color:color,
onload:item_focus.prototype.NULL_FUNCTION,}),

new gimage({width:16,height:16,src:img_a,
draw_type:DIRECT,rotation:[-90,0,0,1],color:color,
onload:this.onload,onerror:this.onload}),
new gimage({width:16,height:16,src:img_a,
draw_type:DIRECT,rotation:[0,0,0,1],color:color,
onload:item_focus.prototype.NULL_FUNCTION,}),
new gimage({width:16,height:16,src:img_a,
draw_type:DIRECT,rotation:[90,0,0,1],color:color,
onload:item_focus.prototype.NULL_FUNCTION,}),
new gimage({width:16,height:16,src:img_a,
draw_type:DIRECT,rotation:[180,0,0,1],color:color,
onload:item_focus.prototype.NULL_FUNCTION,})
];};
item_focus.prototype=new container({});
item_focus.prototype.NULL_FUNCTION=function(){};
item_focus.prototype.IMG_PATH=PALTINUM_PATH_IMG;
item_focus.prototype.ary_loaded_img=[];item_focus.prototype.onload=function(){
force_redraw();
return;};
item_focus.prototype.width=0;
item_focus.prototype.height=0;
item_focus.prototype.color=[255,255,255,255];
item_focus.prototype.setSize=function(w,h){
w=Math.floor(w);
h=Math.floor(h);
this.width=w;
this.height=h;
this.components[0].width=w-8;
this.components[2].width=w-8;
this.components[1].width=h-8;
this.components[3].width=h-8;
this.components[0].translate[1]=h/2+4;
this.components[2].translate[1]=-h/2-4;
this.components[1].translate[0]=-w/2-4;
this.components[3].translate[0]=w/2+4;
this.components[0+4].translate[1]=h/2+4;
this.components[2+4].translate[1]=-h/2-4;
this.components[1+4].translate[0]=-w/2-4;
this.components[3+4].translate[0]=w/2+4;
this.components[0+4].translate[0]=w/2+4;
this.components[2+4].translate[0]=-w/2-4;
this.components[1+4].translate[1]=h/2+4;
this.components[3+4].translate[1]=-h/2-4;};
item_focus.prototype.setTranslate=function(x,y,z){
this.translate[0]=x;
this.translate[1]=y;
this.translate[2]=z;};
item_focus.prototype.setShow=function(b){
console_log("[item_focus.setShow]"+b);
if((b)||(this.visible_p!=b)){
this.visible_p=b;
force_redraw();}
};
item_focus.prototype.isShow=function(){
return this.visible_p;};
item_focus.prototype.free=function(){
this.components[0].src="";
this.components[1].src="";
this.components[2].src="";
this.components[3].src="";
this.components[4].src="";
this.components[5].src="";
this.components[6].src="";
this.components[7].src="";};
provide("pkg_toolbars");
