function disableConsole(){console.log=function(){"use strict"},console.info=function(){"use strict"},console.warn=function(){"use strict"},console.debug=function(){"use strict"},console.error=function(){"use strict"}}function loadJSX(o){console.log("Loading script file: "+o);var e=csInterface.getSystemPath(SystemPath.EXTENSION);csInterface.evalScript('$.evalFile("'+e+o+'")',function(e){console.log("Done loading: "+o)})}function loadToolTips(o){for(console.group("Loading tooltips:"),i=0;i<o.length;i++)try{document.getElementById(o[i][0]).title=o[i][1]}catch(e){alert("Tooltip error with: "+o[i][0]),console.groupEnd(),console.error("Tooltip error with: "+o[i][0])}console.groupEnd()}function setButtonScripts(o){"use strict";for(var e=0;e<o.length;e++)!function(){var n=e;$(o[n][0]).click(function(){console.log("Starting script: "+o[n][1]),buttonClicked(),csInterface.evalScript(o[n][1],function(o){console.log("processing result now..."),logReturnMessage(o)})})}()}function logReturnMessage(o){if("undefined"!=o)try{var e=JSON.parse(o);e.message?console.log(e.message):console.log(e)}catch(n){console.log(o)}else console.warn("No return message")}function executeJSXButton(o){"use strict";for(var e=0;e<o.length;e++)!function(){var n=e;$(o[n][0]).click(function(){console.log("Starting script: "+o[n][1]),buttonClicked(),loadJSX("/jsx/"+o[n][1]),console.log("Done loading script: "+o[n][1])})}()}function getCookie(o){"use strict";try{if(minimumPhotoshopVersionForCookies>versionMajor)return!1;var e="";o+="=";for(var n=document.cookie.split(";"),r=0;r<n.length;r++){for(var t=n[r];" "==t.charAt(0);)t=t.substring(1);if(0==t.indexOf(o))return e=t.substring(o.length,t.length)}return!1}catch(i){alert("Please send a screenshot of this error to support@gregbenzphotography.com.\n\nError retrieving: "+o+".\nerror message = '"+i+"'"),console.error("getCookie error.\n"+i)}}function setCookie(o,e){"use strict";try{if(minimumPhotoshopVersionForCookies>versionMajor)return console.log("This version of Photoshop does not support cookies."),!1;if(permanentCookie){var n=new Date,r=18250,t=24,i=60,s=60,c=1e3,a=r*t*i*s*c;n.setTime(n.getTime()+a),cookieExpiration="; expires="+n.toGMTString()}else cookieExpiration="";document.cookie=o+"="+e+cookieExpiration}catch(l){alert("Please send a screenshot of this error to support@gregbenzphotography.com.\n\nError saving: "+o+".\nerror message = '"+l+"'"),console.error("setCookie error.\n"+l)}}function deleteAllCookies(){console.log("Clearing all cookies."),document.cookie.split(";").forEach(function(o){document.cookie=o.replace(/^ +/,"").replace(/=.*/,"=;expires="+(new Date).toUTCString())})}function setPersistence(o){"use strict";return!1}function buttonClicked(){function o(){themeManager.init();var o=new CSEvent("com.adobe.PhotoshopLoseFocus","APPLICATION");o.extensionId=csInterface.getExtensionID(),csInterface.dispatchEvent(o)}try{o()}catch(e){alert("Please update to the latest version of Photoshop CC, aka v14.2.  Or upgrade to CC2014 or later."),console.error("buttonClicked() error\n"+e)}}function get_browser(){var o,e=navigator.userAgent,n=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?(o=/\brv[ :]+(\d+)/g.exec(e)||[],{name:"IE",version:o[1]||""}):"Chrome"===n[1]&&(o=e.match(/\bOPR\/(\d+)/),null!=o)?{name:"Opera",version:o[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(o=e.match(/version\/(\d+)/i))&&n.splice(1,1,o[1]),{name:n[0],version:n[1]})}var disableConsoleLog=!1;disableConsoleLog&&disableConsole(),console.info("========================\nsub.js loading...");var csInterface=new CSInterface,version=csInterface.hostEnvironment.appVersion,versionMajor=version.substr(0,version.indexOf(".")),cookieExpiration,permanentCookie=!0,reportLaunches=!0,minimumPhotoshopVersionForCookies=16;if(reportLaunches&&versionMajor>=minimumPhotoshopVersionForCookies){var name="numberOfLaunches",numberOfLaunches=Number(getCookie(name));numberOfLaunches?(console.debug("# of panel launches = "+(numberOfLaunches+1)),setCookie(name,numberOfLaunches+1)):(console.warn("No panel launch counter found.  Initializing to 1."),setCookie(name,1))}console.info("sub.js finished loading.\n========================\n");