  function wwOnError () {
    return true;
  }
  onerror = wwOnError;
var wwLastErrorReason   = "";
var wwMaxEvalCodeLen    = 128;
var wwMaxTimeoutCodeLen = 256;
var sPotentiallyHostileIdentifications   = new Array (
"execScript", ".execCommand",
"setInterval", "showModalDialog", "showModelessDialog", "showHelp",
".CreateTextFile", ".DeleteFile", ".GetSpecialFolder", ".Run",
".RegRead", ".RegWrite",
".Recipients", ".Attachments", ".AddressEntries"
);
var sPotentiallyHostileIdentificationsLC = new Array (	"mhtml:file://" );
function IsHostileMarkupCode (str)
{
var i;
var p;
for (i = 0; i < sPotentiallyHostileIdentifications.length; ++i) {
p = str.indexOf (sPotentiallyHostileIdentifications[i]);
if (p != -1) {
var isValid = true;
if ((p > 0) && (str[p] != ".")) {
var ch = str.charCodeAt (p - 1);
if (((ch >= 65) && (ch <= 90)) || ((ch >= 97) && (ch <= 122))) {
isValid = false;
} else {
var pE = p + sPotentiallyHostileIdentifications[i].length;
if (pE < str.length) {
ch = str.charCodeAt (pE);
if (((ch >= 65) && (ch <= 90)) || ((ch >= 97) && (ch <= 122))) {
isValid = false;
}
}
}
}
if (isValid) {
wwLastErrorReason = sPotentiallyHostileIdentifications[i];
return true;
}
}
}
var strLC = str.toLowerCase();
for (i = 0; i < sPotentiallyHostileIdentificationsLC.length; ++i) {
if (strLC.indexOf (sPotentiallyHostileIdentificationsLC[i]) != -1) {
wwLastErrorReason = sPotentiallyHostileIdentificationsLC[i];
return true;
}
}
i = 0;
do {
i = strLC.indexOf (".location", i);
if (i != -1) {
var p;
i += 10;
p = strLC.indexOf ("javascript:", i);
if (p == -1) {
p = strLC.indexOf ("<script", i);
}
if (p == -1) {
p = strLC.indexOf ("file://", i);
}
if (p == -1) {
p = strLC.indexOf ("res://", i);
}
if (p == -1) {
p = strLC.indexOf ("c:/", i);
}
if (p == -1) {
p = strLC.indexOf ("c:\\", i);
}
if (p != -1) {
if ((p - i) <= 15) {
wwLastErrorReason = "location";
return true;
}
}
}
} while (i != -1);
if (str.length > 256) {
var chThis;
var chPrev  = str.charCodeAt (0);
var stepCnt = 16;
var repCnt  = 0;
for (i = stepCnt; i < str.length; i += stepCnt) {
chThis = str.charCodeAt (i);
if (chThis == chPrev) {
++repCnt;
if (stepCnt > 1) {
stepCnt = 1;
}
if (repCnt > 150) {
wwLastErrorReason = "potBufOverflow";
return true;
}
} else if (repCnt > 0) {
repCnt  = 0;
stepCnt = 16;
}
chPrev = chThis;
}
var baseOffs   = 16;
var patBegin   = baseOffs;
var patEnd     = 0;
var patBeginCh = str.charCodeAt (patBegin);
for (i = baseOffs + 1; i < str.length; i++) {
chThis = str.charCodeAt (i);
if (chThis == patBeginCh) {
patEnd = i;
break;
} else if ((i - baseOffs) > 40) {
break;
}
}
if (patEnd > patBegin) {
var patLen = (patEnd - patBegin);
if (patLen > 1) {
var patStr = str.substr (patBegin, patLen);
var patOccurences = 0;
for (var b = baseOffs; b < str.length; b += patLen) {
var patOccurs = true;
for (var i = 0; i < patLen; i++) {
if (str.charCodeAt (b + i) != patStr.charCodeAt (i)) {
patOccurs = false;
break;
}
}
if (patOccurs) {
++patOccurences;
if (patOccurences > 80) {
wwLastErrorReason = "potBufOverflow";
return true;
}
}
}
}
}
}
return false;
}
function BlockScript (categories, callerId)
{
if ( false ) {
var proto = "http";
if (top.location.protocol.toLowerCase().indexOf ("https") == 0) {
proto = "https";
}
if ((wwLastErrorReason.indexOf ("&") != -1) ||
(wwLastErrorReason.indexOf ("=") != -1) ||
(wwLastErrorReason.indexOf (">") != -1)) {
wwLastErrorReason = "tampered";
}
if (wwLastErrorReason.length > 64) {
wwLastErrorReason = wwLastErrorReason.substr (0, 64);
} else if (wwLastErrorReason.length == 0) {
wwLastErrorReason = "n/a";
}
if (encodeURIComponent) {
wwLastErrorReason = encodeURIComponent (wwLastErrorReason);
} else {
wwLastErrorReason = escape (wwLastErrorReason);
}
top.location.href = proto + "://-web.washer-/proactive?block&pfc=y6l7l6lnU3UtFXSM2p/%2B8l6hTy/fhpnL&ruc=UtaQD7wZdnV4pU4wPrJsTfbWvBc9TCDSSINbnY/Y3IRJHmHw91Ok6kIyvWttnVl2WBmEg3ohego=&cats=" + (categories) + "&cid=" + (callerId) + "&ler=" + (wwLastErrorReason);
if (document.all) {
var s, f;
for (s = 0; s < top.document.scripts.length; s++) {
if (top.document.scripts(s).text.indexOf ("wwOnError") == -1) {
top.document.scripts(s).text = "";
}
}
for (f = 0; f < top.frames.length; f++) {
for (s = 0; s < top.frames(f).document.scripts.length; s++) {
if (top.frames(f).document.scripts(s).text.indexOf ("wwOnError") == -1) {
top.frames(f).document.scripts(s).text = "";
}
}
}
}
}

wwLastErrorReason = "";
if (document.all == null) {
throw "Script execution blocked by Webwasher Proactive Scanning";
}
}
var wwWriteCache = "";
function IsHostileMarkupCodeInCache (object, markup)
{
if (markup.length > 2048) {
wwWriteCache = "";
} else if (wwWriteCache.length > 2048) {
wwWriteCache = wwWriteCache.substr (wwWriteCache.length - 2048, 2048);
}
wwWriteCache += markup;
return IsHostileMarkupCode (wwWriteCache);
}
function InjectHooks (str)
{
if (typeof str == "string") {
str = str.replace (/document\.writeln/g,	"wwDocumentWriteln");
str = str.replace (/document\.write/g,		"wwDocumentWrite");
str = str.replace (/execScript/g,			"wwExecScript");
str = str.replace (/execCommand/g,			"wwExecCommand");
str = str.replace (/setTimeout/g,			"wwSetTimeout");
str = str.replace (/setInterval/g,			"wwSetInterval");
str = str.replace (/eval/g,					"wwEval");
str = str.replace (/ActiveXObject/g,		"wwActiveXObject");
}
return str;
}
var wwInIFRAMESection = false;
function RemoveIFRAMEs (markup)
{
if ( true ) {
var markupLC = markup.toLowerCase();
var i, j;
if (!wwInIFRAMESection) {
i = markupLC.indexOf ("<iframe");
if (i != -1) {
var removeThisIFRAME = true;
if ( false ) {
var n, m;
var singleQuotedURL = false;
n = markupLC.indexOf ("src=\"", i + 7);
if (n == -1) {
n = markupLC.indexOf ("src='", i + 7);
if (n != -1) {
singleQuotedURL = true;
}
}
if (n != -1) {
m = markupLC.indexOf (">", i + 7);
if ((m != -1) && (n < m)) {
if (singleQuotedURL) {
m = markupLC.indexOf ("'", n + 5);
} else {
m = markupLC.indexOf ("\"", n + 5);
}
if (m != -1) {
var iframeUrl = markup.substring (n + 5, m);
if (iframeUrl.length >= 5) {
if ( iframeUrl.match (/^http.?\:\/\/\w+\.\w+\.\w+\/.*/) ||
iframeUrl.match (/^\/.+/) ||
iframeUrl.match (/\D\w+\.\D?htm.?$/i) ) {
removeThisIFRAME = false;
}
}
}
} else if (m == -1) {
var iframeUrl = markup.substring (n + 5, markup.length);
if (iframeUrl.length >= 5) {
if ( iframeUrl.match (/^http.?\:\/\/\w+\.\w+\.\w+\/.*/) ) {
removeThisIFRAME = false;
}
}
}
}
}
if (removeThisIFRAME) {
j = markupLC.indexOf ("</iframe", i + 8);
if (j != -1) {
markup = markup.substring (0, i) + markup.substring (j + 9, markup.length);
} else {
markup = markup.substring (0, i);
wwInIFRAMESection = true;
}
}
}
} else {
i = markupLC.indexOf ("</iframe");
if (i != -1) {
markup = markup.substring (i + 9, markup.length);
wwInIFRAMESection = false;
} else {
markup = "";
}
}
}
return markup;
}
function wwWrite (object, markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (object, markup)) {
BlockScript (512 /*Vulnerable*/, 1000);
return;
}
object.write (InjectHooks (RemoveIFRAMEs (markup)));
}
function wwWriteln (object, markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (object, markup)) {
BlockScript (512 /*Vulnerable*/, 1001);
return;
}
object.writeln (InjectHooks (RemoveIFRAMEs (markup)));
}
function wwDocumentWrite (markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (document, markup)) {
BlockScript (512 /*Vulnerable*/, 1002);
return;
}
document.write (InjectHooks (RemoveIFRAMEs (markup)));
}
function wwDocumentWriteln (markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (document, markup)) {
BlockScript (512 /*Vulnerable*/, 1003);
return;
}
document.writeln (InjectHooks (RemoveIFRAMEs (markup)));
}
function GetCategoryIfWellknownHostileActiveX (progID)
{
var str = progID.toLowerCase();
if (str == "scripting.filesystemobject") {
return 3;    /*FileRead | FileWrite*/
} else if (str == "scripting.encoder") {
return 512;  /*Vulnerable*/
} else if (str.indexOf ("wscript.shell") == 0) {
return 15;   /*FileRead | FileWrite | RegistryRead | RegistryWrite*/
} else if (str.indexOf ("wscript.network") == 0) {
return 16;   /*Network*/
} else if (str.indexOf ("outlook.application") == 0) {
return 528;  /*Vulnerable | Network*/
} else if (str.indexOf ("adodb.") == 0) {
return 512;  /*Vulnerable*/
}
return 0;
}
var sAllowedActiveXCtls = new Array (  );
function wwActiveXObject (progID)
{
var cat = GetCategoryIfWellknownHostileActiveX (progID);
if (cat != 0) {
wwLastErrorReason = progID;
BlockScript (cat, 2000);
return null;
}
if ( true ) {
return new ActiveXObject (progID);
}
var i;
for (i = 0; i < sAllowedActiveXCtls.length; ++i) {
if (progID.match (sAllowedActiveXCtls[i])) {
return new ActiveXObject (progID);
}
}
return null;
}
function wwGetEntropy (str)
{
var s = new Array (0x100);
var e = 0;
var n = str.length;
var p;
var ch;
var i;
for (i = 0; i < s.length; i++) {
s[i] = 0;
}
for (i = 0; i < n; i++) {
ch = str.charCodeAt (i);
if (ch < 0x100) {
s[ch] += 1;
}
}
for (i = 0; i < s.length; i++) {
if (s[i] == 0) {
p = 0;
} else if (s[i] == n) {
p = 1;
} else {
p = (s[i] / n);
}
if (p > 0) {
e = e + (p * Math.log (p));
}
}
return (e * -1);
}
function wwFilterCode (scriptCode)
{
if (typeof scriptCode == "string") {
if (scriptCode.length > wwMaxEvalCodeLen) {
var e = wwGetEntropy (scriptCode);
if ((e >= 3) && (e <= 3.75)) {
} else {
wwLastErrorReason = "length " + (scriptCode.length);
BlockScript (512 /*Vulnerable*/, 3000);
return "";
}
}
if (IsHostileMarkupCode (scriptCode)) {
BlockScript (512 /*Vulnerable*/, 3001);
return "";
}
}
return InjectHooks (scriptCode);
}
function wwExecCommand (object, cmd, /*OPTIONAL*/ withUI, /*OPTIONAL*/ value)
{
if ((cmd.length > wwMaxEvalCodeLen) || (value.length > wwMaxEvalCodeLen)) {
wwLastErrorReason = "length " + (cmd.length) + " or " + (value.length);
BlockScript (512 /*Vulnerable*/, 3020);
return;
}
if (IsHostileMarkupCode (cmd) || IsHostileMarkupCode (value)) {
BlockScript (512 /*Vulnerable*/, 3021);
return false;
}
return object.execCommand (InjectHooks (cmd), withUI, InjectHooks (value));
}
function wwSetTimeout (code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3030);
return;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3031);
return;
}
}
return setTimeout (InjectHooks (code), msec, language);
}
function ww2SetTimeout (object, code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3032);
return;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3033);
return;
}
}
return object.setTimeout (InjectHooks (code), msec, language);
}
function wwSetInterval (code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3040);
return 0;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3041);
return 0;
}
}
return setInterval (InjectHooks (code), msec, language);
}
function ww2SetInterval (object, code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3042);
return 0;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3043);
return 0;
}
}
return object.setInterval (InjectHooks (code), msec, language);
}
/*----------------------------------------------------------------------------\
|                                 Timer Class                                 |
|-----------------------------------------------------------------------------|
|                         Created by Erik Arvidsson                           |
|                  (http://webfx.eae.net/contact.html#erik)                   |
|                      For WebFX (http://webfx.eae.net/)                      |
|-----------------------------------------------------------------------------|
| Object Oriented Encapsulation  of setTimeout  fires ontimer when the  timer |
| is triggered. Does not work in IE 5.00                                      |
|-----------------------------------------------------------------------------|
|                   Copyright (c) 2002, 2006 Erik Arvidsson                   |
|-----------------------------------------------------------------------------|
| Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| use this file except in compliance with the License.  You may obtain a copy |
| of the License at http://www.apache.org/licenses/LICENSE-2.0                |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| Unless  required  by  applicable law or  agreed  to  in  writing,  software |
| distributed under the License is distributed on an  "AS IS" BASIS,  WITHOUT |
| WARRANTIES OR  CONDITIONS OF ANY KIND,  either express or implied.  See the |
| License  for the  specific language  governing permissions  and limitations |
| under the License.                                                          |
|-----------------------------------------------------------------------------|
| 2002-10-14 | Original version released                                      |
| 2006-05-28 | Changed license to Apache Software License 2.0.                |
|-----------------------------------------------------------------------------|
| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 |
\----------------------------------------------------------------------------*/

function Timer(nPauseTime) {
	this._pauseTime = typeof nPauseTime == "undefined" ? 1000 : nPauseTime;
	this._timer = null;
	this._isStarted = false;
}

Timer.prototype.start = function () {
	if (this.isStarted())
		this.stop();
	var oThis = this;
	this._timer = ww2SetTimeout(window, function () {
		if (typeof oThis.ontimer == "function")
			oThis.ontimer();
	}, this._pauseTime);
	this._isStarted = false;
};

Timer.prototype.stop = function () {
	if (this._timer != null)
		window.clearTimeout(this._timer);
	this._isStarted = false;
};

Timer.prototype.isStarted = function () {
	return this._isStarted;
};

Timer.prototype.getPauseTime = function () {
	return this._pauseTime;
};

Timer.prototype.setPauseTime = function (nPauseTime) {
	this._pauseTime = nPauseTime;
};