var csInterface=new CSInterface;function onLoaded(){var a=new CSInterface;b=a.hostEnvironment.appName;"FLPR"!=b&&loadJSX();for(var c=["PHXS"],e=0;e<c.length;e++){var d=c[e];if(0<=b.indexOf(d)&&(d=document.getElementById("btn_"+d)))d.disabled=!1}updateThemeWithAppSkinInfo(a.hostEnvironment.appSkinInfo);a.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,onAppThemeColorChanged)}var extensionRoot=csInterface.getSystemPath(SystemPath.EXTENSION)+"/jsx/scripts/";
function loadJSX(){var a=new CSInterface,c=a.getSystemPath(SystemPath.EXTENSION)+"/jsx/";a.evalScript('$._ext.evalFiles("'+c+'")')}function evalScript(a,c){(new CSInterface).evalScript(a,c)}
function onAppThemeColorChanged(a){switch(csInterface.getHostEnvironment().appSkinInfo.panelBackgroundColor.color.red){case 52:$("#skin_panel_css").replaceWith($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/dark_theme/jquery-ui-1.9.2.custom.css"));$("body").attr("bgcolor","#343434");setIcons(1);break;case 83:$("#skin_panel_css").replaceWith($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/dark_theme/jquery-ui-1.9.2.custom.css"));
$("body").attr("bgcolor","#535353");setIcons(1);break;case 184:$("#skin_panel_css").replaceWith($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/light_theme/jquery-ui-1.9.2.custom.css"));$("body").attr("bgcolor","#b8b8b8");setIcons(0);break;case 214:$("#skin_panel_css").replaceWith($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/light_theme/jquery-ui-1.9.2.custom.css")),$("body").attr("bgcolor","#d6d6d6"),setIcons(0)}}
function openUrl(a){csInterface.openURLInDefaultBrowser(a)}
function setIcons(a){a?($("#i_dodge").attr("src","res/icons/dodge_tool_dark.png"),$("#i_burn").attr("src","res/icons/burn_tool_dark.png"),$("#i_brush").attr("src","res/icons/brush_tool_dark.png"),$("#i_heal").attr("src","res/icons/heal_tool_dark.png"),$("#i_heal2").attr("src","res/icons/heal_tool_dark_2.png"),$("#i_mixer").attr("src","res/icons/mixBrush_tool_dark.png"),$("#logo_dark").attr("src","res/icons/logo.png"),$("#sign").attr("src","res/logo.png"),$("#i_patch").attr("src","res/icons/patch_tool_dark.png"),
$("#i_clone").attr("src","res/icons/clone_tool_dark.png")):($("#i_dodge").attr("src","res/icons/dodge_tool_light.png"),$("#i_burn").attr("src","res/icons/burn_tool_light.png"),$("#i_brush").attr("src","res/icons/brush_tool_light.png"),$("#i_heal").attr("src","res/icons/heal_tool_light.png"),$("#i_heal2").attr("src","res/icons/heal_tool_light_2.png"),$("#i_mixer").attr("src","res/icons/mixBrush_tool_light.png"),$("#logo_dark").attr("src","res/icons/dark_logo.png"),$("#sign").attr("src","res/dark_logo.png"),
$("#i_patch").attr("src","res/icons/patch_tool_light.png"),$("#i_clone").attr("src","res/icons/clone_tool_light.png"))}
$(document).ready(function(){loadJSX();csInterface.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,onAppThemeColorChanged);switch(csInterface.getHostEnvironment().appSkinInfo.panelBackgroundColor.color.red){case 52:$("head").prepend($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/dark_theme/jquery-ui-1.9.2.custom.css"));$("body").attr("bgcolor","#343434");setIcons(1);break;case 83:$("head").prepend($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href",
"./css/dark_theme/jquery-ui-1.9.2.custom.css"));$("body").attr("bgcolor","#535353");setIcons(1);break;case 184:$("head").prepend($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/light_theme/jquery-ui-1.9.2.custom.css"));$("body").attr("bgcolor","#b8b8b8");setIcons(0);break;case 214:$("head").prepend($('<link id="skin_panel_css" rel="stylesheet" type="text/css" />').attr("href","./css/light_theme/jquery-ui-1.9.2.custom.css")),$("body").attr("bgcolor","#d6d6d6"),
setIcons(0)}$("#accordion").accordion({heightStyle:"content"});$("#Tb1").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/1.jsx")')});$("#Tb2").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/2.jsx")')});$("#Tb3").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/3.jsx")')});$("#Tb4").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/4.jsx")')});
$("#Tb5").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/5.jsx")')});$("#Tb6").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/6.jsx")')});$("#Tb7").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/7.jsx")')});$("#Tb8").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/8.jsx")')});$("#Tb9").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+
extensionRoot+'Tb_1/9.jsx")')});$("#Tb10").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/10.jsx")')});$("#Tb11").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/11.jsx")')});$("#Tb12").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/12.jsx")')});$("#Tb13").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/13.jsx")')});$("#Tb14").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+
extensionRoot+'Tb_1/14.jsx")')});$("#Tb15").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/15.jsx")')});$("#Tb16").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/16.jsx")')});$("#Tb17").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/17.jsx")')});$("#Tb18").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/18.jsx")')});$("#Tb19").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+
extensionRoot+'Tb_1/19.jsx")')});$("#Tb20").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/20.jsx")')});$("#Tb21").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/21.jsx")')});$("#Tb22").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/22.jsx")')});$("#Tb23").button().click(function(a){csInterface.evalScript('$._ext.evalFile("'+extensionRoot+'Tb_1/23.jsx")')})});
