function updateThemeWithAppSkinInfo(a){var b=a.panelBackgroundColor.color;document.body.bgColor=toHex(b);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(b,40)+" , "+toHex(b,10)+");",f="background-image: -webkit-linear-gradient(top, "+toHex(b,15)+" , "+toHex(b,5)+");",d,g,h,e,k;127<b.red?(d="#000000;",
g="color:"+toHex(b,-70)+";",h="border-color: "+toHex(b,-90)+";",e=toHex(b,54)+";",k="background-image: -webkit-linear-gradient(top, "+toHex(b,-40)+" , "+toHex(b,-50)+");"):(d="#ffffff;",g="color:"+toHex(b,100)+";",h="border-color: "+toHex(b,-45)+";",e=toHex(b,-20)+";",k="background-image: -webkit-linear-gradient(top, "+toHex(b,-20)+" , "+toHex(b,-30)+");");addRule("ppstyle",".default","font-size:"+a.baseFontSize+"px; color:"+d+"; background-color:"+toHex(b)+";");addRule("ppstyle","button, select, input[type=text], input[type=button], input[type=submit]",
h);addRule("ppstyle","button.default, 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]",f);addRule("ppstyle","[disabled]",g);addRule("ppstyle","input[type=text]","padding:1px 3px;");addRule("ppstyle","input[type=text]","background-color: "+e+";");addRule("ppstyle","input[type=text]:focus","background-color: #ffffff;");addRule("ppstyle","input[type=text]:focus","color: #000000;");addRule("ppstyle","select","color: "+d+";");addRule("ppstyle","select","background-color: "+e+";");addRule("ppstyle",".settings-modal-content","color: "+d+";");addRule("ppstyle",
".settings-modal-content","background-color: "+e+";");addRule("ppstyle",".section-color","color: "+d+";")}else addRule("ppstyle",".default","font-size:"+a.baseFontSize+"px; color:"+reverseColor(b)+"; background-color:"+toHex(b,20)),addRule("ppstyle","button","border-color: "+toHex(panelBgColor,-50))}function addRule(a,b,c){if(a=document.getElementById(a))a=a.sheet,a.addRule?a.addRule(b,c):a.insertRule&&a.insertRule(b+" { "+c+" }",a.cssRules.length)}
function reverseColor(a,b){return toHex({red:Math.abs(255-a.red),green:Math.abs(255-a.green),blue:Math.abs(255-a.blue)},b)}function toHex(a,b){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 f="";if(a)with(a)f=c(red,b)+c(green,b)+c(blue,b);return"#"+f}function onAppThemeColorChanged(a){a=JSON.parse(window.__adobe_cep__.getHostEnvironment()).appSkinInfo;updateThemeWithAppSkinInfo(a)}
function loadJSX(){var a=new CSInterface,b=a.getSystemPath(SystemPath.EXTENSION)+"/jsx/";a.evalScript('$._ext.evalFiles("'+b+'")')}function evalScript(a,b){(new CSInterface).evalScript(a,b)}function onClickButton(a){if("FLPR"==a)evalScript('fl.createDocument(); fl.getDocumentDOM().addNewText({left:100, top:100, right:300, bottom:300} , "Hello Flash!"); ');else try{evalScript("$._ext_"+a+".run()")}catch(b){}}
function onLoaded(){(new PSSelectEvent).start(function(){document.getElementById("activeSelectionImg").style.visibility="visible"},function(){document.getElementById("activeSelectionImg").style.visibility="hidden"});var a=new CSInterface;"FLPR"!=a.hostEnvironment.appName&&loadJSX();updateThemeWithAppSkinInfo(a.hostEnvironment.appSkinInfo);a.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,onAppThemeColorChanged);$("#buttonVISITGOODLIGHT").click(function(){a.openURLInDefaultBrowser("http://goodlight.us")})}
$(document).ready(function(){var a=null===localStorage.getItem("sliderValueBasic")||void 0===localStorage.getItem("sliderValueBasic")?1:localStorage.getItem("sliderValueBasic"),b=null===localStorage.getItem("tkLANGDEFAULT")||void 0===localStorage.getItem("tkLANGDEFAULT")?"EN":localStorage.getItem("tkLANGDEFAULT");$("#Slider").val(a);updateSlider(a);TKResetLang(b);a=tkLANG.buttonCLEARCHANNELS;b=tkLANG.tipCLEAR;("Clear Channels"===a||"Rimuovi Maschere"===a||"Kan\u00e4le entfernen"===a||"Borrar canales"===
a||"\u6e05\u9664\u5168\u90e8\u901a\u9053\u8499\u7248"===a)&&("Click for settings"===b||"Impostazioni"===b||"Einstellungen"===b||"Click para ajustes"===b||"\u70b9\u51fb\u8bbe\u7f6e"===b)?$(".default").show():$(".default").hide()});
function updateSlider(a){var b=document.getElementsByClassName("panelColor"),c;for(c=0;c<b.length;c++)document.getElementsByClassName("panelColor")[c].style.opacity=a;document.getElementById("tktips").style.border="1px solid rgba(255, 204, 51, "+a+")";localStorage.setItem("sliderValueBasic",a)}$("#English, #Italian, #German, #Spanish, #Chinese").click(function(){var a=this.value;localStorage.setItem("tkLANGDEFAULT",a);TKResetLang(a)});
function TKResetLang(a){"object"===typeof lang_IT&&"object"===typeof lang_DE&&"object"===typeof lang_CH&&"object"===typeof lang_ES&&"object"===typeof lang_EN?$(".default").show():$(".default").hide();tkLANG="IT"==a?lang_IT:"DE"==a?lang_DE:"ES"==a?lang_ES:"CH"==a?lang_CH:lang_EN;TKTT("tipCLEAR");$("#spanCURVES").html(tkLANG.spanCURVES);$("#spanLEVELS").html(tkLANG.spanLEVELS);$("#spanCHANNELS").html(tkLANG.spanCHANNELS);$("#spanCOLOR").html(tkLANG.spanCOLOR);$("#buttonCURVESL1").html(tkLANG.buttonCURVESL1);
$("#buttonCURVESL2").html(tkLANG.buttonCURVESL2);$("#buttonCURVESL3").html(tkLANG.buttonCURVESL3);$("#buttonCURVESL4").html(tkLANG.buttonCURVESL4);$("#buttonCURVESL5").html(tkLANG.buttonCURVESL5);$("#buttonCURVESLALL").html(tkLANG.buttonCURVESLALL);$("#buttonCURVESMT1").html(tkLANG.buttonCURVESMT1);$("#buttonCURVESMT2").html(tkLANG.buttonCURVESMT2);$("#buttonCURVESMT3").html(tkLANG.buttonCURVESMT3);$("#buttonCURVESMTALL").html(tkLANG.buttonCURVESMTALL);$("#buttonCURVESD1").html(tkLANG.buttonCURVESD1);
$("#buttonCURVESD2").html(tkLANG.buttonCURVESD2);$("#buttonCURVESD3").html(tkLANG.buttonCURVESD3);$("#buttonCURVESD4").html(tkLANG.buttonCURVESD4);$("#buttonCURVESD5").html(tkLANG.buttonCURVESD5);$("#buttonCURVESDALL").html(tkLANG.buttonCURVESDALL);$("#buttonLEVELSL1").html(tkLANG.buttonLEVELSL1);$("#buttonLEVELSL2").html(tkLANG.buttonLEVELSL2);$("#buttonLEVELSL3").html(tkLANG.buttonLEVELSL3);$("#buttonLEVELSL4").html(tkLANG.buttonLEVELSL4);$("#buttonLEVELSL5").html(tkLANG.buttonLEVELSL5);$("#buttonLEVELSLALL").html(tkLANG.buttonLEVELSLALL);
$("#buttonLEVELSMT1").html(tkLANG.buttonLEVELSMT1);$("#buttonLEVELSMT2").html(tkLANG.buttonLEVELSMT2);$("#buttonLEVELSMT3").html(tkLANG.buttonLEVELSMT3);$("#buttonLEVELSMTALL").html(tkLANG.buttonLEVELSMTALL);$("#buttonLEVELSD1").html(tkLANG.buttonLEVELSD1);$("#buttonLEVELSD2").html(tkLANG.buttonLEVELSD2);$("#buttonLEVELSD3").html(tkLANG.buttonLEVELSD3);$("#buttonLEVELSD4").html(tkLANG.buttonLEVELSD4);$("#buttonLEVELSD5").html(tkLANG.buttonLEVELSD5);$("#buttonLEVELSDALL").html(tkLANG.buttonLEVELSDALL);
$("#buttonCHANNELSL1").html(tkLANG.buttonCHANNELSL1);$("#buttonCHANNELSL2").html(tkLANG.buttonCHANNELSL2);$("#buttonCHANNELSL3").html(tkLANG.buttonCHANNELSL3);$("#buttonCHANNELSL4").html(tkLANG.buttonCHANNELSL4);$("#buttonCHANNELSL5").html(tkLANG.buttonCHANNELSL5);$("#buttonCHANNELSLALL").html(tkLANG.buttonCHANNELSLALL);$("#buttonCHANNELSMT1").html(tkLANG.buttonCHANNELSMT1);$("#buttonCHANNELSMT2").html(tkLANG.buttonCHANNELSMT2);$("#buttonCHANNELSMT3").html(tkLANG.buttonCHANNELSMT3);$("#buttonCHANNELSMTALL").html(tkLANG.buttonCHANNELSMTALL);
$("#buttonCHANNELSD1").html(tkLANG.buttonCHANNELSD1);$("#buttonCHANNELSD2").html(tkLANG.buttonCHANNELSD2);$("#buttonCHANNELSD3").html(tkLANG.buttonCHANNELSD3);$("#buttonCHANNELSD4").html(tkLANG.buttonCHANNELSD4);$("#buttonCHANNELSD5").html(tkLANG.buttonCHANNELSD5);$("#buttonCHANNELSDALL").html(tkLANG.buttonCHANNELSDALL);$("#buttonMASKSCHANNELS").html(tkLANG.buttonMASKSCHANNELS);$("#buttonCLEARCHANNELS").html(tkLANG.buttonCLEARCHANNELS)}
function TKTT(a){"tipCLEAR"===a?$("#tktips").css({"font-size":"18px","font-family":"Verdana","text-align":"center","vertical-align":"middle","line-height":"19px",color:"#ffffff"}):$("#tktips").css({"font-size":"11px","font-family":"Arial","text-align":"left","vertical-align":"baseline","line-height":"10px",color:"#000000"});$("#tktips").html(tkLANG[a])}
function openSettings(){var a=document.getElementById("settingsModal"),b=document.getElementById("spanCLOSESETTINGS");a.style.display="block";b.onclick=function(){a.style.display="none"};window.onclick=function(b){b.target==a&&(a.style.display="none")}};
