<package>
<!-- Generated by Soya.IO.WSFFactory v0.92 [Fri, 25 Jan 2002 10:03:43 UTC] -->
<job>
<?job error="false" debug="false" ?>
<resource id="about">
-----------------------------------------------------------------------------
  ESC (ECMAScript Cruncher)
  * Version       : 1.11
  * Date          : 2002-01-25 11:03:43 [+0100]
  * License       : GNU GPL (http://www.gnu.org/copyleft/gpl.txt)
  * Copyright (C) 2001,2002 Thomas Loo - Saltstorm. &lt;esc@saltstorm.net&gt;

  ---------------------------------------------------------------------------
  ESC is an ECMAScript(*) pre-processor enabling an unlimited number of
  external scripts to be compressed/crunched into tight, bandwidth-optimized
  packages. ESC supports compressing of external sources only. Trying to
  process scripts inlined in HTML, ASP, PHP or equivalent pages are NOT
  recommended with this version of ESC. This feature might be added in a
  future version. Type "cscript ESC.wsf -help" for usage instructions.

  ESC is built using components from the Soya Scripting API 1.0.0-b5,
  a uni-host/cross-browser ECMAScript compliant class-library distributed
  freely under the terms of the BSD License. The Soya Scripting API,
  'lib-soya' and the Soya SDK can be found at http://www.saltstorm.net
  ---------------------------------------------------------------------------
  * ECMAScript is the international standard for javascript.
-----------------------------------------------------------------------------
</resource>

<resource id="copyright">
-----------------------------------------------------------------------------

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

-----------------------------------------------------------------------------

</resource>

<resource id="usage">
------------------------------------------------------------------------------
 Usage: cscript ESC.wsf -l [0-4] -ow output.js foo.js bar.js C:\scripts\baz...
 -----------------------------------------------------------------------------
  -a  [-about]             : Description page
  -c  [-copyright]         : Copyright/license notice
  -e  [-example]           : Examples of usage
  -h  [-help]              : This help-screen
 -----------------------------------------------------------------------------
  -l  [-level]   [01(2)34] : [optional] Set crunch-level (4 sets -$ on)
  -s  [-silent]            : [optional] Run silent, nada stdout
  -v  [-verbose]           : [optional] Run in verbose mode
  -$                       : [optional] Activate variable-substitution engine
 -----------------------------------------------------------------------------
  -oa &lt;filename&gt;           : Target filename for appending
  -ow &lt;filename&gt;           : Target filename for writing
  -ow STDOUT               : Write stream to STDOUT
 -----------------------------------------------------------------------------
 &lt;input-file(s)&gt;           : [required]
  file(s) and/or directories containing scripts to crunch...
  (paths containing spaces must be quoted)
</resource>

<resource id="example">
-----------------------------------------------------------------------------
 Examples of usage.

  Crunch 'original1.js','original2.js' and 'original3.js' at
  level 2 (default) and save the output as 'crunched.js'.
  Any previous file named 'crunched.js' will be overwritten.
   X:\cscript ESC.wsf -ow crunched.js original1.js original2.js original3.js
  ---------------------------------------------------------------------------

  Grab all scriptfiles (.js) in directory 'C:\script-directory' and crunch
  them at level 1 (comment and empty line removal only) and append the result
  to 'crunched.js'. If 'crunched.js' doesn't exist, it will be created.
   X:\cscript ESC.wsf -l 1 -oa crunched.js C:\script-directory
  ---------------------------------------------------------------------------

  Subject 'original1.js' and 'original2.js' for variable substitution,
  but perform no comment or whitespace removal.
  Redirect output to STDOUT instead of writing to file.
   X:\cscript ESC.wsf -l 0 -$ -ow STDOUT original1.js original2.js
  ---------------------------------------------------------------------------

  Crunch 'original.js' using variable substitution and remove
  any occurance of whitespace (where permitted...)
  and save it as 'crunched.js' (equals -l 3 -$)
   X:\cscript ESC.wsf -l 4 -ow crunched.js original.js
  ---------------------------------------------------------------------------

 Try 'ESC.wsf -help' for information about available run-time directives.
-----------------------------------------------------------------------------
</resource>

<resource id="wscript">
ESC must be run from a DOS command prompt under	
cscript.exe. Do you want to switch host and have
ESC bring up a helpscreen ?

</resource>

<resource id="jscript">
ESC needs JScript 5.5 or higher to score...
You need to update your version of JScript to run ESC.
Read the 'Requirements' section in the manual for information
how to obtain and install the latest version of Microsofts
'Windows Script' package.

</resource>

<resource id="common.map">

Anchor
ActiveXObject
Call
Closure
Components
Dictionary
Document
DOMParser
Embed
EvalError
Event
Form
Global
Image
JavaArray
JavaClass
JavaMethod
JavaObject
JavaPackage
Layer
MimeType
MimeTypeArray
Option
Url
Packages
Plugin
PluginArray
Popup
RangeError
ReferenceError
TypeError
StyleClass
StyleSelector
SyntaxError
TypeError
WScript
URIError
XMLHttpRequest
XMLSerializer
Attr
CDATASection
CharacterData
Comment
CSS2Properties
DOMException
DOMImplementation
DocumentType
Element
EntityReference
EvalError
NamedNodeMap
Node
NodeList
Notation
ProcessingInstruction
Text
HTMLElement
HTMLDocument
HTMLCollection
HTMLHtmlElement
HTMLHeadElement
HTMLLinkElement
HTMLTitleElement
HTMLMetaElement
HTMLBaseElement
HTMLIsIndexElement
HTMLStyleElement
HTMLBodyElement
HTMLFormElement
HTMLSelectElement
HTMLOptGroupElement
HTMLOptionElement
HTMLInputElement
HTMLTextAreaElement
HTMLButtonElement
HTMLLabelElement
HTMLFieldSetElement
HTMLLegendElement
HTMLUListElement
HTMLOListElement 
HTMLDListElement
HTMLDirectoryElement
HTMLMenuElement
HTMLLIElement
HTMLBlockquoteElement 
HTMLDivElement
HTMLParagraphElement
HTMLHeadingElement
HTMLQuoteElement
HTMLPreElement
HTMLBRElement
HTMLBaseFontElement 
HTMLFontElement
HTMLHRElement
HTMLModElement 
HTMLAnchorElement
HTMLImageElement
HTMLObjectElement
HTMLParamElement
HTMLAppletElement
HTMLMapElement
HTMLAreaElement
HTMLScriptElement
HTMLTableElement
HTMLTableCaptionElement
HTMLTableColElement
HTMLTableSectionElement
HTMLTableRowElement
HTMLTableCellElement
HTMLFrameSetElement
HTMLFrameElement
HTMLIFrameElement
_newEnum
alert
atob
attachEvent
back
btoa
clearTimeout
clearInterval
close
CollectGarbage
confirm
createEventObject 
createPopup
decodeURI
decodeURIComponent
detachEvent
dump
encodeURI
encodeURIComponent
escape
eval
execScript
find
frameElement
getClass
getComputedStyle
getResource
GetObject
home
isFinite
isNaN
moveBy
moveTo
open
openDialog
parseInt
parseFloat
print
prompt
resizeBy
resizeTo
ScriptEngine
ScriptEngineMajorVersion
ScriptEngineMinorVersion
ScriptEngineBuildVersion    
scroll
scrollBy
scrollIntoView
scrollTo
setCursor
setInterval
setTimeout
showHelp
showModalDialog
showModelessDialog
sizeToContent
taint
toString
unescape
untaint
valueOf
_content
appCore
arguments
arity
callee
caller
clientInformation
clipboardData
closed
constructor
controllers
crypto
debug
defaultStatus
directories
document
element
event
external
history
forward
frames
Infinity
innerHeight
innerWidth
java
length
loading
location
locationbar
name
menubar
navigator
netscape
offscreenBuffering
opener
opera
outerHeight
outerWidth
pageXOffset
pageYOffset
parent
personalbar
pkcs11
prompter
prototype
returnValue
screen
screenLeft
screenTop
screenX
screenY
scrollX
scrollY
scrollbars
self
sidebar
status
statusbar
style
sun
title
toolbar
top
window
onafterprint
onbeforeprint
onbeforeunload
onblur
onerror
onfocus
onhelp
onload
onresize
onscroll
onunload
onmousedown
onmouseup
onclick
onmouseover
onmouseout
onkeydown
onkeyup
onkeypress
onmousemove
onsubmit
onreset
onchange
onselect
onclose
onabort
onerror
onpaint
ondragdrop
Soya
BOOTSTRAP
</resource>

<resource id="core.map">

abstract
break
continue
const
class
catch
case
debugger
default
double
delete
do
extends
else
function
finally
float
false
for
get
instanceof
implements
import
int
in
if
long
null
new
protected
private
package
public
return
switch
static
super
set
typeof
throw
true
this
try
void
var
while
with
getter
setter
__defineGetter__
__defineSetter__
end
elif 
cc_on 
_win32
_win16
_mac
_alpha
_x86
_mc680x0
_PowerPC
_jscript
_jscript_build
_jscript_version
Array
Boolean
Date
Enumerator
Error
Function
Math
Number
Object
RegExp
String
VBArray

</resource>

<script language="JScript">
//<![CDATA[
/*** Pod {ESCtool} (Soya/1.0.0-b5; crlvl:2/1; Fri, 25 Jan 2002 10:03:44 UTC) ***/
/**
To prove that ESC actually can handle name-mangling and as a general self-sanity check,
 ESC has been used to compress itself along with other required Soya-beans during bundling.
 If you want to examine these beans in a more human readable state
 you need to get the latest distribution of the Soya API.
**/
/* <POD>  */
function Soya_API($o)
{
this.name='Soya';
this.version='1.0.0-b5';
this.type='static';
this.debug=0;
this.host=$o;
this.libPath='/lib-soya/';
this.podPath='pods';
this.resourcePath='resources';
this.altDowngrade=$a;
this.attachBean=$b;
this.declareBean=$z;
this.registerBean=$d;
this.BeanPrototype=Soya_BeanPrototype;
this.beans=new Object();
this.beans.all=new Array();
Soya_Loader.prototype=new this.BeanPrototype();
this.Loader=new Soya_Loader(this);
this.declareBean('Soya.BeanPrototype',null,this.name,false,true);
}
function Soya_VirtualBean(){}
function Soya_BeanPrototype(){}
function $a($p){
if($p&&!this.Loader.fso&&!this.Loader.gzip&&!navigator.platform)
(document.images)?self.location.replace($p):self.location.href=$p;
}
function $b($q){
if(!$q.virtual){
eval($q.mutexName).prototype=$q;
eval($q.name+'='+(!$q.constructable?'new ':' ')+
$q.mutexName+(!$q.constructable?'()':''));
}
else eval($q.name+'=this.beans["'+$q.name+'"]');
$q.complete=true;
if(this.Loader.callbacks[$q.name])
this.Loader.callbacks[$q.name](eval($q.name));
}
function $z($r,$s,$t,$u,$v){
var $w=new($s?this.BeanPrototype:Soya_VirtualBean)();
$w.iid=0;
$w.stack=[];
$w.complete=Boolean($v);
$w.constructable=($s&&!$u);
$w.name=$r;
$w.mutexName=$s||'Soya_VirtualBean';
$w.parentName=$t;
$w.virtual=!$s;
return(this.beans[$r]=this.beans.all[this.beans.all.length]=$w);
}
function $d($r,$u,$x,i){
var $y;
var $z=$r.split('\x2e');
var $s=$z.join('\x5f');
if(!this.beans[$r]){
if($x){
var $A='';
$y=$z[0];
for(i=1;i<$z.length-1;i++){
$A+=$y;
$y+=('\x2e'+$z[i]);
if(i<=$x&&!this.beans[$y])
this.attachBean(this.declareBean($y,null,$A,true,true));
}
}
$z.length-=$x?$x:1;
$y=$z.join('\x2e');
this.declareBean($r,$s,$y,$u);
if($z.length>1&&!this.beans[$y])
this.Loader.orphans[this.Loader.orphans.length]=this.beans[$r];
else{
this.attachBean(this.beans[$r]);
var $B=new Array();
for(i=0;i<this.Loader.orphans.length;i++)
if(this.Loader.orphans[i].parentName==$r)
this.attachBean(this.Loader.orphans[i]);
else $B[$B.length]=this.Loader.orphans[i];
this.Loader.orphans=$B;
}
}
return Boolean(i)
}
function $e($Z){
this.iid=-1;
this.getResourcePath=Function('sName',
"return(Soya.libPath + Soya.resourcePath + '/' + (sName||this.name).split('.').join('/') + '/')");
this.getClass=Function('sName','return eval(Soya.beans[sName || this.name].mutexName)');
this.toString=Function("return('[object ' + (this.name || 'unknown') + ']')");
this.getBeanPath=Function('sName',
"return(Soya.libPath + (sName||this.name).split('.').join('/') + '.js')");
if(!$Z){
this.finalize=$g;
this.initialize=$f;
}
}
function $f($D){
if(this.stackable)
this.stack[this.iid]=this;
this.getClass().prototype.iid++;
if(!Soya.beans[this.name].initialized){
$D=$D||
Soya.host[Soya.beans[this.name].mutexName+'_initialize'];
if(typeof($D)=='function')
Soya.beans[this.name].initialized=!$D(this.getClass(),this);
}
}
function $g($E){
$E=$E||
Soya.host[Soya.beans[this.name].mutexName+'_finalize'];
if(typeof($E)=='function')
$E(this.getClass(),this);
}
function Soya_Loader($F){
this.name='Soya.Loader';
this.type='static';
var $G=Boolean($F.host.location);
var $H=($G&&location.protocol.indexOf('http')>-1);
this.zipExt='.zip';
this.gzipExt='.jsgz';
this.negotiate=true;
this.orphans=new Array();
this.callbacks=new Object();
this.fso=$G?null:new ActiveXObject('Scripting.FilesystemObject');
this.zip=($G&&$H)?(typeof(self.loading)=='boolean'&&navigator.javaEnabled()):0;
this.gzip=($G&&$H)?((document.all&&navigator.platform=='Win32')||self.opera||(self.pkcs11&&document.getElementById)):0;
this.$R=$i;
this.isAbsPath=$h;
this.$S=$G?$I:$n;
this.$T=$F.host.$U;
this.loadBean=
this.loadScript=$j;
this.loadPod=$m;
this.loadBeanByName=$k;
this.loadPodByName=$l;
$F.declareBean(this.name,null,$F.name,true,true);
}
function $h($J){
return($J.charAt(0)=='/'||$J.indexOf('./')==0||
$J.charAt(1)==':'||$J.indexOf('http')==0);
}
function $i(){
return((this.negotiate&&(this.zip||this.gzip))?
(this.gzip?this.gzipExt:this.zipExt):'.js')
}
function $j($K){
var $J=this.isAbsPath($K)?'':Soya.libPath;
return this.$S($J+$K);
}
function $k($r,$L){
if(!Soya.beans[$r]){
this.callbacks[$r]=$L;
return this.$S(Soya.getBeanPath($r));
}
return '';
}
function $l($M,$N){
return this.loadPod($M.split('.').join('/')+
'\/'+$M.substr($M.lastIndexOf('.')+1),$N);
}
function $m($K,$N){
return this.$S(
(this.isAbsPath($K)?'':Soya.libPath+Soya.podPath+'\/')+
$K+($N?('.'+$N):this.$R()),!$N);
}
function $n($J,$O){
if(this.fso.FileExists($J)){
var $q=this.fso.GetFile($J),
$P=this.fso.OpenTextFile($q.Path),
$Q=$P.Read($q.Size);
$P.Close();
return $Q;
}
else if(!$O)
return(WScript.Echo(this.name+' '+Soya.version+'> File Not found: '+$J),WScript.Quit(99));
else return '';
}
Soya_BeanPrototype.prototype=new $e(0);
Soya_VirtualBean.prototype=new $e(1);
Soya_API.prototype=new $e(1);
var Soya=new Soya_API(this);
if(typeof(BOOTSTRAP)=='function')BOOTSTRAP(Soya);
function Soya_WSH_Arguments(){
this.name='Soya.WSH.Arguments';
this.type='static';
this.version='0.90';
this.dependencies=[];
this.arguments={length:0};
this.getArguments=$V;
this.getArgument=function($X){return(this.arguments[$X]||"")}
this.$02=$W;
}
function $V(){
if(!this.arguments.length&&WScript.Arguments.length){
var i,$Y,$Z=[],$00=new RegExp('^-+');
for(i=0;i<WScript.Arguments.length;i++)
$Z[$Z.length]=WScript.Arguments.item(i);
for(i=0;i<$Z.length;i++){
$Y=$Z[i].replace($00,'-');
if($Y.length>1&&$00.test($Y)){
if(typeof $Z[i+1]!='undefined'&&!$00.test($Z[i+1]))
this.arguments[this.$02($Y.replace($00,''))]=
this.$02($Z[1+(i++)]);
else this.arguments[this.$02($Y.replace($00,''))]=1;
};
else if($Y.length)
this.arguments[this.arguments.length++]=this.$02($Z[i]);
}
}
return this.arguments;
}
function $W($01){
return $01.length<2?$01:$01.replace(/^\\-/,'-').
replace(/\\{2}/g,'\\');
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.WSH.Arguments',true,1);
function Soya_Saltstorm_ESC($0k,$0l,$0m,$O)
{
this.name='Soya.Saltstorm.ESC';
this.version='1.11';
this.type='constructor';
this.dependencies=['Soya.Common','Soya.ECMA.Array'];
this.resourcePath=$0m||'';
this.crunchLevel=$0k||2;
this.substitute=false;
this.verbose=$0l;
this.silent=($O||typeof window=='object');
this.initialize();
this.flush();
}
function Soya_Saltstorm_ESC_initialize($0n,$0o){
$0p=$0o;
var $0q="(?:\"{2}|'{2}|\".*?.\"|'.*?.'|\\/(?!\\*|\\/)..*?\\/)";
var $0r="[-!%&;<=>~:\\/\\^\\+\\|\\,\\(\\)\\*\\?\\[\\]\\{\\}]+";
var $0s="\\/\\*(?!@).(?:.|\\n)*?\\*\\/|\\/\\/.*";
var $0t="\".*?.\"|'.*?.'|\\s*\\/{2,}.*\\n";
var $0u="\\}[\\s\\n]*?([^;,e\\|\\.\\]\\)\\}])";
with($0n){
prototype.fileFilter=new RegExp('.+\\\\(?!$|_)\\w*\\.js$','i');
prototype.$1g=["0123456789abzdefghijklmnopqrstuvwxyzABZDEFGHIJKLMNOPQRSTUVWXYZ",9];
prototype.$1h={};
prototype.fso=Soya.Loader.fso||new ActiveXObject('Scripting.FilesystemObject');
prototype.core={};
prototype.bless={};
prototype.mangle={};
prototype.common={};
prototype.$1i=$n;
prototype.crunch=$0i;
prototype.flush=function(){this.buffer='';this.report=new $04()};
prototype.getSubstitute=$08;
prototype.loadMaps=$05;
prototype.out=$03;
prototype.load=$06;
prototype.save=$07;
prototype.getReport=$0j;
prototype.$1j=new RegExp("[$_]");
prototype.$1k=new RegExp("[^$\\w]","g");
prototype.$1l=new RegExp("^[\\x00\\.\"']");
prototype.$1m=new RegExp("\\s+$");
prototype.$1n=new RegExp("^\\s*\\W");
prototype.$1o=new RegExp("^[-\\\\+\"~'!]");
prototype.$1p=new RegExp("("+$0q+")|("+$0s+")","g");
prototype.$1q=new RegExp("("+$0t+")","g");
prototype.$1r=new RegExp("("+$0q+")|(\\r?\\n\\s+)|(\\x20{2,})","g");
prototype.$1s=new RegExp("("+$0q+")|(\\w+)?[ \\t]+("+$0r+")","g");
prototype.$1t=new RegExp("("+$0q+")|("+$0r+")[ \\t]+","g");
prototype.$1u=new RegExp("("+$0q+")|function[\\n\\s]+([$\\w]+)","g");
prototype.$1v=new RegExp("("+$0q+")|("+$0s+")|(\\W[\\n\\s]*?[$\\w]+)\\b","gm");
prototype.$1w=new RegExp("("+$0q+")|(\\x00)|\\.[\\n\\s]*?([$_][$\\w]{3,})","g");
prototype.$1x=new RegExp("("+$0q+")|("+$0u+")","g");
}
if(!$0o.resourcePath)
$0o.resourcePath=$0o.fso.GetParentFolderName(WScript.ScriptFullName||'.');
$0o.loadMaps('core.map','common.map','bless.map','mangle.map');
}
function $03($0v,$0w){
if(!this.silent){
var $0x=String((!$0w?'ESC> ':'')+($0v||''));
WScript.Echo($0x);
}
}
function $04(){
this.scripts=[];
this.rawSize=
this.crunchedSize=
this.elapsedTime=0;
}
function $05(){
var $0y,$0z,$0A,$0B,$0Z;
for(var i=0;i<arguments.length;i++){
$0y=arguments[i].replace(/\W.+$/,'');
try{
$0A=getResource(arguments[i]).split(/\r?\n/g)||[];
for(var j=0;j<$0A.length;j++)
if($0A[j].length&&!$0p.$1n.test($0A[j]))
Soya_Saltstorm_ESC.prototype[$0y][$0A[j].replace($0p.$1m,'')]=1;
if(this.verbose)
this.out('Parsed map "'+$0y+'", '+$0A.length+' entries.')
}
catch($0D){
if($0D)
$0A=null;
}
if($0A)
continue;
else $0z=this.fso.BuildPath(this.resourcePath,arguments[i]);
if(/^common|core/.test(arguments[i])&&!this.fso.FileExists($0z)){
this.out('Couldn\'t $0E $0F:'+
this.fso.GetAbsolutePathName($0z));
return WScript.Quit(99);
}
else if(typeof this[$0y]!='object'){
this.out('Unrecognized mapname : '+$0y);
return WScript.Quit(99);
}
else if(this.fso.FileExists($0z)){
$0A=this.fso.OpenTextFile($0z);
$0Z=0;
while(!$0A.AtEndOfStream){
$0B=$0A.ReadLine();
if($0B.length&&!$0p.$1n.test($0B))
Soya_Saltstorm_ESC.prototype[$0y][$0B.replace($0p.$1m,'')]=++$0Z;
}
$0A.Close();
Soya_Saltstorm_ESC.prototype[$0y].length=$0Z;
if(this.verbose)
this.out('Loaded map "'+$0y+'", '+$0Z+' entries. ['+$0z+']');
}
}
}
function $06(){
var i,$0G,$0H,$0I,$0J=[];
for(i=0;i<arguments.length;i++){
if(arguments[i]&&this.fso.FolderExists(arguments[i])){
$0I=new Enumerator(this.fso.GetFolder(arguments[i]).SubFolders);
for(;!$0I.atEnd();$0I.moveNext())
arguments[arguments.length++]=$0I.item().Path;
$0I=new Enumerator(this.fso.GetFolder(arguments[i]).Files);
for(;!$0I.atEnd();$0I.moveNext())
if($0I.item().Size&&this.fileFilter.test($0I.item().Path))
$0J.push($0I.item().Path);
}
else if(arguments[i])
$0J.push(arguments[i]);
}
for(i=0;i<$0J.length;i++){
if(!this.fso.FileExists($0J[i])){
this.out('Couldn\'t $0E $0K:"' + this.fso.GetAbsolutePathName(aLoadQueue[i]) + '"');
return WScript.Quit(99);
}
else if(this.verbose)
this.out('Loading script :"'+this.fso.GetAbsolutePathName($0J[i])+'"');
$0H=this.fso.GetFile($0J[i]);
this.buffer+=(this.report.scripts.length?'\r\n':'');
this.buffer+=this.$1i($0H.Path,true);
this.report.scripts.push(
$0H.Path+' ('+($0H.Size/1024).toFixed(2)+' kb)');
}
return $0J.length;
}
function $07($0L,$0M){
var $0N;
if(!$0L){
this.out('Need an output filename!');
return WScript.Quit(99);
}
else if(this.fso.FolderExists($0L)){
this.out('Need an output filename, "'+
this.fso.GetAbsolutePathName($0L)+'" is a folder.');
return WScript.Quit(99);
}
this.outFile=this.fso.GetAbsolutePathName($0L);
this.outMode=$0M?'Writing':'Appending';
$0N=this.fso.OpenTextFile(this.outFile,($0M?2:8),true);
$0N.WriteLine(this.buffer);
$0N.Close();
}
function $08($0O){
if(!this.$1h[$0O]){
var k=1;
while(k<5){
this.$1g[k]++;
if(this.$1g[k]&&!(this.$1g[k]%62)){
k++;
if(this.$1g.length==k)
this.$1g[k]=-1;
}
else break;
}
this.$1h[$0O]='$';
for(k=this.$1g.length-1;k>0;k--)
this.$1h[$0O]+=this.$1g[0].charAt(this.$1g[k]%62);
if(this.verbose)
this.out('Substituting ['+this.$1h[$0O]+'] -> ['+$0O+']');
}
return this.$1h[$0O];
}
function $09($0P,$0Q,$0R){
if(typeof $0R!='undefined')
return '';
else return $0P;
}
function $0a($0P,$0S){
if(typeof $0S!='undefined'&&/^\s+/.test($0S))
return '\r\n';
else return $0P;
}
function $0b($0P,$0T,$0U){
if(typeof $0T!='undefined')
return $0P;
else if($0U&&$0U.length>2&&
($0p.mangle[$0U]||$0p.$1j.test($0U.charAt(0))))
$0U=$0p.getSubstitute($0U);
else Soya_Saltstorm_ESC.prototype.bless[$0U]=1;
return String('function \x00'+$0U);
}
function $0z($0P,$0T,$0V,$0W){
if(typeof $0T=='undefined'&&typeof $0V=='undefined'&&typeof $0W=='string'){
$0W=$0W.replace(/\s+/g,'');
if(!$0p.$1l.test($0W)&&isNaN(parseInt($0W.substr(1),10))){
$0W=$0W.replace($0p.$1k,'');
if($0W.length>2&&!$0p.core[$0W]&&!$0p.common[$0W]&&
!$0p.bless[$0W]&&($0p.mangle[$0W]||!$0p.mangle.length))
return $0P.replace($0W,$0p.getSubstitute($0W));
}
}
return $0P;
}
function $0d($0P,$0T,$0X,$0Y){
if(typeof $0Y=='string')
return(!$0p.core[$0Y]&&!$0p.common[$0Y]&&!$0p.bless[$0Y])?
String('.'+$0p.getSubstitute($0Y)):$0P;
else if(typeof $0T!='undefined')
return $0P;
else return '';
}
function $0e($0P,$0T,$0Z,$10,$11){
if(typeof $0T!='undefined')
return $0P;
else if(typeof $0Z!='undefined')
return '\r\n';
else if(typeof $10!='undefined')
return ' ';
else return '';
}
function $0f($0P,$0T,$12,$13){
if(typeof $0T=='undefined'){
if(!$0p.$1o.test($13)||!$12||!$0p.core[$12])
return($12||'')+$13;
else return $0P;
}
else return $0T;
}
function $0g($0P,$0T,$13){
if(typeof $0T!='undefined')
return $0P;
else return $13;
}
function $0h($0P,$0T,$14,$15){
if(typeof $0T!='undefined')
return $0P;
return('};'+$15);
}
function $0i($16,$0k,$17){
var $Q=(typeof $16=='string')?$16:this.buffer;
if(!this.buffer.length&&!$16)
return String();
else if(typeof $0k=='number')
this.crunchLevel=$0k;
var $18=(new Date()).getTime()-1;
var $19=$Q.length;
this.report.rawSize+=$Q.length;
if(this.crunchLevel>=1){
$Q=$Q.replace(this.$1p,$09)
.replace(this.$1q,$0a)
.replace(/\s+\r?\n/g,'\r\n')
if(this.verbose)
this.out('Removing comments, empty lines and trailing whitespace, saved '+
($19-$Q.length)+' bytes.');
$19=$Q.length;
}
if(this.crunchLevel>=2){
$Q=$Q.replace(this.$1r,$0e);
if(this.verbose)
this.out('Removing tabs and spaces, saved '+
($19-$Q.length)+' bytes.');
$19=$Q.length;
$Q=$Q.replace(this.$1s,$0f);
if(this.verbose)
this.out('Removing spaces left to operators, saved '+
($19-$Q.length)+' bytes.');
$19=$Q.length;
$Q=$Q.replace(this.$1t,$0g);
if(this.verbose)
this.out('Removing spaces right to operators, saved '+
($19-$Q.length)+' bytes.');
$19=$Q.length;
}
if(this.substitute||$17||this.crunchLevel>=4){
$Q=$Q.replace(this.$1u,$0b);
$Q=$Q.replace(this.$1v,$0z);
$Q=$Q.replace(this.$1w,$0d);
if(this.verbose)
this.out('Substitution summary, saved '+
($19-$Q.length)+' bytes.');
$19=$Q.length;
}
if(this.crunchLevel>=3){
$Q=$Q.replace(/\r?\n/g,'')
.replace(this.$1x,$0h)
$Q+='\r\n';
if(this.verbose){
this.out('Removing newlines, saved '+
($19-$Q.length)+' bytes.');
this.out('',1);
}
}
if(typeof $16=='string'){
this.report.crunchedSize+=$Q.length;
this.buffer+=$Q;
}
else{
this.buffer=$Q;
this.report.crunchedSize=$Q.length;
}
this.report.elapsedTime+=(new Date()).getTime()-$18;
return this.buffer;
}
function $0j($1a){
var $1b=($1a||'\r\n'),
$1z=this.label?String($1b+this.label+$1b):'';
if(!this.report.elapsedTime){
$1z+='Nothing to report, yet...';
return(!$1d)?this.out($1z,1):$1z;
}
var $1e=Boolean(this.substitute||this.crunchLevel>=4),
$1f=this.report.rawSize-this.report.crunchedSize;
if(this.report.scripts.length){
$1z+="-----------------------------------------------------------------------------"+$1b;
$1z+=" Crunching script(s):\r\n\t * "+this.report.scripts.join("\r\n\t * ")+$1b;
$1z+="-----------------------------------------------------------------------------"+$1b;
$1z+=" "+(this.outMode||"Put")+" to : "+(this.outFile||"[buffer]")+" ("+
(this.report.crunchedSize/1024).toFixed(2)+" kb)"+$1b;
}
$1z+="-----------------------------------------------------------------------------"+$1b;
$1z+=" Processtime     :\t"+(this.report.elapsedTime/1000).toFixed(3)+" secs"+$1b;
$1z+=" Crunch-level    :\t"+this.crunchLevel+$1b;
$1z+=" Subst. engine   :\t"+($1e?'On':'Off')+$1b;
if($1e)
$1z+=" Substitutions   :\t"+(this.$1g[1]-9)+$1b;
$1z+=" Original size   :\t"+(this.report.rawSize/1024).toFixed(2)+" kb"+$1b;
$1z+=" Crunched size   :\t"+(this.report.crunchedSize/1024).toFixed(2)+" kb"+$1b;
$1z+=" Saving ratio    :\t"+($1f/1024).toFixed(2)+" kb"+$1b;
$1z+="   -'' ''-   (%) :\t"+(($1f/this.report.rawSize)*100).toFixed(2)+" %"+$1b;
$1z+="-----------------------------------------------------------------------------"+$1b;
return $1z;
}
if(typeof(Soya)=='object')Soya.registerBean('Soya.Saltstorm.ESC',false,1);

/* </POD> */

//]]>
</script>
<script language="JScript">
//<![CDATA[
	/*
	Command flow control script for ESC.wsf
	Edited : 23:25 2001-06-14
	*/

	var oShell = WScript.CreateObject('WScript.Shell');

	if(!oShell)
	  WScript.Quit(64);

	// Do we have Jscript 5.5+ ?
	else if(oShell && parseFloat(ScriptEngineMajorVersion() + '.' + ScriptEngineMinorVersion()) < 5.5)
	  oShell.Popup(getResource('jscript'), 64, WScript.ScriptName, 16), WScript.Quit(4);
	
	// Is ESC executed under cscript ?
	// if not let user select switching to cscript automagically.
	else if(oShell && WScript.FullName.toLowerCase().indexOf('cscript') < 0){
	  if(oShell.Popup(getResource('wscript'), 64, WScript.ScriptName, 52) == 6)
	    oShell.Run('%comspec% /Q /K cscript //NoLogo ' + WScript.ScriptName + ' -a', 9);
	  WScript.Quit(3);
	  }

	// get the cmdline arguments formatted in a nice manner.
	var oArgs = Soya.WSH.Arguments.getArguments();

	// should we run in verbose-mode ?;
	var bVerbose = Boolean(!oArgs.s && !oArgs.silent && (oArgs.v || oArgs.verbose));

	// create an instance of the ESC object.
	var esc = new Soya.Saltstorm.ESC(oArgs.l || oArgs.level, bVerbose);
	esc.label = 'ESC (ECMAScript Cruncher) ' + esc.version +
			 '\r\nCopyright (C) 2001,2002 Thomas Loo - Saltstorm <esc@saltstorm.net>';

	var sOutput = String(oArgs.oa || oArgs.ow || '');

	if(oArgs.a || oArgs.about){
	  WScript.Echo(getResource('about'));
	  WScript.Quit(1);
	  }
	else if(oArgs.c || oArgs.copyright){
	  WScript.Echo('\n' + esc.label + getResource('copyright'));
	  WScript.Quit(1);
	  }
	else if(oArgs.e || oArgs.example){
	  WScript.Echo('\n' + esc.label + getResource('example'));
	  WScript.Quit(1);
	  }

	// if there are options missing, print out the help table and quit.
	else if((oArgs.h || oArgs.help) || !sOutput.length || !oArgs[0]){
	  WScript.Echo('\n' + esc.label + getResource('usage'));
	  WScript.Quit((oArgs.h || oArgs.help) ? 1 : 2);
	  }
	
	// Wake up the variable substitution engine if option set (-$);
	esc.substitute = Boolean(oArgs.$);

	// load input files;
	for(var i = 0; i < oArgs.length; i++)
	  esc.load(oArgs[i]);

	// crunch baby, crunch!;
	if(sOutput.toUpperCase() == 'STDOUT'){
	  esc.silent = true;
	  WScript.StdOut.Write(esc.crunch());
	  }
	else if(sOutput.length){
	  esc.crunch();
	  esc.save(sOutput, Boolean(oArgs.ow));
	  // write report to stdout if not silence'd.
	  if(!oArgs.s && !oArgs.silent)
	    WScript.StdOut.Write(esc.getReport());
	  }
	
	// Shutting down nicely..
	WScript.Quit(0);

//]]>
</script>
</job>
</package>
