function onLoaded(){var b=new CSInterface;"FLPR"!=b.hostEnvironment.appName&&loadJSX();var a=document.getElementById("btn_retouch");a&&(a.disabled=!1);if(a=document.getElementById("btn_makeup"))a.disabled=!1;if(a=document.getElementById("btn_extras"))a.disabled=!1;if(a=document.getElementById("btn_colorful"))a.disabled=!1;if(a=document.getElementById("btn_chrome"))a.disabled=!1;if(a=document.getElementById("btn_bwfilters"))a.disabled=!1;updateThemeWithAppSkinInfo(b.hostEnvironment.appSkinInfo);b.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,
onAppThemeColorChanged)}
function updateThemeWithAppSkinInfo(b){var a=b.panelBackgroundColor.color;document.body.bgColor=toHex(a);var c=(new CSInterface).hostEnvironment.appName;"PHXS"==c&&addRule("ppstyle","button, select, input[type=button], input[type=submit]","border-radius:3px;");if("PHXS"==c||"PPRO"==c||"PRLD"==c){var c="background-image: -webkit-linear-gradient(top, "+toHex(a,40)+" , "+toHex(a,10)+");",d="background-image: -webkit-linear-gradient(top, "+toHex(a,15)+" , "+toHex(a,5)+");",e,f,g,h,k;127<a.red?(e="#000000;",
f="color:"+toHex(a,-70)+";",g="border-color: "+toHex(a,-90)+";",h=toHex(a,54)+";",k="background-image: -webkit-linear-gradient(top, "+toHex(a,-40)+" , "+toHex(a,-50)+");"):(e="#ffffff;",f="color:"+toHex(a,100)+";",g="border-color: "+toHex(a,-45)+";",h=toHex(a,-20)+";",k="background-image: -webkit-linear-gradient(top, "+toHex(a,-20)+" , "+toHex(a,-30)+");");addRule("ppstyle",".default","font-size:"+b.baseFontSize+"px; color:"+e+"; background-color:"+toHex(a)+";");addRule("ppstyle","button, select, input[type=text], input[type=button], input[type=submit]",
g);addRule("ppstyle","button, select, input[type=button], input[type=submit]",c);addRule("ppstyle","button, select, input[type=button], input[type=submit]","-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);");addRule("ppstyle","button:enabled:active, input[type=button]:enabled:active, input[type=submit]:enabled:active",k);addRule("ppstyle","button:enabled:active, input[type=button]:enabled:active, input[type=submit]:enabled:active","-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);");
addRule("ppstyle","[disabled]",d);addRule("ppstyle","[disabled]",f);addRule("ppstyle","input[type=text]","padding:1px 3px;");addRule("ppstyle","input[type=text]","background-color: "+h)+";";addRule("ppstyle","input[type=text]:focus","background-color: #ffffff;");addRule("ppstyle","input[type=text]:focus","color: #000000;")}else addRule("ppstyle",".default","font-size:"+b.baseFontSize+"px; color:"+reverseColor(a)+"; background-color:"+toHex(a,20)),addRule("ppstyle","button","border-color: "+toHex(panelBgColor,
-50))}function addRule(b,a,c){if(b=document.getElementById(b))b=b.sheet,b.addRule?b.addRule(a,c):b.insertRule&&b.insertRule(a+" { "+c+" }",b.cssRules.length)}function reverseColor(b,a){return toHex({red:Math.abs(255-b.red),green:Math.abs(255-b.green),blue:Math.abs(255-b.blue)},a)}function toHex(b,a){function c(a,b){var c=!isNaN(b)?a+b:a;0>c?c=0:255<c&&(c=255);c=c.toString(16);return 1==c.length?"0"+c:c}var d="";if(b)with(b)d=c(red,a)+c(green,a)+c(blue,a);return"#"+d}
function onAppThemeColorChanged(b){b=JSON.parse(window.__adobe_cep__.getHostEnvironment()).appSkinInfo;updateThemeWithAppSkinInfo(b)}function loadJSX(){var b=new CSInterface,a=b.getSystemPath(SystemPath.EXTENSION)+"/jsx/";b.evalScript('$._ext.evalFiles("'+a+'")')}function evalScript(b,a){(new CSInterface).evalScript(b,a)}
function onClickButton(b){var a=document.getElementById("retouch_list"),c=document.getElementById("makeup_list"),d=document.getElementById("extras_list"),e=document.getElementById("colorful_list"),f=document.getElementById("chrome_list"),g=document.getElementById("bwfilters_list");if("RETOUCH"==b){if("0px"==a.style.height||0==a.style.height)c.style.height="0px",d.style.height="0px",a.style.height="135px"}else if("MAKEUP"==b){if("0px"==c.style.height||0==c.style.height)a.style.height="0px",d.style.height=
"0px",c.style.height="135px"}else if("EXTRAS"==b){if("0px"==d.style.height||0==d.style.height)c.style.height="0px",a.style.height="0px",d.style.height="157px"}else if("COLORFUL"==b){if("0px"==e.style.height||0==e.style.height)g.style.height="0px",f.style.height="0px",e.style.height="475px"}else if("CHROME"==b){if("0px"==f.style.height||0==f.style.height)g.style.height="0px",e.style.height="0px",f.style.height="370px"}else if("BLACK&WHITE"==b&&("0px"==g.style.height||0==g.style.height))f.style.height=
"0px",e.style.height="0px",g.style.height="360px"}function onClickEffects(b){evalScript("$._ext_"+b+".run()")};
