/**
 * Version: 10.20.1229.36
 *
 * (funnelweb5) (C) 2015 Toshiba (Australia) Pty Ltd
 */
FWSDK=function(){function e(e){JBUS.jCall("OUTPUT.addPJL","@PJL "+e+"\n")}function n(){return JBUS.jCall("OUTPUT.getPJL")}function t(e,n){JBUS.jCall("OUTPUT.insertPJL","@PJL "+e+"\n",n)}function r(e,t){var r=n();var i=0;while(i<r.length){if(r[i].indexOf(t)!=-1)break;++i}JBUS.jCall("OUTPUT.insertPJL","@PJL "+e+"\n",i)}function i(e,t){var r=n();var i=0;while(i<r.length){if(r[i].indexOf(t)!=-1)break;++i}JBUS.jCall("OUTPUT.insertPJL","@PJL "+e+"\n",i+1)}function a(e){JBUS.jCall("OUTPUT.erasePJL",e)}function f(e){JBUS.jCall("OUTPUT.addEndJobPJL",e)}function o(e){for(var n=0;n<e.Features.length;++n){var t=e.Features[n];if(!t.hasOwnProperty("name")&&t.hasOwnProperty("func")){t.func()}else{if(FWSDK.exists("job:///"+t.name)){var r=FWSDK.getResource("job:///"+t.name);if("func"in t){t.func(r)}else if("Options"in t){if("after"in t){if(r in t.Options){FWSDK.insertPJLAfter(t.Options[r],t.after)}else if("DefaultOption"in t){FWSDK.insertPJLAfter(t.DefaultOption,t.after)}}else{if(r in t.Options){FWSDK.addPJL(t.Options[r])}else if("DefaultOption"in t){FWSDK.addPJL(t.DefaultOption)}}}}else{if("func"in t){}else if("DefaultOption"in t){FWSDK.addPJL(t.DefaultOption)}}}}}function l(e){return JBUS.jCall("JOBSETTINGS.get",e.replace("job:///",""))}function u(e){return JBUS.jCall("JOBSETTINGS.has",e.replace("job:///",""))}function s(e,n){var t=parseInt(e);if(t<0)t+=256;else if(t>256)t-=256;var r="0"+t.toString(16);if(!n)r=r.toUpperCase();return r.substr(r.length-2)}function J(e){if(e.length===0)return"";var n=[];var t="";for(var r=0;r<e.length;++r){var i=~e.charCodeAt(r);i=i&255;i=(i&240)>>4|(i&15)<<4;t+=s(i,true);t+="ff"}return t}function P(e){if(e.length===0)return"";var n=[];var t="ffff";for(var r=0;r<e.length;++r){var i=~e.charCodeAt(r);i=i&255;i=(i&240)>>4|(i&15)<<4;t+=s(i,true)}return t}function c(e){if(e.length<4)return"";var n="";for(var t=0;t<e.length;t+=4){var r=~parseInt(e.charAt(t+1)+e.charAt(t),16)&255;n+=String.fromCharCode(r)}return n}return{addPJL:e,getPJL:n,insertPJL:t,insertPJLBefore:r,insertPJLAfter:i,erasePJL:a,addEndJobPJL:f,processPJL:o,getResource:l,exists:u,toCBHex:s,encrypt:J,encryptUTF8:P,decrypt:c}}();
