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