function onLoaded(){var b=new CSInterface;"FLPR"!=b.hostEnvironment.appName&&loadJSX();var a=document.getElementById("headerimg");a&&(a.disabled=!1);updateThemeWithAppSkinInfo(b.hostEnvironment.appSkinInfo);b.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,onAppThemeColorChanged);try{a.src="http://www.xiutuw.com"}catch(c){a.src="assets/announcements.png"}}
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){evalScript("$._ext_"+b+".run()")}function onClickShop(){(new CSInterface).openURLInDefaultBrowser("http://%77%77%77%2E%78%69%75%74%75%77%2E%63%6F%6D/")};
