/* (c) 2000 - 2007 iControl, Inc., all rights reservered.  You may not use, copy or alter this file except in compliance with the License.  Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.  The Initial Developer of the Original Code is David Erickson.  Contributor(s):  David Erickson, iControl, Inc., Copyright 2000 - 2007 */  /* The contents of this file are subject to the Netscape Public License Version 1.1 (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.mozilla.org/NPL/  Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.  The Initial Developer of the Original Code is Bob Clary.  Contributor(s): Bob Clary, Original Work, Copyright 1999-2000  Bob Clary, Netscape Communications, Copyright 2001  Alternatively, the contents of this file may be used under the terms of the GNU Public License (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the NPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the GPL. */  window.saveNavigator = window.navigator;  function noop() {} function noerror() { return true; }  function defaultOnError(msg, url, line) {  if (top.location.href.indexOf('_files/errors/') == -1)  top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(msg) + '&url=' + escape(url) + '&line=' + escape(line); }; function reportError(message) {  if (top.location.href.indexOf('_files/errors/') == -1)  top.location = '/evangelism/xbProjects/_files/errors/index.html?msg=' + escape(message); }; function pageRequires(cond, msg, redirectTo) {  if (!cond)  {  msg = 'This page requires ' + msg;  top.location = redirectTo + '?msg=' + escape(msg);  }  return cond; }; function detectBrowser() {  var oldOnError = window.onerror;  var element = null;   window.onerror = defaultOnError;   navigator.OS = '';  navigator.version = 0;  navigator.org = '';  navigator.family = '';   var platform;  if (typeof(window.navigator.platform) != 'undefined')  {  platform = window.navigator.platform.toLowerCase();  if (platform.indexOf('win') != -1)  navigator.OS = 'win';  else if (platform.indexOf('mac') != -1)  navigator.OS = 'mac';  else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1)  navigator.OS = 'nix';  }   var i = 0;  var ua = window.navigator.userAgent.toLowerCase();   if (ua.indexOf('opera') != -1)  {  i = ua.indexOf('opera');  navigator.family = 'opera';  navigator.org = 'opera';  navigator.version = parseFloat('0' + ua.substr(i+6), 10);  }  else if ((i = ua.indexOf('msie')) != -1)  {  navigator.org = 'microsoft';  navigator.version = parseFloat('0' + ua.substr(i+5), 10);   if (navigator.version < 4)  navigator.family = 'ie3';  else  navigator.family = 'ie4'  }  else if (typeof(window.controllers) != 'undefined' && typeof(window.locationbar) != 'undefined')  {  i = ua.lastIndexOf('/');  navigator.version = parseFloat('0' + ua.substr(i+1), 10);  navigator.family = 'gecko';   if (ua.indexOf('netscape') != -1)  navigator.org = 'netscape';  else if (ua.indexOf('compuserve') != -1)  navigator.org = 'compuserve';  else  navigator.org = 'mozilla';  }  else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1))  {  var is_major = parseFloat(navigator.appVersion);   if (is_major < 4)  navigator.version = is_major;  else  {  i = ua.lastIndexOf('/');  navigator.version = parseFloat('0' + ua.substr(i+1), 10);  }  navigator.org = 'netscape';  navigator.family = 'nn' + parseInt(navigator.appVersion);  }  else if ((i = ua.indexOf('aol')) != -1 )  {  navigator.family = 'aol';  navigator.org = 'aol';  navigator.version = parseFloat('0' + ua.substr(i+4), 10);  }   navigator.DOMCORE1 = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined');  navigator.DOMCORE2 = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined' && typeof(document.createElementNS) != 'undefined');  navigator.DOMHTML = (navigator.DOMCORE1 && typeof(document.getElementById) != 'undefined');  navigator.DOMCSS1 = ( (navigator.family == 'gecko') || (navigator.family == 'ie4') );   navigator.DOMCSS2 = false;  if (navigator.DOMCORE1)  {  element = document.createElement('p');  navigator.DOMCSS2 = (typeof(element.style) == 'object');  }   navigator.DOMEVENTS = (typeof(document.createEvent) != 'undefined');   window.onerror = oldOnError; }; detectBrowser();    var ie = (navigator.family.search(/^ie/) > -1);    /* Event */  var eventTransform = []; eventTransform['mouseover'] = 'onmouseover'; eventTransform['mouseout'] = 'onmouseout'; eventTransform['change'] = 'onchange'; eventTransform['click'] = 'onclick'; eventTransform['dblclick'] = 'ondblclick'; eventTransform['focus'] = 'onfocus'; eventTransform['blur'] = 'onblur'; eventTransform['mousedown'] = 'onmousedown'; eventTransform['mouseup'] = 'onmouseup'; eventTransform['mousemove'] = 'onmousemove'; eventTransform['resize'] = 'onresize'; eventTransform['keydown'] = 'onkeydown'; eventTransform['keyup'] = 'onkeyup'; eventTransform['keypress'] = 'onkeypress'; eventTransform['load'] = 'onload'; eventTransform['unload'] = 'onunload'; eventTransform['error'] = 'onerror'; eventTransform['abort'] = 'onabort'; eventTransform['submit'] = 'onsubmit'; eventTransform['resize'] = 'onresize'; eventTransform['close'] = 'onclose';   function DomAddEventListener(element, eventName, eventFunction, eventBubble) {  if (ie) {  element.attachEvent(eventTransform[eventName], eventFunction)  } else {  element.addEventListener(eventName, eventFunction, eventBubble)  } };  function DomFireEvent(element, eventName, eventReference) {  if (ie) {  element.fireEvent(eventTransform[eventName])  } else {  var anEvent = document.createEvent(eventReference || "HTMLEvents");  anEvent.initEvent(eventName, false, false);  element.dispatchEvent(anEvent)  } };  function DomCancelEvent(theEvent) {  if (ie) {  theEvent.cancelBubble = true  } else {  theEvent.stopPropagation()  } };  function DomGetTarget(theEvent) {  return theEvent.target || theEvent.srcElement };  function DomGetLayerX(theEvent) {  return theEvent.layerX || theEvent.offsetX };  function DomGetLayerY(theEvent) {  return theEvent.layerY || theEvent.offsetY };  function DomGetPageX(theEvent) {  return theEvent.pageX || theEvent.clientX };  function DomGetPageY(theEvent) {  return theEvent.pageY || theEvent.clientY };   /* Window */   function DomGetWindowWidth() {  return ie ? window.document.body.clientWidth : window.innerWidth };  function DomGetWindowHeight() {  return ie ? window.document.body.clientHeight : window.innerHeight };  function DomGetWindowScrollX() {  return ie ? document.body.scrollLeft : window.pageXOffset };  function DomGetWindowScrollY() {  return ie ? document.body.scrollTop : window.pageYOffset };   /* Element Dimensions */   function DomGetElementWidth(element) {  return ie ? element.offsetWidth : element.clientWidth };  function DomGetElementHeight(element) {  return ie ? element.offsetHeight : element.clientHeight };  function DomGetElementLeft(element) {  var left = 0;  do {  if (element.tagName != 'TABLE') {  left += element.offsetLeft;  }  element = (element.offsetParent)  } while (element && (element.tagName != 'BODY'));  return left };  function DomGetElementTop(element) {  var top = 0;  do {  if (element.tagName != 'TABLE') {  top += element.offsetTop;  }  element = (element.offsetParent)  } while (element && (element.tagName != 'BODY'));  return top };  function DomGetElementPosition(element) {  var left = 0;  var top = 0;  do {  if (element.tagName != 'TABLE') {  left += element.offsetLeft;  top += element.offsetTop;  }  element = (element.offsetParent)  } while (element && (element.tagName != 'BODY'));  return [left, top] };   /* Model Hierarchy */   function DomGetModel(element, level) {  while (element && !element.model) {  element = element.parentNode || element.parentElement  }  for (level = level || 0; element && (level > 0); level--) {  element = element.model  }  return (element && element.model) ? element.model : null };     /* Storage Functions */   function Flatten(list) {  var template = [];  for (var index = 0; index < list.length; index++)  if (list[index] == null)  template[template.length] = '';  else switch (list[index].constructor) {  case null:  case Boolean:  case Number:  template[template.length] = list[index];  break;  case String:  template[template.length] = "'" + escape(list[index]) + "'";  break;  case Function:  template[template.length] = "'" + escape(list[index].toString()) + "'";  break;  case Array:  template[template.length] = Flatten(list[index]);  break;  default:  alert("Flatten encountered unknown constructor '" + list[index].constructor + "' for '" + list[index] + "'!")  }  return '[' + template.join(',') + ']' };  function UnescapeStrings(list) {  for (var index = 0; index < list.length; index++)  if (list[index] != null)  switch (list[index].constructor) {  case String:  list[index] = unescape(list[index]);  break;  case Array:  list[index] = UnescapeStrings(list[index]);  break  }  return list };  function Fluff(template) {  var list = [];  eval('list = ' + template);  return UnescapeStrings(list) };   /* Vector Handling */   function EnsureRecord(value) {  return ((value != undefined) && (value.constructor == Array)) ? value : [value] };  function ExtractRecord(value, index, alternate) {  return (((value != undefined) && (value.constructor == Array) && (value.length > index)) ? value[index] : alternate) };  function IsMember(value, group) {  group = EnsureRecord(group);  for (var index = 0; index < group.length; index++)  if (group[index] == value)  return true;  return false };  function CompareArrayValue(a, b) {  for (var index = 0; (index < a.length) && (index < b.length); index++)  if (a[index] == null)  return (b[index] == null) ? 0 : -1;  else if (b[index] == null)  return 1;  else if ((a[index].constructor == Array) && (b[index].constructor == Array)) {  var result = CompareArrayValue(a[index], b[index]);  if (result != 0)  return result  } else if (a[index] < b[index])  return -1;  else if (a[index] > b[index])  return 1;  return a.length - b.length };  function CloneArrayValue(template) {  var clone = [];  for (var index = 0; index < template.length; index++)  if (template[index] != null)  clone[index] = (template[index].constructor == Array) ?  CloneArrayValue(template[index]) : template[index];  return clone };   /* Hash Functions */   function PackHash(hash, setDelimiter, associationToken) {  var pairs = [];  if (setDelimiter == undefined)  setDelimiter = '&';  if (associationToken == undefined)  associationToken = '=';  for (var key in hash)  if (hash[key] != undefined)  pairs[pairs.length] = key + associationToken + escape(hash[key]);  return pairs.join(setDelimiter) };  function UnpackHash(hash, message, setDelimiter, associationToken) {  if (hash == undefined)  hash = [];  if (message == undefined)  message = '';  if (setDelimiter == undefined)  setDelimiter = '&';  if (associationToken == undefined)  associationToken = '=';  var parts = message.split(setDelimiter);  for (var index = 0; index < parts.length; index++) {  var pieces = parts[index].split(associationToken);  if (pieces.length > 1) {  var key = pieces.shift().replace(/\s+/g, '');  if (hash[key] == undefined) {  hash[key] = unescape(pieces.join(associationToken))  }  }  }  return hash };  function CopyHash(destination, source) {  for (var key in source) {  destination[key] = source[key]  } };   /* HTTP: Search */   function ParseURLQuery() {  return UnpackHash([], self.location.search.substring(1)) };   /* HTTP: Cookie */   function ReportClientTimeZone() {  var dateTime = new Date();  document.cookie = 'TimeZone=' + dateTime.getTimezoneOffset() + ';' };  function NumeralFormat(numeral, length) {  numeral = String(numeral);  return (numeral.length == 1) ? (0 + numeral) : numeral };  function MakeCookieDate(dateTime, dayOffset) {  var cookieDate = new Date();  cookieDate.setTime(dateTime.getTime() + (dayOffset || 0) * 24 * 3600 * 1000);  var weekday = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];  var month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];  return weekday[cookieDate.getDay()] + ', ' + NumeralFormat(cookieDate.getDate(), 2) + '-' + month[cookieDate.getMonth()] + '-' +  String(cookieDate.getFullYear()).substring(2, 4) + ' ' + NumeralFormat(cookieDate.getHours(), 2) + ':' +  NumeralFormat(cookieDate.getMinutes(), 2) + ':' + NumeralFormat(cookieDate.getSeconds(), 2) + ' GMT' };  function OLD_SetCookie(key, value, dayOffset) {  document.cookie = key + '=' + value + (dayOffset ? (';expires=' + MakeCookieDate(new Date(), dayOffset)) : '') + ';' }; function SetCookie(key, value, dayOffset) {  document.cookie = key + '=' + ';'; }; function GetCookie(key) {  var values = UnpackHash([], document.cookie, ';');  return values[key] };   /* String Value Conditioning */   function LinearDimension(size) {  return (String(size).search(/\%/) < 0) ? (Math.round(size) + "px") : size };  function LeadingValue(value) {  return (value < 10) ? ('0' + String(value)) : String(value); };   /* Date-Time Formatting */   function NowUTC() {  var now = new Date;  var result = now.getUTCFullYear() + '-' + NumeralFormat(now.getUTCMonth() + 1) + '-' + NumeralFormat(now.getUTCDate()) + ' ' +  NumeralFormat(now.getUTCHours()) + ':' + NumeralFormat(now.getUTCMinutes()) + ':' + NumeralFormat(now.getUTCSeconds());  return result; }; function NowLocal() {  var now = new Date;  var result = now.getFullYear() + '-' + NumeralFormat(now.getMonth() + 1) + '-' + NumeralFormat(now.getDate()) + ' ' +  NumeralFormat(now.getHours()) + ':' + NumeralFormat(now.getMinutes()) + ':' + NumeralFormat(now.getSeconds());  return result; };    function Subscription() {  this.subscribers = []; };  Subscription.prototype.subscribe = function(target, type, action) {  if (!this.subscribers[type]) {  this.subscribers[type] = [];  }  this.subscribers[type][this.subscribers[type].length] = [target, action]; };  Subscription.prototype.broadcast = function(type, parameters) {  var recipients = this.subscribers[type] || [];  for (var index = 0; index < recipients.length; index++) {  recipients[index][0].receive(recipients[index][1], parameters);  } };     function Panel(name, parameters) {  this.name = name;  this.id = 'Panel_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   var enclosureDocument = this.parameters.enclosure || document;  var enclosureElement = this.parameters.insertion || enclosureDocument.body;   this.divElement = enclosureDocument.createElement('DIV');  enclosureElement.appendChild(this.divElement);  this.divElement.style.position = 'absolute';  this.divElement.style.display = 'none';   this.tableElement = enclosureDocument.createElement('TABLE');  this.divElement.appendChild(this.tableElement);  DomAddEventListener(this.tableElement, 'mouseover', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.tableElement, 'mouseout', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.tableBodyElement = enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   this.rowElement = enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);   this.contentElement = enclosureDocument.createElement('TD');  this.rowElement.appendChild(this.contentElement);  this.contentElement.model = this;   this.tableElement.className = 'panel_opacity_50';  this.tableElement.style.border = 'outset';  this.tableElement.style.width = LinearDimension(1);  this.divElement.style.zIndex = 100;   this.blurClass = this.tableElement.className;  this.focusClass = 'panel_opacity_100';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.inplace = (this.parameters.position == 'relative');  this.sticky = this.parameters.sticky || this.inplace;  this.divElement.model = this;   this.position(0, 0) };   /* Construction */   Panel.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.tableElement.className = this.blurClass = value;  break;  case 'width':  case 'height':  this.tableElement.style[property] = LinearDimension(value);  break;  case 'position':  case 'left':  case 'top':  case 'zIndex':  this.divElement.style[property] = value;  break;  case 'sticky':  break;  case 'hoverClass':  this.focusClass = value;  break;  case 'html':  this.contentElement.innerHTML = value;  break;  case 'content':  while (this.contentElement.firstChild) {  this.contentElement.removeChild(this.contentElement.firstChild)  }  this.contentElement.appendChild(value);  break;  default:  this.tableElement.style[property] = value;  break;  } };  Panel.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.blurClass;  case 'width':  case 'height':  return this.tableElement.style[property];  case 'position':  case 'left':  case 'top':  case 'zIndex':  return this.divElement.style[property];  case 'sticky':  return this.sticky;  case 'hoverClass':  return this.focusClass;  case 'html':  return this.contentElement.innerHTML;  case 'content':  return this.contentElement.firstChild();  default:  return this.tableElement.style[property]  } };   /* Animation */   Panel.prototype.hilite = function(hilite) {  this.tableElement.className = (hilite ? this.focusClass : this.blurClass) };  Panel.prototype.track = function(theEvent) {  switch (theEvent.type) {  case 'mouseover':  this.hilite(true);  break;  case 'mouseout':  this.hilite(false);  break;  } };   Panel.prototype.grow = function(displayPanel, targetElement, suppressAnimation) {   this.showing = displayPanel;   if (targetElement) {  this.targetElementLeft = DomGetElementLeft(targetElement);  this.targetElementTop = DomGetElementTop(targetElement);  }   if (displayPanel) {  this.divElement.style.visibility = 'hidden';  this.divElement.style.display = 'block'  }   var divElementWidth = DomGetElementWidth(this.divElement);  var divElementHeight = DomGetElementHeight(this.divElement);  var endPoints = [];  endPoints[0] = [];  endPoints[1] = [];  if (displayPanel) {  endPoints[0][0] = (this.targetElementLeft || 0);  endPoints[0][1] = (this.targetElementTop || 0);  endPoints[1][0] = parseInt(this.left) || ((DomGetWindowWidth() - divElementWidth) / 2 + DomGetWindowScrollX());  endPoints[1][1] = parseInt(this.top) || ((DomGetWindowHeight() - divElementHeight) / 2 + DomGetWindowScrollY());  } else {  endPoints[0][0] = parseInt(this.divElement.style.left || 0);  endPoints[0][1] = parseInt(this.divElement.style.top || 0);  endPoints[1][0] = (this.targetElementLeft || 0);  endPoints[1][1] = (this.targetElementTop || 0)  }   if (displayPanel) {  if (!this.inplace) {  this.divElement.style.left = LinearDimension(endPoints[0][0]);  this.divElement.style.top = LinearDimension(endPoints[0][1]);  this.divElement.style.clip = 'rect(0,0,0,0)'  }  this.divElement.style.display = 'block';  this.divElement.style.visibility = 'visible'  }   var progress = 0;  var goal = 100;  var rate = suppressAnimation ? 100 : 10;  var speed = 10;   var panel = this;   function DynamicPlaceResize() {  if (progress <= goal) {  var remaining = goal - progress;  if (!panel.sticky) {  panel.divElement.style.left = LinearDimension(Math.max(0, (progress * endPoints[1][0] + remaining * endPoints[0][0]) / goal));  panel.divElement.style.top = LinearDimension(Math.max(0, (progress * endPoints[1][1] + remaining * endPoints[0][1]) / goal))  }  var gain = displayPanel ? progress : remaining;  panel.divElement.style.clip = 'rect(0,' + (gain * divElementWidth / goal) + ',' + (gain * divElementHeight / goal) + ',0)';  progress += rate;  setTimeout(DynamicPlaceResize, speed)  } else {  panel.divElement.style.clip = 'rect(0,1000,1000,0)';  panel.contentElement.style.visibility = 'visible';  if (!displayPanel) {  panel.divElement.style.display = 'none'  }  }  };   if (this.inplace) {  this.contentElement.style.visibility = 'visible';  if (!displayPanel) {  this.divElement.style.display = 'none'  }  } else {  this.contentElement.style.visibility = 'hidden';  DynamicPlaceResize()  } };  Panel.prototype.show = function(targetElement) {  this.grow(true, targetElement) };  Panel.prototype.hide = function() {  this.grow(false) };  Panel.prototype.place = function(targetElement) {  this.grow(true, null, true) };  Panel.prototype.position = function(left, top) {  this.left = left;  this.top = top };  Panel.prototype.move = function(left, top) {  this.divElement.style.left = LinearDimension(left);  this.divElement.style.top = LinearDimension(top) };   function Calendar(name, parameters) {  this.name = name;  this.id = 'Calendar_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  var enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.divElement = this.enclosureDocument.createElement('DIV');  enclosureElement.appendChild(this.divElement);  this.divElement.setAttribute('id', this.id + '_Calendar');  this.divElement.className = 'calendar';  this.url = '/_iView/image/calendar/';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.divElement.model = this;   this.divElement.innerHTML = this.build();   var images = ['close.gif', 'drop.gif', 'drop_hover.gif', 'left.gif', 'left_hover.gif', 'right.gif', 'right_hover.gif', 'divider.gif'];  var cache = [];  for (var index = 0; index < images.length; index++) {  cache[index] = new Image();  cache[index].src = this.url + images[index];  } };   /* Construction */   Calendar.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.divElement.className = value;  break;  case 'time':  case 'url':  this[property] = value;  break;  case 'persist':  break;  default:  this.divElement.style[property] = value;  break;  } };  Calendar.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.divElement.className;  case 'width':  case 'height':  return this.divElement.style[property];  case 'time':  case 'url':  return this[property];  case 'persist':  return this.parameters[property];  default:  return this.divElement.style[property];  } };   /* Construction */   Calendar.prototype.build = function() {  var className = this.divElement.className;  var id = this.id;   var html = '<div id="' + id + '_Frame" class="' + className + '_frame">';   html +=  '<table class="' + className + '_table">' +  '<tr class="' + className + '_heading"><td>' +  '<table class="' + className + '_caption"><tr>' +  '<td class="' + className + '_caption_content">' +  '<span id="caption">' +  '<span id="' + id + '_DecrementMonthControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp;' +  '<img id="' + id + '_DecrementMonthImage" suppress="true" src="' + this.url + 'left.gif" width=10 height=11 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp</span>&nbsp;' +  '<span id="' + id + '_IncrementMonthControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp;' +  '<img id="' + id + '_IncrementMonthImage" suppress="true" src="' + this.url + 'right.gif" width=10 height=11 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp</span>&nbsp;' +  '<span id="' + id + '_MonthMenuControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></span>&nbsp;' +  '<span id="' + id + '_YearMenuControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></span>&nbsp;' +  '</span></td>';   if (!this.parameters.persist)  html += '<td align=right><span onclick="DomGetModel(this).hide()" style="cursor:pointer">' +  '<img src="' + this.url + 'close.gif" suppress=true width=15 height=13 border=0 alt="Close Calendar">' +  '</span></td>';   html += '</tr></table>' +  '</td></tr>' +  '<tr><td class="' + className + '_body">' +  '<span id="' + id + '_Content"></span>' +  '</td></tr></table></div>';   html += '<span id="' + id + '_MonthSelector" class="' + className + '_menu"></span>' +  '<span id="' + id + '_YearSelector" class="' + className + '_menu"></span>';   return html; };  var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var weekdayNames = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];   Calendar.prototype.construct = function() {  var className = this.divElement.className;  var id = this.id;   var html = '<table border="0" cols="7"><tr>';  for (var weekday = 0; weekday < 7; weekday++)  html += '<td align="center" class="' + className + '_content">' + weekdayNames[weekday] + '</td>';  html += '</tr>';   var today = new Date();  var thisDate = today.getFullYear() + '-' + LeadingValue(today.getMonth() + 1) + '-' + LeadingValue(today.getDate());  if (!this.selectDate) {  this.selectDate = thisDate;  }  if (!this.selectedYear) {  this.selectedYear = today.getFullYear();  }  if (this.selectedMonth == undefined) {  this.selectedMonth = today.getMonth();  }  var startDate = new Date(this.selectedYear, this.selectedMonth, 1);  var endMonth = (this.selectedMonth + 1) % 12;  var endYear = this.selectedYear + ((this.selectedMonth == 11) ? 1 : 0);  var endDate = new Date(endYear, endMonth, 1);  endDate = new Date(endDate - 24 * 3600 * 1000);  var terminalDay = endDate.getDate();  for (var day = -startDate.getDay() + 1; day <= terminalDay; ) {  html += '<tr>';  for (var weekday = 0; weekday < 7; weekday++) {  var dateTime = this.selectedYear + '-' + LeadingValue(this.selectedMonth + 1) + '-' + LeadingValue(day);  var highlight = (thisDate == dateTime);  var mark = (this.selectDate == dateTime);  html += '<td align="right" class="' + className + '_content">' +  (highlight ? ('<span class="' + className + '_date_hilite">') : '') +  ( ((day > 0) && (day <= terminalDay)) ?  ('<span onclick="DomGetModel(this).setDate(\'' + dateTime + '\')" onmouseover="window.status=\'Select ' + dateTime + '\'; return true" onmouseout="window.status=\'\'; return true" style="cursor:pointer;">' +  (mark ? ('<span class="' + className + '_date_mark">') : '') +  day +  (mark ? '</span>' : '') +  '</span>') :  '' ) +  (highlight ? '</span>' : '') +  '</td>';  day++;  }  html += '</tr>';  }  html += '</table>';   document.getElementById(id + '_Content').innerHTML = html;   document.getElementById(id + '_MonthMenuControl').innerHTML = '&nbsp;' +  monthNames[this.selectedMonth] + '&nbsp;<img id="' + id + '_MonthMenuImage" suppress=true src="' + this.url + 'drop.gif" width=12 height=10 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">';   document.getElementById(id + '_YearMenuControl').innerHTML = '&nbsp;' +  this.selectedYear + '&nbsp;<img id="' + id + '_YearMenuImage" suppress=true src="' + this.url + 'drop.gif" width=12 height=10 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">'; };  Calendar.prototype.constructMonth = function() {  var className = this.divElement.className;  var id = this.id;   this.popDownYear();  if (!this.monthConstructed) {  var html = '';  for (month = 0; month < 12; month++) {  var highlight = (month == this.selectedMonth);  html += '<tr><td id="' + id + '_' + month + '_MonthItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"' +  (highlight ? ' style="font-weight:bold"' : '') + '>&nbsp;' + monthNames[month] +  '&nbsp;</td></tr>';  }  document.getElementById(id + '_MonthSelector').innerHTML = '<table width="70" id="' + id + '_MonthBody" class="' + className + '_menu_body" cellspacing=0 ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)">' + html + '</table>';  this.monthConstructed = true;  } };  Calendar.prototype.constructYear = function(year) {  var className = this.divElement.className;  var id = this.id;   this.popDownMonth();  if (!this.yearConstructed) {  var html = '<tr><td align="center" id="' + id + '_DecYearItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" >-</td></tr>';  for (year = 0; year < 7; year++) {  var highlight = (year == 3);  html += '<tr><td id="' + id + '_' + year + '_YearItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"' +  (highlight ? ' style="font-weight:bold"' : '') + '>&nbsp;' + (this.selectedYear + year - 3) +  '&nbsp;</td></tr>';  }  html += '<tr><td align="center" id="' + id + '_IncYearItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" >+</td></tr>';  document.getElementById(id + '_YearSelector').innerHTML = '<table width="44" id="' + id + '_YearBody" class="' + className + '_menu_body" cellspacing=0 ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)">' + html + '</table>';  this.yearConstructed = true;  } };   /* Animation */   Calendar.prototype.track = function(theEvent) {  var className = this.divElement.className;  var id = this.id;   var target = DomGetTarget(theEvent);  var ids = target.id.split('_');   switch (ids[ids.length - 1]) {  case 'DecrementMonthControl':  case 'DecrementMonthImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_DecrementMonthImage').src = this.url + 'left_hover.gif';  document.getElementById(this.id + '_DecrementMonthControl').className = className + '_control_hover';  window.status = 'Scroll to previous month';  break;  case 'mouseout':  this.halt();  document.getElementById(this.id + '_DecrementMonthImage').src = this.url + 'left.gif';  document.getElementById(this.id + '_DecrementMonthControl').className = className + '_control';  window.status = '';  break;  case 'mousedown':  this.startDecrementMonth();  break;  case 'mouseup':  this.halt();  break;  case 'click':  this.halt();  this.decMonth();  theEvent.cancelBubble=true;  break;  }  break;  case 'IncrementMonthControl':  case 'IncrementMonthImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_IncrementMonthImage').src = this.url + 'right_hover.gif';  document.getElementById(this.id + '_IncrementMonthControl').className = className + '_control_hover';  window.status = 'Scroll to next month';  break;  case 'mouseout':  this.halt();  document.getElementById(this.id + '_IncrementMonthImage').src = this.url + 'right.gif';  document.getElementById(this.id + '_IncrementMonthControl').className = className + '_control';  window.status = '';  break;  case 'mousedown':  this.startIncrementMonth();  break;  case 'mouseup':  this.halt();  break;  case 'click':  this.halt();  this.incMonth();  theEvent.cancelBubble=true;  break;  }  break;  case 'MonthMenuControl':  case 'MonthMenuImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_MonthMenuImage').src = this.url + 'drop_hover.gif';  document.getElementById(this.id + '_MonthMenuControl').className = className + '_control_hover';  window.status = 'Select month';  break;  case 'mouseout':  document.getElementById(this.id + '_MonthMenuImage').src = this.url + 'drop.gif';  document.getElementById(this.id + '_MonthMenuControl').className = className + '_control';  window.status = '';  break;  case 'click':  this.popUpMonth();  break;  }  break;  case 'YearMenuControl':  case 'YearMenuImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_YearMenuImage').src = this.url + 'drop_hover.gif';  document.getElementById(this.id + '_YearMenuControl').className = className + '_control_hover';  window.status = 'Select year';  break;  case 'mouseout':  document.getElementById(this.id + '_YearMenuImage').src = this.url + 'drop.gif';  document.getElementById(this.id + '_YearMenuControl').className = className + '_control';  window.status = '';  break;  case 'click':  this.popUpYear();  break;  }  break;  case 'MonthBody':  switch (theEvent.type) {  case 'mouseover':  this.stop();  break;  case 'mouseout':  this.startPopDownMonth();  break;  }  break;  case 'MonthItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  target.className = className + '_menu_item';  break;  case 'click':  this.monthConstructed = false;  this.selectedMonth = parseInt(ids[ids.length - 2]);  this.construct();  this.popDownMonth();  break;  }  break;  case 'YearBody':  switch (theEvent.type) {  case 'mouseover':  this.stop();  break;  case 'mouseout':  this.startPopDownYear();  break;  }  break;  case 'YearItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  target.className = className + '_menu_item';  break;  case 'click':  this.selectYear(this.selectedYear + parseInt(ids[ids.length - 2]) - 3);  theEvent.cancelBubble=true;  break;  }  break;  case 'DecYearItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  this.halt();  target.className = className + '_menu_item';  break;  case 'mousedown':  this.startDecrementYear();  break;  case 'mouseup':  this.halt();  break;  }  break;  case 'IncYearItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  this.halt();  target.className = className + '_menu_item';  break;  case 'mousedown':  this.startIncrementYear();  break;  case 'mouseup':  this.halt();  break;  }  break;  } };  Calendar.prototype.setDate = function(date) {  this.date = date;  if (this.targetElement) {  this.targetElement.value = date + (this.time ? (' ' + this.time) : '');  DomFireEvent(this.targetElement, 'change')  }  this.show();  if (!this.parameters.persist) {  this.hide();  } }; Calendar.prototype.show = function(targetElement) {  if (targetElement) {  this.targetElement = targetElement;  }   var date = this.targetElement ? this.targetElement.value : this.date;  if (date) {  var defaultDate = new Date();  date = date.substring(0, 10);  var delimiters = ['-', '/', '.', ' ', '\\'];  var parts;  for (var index = 0; index < delimiters.length; index++) {  parts = date.split(delimiters[index]);  if (parts.length > 0) {  this.selectedYear = parseInt(parts[0]) || defaultDate.getFullYear();  if (parts.length > 1) {  parts[1] = parts[1].replace(/^0+(.)/, "$1");  this.selectedMonth = parseInt(parts[1]) || (defaultDate.getMonth() + 1);  if (this.selectedMonth != undefined) this.selectedMonth--;  if (parts[1] < 10)  parts[1] = '0' + parts[1];  if (parts.length > 2) {  parts[2] = parts[2].replace(/^0+(.)/, "$1");  this.selectedDay = parseInt(parts[2]) || defaultDate.getDate();  if (parts[2] < 10)  parts[2] = '0' + parts[2];  parts.length = 3;  } else  parts[2] = '01';  } else  parts[1] = parts[2] = '01';  this.selectDate = parts.join('-');  break;  }  }  }   this.calendarFrameElement = document.getElementById(this.id + '_Frame');  this.calendarElement = document.getElementById(this.id + '_Calendar');  this.calendarPosition = this.calendarPosition || DomGetElementPosition(this.calendarElement);   this.targetPosition = this.targetElement ? DomGetElementPosition(this.targetElement) : [0, 0];  this.targetHeight = this.targetElement ? DomGetElementHeight(this.targetElement) : 0;   this.calendarElement.style.left = LinearDimension(Math.max(0, this.targetPosition[0]));  this.calendarElement.style.top = LinearDimension(Math.max(0, this.targetPosition[1] + this.targetHeight));   this.construct();   this.calendarElement.style.visibility = 'visible';  this.calendarFrameElement.style.visibility = 'visible';   this.monthElement = document.getElementById(this.id + '_MonthSelector');  this.yearElement = document.getElementById(this.id + '_YearSelector'); };  Calendar.prototype.hide = function() {  if (this.calendarElement) {  this.calendarElement.style.visibility = 'hidden';  this.calendarFrameElement.style.visibility = 'hidden';  this.monthElement.style.visibility = 'hidden';  this.yearElement.style.visibility = 'hidden';  } };   /* Month Animations */   Calendar.prototype.incMonth = function() {  this.selectedMonth++;  if (this.selectedMonth > 11) {  this.selectedMonth = 0;  this.selectedYear++;  }  this.construct(); };  Calendar.prototype.decMonth = function() {  this.selectedMonth--;  if (this.selectedMonth < 0) {  this.selectedMonth = 11;  this.selectedYear--;  }  this.construct(); };  Calendar.prototype.startIncrementMonth = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.incMonth() }, speed || 500); };  Calendar.prototype.startDecrementMonth = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.decMonth() }, speed || 500); };  Calendar.prototype.halt = function() {  clearInterval(this.intervalTask); };  Calendar.prototype.startPopDownMonth = function(delay) {  var calendar = this;  this.stop();  this.intervalTask = setInterval(function() { calendar.popDownMonth() }, delay || 1000); };  Calendar.prototype.startPopDownYear = function(delay) {  var calendar = this;  this.stop();  this.intervalTask = setInterval(function() { calendar.popDownYear() }, delay || 1000); };  Calendar.prototype.stop = function() {  clearTimeout(this.timeoutTask); };  Calendar.prototype.popUpMonth = function() {  this.constructMonth();  this.monthElement.style.left = document.getElementById(this.id + '_MonthMenuControl').offsetLeft + 6;  this.monthElement.style.top = document.getElementById(this.id + '_MonthMenuControl').offsetHeight + 6;  this.monthElement.style.visibility = 'visible'; };  Calendar.prototype.popDownMonth = function() {  this.monthElement.style.visibility = 'hidden'; };   /* Year Animations */   Calendar.prototype.incYear = function() {  this.selectedYear++;  for (year = 0; year < 7; year++) {  var highlight = (year == 3);  document.getElementById(this.id + '_' + year + '_YearItem').innerHTML =  '&nbsp;' + (this.selectedYear + year - 3) + '&nbsp;';  } };  Calendar.prototype.decYear = function() {  this.selectedYear--;  for (year = 0; year < 7; year++) {  var highlight = (year == 3);  document.getElementById(this.id + '_' + year + '_YearItem').innerHTML =  '&nbsp;' + (this.selectedYear + year - 3) + '&nbsp;';  } };  Calendar.prototype.startIncrementYear = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.incYear() }, speed || 80); };  Calendar.prototype.startDecrementYear = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.decYear() }, speed || 80); };  Calendar.prototype.selectYear = function(year) {  this.selectedYear = parseInt(year);  this.yearConstructed = false;  this.construct();  this.popDownYear(); };  Calendar.prototype.popUpYear = function(year) {  this.constructYear();  this.yearElement.style.visibility = 'visible';  this.yearElement.style.left = document.getElementById(this.id + '_YearMenuControl').offsetLeft + 6;  this.yearElement.style.top = document.getElementById(this.id + '_YearMenuControl').offsetHeight + 6; };  Calendar.prototype.popDownYear = function() {  this.halt();  this.stop();  this.yearElement.style.visibility = 'hidden'; };  function DateTime(name, parameters) {  this.name = name;  this.id = 'DateTime_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.className = 'dateTime';   this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];   var panelParameters = [];  panelParameters.html = this.build();  panelParameters.sticky = this.parameters.sticky;  this.timePanel = new Panel(this.id + '_Panel', panelParameters);   var calendarParameters = [];  calendarParameters.time = '00:00:00';  this.calendar = new Calendar(this.id + '_Calendar', calendarParameters);   this.timePanel.model = this;  this.subscription = new Subscription() };   /* Construction */   DateTime.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'html':  this.timePanel.innerHTML = value;  break;  default:  this.timePanel.style[property] = value;  break;  } };  DateTime.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'html':  return this.timePanel.innerHTML;  default:  return this.timePanel.style[property];  } };  DateTime.prototype.build = function() {  var id = this.id;  var className = this.className;   var html = '<h2>Date Time Constraints</h2>';  html += '<table className="' + className + '_frame" border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td>Period</td></tr>';  html += '<tr><td><select id="' + id + '_Control_Period" onchange="DomGetModel(this, 1).track(event)">';  html += '<option value="Last" ' + (this.configuration.Period == 'Last' ? ' selected' : '') + '>Last</option>';  html += '<option value="Today" ' + (this.configuration.Period == 'Today' ? ' selected' : '') + '>Today</option>';  html += '<option value="Yesterday" ' + (this.configuration.Period == 'Yesterday' ? ' selected' : '') + '>Yesterday</option>';  html += '<option value="Last 24 Hours" ' + (this.configuration.Period == 'Last 24 Hours' ? ' selected' : '') + '>Last 24 Hours</option>';  html += '<option value="This Week" ' + (this.configuration.Period == 'This Week' ? ' selected' : '') + '>This Week</option>';  html += '<option value="Last Week" ' + (this.configuration.Period == 'Last Week' ? ' selected' : '') + '>Last Week</option>';  html += '<option value="Last 7 Days" ' + (this.configuration.Period == 'Last 7 Days' ? ' selected' : '') + '>Last 7 Days</option>';  html += '<option value="This Month" ' + (this.configuration.Period == 'This Month' ? ' selected' : '') + '>This Month</option>';  html += '<option value="Last Month" ' + (this.configuration.Period == 'Last Month' ? ' selected' : '') + '>Last Month</option>';  html += '<option value="Last 30 Days" ' + (this.configuration.Period == 'Last 30 Days' ? ' selected' : '') + '>Last 30 Days</option>';  html += '<option value="This Year" ' + (this.configuration.Period == 'This Year' ? ' selected' : '') + '>This Year</option>';  html += '<option value="Last Year" ' + (this.configuration.Period == 'Last Year' ? ' selected' : '') + '>Last Year</option>';  html += '<option value="Last 365 Days" ' + (this.configuration.Period == 'Last 365 Days' ? ' selected' : '') + '>Last 365 Days</option>';  html += '<option value="Other..." ' + (this.configuration.Period == 'Other...' ? ' selected' : '') + '>Other...</option>';  html += '</select></td></tr>';  html += '<tr><td>Summary</td></tr>';  html += '<tr><td><select id="' + id + '_Control_Group" onchange="DomGetModel(this, 1).track(event)">';  html += '<option value="(None)" ' + (this.configuration.Group == '(None)' ? ' selected' : '') + '>(None)</option>';  html += '<option value="Hour" ' + (this.configuration.Group == 'Hour' ? ' selected' : '') + '>Hour</option>';  html += '<option value="Day" ' + (this.configuration.Group == 'Day' ? ' selected' : '') + '>Day</option>';  html += '<option value="Week" ' + (this.configuration.Group == 'Week' ? ' selected' : '') + '>Week</option>';  html += '<option value="Month" ' + (this.configuration.Group == 'Month' ? ' selected' : '') + '>Month</option>';  html += '<option value="Year" ' + (this.configuration.Group == 'Year' ? ' selected' : '') + '>Year</option>';  html += '</select></td></tr>';  html += '<tr><td><div id="' + id + '_OtherTime" style="position:relative;display:' + ((this.configuration.Period == 'Other...') ? 'block' : 'none') + '">';  html += '<table border="0" cellpadding="0" cellspacing="0">';  html += '<tr><td>From</td></tr>';  html += '<tr><td><input type="text" size="20" value="' + (this.configuration.From || '') + '" id="' + id + '_Input_From" onfocus="DomGetModel(this, 1).track(event)" onchange="DomGetModel(this, 1).track(event)" /></td></tr>';  html += '<tr><td>To</td></tr>';  html += '<tr><td><input type="text" size="20" value="' + (this.configuration.To || '') + '" id="' + id + '_Input_To" onfocus="DomGetModel(this, 1).track(event)" onchange="DomGetModel(this, 1).track(event)" /></td></tr>';  html += '</table>';  html += '</div></td></tr>';  html += '<tr><td>Limit</td></tr>';  html += '<tr><td><input type="text" size="20" value="' + (this.configuration.Limit || '') + '" id="' + id + '_Input_Limit" onchange="DomGetModel(this, 1).track(event)" /></td></tr>';  html += '<tr><td><br><input type="button" value="Apply" id="' + id + '_Button_Apply" onclick="DomGetModel(this, 1).track(event)" \></td>';  html += '<td><br><input type="button" value="Close" id="' + id + '_Button_Hide" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '</table>';   return html };   /* Animation */   DateTime.prototype.track = function(theEvent) {   var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var ids = targetElement.id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Period':  case 'Group':  switch (theEvent.type) {  case 'change':  var options = targetElement.options;  for (var index = 0; index < options.length; index++) {  if (options[index].selected) {  this.configuration[action] = options[index].value;  }  }  document.getElementById(id + '_OtherTime').style.display = ((this.configuration.Period == 'Other...') ? 'block' : 'none');  break;  }  break;  case 'From':  case 'To':  switch (theEvent.type) {  case 'focus':  this.calendar.show(targetElement);  break;  }  case 'Limit':  switch (theEvent.type) {  case 'change':  this.configuration[action] = targetElement.value;  break;  }  break;  case 'Apply':  switch (theEvent.type) {  case 'click':  break;  }  break;  case 'Hide':  switch (theEvent.type) {  case 'click':  this.timePanel.hide();  return;  }  break;  }  SetCookie(id, PackHash(this.configuration, '|', '~'), 7);  this.subscription.broadcast('change', this.configuration) };  DateTime.prototype.show = function(targetElement) {  this.timePanel.show(targetElement) };  DateTime.prototype.hide = function() {  this.timePanel.hide() };   /* Subscription */   DateTime.prototype.subscriptions = function() {  return ['change'] };  DateTime.prototype.actions = function() {  return ['value'] };  DateTime.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  DateTime.prototype.receive = function(action, parameters) {  switch (action) {  case 'value':  CopyHash(this.configuration, parameters);  this.timePanel.setProperty('html', this.build());  break;  } };   function Graph(name, parameters) {  this.name = name;  this.id = 'Graph_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = parameters.enclosure || document;  this.enclosureElement = parameters.insertion || this.enclosureDocument.body;   var panelParameters = [];  panelParameters.enclosure = this.enclosureDocument;  panelParameters.insertion = this.enclosureElement;  panelParameters.sticky = this.parameters.sticky;   this.graphPanel = new Panel(this.id + '_Panel', panelParameters);  this.graphPanel.model = this;   this.imageElement = this.enclosureDocument.createElement('IMG');  this.graphPanel.setProperty('content', this.imageElement);  this.imageElement.id = this.id + '_Image';  this.imageElement.style.cursor = 'pointer';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   var thisGraph = this;   DomAddEventListener(this.imageElement, 'load', function(theEvent) { thisGraph.track(theEvent) }, false);  DomAddEventListener(this.imageElement, 'error', function(theEvent) { thisGraph.track(theEvent) }, false);  DomAddEventListener(this.imageElement, 'abort', function(theEvent) { thisGraph.track(theEvent) }, false);  DomAddEventListener(this.imageElement, 'click', function(theEvent) { thisGraph.track(theEvent) }, false);   this.dateTime = UnpackHash([], GetCookie(this.id + '_DateTimePanel'), '|', '~') || [];  this.control = UnpackHash([], GetCookie(this.id + '_ControlPanel'), '|', '~') || [];   this.imageElement.src = '/_iView/image/transparent.gif';   this.controlPanel = new GraphControl(this.id + '_Control', []);  var parms = [];  parms.sticky = true;  this.dateTimePanel = new DateTime(this.id + '_DateTime', parms);   this.controlPanel.subscribe(this, 'change', 'control');  this.controlPanel.subscribe(this, 'animate', 'animate');  this.dateTimePanel.subscribe(this, 'change', 'dateTime');   var imageCache = new Image();  imageCache.src = this.progressUrl = '/_iView/image/progress/progress.gif'; };    /* Construction */    Graph.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'width':  case 'height':  this.imageElement.style[property] = LinearDimension(value);  break;  case 'url':  this.urlbase = (value || '');  this.url = this.urlbase + '?Request=Graph&Names=' + this.name + '&Title=' + (this.parameters.title || this.name) + '&';  break;  case 'Scope':  this.Scope = (value || '');  this.reloadImage();  break;  case 'nullURL':  case 'faultURL':  break;  case 'Title':  this.parameters.title = value;  this.url = this.urlbase + '?Request=Graph&Names=' + this.name + '&Title=' + (this.parameters.title || this.name) + '&';  break;  case 'Names':  this.name = value;  this.url = this.urlbase + '?Request=Graph&Names=' + this.name + '&Title=' + (this.parameters.title || this.name) + '&';  break;  case 'Period':  case 'From':  case 'To':  case 'Group':  case 'Constraint':  case 'Reverse':  this.dateTime[property] = value;  break;  default:  this.imageElement.style[property] = value;  break;  } };  Graph.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.imageElement.style[property];  case 'url':  return this.url;  case 'nullURL':  case 'faultURL':  case 'title':  return this.parameters[property];  default:  return this.imageElement.style[property];  } };   /* Animation */   Graph.prototype.track = function(theEvent) {  switch (theEvent.type) {  case 'load':  if (this.control.animate) {  this.startReloadAnimation()  }  if (this.graphPanel.showing) {  this.graphPanel.place()  }  break;  case 'error':  case 'abort':  this.imageElement.src = (this.parameters.faultURL || '/_iView/image/na.png');  break;  case 'click':  if (theEvent.altKey ) {  this.dateTimePanel.show(this.imageElement)  } else if (theEvent.ctrlKey) {  this.controlPanel.show(this.imageElement)  } else {  this.hide()  }  break;  } };  Graph.prototype.startReloadAnimation = function(delay) {  var graph = this;  this.timeoutTask = setTimeout(function() { graph.reloadImage() }, this.delay = delay || this.delay || 60000); };  Graph.prototype.reloadImage = function() {  if (this.graphPanel.showing) {  this.imageElement.src = this.progressUrl;  this.imageElement.src = this.url + PackHash(this.dateTime) + '&' + PackHash(this.control) + '&Code=' + Math.random() + (this.Scope ? ('&Scope=' + this.Scope) : '')  } };  Graph.prototype.show = function(targetElement) {  this.graphPanel.show(targetElement);  this.reloadImage() };  Graph.prototype.hide = function() {  this.hideAll();  this.graphPanel.hide() };  Graph.prototype.hideAll = function() {  if (this.controlPanel) {  this.controlPanel.hide()  }  if (this.dateTimePanel) {  this.dateTimePanel.hide()  } };   /* Subscription */   Graph.prototype.subscriptions = function() {  return [] };  Graph.prototype.actions = function() {  return ['control', 'dateTime', 'animate'] };  Graph.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Graph.prototype.receive = function(action, parameters) {  switch (action) {  case 'control':  this.control = [];  CopyHash(this.control, parameters);  this.reloadImage();   SetCookie(this.id + '_ControlPanel', PackHash(this.control, '|', '~'));   break;  case 'dateTime':  this.dateTime = [];  CopyHash(this.dateTime, parameters);  this.reloadImage();   SetCookie(this.id + '_DateTimePanel', PackHash(this.dateTime, '|', '~'));   break;  case 'animate':  if (this.control.animate = parameters) {  this.reloadImage()  }  break;  } };    function GraphControl(name, parameters) {  this.name = name;  this.id = 'GraphControl_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.className = 'graphControl';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];   var panelParameters = [];  panelParameters.html = this.build();  panelParameters.sticky = true;  this.controlPanel = new Panel(this.id + '_Panel', panelParameters);   this.controlPanel.model = this;  this.subscription = new Subscription() };   /* Construction */   GraphControl.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'html':  this.controlPanel.innerHTML = value;  break;  default:  this.controlPanel.style[property] = value;  break;  } };  GraphControl.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'html':  return this.controlPanel.innerHTML;  default:  return this.controlPanel.style[property];  } };  GraphControl.prototype.build = function() {  var id = this.id;  var className = this.className;   var html = '<form><table border="0" cellspacing="0" cellpadding="0"><tr vAlign="top">';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td noWrap="1"><input type="checkbox" value="Bar" id="' + id + '_Control_Bar"' + (this.configuration.Bar ? ' checked' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Bar</td></tr>';  html += '<tr><td noWrap="1"><input type="checkbox" value="Smooth" id="' + id + '_Control_Smooth"' + (this.configuration.Smooth ? ' checked' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Smooth</td></tr>';  html += '<tr><td noWrap="1"><input type="checkbox" value="Animate" id="' + id + '_Control_Animate"' + (this.configuration.Animate ? ' checked' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Animate</td></tr>';  html += '<tr><td noWrap="1"><input type="button" value="Close" id="' + id + '_Control_Hide" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '</table></td>';  html += '<td><div id="' + this.id + '_BarType_Panel" style="position:relative;display:' + (this.configuration.Bar ? 'block' : 'none') + '"><table border="0" cellspacing="0" cellpadding="0"><tr>';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td noWrap="1"><input type="radio" name="Type" value="Interleave" id="' + id + '_Control_Type_Interleave"' + ((this.configuration.Type == 'Interleave') ? 'checked ' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Interleave</td></tr>';  html += '<tr><td noWrap="1"><input type="radio" name="Type" value="Overlay" id="' + id + '_Control_Type_Overlay"' + ((this.configuration.Type == 'Overlay') ? 'checked ' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Overlay</td></tr>';  html += '<tr><td noWrap="1"><input type="radio" name="Type" value="Stack" id="' + id + '_Control_Type_Stack" ' + ((this.configuration.Type == 'Stack') ? 'checked ' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Stack</td></tr>';  html += '</table></td>';  html += '</tr></table></div></td>';  html += '</tr></table></form>';   return html };   /* Animation */   GraphControl.prototype.track = function(theEvent) {   var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var ids = targetElement.id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Bar':  switch (theEvent.type) {  case 'click':  document.getElementById(this.id + '_BarType_Panel').style.display = (this.configuration.Bar ? 'none' : 'block');  break;  }  case 'Animate':  switch (theEvent.type) {  case 'click':  this.subscription.broadcast('animate', targetElement.checked);  break;  }  case 'Smooth':  switch (theEvent.type) {  case 'click':  if (targetElement.checked) {  this.configuration[action] = 'True'  } else {  delete this.configuration[action]  }  break;  }  break;  case 'Interleave':  case 'Overlay':  case 'Stack':  switch (theEvent.type) {  case 'click':  this.configuration.Type = action;  break;  }  break;  case 'Hide':  switch (theEvent.type) {  case 'click':  this.controlPanel.hide();  break;  }  return;  }   SetCookie(id, PackHash(this.configuration, '|', '~'));   this.subscription.broadcast('change', this.configuration) };  GraphControl.prototype.show = function(targetElement) {  this.controlPanel.show(targetElement) };  GraphControl.prototype.hide = function() {  this.controlPanel.hide() };   /* Subscription */   GraphControl.prototype.subscriptions = function() {  return ['change', 'animate'] };  GraphControl.prototype.actions = function() {  return ['value'] };  GraphControl.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  GraphControl.prototype.receive = function(action, parameters) {  switch (action) {  case 'value':  CopyHash(this.configuration, parameters);  this.controlPanel.setProperty('html', this.build());  break;  } };     function Indicator(name, parameters) {  this.name = name;  this.id = 'Indicator_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.indicatorElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.indicatorElement);  this.indicatorElement.className = 'indicator';  this.indicatorElement.id = this.id + '_Frame';  this.indicatorElement.model = this;   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.indicatorElement.appendChild(this.tableBodyElement);   this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);   this.cellElement = this.enclosureDocument.createElement('TD');  this.rowElement.appendChild(this.cellElement);   this.graphParameters = [];   this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];  this.configuration.type = (this.configuration.type || 'Text');   var templates = (this.configuration.thresholds || '').split(',');  var thresholds = [];  while (templates.length > 0) {  thresholds[thresholds.length] = [];  for (var column = 0; (column < 4) && (templates.length > 0); column++) {  thresholds[thresholds.length - 1][column] = templates.shift()  }  }  this.configuration.thresholds = thresholds;   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   DomAddEventListener(this.indicatorElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.cellElement.innerHTML = this.build();  this.showDial();  this.built = true;   this.graphParameters.sticky = true;  this.graphPanel = new Graph(this.name, this.graphParameters);  this.graphPanel.model = this;   this.controlPanel = new IndicatorControl(this.id + '_Control', []);  this.controlPanel.subscribe(this, 'change', 'control');   this.value = 0; };   /* Construction */   Indicator.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.indicatorElement.className = this.className = value;  break;  case 'width':  case 'height':  this.indicatorElement.style[key] = LinearDimension(value);  break;  case 'title':  this.graphParameters[property] = value;  if (this.graphPanel) {  this.graphPanel.setProperty(property, value);  }  case 'label':  this.indicatorElement.style[property] = value;  this.rebuild();  break;  case 'url':  case 'query':  case 'Scope':  this.graphParameters[property] = value;  if (this.graphPanel) {  this.graphPanel.setProperty(property, value)  }  break;  case 'scale':  case 'clock':  case 'half':  case 'dialURL':  case 'lampURL':  case 'barURL':  case 'type':  case 'minimum':  case 'maximum':  case 'dialURL':  case 'thresholds':  this.configuration[property] = value;  this.rebuild();  break;  case 'data':  if ((value != '') && (value != undefined)) {  this.value = value  } else if ((this.value != '') && (this.value != undefined) && !isNaN(this.value)) {  value = this.value  } else {  value = 0  }   var effect = [];  if (this.configuration.thresholds) {  for (var index = 0; index < this.configuration.thresholds.length; index++) {  var record = this.configuration.thresholds[index];  if ( (value >= ExtractRecord(record, 0, 0)) && (value <= ExtractRecord(record, 1, 0)) ) {  effect[ExtractRecord(record, 2, '')] = ExtractRecord(record, 3, '');  }  }  }   switch (this.configuration.type || 'Text') {   case 'Text':  var targetElement = document.getElementById(this.id + '_Text');  if (targetElement) {  targetElement.innerHTML = value || '&nbsp;';  for (var key in effect) {  targetElement.style[(key == 'color') ? 'backgroundColor' : key] = effect[key]  }  }  break;   case 'Dial':  var dialElement = document.getElementById(this.id + '_Dial');  if (dialElement) {  var url = (this.configuration.dialURL || '/_iView/image/dial/full/dial_');  var clock = this.configuration.clock;  var half = this.configuration.half;  var minimum = (this.configuration.minimum || 0);  var maximum = (this.configuration.maximum || (clock ? 23 : 100));  var data = Math.min(Math.max(parseInt(this.value), minimum), maximum);  if (isNaN(data)) { data = 0 }  value = LeadingValue(Math.round((half ? 12 : (clock ? 23 : 23)) * (data - minimum + ((half || clock) ? ((maximum - minimum) / 2) : 0)) / (maximum - minimum)) % 24);  var label = this.parameters.label;  if ((label != undefined) && !label) {  label = this.value + (clock ? ':00' : '')  }   dialElement.src = url + (effect.color || '') + '.gif';  var faceElement = document.getElementById(this.id + '_Face');  if (faceElement) {  faceElement.src = url + value + '.gif'  }  }   if (label) {  var labelElement = document.getElementById(this.id + '_Label');  if (labelElement) {  labelElement.innerHTML = label  }  }  break;   case 'Lamp':  var label = this.parameters.label;  if ((label != undefined) && !label) {  label = value  }  var url = (this.configuration.lampURL || '/_iView/image/lamp/');   var targetElement = document.getElementById(this.id + '_Lamp');  if (targetElement) {  targetElement.src = url + (effect.color || 'black') + '.gif';  if (label) {  var labelElement = document.getElementById(this.id + '_Label');  if (labelElement) {  labelElement.innerHTML = label  }  }  }  break;   case 'Bar':  var url = (this.configuration.barURL || '/_iView/image/bar/');  var goal = this.configuration.goal;  var minimum = (this.configuration.minimum || 0);  var maximum = ((this.configuration.maximum != undefined) ? this.configuration.maximum : (goal || 100));  var data = Math.min(Math.max(parseInt(this.value), minimum), maximum);  var progress = (this.configuration.progress || ((parseInt(data) - minimum) / (maximum - minimum)) || 0);  var label = this.parameters.label;  if ((label != undefined) && !label) {  label = goal ? ((100 * progress) + '% (' + progress + '/' + goal + ')') : (this.value || '')  }  var width = (this.configuration.scale || 1) * 400;  var height = (this.scale || 0.5) * 32;   var progressElement = document.getElementById(this.id + '_Completed');  if (progressElement) {  progressElement.style.width = progress * width;  progressElement.style.backgroundColor = (effect.color || 'blue');   var imageElement = document.getElementById(this.id + '_Bar');  if (imageElement) {  if (this.configuration.barURL) {  imageElement.style.width = Math.min(progress * width, width - 6);  imageElement.src = url + (effect.color || 'transparent') + '.gif'  } else {  imageElement.style.width = 1;  imageElement.src = (this.configuration.nullURL || '/_iView/image/transparent.gif')  }  }   var remainderElement = document.getElementById(this.id + '_Remainder');  if (remainderElement) {  remainderElement.style.width = (1 - progress) * width  }  }   if (label) {  var labelElement = document.getElementById(this.id + '_Label');  if (labelElement) {  labelElement.innerHTML = label  }  }  break;  }   } };  Indicator.prototype.getProperty = function(property) {  switch (property) {  case 'width':  case 'height':  case 'title':  case 'label':  return this.parameters[property];  case 'url':  case 'query':  case 'scope':  return this.graphParameters[property];  case 'scale':  case 'clock':  case 'half':  case 'dialURL':  case 'lampURL':  case 'barURL':  case 'type':  case 'minimum':  case 'maximum':  case 'dialURL':  case 'thresholds':  return this.configuration[property];  case 'data':  return this.value;  } };  Indicator.prototype.build = function() {  var className = this.className || 'indicator';  var id = this.id;   var html = '';   switch (this.configuration.type = (this.configuration.type || 'Text')) {   case 'Text':  var width = (this.configuration.scale || 0.5) * 400;  if (this.parameters.title) {  html += '<span id="' + id + '_Title" class="' + className + '_title">' + this.parameters.title + '</span><br>'  }  html += '<table border="0" cellpadding="0" cellspacing="0"><tr><td><div id="' + id + '_Text" style="border:inset;cursor:pointer;width:' + LinearDimension(width) + ';" class="' + className + '_text"';  html += ' onmouseover="return DomGetModel(this).track(event)" onmouseout="return DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"';  html += '>&nbsp;</div></td>';  if (this.parameters.label) {  html += '<td><span id="' + id + '_Label" class="' + className + '_label">' + this.parameters.label + '</span></td>'  }  return html + '</tr></table>';   case 'Dial':  var url = (this.configuration.dialURL || '/_iView/image/dial/full/dial_');  var clock = this.configuration.clock;  var half = this.configuration.half;  var minimum = (parseInt(this.configuration.minimum) || 0);  var maximum = (parseInt(this.configuration.maximum) || (clock ? 23 : 100));  var className = (className || 'dial');   var title = (this.parameters.title || this.name);  var label = this.parameters.label;   var data = Math.min(Math.max(parseInt(this.value) || 0, minimum), maximum);  value = LeadingValue(Math.round((half ? 12 : (clock ? 23 : 23)) * (data - minimum + ((half || clock) ? ((maximum - minimum) / 2) : 0)) / (maximum - minimum)) % 24);  if ((label != undefined) && !label) {  label = data + (clock ? ':00' : '')  }   var scale = (this.configuration.scale || 0.5);  this.width = scale * 351;  this.height = scale * 351;  this.dialWidth = scale * 249;  this.dialHeight = scale * 249;   var html = '<table border=0 cellpadding=0 cellspacing=0 style="cursor:pointer"';  html += ' onmouseover="return DomGetModel(this).track(event)" onmouseout="return DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"';  html += '><tr><td><div style="position:relative">';   html += '<table border=0 cellpadding=0 cellspacing=0><tr><td align="center">';  html += '<div id="' + id + '_DialPanel" style="visibility:hidden;">';  html += '<img id="' + id + '_Dial" suppress=true src="' + url + '.gif" width="' + this.width + '" height="' + this.height + '">';  html += '</div></td></tr>';  if (title != undefined) {  html += '<tr><td align="center"><span class="' + className + '_title" id="' + id + '_Title">' + title + '</span></td></tr>'  }  if (label != undefined) {  html += '<tr><td align="center"><span class="' + className + '_label" id="' + id + '_Label">' + label + '</span></td></tr>'  }  html += '</table>';   html += '<div id="' + id + '_FacePanel" style="position:absolute;visibility:hidden;">';  html += '<img id="' + id + '_Face" src="' + url + value + '.gif" suppress=true width="' + this.dialWidth + '" height="' + this.dialHeight + '">';  html += '</div>';   html += '<div id="' + id + '_LabelPanel" style="position:absolute;visibility:hidden;">';  html += '<table width="' + this.dialWidth + '" height="' + this.dialHeight + '" border="0" cellpadding="0" cellspacing="0">';  html += '<tr height="33%"><td align="center" vAlign="top"><span class="' + className + '_marks">' + (clock ? 12 : Math.round(0.5 * (maximum - minimum) + minimum)) + '</span></td></tr>';;  html += '<tr height="33%"><td align="center" vAlign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0">';  html += '<tr><td align="left"><span class="' + className + '_marks">' + (clock ? 9 : (half ? Math.round(minimum) : Math.round(0.25 * (maximum - minimum) + minimum))) + '</span></td><td>&nbsp;</td><td align="right"><span class="' + className + '_marks">' + (clock ? 3 : (half ? Math.round(maximum) : Math.round(0.75 * (maximum - minimum) + minimum))) + '</span></td></tr></table></td></tr>';;  html += '<tr height="33%"><td align="center" vAlign="bottom"><span class="' + className + '_marks">' + (clock ? 6 : (half ? '&nbsp;' : Math.round(minimum))) + '</span></td></tr>';  html += '</table></div></td></tr></table>';  return html + '</div>';   case 'Lamp':  var url = (this.configuration.lampURL || '/_iView/image/lamp/');  var label = this.parameters.label;  if ((label != undefined) && !label) {  label = (this.value || '')  }  var width = 2 * (this.scale || 0.5) * 64;  var height = 2 * (this.scale || 0.5) * 64;   html += '<table border=0 cellpadding=0 cellspacing=0 style="cursor:pointer" id="' + id + '"';  html += ' onmouseover="return DomGetModel(this).track(event)" onmouseout="return DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"';  html += '>';  html += '<tr><td align="center" vAlign="top">';  if (this.parameters.title) {  html += '<span id="' + id + '_Title" class="' + className + '_title">' + this.parameters.title + '</span><br>'  }  html += '<img id="' + id + '_Lamp" suppress=true border=0 width="' + width + '" height="' + height + '" src="' + url + 'black.gif">';  if (label != undefined) {  html += '<br><span id="' + id + '_Label" class="' + className + '_Label">' + label + '</span>'  }  html += '</td></tr></table>';  return html;   case 'Bar':  var url = (this.configuration.barURL || '/_iView/image/bar/');  var goal = this.configuration.goal;  var progress = (this.configuration.progress || 0) / (goal || 1);  var label = this.parameters.label;  if ((label != undefined) && !label) {  label = goal ? ((100 * progress) + '% (' + progress + '/' + goal + ')') : (this.value || '')  }  var width = (this.configuration.scale || 0.5) * 400;  var height = (this.scale || 0.5) * 32;   html += '<table border=0 cellpadding=0 cellspacing=0 style="cursor:pointer" id="' + id + '"';  html += ' onmouseover="return DomGetModel(this).track(event)" onmouseout="return DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"';  html += '>';  if (this.parameters.title) {  html += '<tr><td id="' + id + '_Title"class="' + className + '_title">' + this.parameters.title + '</td></tr>'  }  html += '<tr><td><table border=0 cellpadding=0 cellspacing=0 height="' + height + '" width="' + width + '" style="border:inset">';  html += '<tr>';  html += '<td id="' + id + '_Completed" width="' + (progress * width) + '">';  html += '<img id="' + id + '_Bar" suppress="true" border="0" width="' + Math.min(progress * width, width - 6) + '" height="' + height + '" src="' + url + 'transparent.gif" /></td>';  html += '<td id="' + id + '_Remainder" width="' + ((1 - progress) * width) + '"></td>';  html += '</tr>';  html += '</table></td>';  html += '<td id="' + id + '_Label" class="' + className + '_label">' + label + '</td>';  html += '</tr></table>';  return html;   }  return html };  Indicator.prototype.showDial = function() {  var dialElement = document.getElementById(this.id + '_DialPanel');  if (dialElement) {  dialElement.style.visibility = 'visible'  }  var faceElement = document.getElementById(this.id + '_FacePanel');  if (faceElement) {  faceElement.style.left = Math.round((this.width - this.dialWidth) / 2);  faceElement.style.top = Math.round((this.height - this.dialHeight) / 2);  faceElement.style.visibility = 'visible'  }  var labelElement = document.getElementById(this.id + '_LabelPanel');  if (labelElement) {  labelElement.style.left = ((this.width - this.dialWidth) / 2);  labelElement.style.top = ((this.height - this.dialHeight) / 2);  labelElement.style.visibility = 'visible'  } };  Indicator.prototype.rebuild = function() {  if (this.built) {  this.cellElement.innerHTML = this.build();  this.showDial()  } };  var indicatorNextType = []; indicatorNextType.Text = 'Bar'; indicatorNextType.Bar = 'Dial'; indicatorNextType.Dial = 'Lamp'; indicatorNextType.Lamp = 'Text';  Indicator.prototype.swap = function() {  if (!this.parameters.noSwap) {  this.configuration.type = indicatorNextType[this.configuration.type];   SetCookie(this.id, PackHash(this.configuration, '|', '~'));   this.rebuild()  } };   /* Animation */   Indicator.prototype.track = function(theEvent) {  switch (theEvent.type) {   case 'mouseover':  window.status = 'Click: show graph. Ctl-click: configure controls.' + (this.parameters.noAction ? '' : ' Alt-click: change control type.');  return true;   case 'mouseout':  window.status = '';  return true;   case 'click':  if (theEvent.ctrlKey) {  CopyHash(this.controlPanel.configuration, this.configuration);  this.controlPanel.rebuild();  this.controlPanel.show(this.indicatorElement)  } else if (!this.parameters.noAction && theEvent.altKey) {  this.swap()  } else {  if (this.graphParameters.url) {  this.graphPanel.show(this.indicatorElement)  }  }  break;   } };  Indicator.prototype.notLoaded = function() {  this.imageElement.src = (this.parameters.faultURL || '/_iView/image/na.png'); };   /* Subscription */   Indicator.prototype.subscriptions = function() {  return [] };  Indicator.prototype.actions = function() {  return ['data'] };  Indicator.prototype.receive = function(action, parameters) {  switch (action) {  case 'control':  this.configuration = parameters;   SetCookie(this.id, PackHash(this.configuration, '|', '~'));   this.rebuild();  break;  case 'values':  case 'data':  this.setProperty(action, parameters);  break;  } };    function IndicatorControl(name, parameters) {  this.name = name;  this.id = 'IndicatorControl_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.className = 'indicator_control';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];   var templates = (this.configuration.thresholds || '').split(',');  var thresholds = [];  while (templates.length > 0) {  thresholds[thresholds.length] = [];  for (var column = 0; (column < 4) && (templates.length > 0); column++) {  thresholds[thresholds.length - 1][column] = templates.shift()  }  }  this.configuration.thresholds = thresholds;   var panelParameters = [];  panelParameters.html = this.build();  panelParameters.sticky = true;  this.controlPanel = new Panel(this.id + '_Panel', panelParameters);  this.controlPanel.model = this;   this.subscription = new Subscription() };   /* Construction */   IndicatorControl.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  default:  this.controlPanel.style[property] = value;  break;  } };  IndicatorControl.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  default:  return this.controlPanel.style[property];  } };  IndicatorControl.prototype.build = function(property, value) {  var id = this.id;  var className = this.className;   var thresholds = [];  var source = this.configuration.thresholds = (this.configuration.thresholds || []);  for (var index = 0; index < source.length; index++) {  thresholds[index] = [];  for (var subindex = 0; subindex < source[index].length; subindex++) {  thresholds[index][subindex] = source[index][subindex];  }  }  while (thresholds.length < 4) {  thresholds[thresholds.length] = []  }   var html = '<form><table border="0" cellspacing="0" cellpadding="0"><tr><td>';  html += 'Thresholds</td></tr><tr><td colspan="2">';  html += '<table cellspacing="0" cellpadding="0" style="border:outset">';  html += '<tr><td>Low</td><td>High</td><td>Style</td><td>Value</td>';  html += '</tr><tr>';  html += '<td nowrap="1"><input type="input" name="Threshold_0_0" size="10" value="' + (thresholds[0][0] || 0) + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_0_1" size="10" value="' + (thresholds[0][1] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><select name="ThresholdStyle_0" onchange="DomGetModel(this, 1).track(event)" ><option value="color"' + (((thresholds[0][2] || '') == 'color') ? ' selected' : '') + '>Color</option><option value="fontSize"' + (((thresholds[0][2] || '') == 'fontSize') ? ' selected' : '') + '>Font Size</option></select></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_0_3" value="' + (thresholds[0][3] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr><tr>';  html += '<td nowrap="1"><input type="input" name="Threshold_1_0" size="10" value="' + (thresholds[1][0] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_1_1" size="10" value="' + (thresholds[1][1] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><select name="ThresholdStyle_1" onchange="DomGetModel(this, 1).track(event)" ><option value="color"' + (((thresholds[1][2] || '') == 'color') ? ' selected' : '') + '>Color</option><option value="fontSize"' + (((thresholds[1][2] || '') == 'fontSize') ? ' selected' : '') + '>Font Size</option></select></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_1_3" value="' + (thresholds[1][3] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr><tr>';  html += '<td nowrap="1"><input type="input" name="Threshold_2_0" size="10" value="' + (thresholds[2][0] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_2_1" size="10" value="' + (thresholds[2][1] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><select name="ThresholdStyle_2" onchange="DomGetModel(this, 1).track(event)" ><option value="color"' + (((thresholds[2][2] || '') == 'color') ? ' selected' : '') + '>Color</option><option value="fontSize"' + (((thresholds[2][2] || '') == 'fontSize') ? ' selected' : '') + '>Font Size</option></select></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_2_3" value="' + (thresholds[2][3] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr><tr>';  html += '<td nowrap="1"><input type="input" name="Threshold_3_0" size="10" value="' + (thresholds[3][0] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_3_1" size="10" value="' + (thresholds[3][1] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1"><select name="ThresholdStyle_3" onchange="DomGetModel(this, 1).track(event)" ><option value="color"' + (((thresholds[3][2] || '') == 'color') ? ' selected' : '') + '>Color</option><option value="fontSize"' + (((thresholds[3][2] || '') == 'fontSize') ? ' selected' : '') + '>Font Size</option></select></td>';  html += '<td nowrap="1"><input type="input" name="Threshold_3_3" value="' + (thresholds[3][3] || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr></table>';  html += '</td></tr><tr vAlign="top"><td>';  html += '<table border="0" cellspacing="0" cellpadding="0"><tr><td>';  html += '<table cellspacing="0" cellpadding="0" style="border:outset">';  html += '<tr><td nowrap="1">Common Options</td></tr><tr>';  html += '<td nowrap="1">Scale<br><input type="input" name="scale" size="30" value="' + (this.configuration.scale || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr></table>';  html += '</td></tr><tr><td>';  html += '<table cellspacing="0" cellpadding="0" style="border:outset">';  html += '<tr><td nowrap="1">Lamp Options</td></tr><tr>';  html += '<td nowrap="1">URL Base<br><input type="input" name="lampURL" size="30" value="' + (this.configuration.lampURL || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr></table>';  html += '</td></tr><tr><td>';  html += '<table cellspacing="0" cellpadding="0" style="border:outset">';  html += '<tr><td nowrap="1">Bar Options</td></tr><tr>';  html += '<td nowrap="1">URL Base<br><input type="input" name="barURL" size="30" value="' + (this.configuration.barURL || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr></table>';  html += '</td></tr></table>';  html += '</td><td>';  html += '<table cellspacing="0" cellpadding="0" style="border:outset">';  html += '<tr><td nowrap="1">Dial Options</td></tr><tr>';  html += '<td nowrap="1"><input type="checkbox" value="half" name="half" ' + (this.configuration.half ? 'checked ' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Half Gauge</td>';  html += '<td nowrap="1"><input type="checkbox" value="clock" name="clock" ' + (this.configuration.clock ? 'checked ' : '') + ' onclick="DomGetModel(this, 1).track(event)" \>Clock Style</td>';  html += '</tr><tr>';  html += '<td nowrap="1">Minimum<br><input type="input" name="minimum" size="10" value="' + (this.configuration.minimum || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '<td nowrap="1">Maximum<br><input type="input" name="maximum" size="10" value="' + (this.configuration.maximum || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr><tr>';  html += '<td nowrap="1" colspan="2">URL Base<br><input type="input" name="dialURL" size="30" value="' + (this.configuration.dialURL || '') + '" onchange="DomGetModel(this, 1).track(event)" \></td>';  html += '</tr></table>';  html += '</td></tr><tr><td>';  html += '<br><input type="button" name="Close" value="Close" onclick="DomGetModel(this, 1).track(event)" \></td>';  html += '</td></tr></table></form>';  return html };  IndicatorControl.prototype.rebuild = function() {  this.controlPanel.setProperty('html', this.build()) };   /* Subscription */   IndicatorControl.prototype.show = function(targetElement) {  this.controlPanel.show(targetElement) };  IndicatorControl.prototype.hide = function() {  this.controlPanel.hide() };  IndicatorControl.prototype.track = function(theEvent) {  var id = this.id;  var className = this.className;   var targetElement = DomGetTarget(theEvent);  var names = targetElement.name.split('_');  var row = names[1] || 0;  var column = names[2] || 0;   switch (names[0]) {  case 'ThresholdStyle':  var options = targetElement.options;  for (var index = 0; index < options.length; index++) {  if (options[index].selected) {  targetElement = options[index]  }  }  column = 2;  case 'Threshold':  while (this.configuration.thresholds.length <= row) {  this.configuration.thresholds[this.configuration.thresholds.length] = ['', '', '', '']  }  this.configuration.thresholds[row][column] = targetElement.value;  break;  case 'half':  case 'clock':  this.configuration[names[0]] = targetElement.checked ? names[0] : '';  break;  case 'scale':  case 'minimum':  case 'maximum':  case 'lampURL':  case 'barURL':  case 'dialURL':  this.configuration[names[0]] = targetElement.value;  break;  case 'Close':  this.hide();  break;  }   SetCookie(id, PackHash(this.configuration, '|', '~'));   this.subscription.broadcast('change', this.configuration) };   /* Subscription */   IndicatorControl.prototype.subscriptions = function() {  return ['change'] };  IndicatorControl.prototype.actions = function() {  return [] };  IndicatorControl.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };   function Calendar(name, parameters) {  this.name = name;  this.id = 'Calendar_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  var enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.divElement = this.enclosureDocument.createElement('DIV');  enclosureElement.appendChild(this.divElement);  this.divElement.setAttribute('id', this.id + '_Calendar');  this.divElement.className = 'calendar';  this.url = '/_iView/image/calendar/';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.divElement.model = this;   this.divElement.innerHTML = this.build();   var images = ['close.gif', 'drop.gif', 'drop_hover.gif', 'left.gif', 'left_hover.gif', 'right.gif', 'right_hover.gif', 'divider.gif'];  var cache = [];  for (var index = 0; index < images.length; index++) {  cache[index] = new Image();  cache[index].src = this.url + images[index];  } };   /* Construction */   Calendar.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.divElement.className = value;  break;  case 'time':  case 'url':  this[property] = value;  break;  case 'persist':  break;  default:  this.divElement.style[property] = value;  break;  } };  Calendar.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.divElement.className;  case 'width':  case 'height':  return this.divElement.style[property];  case 'time':  case 'url':  return this[property];  case 'persist':  return this.parameters[property];  default:  return this.divElement.style[property];  } };   /* Construction */   Calendar.prototype.build = function() {  var className = this.divElement.className;  var id = this.id;   var html = '<div id="' + id + '_Frame" class="' + className + '_frame">';   html +=  '<table class="' + className + '_table">' +  '<tr class="' + className + '_heading"><td>' +  '<table class="' + className + '_caption"><tr>' +  '<td class="' + className + '_caption_content">' +  '<span id="caption">' +  '<span id="' + id + '_DecrementMonthControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp;' +  '<img id="' + id + '_DecrementMonthImage" suppress="true" src="' + this.url + 'left.gif" width=10 height=11 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp</span>&nbsp;' +  '<span id="' + id + '_IncrementMonthControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp;' +  '<img id="' + id + '_IncrementMonthImage" suppress="true" src="' + this.url + 'right.gif" width=10 height=11 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">&nbsp</span>&nbsp;' +  '<span id="' + id + '_MonthMenuControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></span>&nbsp;' +  '<span id="' + id + '_YearMenuControl" class="' + className + '_control" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></span>&nbsp;' +  '</span></td>';   if (!this.parameters.persist)  html += '<td align=right><span onclick="DomGetModel(this).hide()" style="cursor:pointer">' +  '<img src="' + this.url + 'close.gif" suppress=true width=15 height=13 border=0 alt="Close Calendar">' +  '</span></td>';   html += '</tr></table>' +  '</td></tr>' +  '<tr><td class="' + className + '_body">' +  '<span id="' + id + '_Content"></span>' +  '</td></tr></table></div>';   html += '<span id="' + id + '_MonthSelector" class="' + className + '_menu"></span>' +  '<span id="' + id + '_YearSelector" class="' + className + '_menu"></span>';   return html; };  var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var weekdayNames = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];   Calendar.prototype.construct = function() {  var className = this.divElement.className;  var id = this.id;   var html = '<table border="0" cols="7"><tr>';  for (var weekday = 0; weekday < 7; weekday++)  html += '<td align="center" class="' + className + '_content">' + weekdayNames[weekday] + '</td>';  html += '</tr>';   var today = new Date();  var thisDate = today.getFullYear() + '-' + LeadingValue(today.getMonth() + 1) + '-' + LeadingValue(today.getDate());  if (!this.selectDate) {  this.selectDate = thisDate;  }  if (!this.selectedYear) {  this.selectedYear = today.getFullYear();  }  if (this.selectedMonth == undefined) {  this.selectedMonth = today.getMonth();  }  var startDate = new Date(this.selectedYear, this.selectedMonth, 1);  var endMonth = (this.selectedMonth + 1) % 12;  var endYear = this.selectedYear + ((this.selectedMonth == 11) ? 1 : 0);  var endDate = new Date(endYear, endMonth, 1);  endDate = new Date(endDate - 24 * 3600 * 1000);  var terminalDay = endDate.getDate();  for (var day = -startDate.getDay() + 1; day <= terminalDay; ) {  html += '<tr>';  for (var weekday = 0; weekday < 7; weekday++) {  var dateTime = this.selectedYear + '-' + LeadingValue(this.selectedMonth + 1) + '-' + LeadingValue(day);  var highlight = (thisDate == dateTime);  var mark = (this.selectDate == dateTime);  html += '<td align="right" class="' + className + '_content">' +  (highlight ? ('<span class="' + className + '_date_hilite">') : '') +  ( ((day > 0) && (day <= terminalDay)) ?  ('<span onclick="DomGetModel(this).setDate(\'' + dateTime + '\')" onmouseover="window.status=\'Select ' + dateTime + '\'; return true" onmouseout="window.status=\'\'; return true" style="cursor:pointer;">' +  (mark ? ('<span class="' + className + '_date_mark">') : '') +  day +  (mark ? '</span>' : '') +  '</span>') :  '' ) +  (highlight ? '</span>' : '') +  '</td>';  day++;  }  html += '</tr>';  }  html += '</table>';   document.getElementById(id + '_Content').innerHTML = html;   document.getElementById(id + '_MonthMenuControl').innerHTML = '&nbsp;' +  monthNames[this.selectedMonth] + '&nbsp;<img id="' + id + '_MonthMenuImage" suppress=true src="' + this.url + 'drop.gif" width=12 height=10 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">';   document.getElementById(id + '_YearMenuControl').innerHTML = '&nbsp;' +  this.selectedYear + '&nbsp;<img id="' + id + '_YearMenuImage" suppress=true src="' + this.url + 'drop.gif" width=12 height=10 border=0 onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">'; };  Calendar.prototype.constructMonth = function() {  var className = this.divElement.className;  var id = this.id;   this.popDownYear();  if (!this.monthConstructed) {  var html = '';  for (month = 0; month < 12; month++) {  var highlight = (month == this.selectedMonth);  html += '<tr><td id="' + id + '_' + month + '_MonthItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"' +  (highlight ? ' style="font-weight:bold"' : '') + '>&nbsp;' + monthNames[month] +  '&nbsp;</td></tr>';  }  document.getElementById(id + '_MonthSelector').innerHTML = '<table width="70" id="' + id + '_MonthBody" class="' + className + '_menu_body" cellspacing=0 ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)">' + html + '</table>';  this.monthConstructed = true;  } };  Calendar.prototype.constructYear = function(year) {  var className = this.divElement.className;  var id = this.id;   this.popDownMonth();  if (!this.yearConstructed) {  var html = '<tr><td align="center" id="' + id + '_DecYearItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" >-</td></tr>';  for (year = 0; year < 7; year++) {  var highlight = (year == 3);  html += '<tr><td id="' + id + '_' + year + '_YearItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"' +  (highlight ? ' style="font-weight:bold"' : '') + '>&nbsp;' + (this.selectedYear + year - 3) +  '&nbsp;</td></tr>';  }  html += '<tr><td align="center" id="' + id + '_IncYearItem" class="' + className + '_menu_item" ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" >+</td></tr>';  document.getElementById(id + '_YearSelector').innerHTML = '<table width="44" id="' + id + '_YearBody" class="' + className + '_menu_body" cellspacing=0 ' +  'onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)">' + html + '</table>';  this.yearConstructed = true;  } };   /* Animation */   Calendar.prototype.track = function(theEvent) {  var className = this.divElement.className;  var id = this.id;   var target = DomGetTarget(theEvent);  var ids = target.id.split('_');   switch (ids[ids.length - 1]) {  case 'DecrementMonthControl':  case 'DecrementMonthImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_DecrementMonthImage').src = this.url + 'left_hover.gif';  document.getElementById(this.id + '_DecrementMonthControl').className = className + '_control_hover';  window.status = 'Scroll to previous month';  break;  case 'mouseout':  this.halt();  document.getElementById(this.id + '_DecrementMonthImage').src = this.url + 'left.gif';  document.getElementById(this.id + '_DecrementMonthControl').className = className + '_control';  window.status = '';  break;  case 'mousedown':  this.startDecrementMonth();  break;  case 'mouseup':  this.halt();  break;  case 'click':  this.halt();  this.decMonth();  theEvent.cancelBubble=true;  break;  }  break;  case 'IncrementMonthControl':  case 'IncrementMonthImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_IncrementMonthImage').src = this.url + 'right_hover.gif';  document.getElementById(this.id + '_IncrementMonthControl').className = className + '_control_hover';  window.status = 'Scroll to next month';  break;  case 'mouseout':  this.halt();  document.getElementById(this.id + '_IncrementMonthImage').src = this.url + 'right.gif';  document.getElementById(this.id + '_IncrementMonthControl').className = className + '_control';  window.status = '';  break;  case 'mousedown':  this.startIncrementMonth();  break;  case 'mouseup':  this.halt();  break;  case 'click':  this.halt();  this.incMonth();  theEvent.cancelBubble=true;  break;  }  break;  case 'MonthMenuControl':  case 'MonthMenuImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_MonthMenuImage').src = this.url + 'drop_hover.gif';  document.getElementById(this.id + '_MonthMenuControl').className = className + '_control_hover';  window.status = 'Select month';  break;  case 'mouseout':  document.getElementById(this.id + '_MonthMenuImage').src = this.url + 'drop.gif';  document.getElementById(this.id + '_MonthMenuControl').className = className + '_control';  window.status = '';  break;  case 'click':  this.popUpMonth();  break;  }  break;  case 'YearMenuControl':  case 'YearMenuImage':  switch (theEvent.type) {  case 'mouseover':  document.getElementById(this.id + '_YearMenuImage').src = this.url + 'drop_hover.gif';  document.getElementById(this.id + '_YearMenuControl').className = className + '_control_hover';  window.status = 'Select year';  break;  case 'mouseout':  document.getElementById(this.id + '_YearMenuImage').src = this.url + 'drop.gif';  document.getElementById(this.id + '_YearMenuControl').className = className + '_control';  window.status = '';  break;  case 'click':  this.popUpYear();  break;  }  break;  case 'MonthBody':  switch (theEvent.type) {  case 'mouseover':  this.stop();  break;  case 'mouseout':  this.startPopDownMonth();  break;  }  break;  case 'MonthItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  target.className = className + '_menu_item';  break;  case 'click':  this.monthConstructed = false;  this.selectedMonth = parseInt(ids[ids.length - 2]);  this.construct();  this.popDownMonth();  break;  }  break;  case 'YearBody':  switch (theEvent.type) {  case 'mouseover':  this.stop();  break;  case 'mouseout':  this.startPopDownYear();  break;  }  break;  case 'YearItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  target.className = className + '_menu_item';  break;  case 'click':  this.selectYear(this.selectedYear + parseInt(ids[ids.length - 2]) - 3);  theEvent.cancelBubble=true;  break;  }  break;  case 'DecYearItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  this.halt();  target.className = className + '_menu_item';  break;  case 'mousedown':  this.startDecrementYear();  break;  case 'mouseup':  this.halt();  break;  }  break;  case 'IncYearItem':  switch (theEvent.type) {  case 'mouseover':  target.className = className + '_menu_item_hover';  break;  case 'mouseout':  this.halt();  target.className = className + '_menu_item';  break;  case 'mousedown':  this.startIncrementYear();  break;  case 'mouseup':  this.halt();  break;  }  break;  } };  Calendar.prototype.setDate = function(date) {  this.date = date;  if (this.targetElement) {  this.targetElement.value = date + (this.time ? (' ' + this.time) : '');  DomFireEvent(this.targetElement, 'change')  }  this.show();  if (!this.parameters.persist) {  this.hide();  } }; Calendar.prototype.show = function(targetElement) {  if (targetElement) {  this.targetElement = targetElement;  }   var date = this.targetElement ? this.targetElement.value : this.date;  if (date) {  var defaultDate = new Date();  date = date.substring(0, 10);  var delimiters = ['-', '/', '.', ' ', '\\'];  var parts;  for (var index = 0; index < delimiters.length; index++) {  parts = date.split(delimiters[index]);  if (parts.length > 0) {  this.selectedYear = parseInt(parts[0]) || defaultDate.getFullYear();  if (parts.length > 1) {  parts[1] = parts[1].replace(/^0+(.)/, "$1");  this.selectedMonth = parseInt(parts[1]) || (defaultDate.getMonth() + 1);  if (this.selectedMonth != undefined) this.selectedMonth--;  if (parts[1] < 10)  parts[1] = '0' + parts[1];  if (parts.length > 2) {  parts[2] = parts[2].replace(/^0+(.)/, "$1");  this.selectedDay = parseInt(parts[2]) || defaultDate.getDate();  if (parts[2] < 10)  parts[2] = '0' + parts[2];  parts.length = 3;  } else  parts[2] = '01';  } else  parts[1] = parts[2] = '01';  this.selectDate = parts.join('-');  break;  }  }  }   this.calendarFrameElement = document.getElementById(this.id + '_Frame');  this.calendarElement = document.getElementById(this.id + '_Calendar');  this.calendarPosition = this.calendarPosition || DomGetElementPosition(this.calendarElement);   this.targetPosition = this.targetElement ? DomGetElementPosition(this.targetElement) : [0, 0];  this.targetHeight = this.targetElement ? DomGetElementHeight(this.targetElement) : 0;   this.calendarElement.style.left = LinearDimension(Math.max(0, this.targetPosition[0]));  this.calendarElement.style.top = LinearDimension(Math.max(0, this.targetPosition[1] + this.targetHeight));   this.construct();   this.calendarElement.style.visibility = 'visible';  this.calendarFrameElement.style.visibility = 'visible';   this.monthElement = document.getElementById(this.id + '_MonthSelector');  this.yearElement = document.getElementById(this.id + '_YearSelector'); };  Calendar.prototype.hide = function() {  if (this.calendarElement) {  this.calendarElement.style.visibility = 'hidden';  this.calendarFrameElement.style.visibility = 'hidden';  this.monthElement.style.visibility = 'hidden';  this.yearElement.style.visibility = 'hidden';  } };   /* Month Animations */   Calendar.prototype.incMonth = function() {  this.selectedMonth++;  if (this.selectedMonth > 11) {  this.selectedMonth = 0;  this.selectedYear++;  }  this.construct(); };  Calendar.prototype.decMonth = function() {  this.selectedMonth--;  if (this.selectedMonth < 0) {  this.selectedMonth = 11;  this.selectedYear--;  }  this.construct(); };  Calendar.prototype.startIncrementMonth = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.incMonth() }, speed || 500); };  Calendar.prototype.startDecrementMonth = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.decMonth() }, speed || 500); };  Calendar.prototype.halt = function() {  clearInterval(this.intervalTask); };  Calendar.prototype.startPopDownMonth = function(delay) {  var calendar = this;  this.stop();  this.intervalTask = setInterval(function() { calendar.popDownMonth() }, delay || 1000); };  Calendar.prototype.startPopDownYear = function(delay) {  var calendar = this;  this.stop();  this.intervalTask = setInterval(function() { calendar.popDownYear() }, delay || 1000); };  Calendar.prototype.stop = function() {  clearTimeout(this.timeoutTask); };  Calendar.prototype.popUpMonth = function() {  this.constructMonth();  this.monthElement.style.left = document.getElementById(this.id + '_MonthMenuControl').offsetLeft + 6;  this.monthElement.style.top = document.getElementById(this.id + '_MonthMenuControl').offsetHeight + 6;  this.monthElement.style.visibility = 'visible'; };  Calendar.prototype.popDownMonth = function() {  this.monthElement.style.visibility = 'hidden'; };   /* Year Animations */   Calendar.prototype.incYear = function() {  this.selectedYear++;  for (year = 0; year < 7; year++) {  var highlight = (year == 3);  document.getElementById(this.id + '_' + year + '_YearItem').innerHTML =  '&nbsp;' + (this.selectedYear + year - 3) + '&nbsp;';  } };  Calendar.prototype.decYear = function() {  this.selectedYear--;  for (year = 0; year < 7; year++) {  var highlight = (year == 3);  document.getElementById(this.id + '_' + year + '_YearItem').innerHTML =  '&nbsp;' + (this.selectedYear + year - 3) + '&nbsp;';  } };  Calendar.prototype.startIncrementYear = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.incYear() }, speed || 80); };  Calendar.prototype.startDecrementYear = function(speed) {  var calendar = this;  this.halt();  this.intervalTask = setInterval(function() { calendar.decYear() }, speed || 80); };  Calendar.prototype.selectYear = function(year) {  this.selectedYear = parseInt(year);  this.yearConstructed = false;  this.construct();  this.popDownYear(); };  Calendar.prototype.popUpYear = function(year) {  this.constructYear();  this.yearElement.style.visibility = 'visible';  this.yearElement.style.left = document.getElementById(this.id + '_YearMenuControl').offsetLeft + 6;  this.yearElement.style.top = document.getElementById(this.id + '_YearMenuControl').offsetHeight + 6; };  Calendar.prototype.popDownYear = function() {  this.halt();  this.stop();  this.yearElement.style.visibility = 'hidden'; };  function DateTime(name, parameters) {  this.name = name;  this.id = 'DateTime_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.className = 'dateTime';   this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];   var panelParameters = [];  panelParameters.html = this.build();  panelParameters.sticky = this.parameters.sticky;  this.timePanel = new Panel(this.id + '_Panel', panelParameters);   var calendarParameters = [];  calendarParameters.time = '00:00:00';  this.calendar = new Calendar(this.id + '_Calendar', calendarParameters);   this.timePanel.model = this;  this.subscription = new Subscription() };   /* Construction */   DateTime.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'html':  this.timePanel.innerHTML = value;  break;  default:  this.timePanel.style[property] = value;  break;  } };  DateTime.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'html':  return this.timePanel.innerHTML;  default:  return this.timePanel.style[property];  } };  DateTime.prototype.build = function() {  var id = this.id;  var className = this.className;   var html = '<h2>Date Time Constraints</h2>';  html += '<table className="' + className + '_frame" border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td>Period</td></tr>';  html += '<tr><td><select id="' + id + '_Control_Period" onchange="DomGetModel(this, 1).track(event)">';  html += '<option value="Last" ' + (this.configuration.Period == 'Last' ? ' selected' : '') + '>Last</option>';  html += '<option value="Today" ' + (this.configuration.Period == 'Today' ? ' selected' : '') + '>Today</option>';  html += '<option value="Yesterday" ' + (this.configuration.Period == 'Yesterday' ? ' selected' : '') + '>Yesterday</option>';  html += '<option value="Last 24 Hours" ' + (this.configuration.Period == 'Last 24 Hours' ? ' selected' : '') + '>Last 24 Hours</option>';  html += '<option value="This Week" ' + (this.configuration.Period == 'This Week' ? ' selected' : '') + '>This Week</option>';  html += '<option value="Last Week" ' + (this.configuration.Period == 'Last Week' ? ' selected' : '') + '>Last Week</option>';  html += '<option value="Last 7 Days" ' + (this.configuration.Period == 'Last 7 Days' ? ' selected' : '') + '>Last 7 Days</option>';  html += '<option value="This Month" ' + (this.configuration.Period == 'This Month' ? ' selected' : '') + '>This Month</option>';  html += '<option value="Last Month" ' + (this.configuration.Period == 'Last Month' ? ' selected' : '') + '>Last Month</option>';  html += '<option value="Last 30 Days" ' + (this.configuration.Period == 'Last 30 Days' ? ' selected' : '') + '>Last 30 Days</option>';  html += '<option value="This Year" ' + (this.configuration.Period == 'This Year' ? ' selected' : '') + '>This Year</option>';  html += '<option value="Last Year" ' + (this.configuration.Period == 'Last Year' ? ' selected' : '') + '>Last Year</option>';  html += '<option value="Last 365 Days" ' + (this.configuration.Period == 'Last 365 Days' ? ' selected' : '') + '>Last 365 Days</option>';  html += '<option value="Other..." ' + (this.configuration.Period == 'Other...' ? ' selected' : '') + '>Other...</option>';  html += '</select></td></tr>';  html += '<tr><td>Summary</td></tr>';  html += '<tr><td><select id="' + id + '_Control_Group" onchange="DomGetModel(this, 1).track(event)">';  html += '<option value="(None)" ' + (this.configuration.Group == '(None)' ? ' selected' : '') + '>(None)</option>';  html += '<option value="Hour" ' + (this.configuration.Group == 'Hour' ? ' selected' : '') + '>Hour</option>';  html += '<option value="Day" ' + (this.configuration.Group == 'Day' ? ' selected' : '') + '>Day</option>';  html += '<option value="Week" ' + (this.configuration.Group == 'Week' ? ' selected' : '') + '>Week</option>';  html += '<option value="Month" ' + (this.configuration.Group == 'Month' ? ' selected' : '') + '>Month</option>';  html += '<option value="Year" ' + (this.configuration.Group == 'Year' ? ' selected' : '') + '>Year</option>';  html += '</select></td></tr>';  html += '<tr><td><div id="' + id + '_OtherTime" style="position:relative;display:' + ((this.configuration.Period == 'Other...') ? 'block' : 'none') + '">';  html += '<table border="0" cellpadding="0" cellspacing="0">';  html += '<tr><td>From</td></tr>';  html += '<tr><td><input type="text" size="20" value="' + (this.configuration.From || '') + '" id="' + id + '_Input_From" onfocus="DomGetModel(this, 1).track(event)" onchange="DomGetModel(this, 1).track(event)" /></td></tr>';  html += '<tr><td>To</td></tr>';  html += '<tr><td><input type="text" size="20" value="' + (this.configuration.To || '') + '" id="' + id + '_Input_To" onfocus="DomGetModel(this, 1).track(event)" onchange="DomGetModel(this, 1).track(event)" /></td></tr>';  html += '</table>';  html += '</div></td></tr>';  html += '<tr><td>Limit</td></tr>';  html += '<tr><td><input type="text" size="20" value="' + (this.configuration.Limit || '') + '" id="' + id + '_Input_Limit" onchange="DomGetModel(this, 1).track(event)" /></td></tr>';  html += '<tr><td><br><input type="button" value="Apply" id="' + id + '_Button_Apply" onclick="DomGetModel(this, 1).track(event)" \></td>';  html += '<td><br><input type="button" value="Close" id="' + id + '_Button_Hide" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '</table>';   return html };   /* Animation */   DateTime.prototype.track = function(theEvent) {   var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var ids = targetElement.id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Period':  case 'Group':  switch (theEvent.type) {  case 'change':  var options = targetElement.options;  for (var index = 0; index < options.length; index++) {  if (options[index].selected) {  this.configuration[action] = options[index].value;  }  }  document.getElementById(id + '_OtherTime').style.display = ((this.configuration.Period == 'Other...') ? 'block' : 'none');  break;  }  break;  case 'From':  case 'To':  switch (theEvent.type) {  case 'focus':  this.calendar.show(targetElement);  break;  }  case 'Limit':  switch (theEvent.type) {  case 'change':  this.configuration[action] = targetElement.value;  break;  }  break;  case 'Apply':  switch (theEvent.type) {  case 'click':  break;  }  break;  case 'Hide':  switch (theEvent.type) {  case 'click':  this.timePanel.hide();  return;  }  break;  }  SetCookie(id, PackHash(this.configuration, '|', '~'), 7);  this.subscription.broadcast('change', this.configuration) };  DateTime.prototype.show = function(targetElement) {  this.timePanel.show(targetElement) };  DateTime.prototype.hide = function() {  this.timePanel.hide() };   /* Subscription */   DateTime.prototype.subscriptions = function() {  return ['change'] };  DateTime.prototype.actions = function() {  return ['value'] };  DateTime.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  DateTime.prototype.receive = function(action, parameters) {  switch (action) {  case 'value':  CopyHash(this.configuration, parameters);  this.timePanel.setProperty('html', this.build());  break;  } };   /* Request XML Document */  function iVIEWclientXMLrequest() { };  iVIEWclientXMLrequest.create = function() {  if (typeof ActiveXObject != "undefined") {  try {  return new ActiveXObject("Microsoft.XMLHTTP");  }  catch(a) {  }  }  if (typeof XMLHttpRequest != "undefined") {  return new XMLHttpRequest();  }  return null; };  var XmlHttp = iVIEWclientXMLrequest;    /* Request XSLT Document */   function iVIEWclientXSLTrequest(xsltDoc) {  this.stylesheet = xsltDoc; }; iVIEWclientXSLTrequest.cache_ = new Object();   iVIEWclientXSLTrequest.create = function(xsltDoc) {  return new iVIEWclientXSLTrequest(xsltDoc); };  iVIEWclientXSLTrequest.getCached = function(functionId) {  return iVIEWclientXSLTrequest.cache_[functionId]; };  iVIEWclientXSLTrequest.cache = function(functionId, functionBody) {  iVIEWclientXSLTrequest.cache_[functionId] = functionBody; };  iVIEWclientXSLTrequest.prototype.transformToHtml = function(xmlDoc, targetElement) {  if (typeof xmlDoc.transformNode != "undefined") {  targetElement.innerHTML = xmlDoc.transformNode(this.stylesheet);  } else if ((typeof XSLTProcessor != "undefined") && (typeof XSLTProcessor.prototype.importStylesheet != "undefined")) {  var xsltProcessor = new XSLTProcessor();  xsltProcessor.importStylesheet(this.stylesheet);  var xsltFragment = xsltProcessor.transformToFragment(xmlDoc, window.document);  targetElement.innerHTML = "";  targetElement.appendChild(xsltFragment);  } else {  targetElement.innerHTML = "";  } };  var Xslt = iVIEWclientXSLTrequest;    function Store(name, parameters) {  this.name = name;  this.id = 'Store_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.terms = [];   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.subscription = new Subscription();  this.xmlRequest = XmlHttp.create() };   /* Construction */   Store.prototype.setProperty = function(property, value) {  switch (property) {  case 'user':  case 'password':  case 'delay':  case 'url':  this[property] = (value || '');  break;  case 'terms':  this.terms = [];  CopyHash(this[property], value || []);  break;  case 'term':  var term = EnsureRecord(value);  if (term[0]) {  this.terms[term[0]] = term[1];  }  break;  } };  Store.prototype.getProperty = function(property) {  switch (property) {  case 'user':  case 'password':  case 'delay':  case 'url':  case 'terms':  return this[property];  break;  } };   /* Animation */   Store.prototype.startLoad = function(delay) {  var store = this;  this.timeoutTask = setTimeout(function() { store.load() }, delay || this.delay || 60000); };  Store.prototype.stopLoad = function() {  this.delay = 0;  if (this.timeoutTask) {  clearTimeout(this.timeoutTask)  } };  var storeReadyStates = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];  Store.prototype.load = function() {  var terms = [];  CopyHash(terms, this.terms);  this.query = this.url + '?' + PackHash(terms);   this.xmlRequest = XmlHttp.create();  this.xmlRequest.open("GET", this.query, true, this.user, this.password);   var store = this;   this.xmlRequest.onreadystatechange = function() {  if (store.xmlRequest.readyState == 4) {  store.xmlDoc = store.xmlRequest.responseXML;  if (!store.xmlDoc || (store.xmlDoc.parseError && store.xmlDoc.parseError.errorCode)) {  store.subscription.broadcast('error', [store.GetStatus()])  } else {  store.subscription.broadcast('data', [store.xmlDoc, store]);  if (store.delay) {  store.startLoad()  }  }  } else {  store.subscription.broadcast('state', [storeReadyStates[store.xmlRequest.readyState], store])  }  };   this.xmlRequest.send(null) };  Store.prototype.GetState = function() {  return storeReadyStates[this.xmlRequest.readyState] };  Store.prototype.GetStatus = function() {  return this.xmlDoc ?  (this.xmlRequest.status != 200) ?  ('Error receiving data: ' + this.xmlRequest.status + ' [' + this.xmlRequest.statusText + ']') :  this.xmlDoc.parseError.errorCode ?  ('Error loading data: ' + this.xmlDoc.parseError.errorCode + ' on line ' + this.xmlDoc.parseError.line + " because\n" + this.xmlDoc.parseError.reason + "\n" + this.xmlDoc.parseError.srcText) :  'Data loaded' :  'Data failed to load' };   /* Access */   Store.prototype.GetNodeListByTagName = function(name) {  return (this.xmlDoc && this.xmlDoc.documentElement) ? this.xmlDoc.documentElement.getElementsByTagName(name) : [] };  Store.prototype.GetNodeListLength = function(nodeList) {  return nodeList ? nodeList.length : 0 };  Store.prototype.GetNode = function(nodeList, index) {  return (nodeList && (index >= 0) && (index < nodeList.length)) ? nodeList[index] : null };  Store.prototype.GetNodeChildren = function(node, type) {  var list = [];  if (type) {  var nodeList = node ? node.childNodes : [];  for (var index = 0; index < nodeList.length; index++) {  if (nodeList[index].nodeType == type) {  list[list.length] = nodeList[index]  }  }  } else {  list = (node ? node.childNodes : [])  }  return list };  Store.prototype.GetNodeAttributeNames = function(node) {  if (node) {  var names = [];  var attributeList = nodes.attributes;  for (var index = 0; index < attributeList.length; index++) {  names[names.length] = attributeList.item(index).name;  }  return names  }  return null };  Store.prototype.GetNodeAttribute = function(node, name) {  return node ? node.getAttribute(name) : null };  Store.prototype.GetNodeName = function(node) {  return node ? node.nodeName : null }; Store.prototype.GetNodeType = function(node) {  return node ? node.nodeType : null }; Store.prototype.GetNodeValue = function(node) {  return node ? node.nodeValue : null };   /* Subscription */   Store.prototype.subscriptions = function() {  return ['data', 'state', 'error'] };  Store.prototype.actions = function() {  return ['url', 'term', 'terms', 'request'] };  Store.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Store.prototype.receive = function(action, parameters) {  switch (action) {  case 'url':  case 'term':  case 'terms':  this.setProperty(action, parameters);  case 'request':  this.load();  break;  } };    function StoreTable(name, parameters) {  this.name = name;  this.id = 'StoreTable_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.terms = [];   this.store = new Store(name, []);   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.registry = [];  this.selection = [];  this.subscription = new Subscription();  this.store.subscribe(this, 'data', 'data') };   /* Construction */   StoreTable.prototype.setProperty = function(property, value) {  switch (property) {  case 'selection':  this.select(value);  break;  case 'table':  case 'data':  case 'nodeName':  case 'nodeList':  this[property] = (value || []);  break;  case 'user':  case 'password':  case 'delay':  case 'url':  case 'terms':  case 'term':  this.store.setProperty(property, value);  break;  } };  StoreTable.prototype.getProperty = function(property) {  switch (property) {  case 'selection':  case 'table':  case 'data':  case 'nodeName':  case 'nodeList':  return this[property];  case 'user':  case 'password':  case 'delay':  case 'url':  case 'terms':  case 'term':  return this.store.getProperty(property);  } };   /* Animation */   StoreTable.prototype.startLoad = function(delay) {  this.store.startLoad(delay) };  StoreTable.prototype.stopLoad = function() {  this.store.stopLoad() };  StoreTable.prototype.load = function() {  this.store.load() };   /* Access */   StoreTable.prototype.post = function() {  var status = [];  this.data = [];  var table = this.table || [];  for (var index = 0; index < this.selection.length; index++) {  var row = this.selection[index];  if ((row >= 0) && (row < this.table.length)) {  var record = table[row];  for (var field = 0; field < record.length; field++) {  if (status[field] == undefined) {  status[field] = this.data[field] = record[field]  } else if (status[field] && (this.data[field] != record[field])) {  this.data[field] = ''  }  }  }  }  this.subscription.broadcast('post', this.data) };  StoreTable.prototype.distribute = function() {  var record = this.table[this.table.length - 1] || [];  for (var key in this.registry) {  var field = this.registry[key][0];  var target = this.registry[key][1];  if (target) {  target.receive('data', record[field] || '')  }  } };  StoreTable.prototype.select = function(selection) {  this.selection = EnsureRecord(selection || []);  this.post() };  StoreTable.prototype.update = function(record, change) {  record = record || [];  this.selection = EnsureRecord(this.selection || []);  this.table = this.table || [];  for (var index = 0; index < this.selection.length; index++) {  var row = this.selection[index];  if (row >= 0) {  while (this.table.length <= row) {  this.table[this.table.length] = []  }  if (change != undefined) {  this.table[row][change] = record[change]  } else {  for (var field = 0; field < record.length; field++) {  this.table[row][field] = record[field]  }  }  }  }  this.subscription.broadcast('data', this.table) };  StoreTable.prototype.clone = function() {  this.selection = EnsureRecord(this.selection || []);  this.table = this.table || [];  for (var index = this.selection.length - 1; index >= 0; index--) {  var row = this.selection[index];  if (row >= 0) {  while (this.table.length <= row) {  this.table[this.table.length] = []  }  var record = [];  for (var field = 0; field < this.table[row].length; field++) {  record[field] = this.table[row][field]  }  for (var tail = this.table.length; tail > row; tail--) {  this.table[tail] = this.table[tail - 1]  }  this.table[row] = record  }  this.selection[index] += (index + 1)  }  this.subscription.broadcast('data', this.table) };  StoreTable.prototype.prune = function() {  this.selection = EnsureRecord(this.selection || []);  this.table = this.table || [];  for (var index = this.selection.length - 1; index >= 0; index--) {  var row = this.selection[index];  if (row >= 0) {  for (var tail = row + 1; tail < this.table.length; tail++) {  this.table[tail - 1] = this.table[tail]  }  this.table.length -= 1  }  }  this.selection = [];  this.subscription.broadcast('data', this.table) };  StoreTable.prototype.parse = function() {  this.table = [];  if (this.nodeName) {  var recordList = this.nodeName ? this.store.GetNodeListByTagName(this.nodeName) : this.store.GetNodeChildren(this.store.xmlDoc.documentElement);  for (var row = 0; row < recordList.length; row++) {  var fields = [];  var fieldList = this.store.GetNodeChildren(recordList[row], 1);  for (var column = 0; column < fieldList.length; column++) {  var valueList = this.store.GetNodeChildren(fieldList[column]);  if (valueList.length) {  fields[column] = valueList[0].nodeValue  }  }  this.table[this.table.length] = fields  }  this.subscription.broadcast('loaded', this.table);  } else {  var name = this.store.GetNodeName(this.store.xmlDoc.documentElement);  switch (name) {  case 'Report':  this.subscription.broadcast('loaded', this.parseReport());  break;  case 'Vectors':  this.subscription.broadcast('loaded', this.parseVectors());  break;  case 'Values':  this.subscription.broadcast('loaded', this.parseValues());  break;  }  } }; StoreTable.prototype.parseReport = function() {  var result = [];  var vectors = this.store.GetNodeChildren(this.store.xmlDoc.documentElement, 1);  var vectorsLength = this.store.GetNodeListLength(vectors);  for (var vectorIndex = 0; vectorIndex < vectorsLength; vectorIndex++) {  if (this.store.GetNodeName(this.store.GetNode(vectors, vectorIndex)) == 'Report') {  var report = this.store.GetNode(vectors, vectorIndex);  var records = this.store.GetNodeChildren(report, 1);  var recordsLength = this.store.GetNodeListLength(records);  for (var recordsIndex = 0; recordsIndex < recordsLength; recordsIndex++) {  var hash = [];  var record = this.store.GetNode(records, recordsIndex);  var values = this.store.GetNodeChildren(record, 1);  var valuesLength = this.store.GetNodeListLength(values);  for (var valuesIndex = 0; valuesIndex < valuesLength; valuesIndex++) {  var inside;  var node = this.store.GetNode(values, valuesIndex);  var contents = this.store.GetNodeChildren(node);  var contentsLength = this.store.GetNodeListLength(contents);  for (var contentsIndex = 0; contentsIndex < contentsLength; contentsIndex++) {  inside = this.store.GetNodeValue(this.store.GetNode(contents, contentsIndex));  }  hash[this.store.GetNodeName(node)] = inside;  }  result[result.length] = hash;  }  }  }  return result; }; StoreTable.prototype.parseVectors = function() {  var result = [];  var vectors = this.store.GetNodeChildren(this.store.xmlDoc.documentElement, 1);  var vectorsLength = this.store.GetNodeListLength(vectors);  for (var vectorIndex = 0; vectorIndex < vectorsLength; vectorIndex++) {  var array = [];  var vector = this.store.GetNode(vectors, vectorIndex);  var name = this.store.GetNodeName(vector);  if (name) {  var values = this.store.GetNodeChildren(vector, 1);  var valuesLength = this.store.GetNodeListLength(values);  for (var valuesIndex = 0; valuesIndex < valuesLength; valuesIndex++) {  var value = this.store.GetNode(values, valuesIndex);  var contents = this.store.GetNodeChildren(value);  var contentsLength = this.store.GetNodeListLength(contents);  for (var contentsIndex = 0; contentsIndex < contentsLength; contentsIndex++) {  var node = this.store.GetNode(contents, contentsIndex);  array[array.length] = this.store.GetNodeValue(node);  }  }  result[name] = array;  }  }  return result; }; StoreTable.prototype.parseValues = function() {  var result = [];  var values = this.store.GetNodeChildren(this.store.xmlDoc.documentElement, 1);  var valuesLength = this.store.GetNodeListLength(values);  for (var valueIndex = 0; valueIndex < valuesLength; valueIndex++) {  var inside = '';  var value = this.store.GetNode(values, valueIndex);  var name = this.store.GetNodeName(value);  if (name == 'Report') {  inside = this.parseReport(value);  } else {  var contents = this.store.GetNodeChildren(value);  var contentsLength = this.store.GetNodeListLength(contents);  for (var contentsIndex = 0; contentsIndex < contentsLength; contentsIndex++) {  var node = this.store.GetNode(contents, contentsIndex);  inside = this.store.GetNodeValue(node);  }  }  result[name] = inside;  }  return result; };  /* Subscription */   StoreTable.prototype.subscriptions = function() {  return ['data', 'loaded', 'post', 'error', 'state'] };  StoreTable.prototype.actions = function() {  return ['data', 'update', 'select', 'clone', 'prune', 'url', 'term', 'terms', 'request'] };  StoreTable.prototype.subscribe = function(target, type, action) {  switch (type) {  case 'data':  case 'loaded':  case 'post':  this.subscription.subscribe(target, type, action);  break;  case 'error':  case 'state':  this.store.subscription.subscribe(target, type, action);  break;  } };  StoreTable.prototype.register = function(source, field, reference) {  this.registry[source] = [field, reference] };  StoreTable.prototype.receive = function(action, parameters) {  switch (action) {  case 'url':  case 'term':  case 'terms':  case 'request':  this.store.receive(action, parameters);  break;  case 'data':  this.parse();  this.post();  this.distribute();  break;  case 'select':  this.select(parameters);  break;  case 'clone':  this.clone();  break;  case 'prune':  this.prune();  break;  case 'update':  this.update(parameters);  break;  default:  if (this.registry[action]) {  this.update(parameters, this.registry[action][0]);  }  } };   function Status(name, parameters) {  this.name = name;  this.id = 'Status_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.className = 'status';   this.statusElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.statusElement);  this.statusElement.model = this;  this.statusElement.className = this.className + '_frame';  this.statusElement.style.cursor = 'pointer';  this.statusElement.setAttribute('cellPadding', 0);  this.statusElement.setAttribute('cellSpacing', 0);  this.statusElement.setAttribute('border', 0);   var tableBody = this.enclosureDocument.createElement('TBODY');  this.statusElement.appendChild(tableBody);   var tableRow = this.enclosureDocument.createElement('TR');  tableBody.appendChild(tableRow);  tableBody.model = this;   this.completedCell = this.enclosureDocument.createElement('TD');  tableRow.appendChild(this.completedCell);  this.completedCell.style.width = LinearDimension(0);  DomAddEventListener(this.completedCell, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.remainingCell = this.enclosureDocument.createElement('TD');  tableRow.appendChild(this.remainingCell);  this.remainingCell.innerHTML = '&nbsp;';  DomAddEventListener(this.remainingCell, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.store = new Store(this.id + '_Track');  this.store.subscribe(this, 'data', 'progress') };   /* Construction */   Status.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'width':  case 'height':  this.statusElement.style[property] = LinearDimension(value);  this[property] = (value || this.statusElement.style[property]);  break;  case 'url':  case 'goal':  this[property] = (value || '');  break;  case 'data':  var progress = (this.progress = (value || 0)) / (this.goal || 100);  this.completedCell.style.width = LinearDimension((this.width || 200) * progress);  this.remainingCell.style.width = LinearDimension((this.width || 200) * (1 - progress));  this.remainingCell.setAttribute('align', 'right');  if (progress < 0.5) {  this.remainingCell.innerHTML = Math.round(100 * progress) + '%' + (this.goal ? (' (' + (value || 0) + '/' + (this.goal || 100) + ')') : '');  this.completedCell.innerHTML = ''  } else {  this.remainingCell.innerHTML = '';  this.completedCell.innerHTML = Math.round(100 * progress) + '%' + (this.goal ? (' (' + (value || 0) + '/' + (this.goal || 100) + ')') : '')  }  break;  default:  this.statusElement.style[property] = value;  } };  Status.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.statusElement.style[property];  case 'goal':  case 'url':  return this[property];  case 'data':  return this.progress;  default:  return this.statusElement.style[property];  } };   /* Animation */   Status.prototype.startTracking = function(delay) {  this.stopTracking();  var parameters = [];  this.store.setProperty('url', this.url);  var terms = [];  terms.Web = 'Track';  terms.Track = this.trackId;  var delay = 0;  if (this.cancel) {  delete this.cancel;  terms.Cancel = 'True';  this.receive('error', ['User Stop Load'])  } else {  delay = 1000  }  this.store.setProperty('terms', terms);  this.store.setProperty('delay', delay);  this.store.load() };  Status.prototype.stopTracking = function(delay) {  if (this.store) {  this.store.setProperty('delay', 0)  } };  Status.prototype.shutdown = function(delay) {  var status = this;  if (this.trackId) {  delete this.trackId;  setTimeout(function() { status.receive('halt') }, delay || 10000)  } };  Status.prototype.track = function(theEvent) {  var targetElement = DomGetTarget(theEvent);  if (confirm("Stop loading data?")) {  this.cancel = true;  this.startTracking()  } };   /* Subscription */   Status.prototype.subscriptions = function() {  return [] };  Status.prototype.actions = function() {  return ['done', 'error', 'state', 'halt'] };  Status.prototype.receive = function(action, parameters) {  var className = this.className;  switch (action) {  case 'state':  if (!this.inhibit) {  this.completedCell.className = className + '_ok';  this.remainingCell.className = className + '_warning';  if (this.progress <= 0) {  this.remainingCell.style.width = LinearDimension(this.width || 200);  this.completedCell.style.width = LinearDimension(0);  }  if (parameters[0] == 'Loading') {  var source = parameters[1];  if (source.terms.Track && !this.trackId) {  this.trackId = source.terms.Track;  this.startTracking()  }  if ((this.progress || 0) < 0.5) {  this.completedCell.innerHTML = '';  this.remainingCell.innerHTML = parameters[0]  } else {  this.completedCell.innerHTML = parameters[0];  this.remainingCell.innerHTML = ''  }  break;  } else if (parameters[0] == 'Loaded') {  this.setProperty('data', (this.goal || 100));  } else {  break;  }  }  case 'done':  if (this.trackId) {  this.inhibit = true;  this.stopTracking()  }  this.completedCell.className = className + '_ok';  this.completedCell.style.width = LinearDimension(this.width || 200);  this.remainingCell.style.width = LinearDimension(0);  this.completedCell.innerHTML = 'Loaded';  this.remainingCell.innerHTML = '';  this.progress = 0;  this.shutdown();  break;  case 'error':  if (this.trackId) {  this.inhibit = true;  this.stopTracking()  }  this.completedCell.style.width = LinearDimension(this.width || 200);  this.remainingCell.style.width = LinearDimension(0);  this.completedCell.innerHTML = parameters[0];  this.remainingCell.innerHTML = '';  this.completedCell.className = className + '_error';  this.progress = 0;  this.shutdown();  break;  case 'halt':  this.completedCell.className = className + '_silent';  this.remainingCell.className = className + '_silent';  if ((this.progress || 0) < 0.5) {  this.completedCell.innerHTML = '';  this.remainingCell.innerHTML = '&nbsp;'  } else {  this.completedCell.innerHTML = '&nbsp;';  this.remainingCell.innerHTML = ''  }  delete this.inhibit;  break;  case 'progress':  if (!this.inhibit) {  var progressStore = parameters[1];  var maximumNodeList = progressStore.GetNodeListByTagName('Maximum');  if (maximumNodeList && (maximumNodeList.length > 0)) {  var maximum = maximumNodeList[0].firstChild.nodeValue;  if (maximum > 1) {  this.setProperty('goal', maximum)  }  }  var progressNodeList = progressStore.GetNodeListByTagName('Completed');  if (progressNodeList && (progressNodeList.length > 0)) {  var progress = progressNodeList[0].firstChild.nodeValue;  if (progress > 1) {  this.setProperty('data', progress)  }  }  }  break;  } };    function Report(name, parameters) {  this.name = name;  this.id = 'Report_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);  this.parameters.terms = [];  CopyHash(this.parameters.terms, parameters.terms || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.reportElement = this.enclosureDocument.createElement('DIV');  this.enclosureElement.appendChild(this.reportElement);  this.reportElement.id = this.id + '_Frame';  this.reportElement.model = this;   this.className = 'report';   this.graphParameters = [];  this.dateTime = [];   this.control = [];  this.control.SuppressDisplay = this.parameters.SuppressDisplay;   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   DomAddEventListener(this.reportElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.dateTimePanel = new DateTime(this.id + '_DateTime', []);  CopyHash(this.dateTime, this.dateTimePanel.configuration);   this.reportElement.innerHTML = this.build();   this.controlPanel = new ReportControl(this.id + '_Control', this.control);  document.getElementById(this.id + '_Legend').style.display = (this.control.Legend || this.parameters.Suppress) ? 'none' : 'block';   this.controlPanel.subscribe(this, 'change', 'control');  this.controlPanel.subscribe(this, 'animate', 'animate');  this.controlPanel.subscribe(this, 'report', 'report');  this.controlPanel.subscribe(this, 'show', 'show');  this.controlPanel.subscribe(this, 'open', 'open');  this.controlPanel.subscribe(this, 'sql', 'sql');  this.dateTimePanel.subscribe(this, 'change', 'dateTime');   var footerElement = document.getElementById(this.id + '_Footer');  if (this.parameters.Suppress) {  footerElement.style.display = 'none';  }   var parameters = [];  parameters.insertion = footerElement;  parameters.noWrap = true;  var viewButtons = new Layout(parameters);   var target = this;   var parameters = [];  parameters.insertion = viewButtons.insert(null, 0, 1);  parameters.title = 'Show Controls';  parameters.noWrap = true;  var showControlButton = new Button('Show_Control', parameters);   var targetElement = this.reportElement;   var parameters = [];  parameters.action = function(parameters) { target.controlPanel.show(targetElement) };  var showControlAction = new Behavior('Show_Control', parameters);  showControlButton.subscribe(showControlAction, 'click', 'trigger');   var parameters = [];  parameters.insertion = viewButtons.insert(null, 0, 2);  parameters.title = 'Show Periods';  parameters.noWrap = true;  var showPeriodButton = new Button('Show_Period', parameters);   var parameters = [];  parameters.action = function(parameters) { target.dateTimePanel.show(targetElement) };  var showPeriodAction = new Behavior('Show_Period', parameters);  showPeriodButton.subscribe(showPeriodAction, 'click', 'trigger');   var parameters = [];  parameters.insertion = viewButtons.insert(null, 0, 3);  parameters.title = 'Hide Buttons';  parameters.noWrap = true;  var hideButtonsButton = new Button('Hide_Buttons', parameters);   var parameters = [];  parameters.action = function(parameters) { alert("Reload page to show buttons"); footerElement.style.display = 'none' };  var hideButtonsAction = new Behavior('Hide_Buttons', parameters);  hideButtonsButton.subscribe(hideButtonsAction, 'click', 'trigger');   this.graphPanel = new Graph(this.name, this.graphParameters);  this.graphPanel.model = this;   this.subscription = new Subscription();   this.xmlStore = new Store(this.id + '_Store_XML');  this.xmlStore.subscribe(this, 'data', 'xml');  this.xmlStore.subscribe(this, 'state', 'state');  this.xmlStore.subscribe(this, 'error', 'error');   this.xsltStore = new Store(this.id + '_Store_XSLT');  this.xsltStore.subscribe(this, 'data', 'xslt');   var imageCache = new Image();  imageCache.src = this.progressUrl = '/_iView/image/progress/progress.gif'; };   /* Construction */    Report.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'width':  case 'height':  this.reportElement.style[property] = LinearDimension(value);  break;  case 'Suppress':  case 'SuppressDisplay':  this.parameters[property] = value;  break;  case 'url':  this.url = (value || '');  if (this.controlPanel) {  this.controlPanel.setProperty('url', this.url + '?Web=XML&' + PackHash(this.dateTime) + '&' + PackHash(this.control) + '&' + PackHash(this.parameters.terms))  }  case 'query':  case 'Scope':  case 'scope':  this.graphParameters[property] = value;  if (this.graphPanel) {  this.graphPanel.setProperty(property, value)  }  case 'title':  case 'term':  switch (value[0]) {  case 'Period':  case 'From':  case 'To':  case 'Sort':  case 'Desc':  case 'Group':  case 'Limit':  case 'Skip':  this.dateTime[value[0]] = value[1];  break;  default:  this.parameters.terms[value[0]] = value[1];  }  break;  case 'terms':  for (var key in value) {  this.setProperty('term', [key, value[key]])  }  break;  default:  this.reportElement.style[property] = value;  } };  Report.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.reportElement.style[property];  case 'url':  return this.url;  case 'query':  case 'scope':  return this.graphParameters[property];  case 'title':  return this.parameters[property];  default:  return this.reportElement.style[property];  } };  Report.prototype.build = function() {  var className = this.className;  var id = this.id;  var displayScrollDown = !this.parameters.Suppress && ((this.dateTime.Limit) || (this.dateTime.Period == 'Last') || (this.dateTime.Period == 'Recent') || !this.dateTime.Period);  var displayScrollUp = !this.parameters.Suppress && ((this.parameters.Skip > 0) || (this.dateTime.Period == 'Recent'));  return '<div id="' + id + '_Legend" style="cursor:pointer;display:block;border:ridge" class="viewPane"></div>' +  '<table width="100%" cellpadding=0 cellspacing=0 border=0>' +  '<tr><td><div id="' + id + '_Scroll_Panel_Up" style="cursor:pointer;border:ridge;display:' + (displayScrollUp ? 'block' : 'none') + '" class="scroll_control_arrow" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">' +  '<center><img id="' + id + '_Up" src="' + ((this.parameters.arrowURL || '/_iView/image/arrow_') + 'up.gif') + '"/></center>' +  '</div></td></tr>' +  '<tr><td><div id="' + id + '_Content" class="' + className + '" style="cursor:pointer"></div></td></tr>' +  '<tr><td><div id="' + id + '_Scroll_Panel_Down" style="cursor:pointer;border:ridge;display:' + (displayScrollDown ? 'block' : 'none') + '" class="scroll_control_arrow" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)">' +  '<center><img id="' + id + '_Down" src="' + ((this.parameters.arrowURL || '/_iView/image/arrow_') + 'down.gif') + '"/></center>' +  '</div></td></tr>' +  '</table>' +  '<div id="' + id + '_Footer" style="cursor:pointer"><br></div>'; };   /* Animation */   Report.prototype.scrollUpdate = function() {  this.scrollUpPanel = document.getElementById(this.id + '_Scroll_Panel_Up');  if (this.scrollUpPanel) {  var displayScrollUp = !this.parameters.Suppress && ((this.parameters.Skip > 0) || (this.dateTime.Period == 'Recent'));  this.scrollUpPanel.style.display = displayScrollUp ? 'block' : 'none';  }  this.scrollDownPanel = document.getElementById(this.id + '_Scroll_Panel_Down');  if (this.scrollDownPanel) {  var displayScrollDown = !this.parameters.Suppress && ((this.dateTime.Limit > 0) || (this.dateTime.Period == 'Last') || (this.dateTime.Period == 'Recent') || !this.dateTime.Period);  this.scrollDownPanel.style.display = displayScrollDown ? 'block' : 'none'  } }; Report.prototype.track = function(theEvent) {  var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var id = targetElement.id;  if (!id) {  targetElement = targetElement.parentNode || targetElement.parentElement;  id = targetElement.id;  }  var ids = id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Legend':  case 'Content':  case 'Footer':  switch (theEvent.type) {  case 'click':  var targetElement = document.getElementById(this.id + '_Content');  if (theEvent.altKey ) {  this.dateTimePanel.show(targetElement)  } else if (theEvent.ctrlKey) {  this.controlPanel.show(targetElement)  }  break;  }  DomCancelEvent(theEvent);  break;  case 'Sort':  ids.pop();  var sortName = ids.join('_');  if (sortName != 'Site') {  switch (theEvent.type) {  case 'click':  if ((sortName == this.dateTime.Sort) && !this.dateTime.Desc) {  this.dateTime.Desc = 'Desc';  var arrowElement = document.getElementById(sortName + '_Sort');  arrowElement.src = (this.parameters.arrowDownURL || '/_iView/image/arrow_down.gif')  } else {  delete this.dateTime.Desc;  var arrowElement = document.getElementById(sortName + '_Sort');  arrowElement.src = (this.parameters.arrowUpURL || '/_iView/image/arrow_up.gif')  }  this.load();  break;  }  }  DomCancelEvent(theEvent);  break;  case 'Heading':  ids.pop();  var sortName = ids.join('_');  if (sortName != 'Site') {  switch (theEvent.type) {  case 'mouseover':  if (this.control.Sort != sortName) {  targetElement.style.backgroundColor = (this.highlightHeadingColor || '#DDDDDD')  }  break;  case 'mouseout':  if (this.control.Sort != sortName) {  targetElement.style.backgroundColor = ''  }  break;  case 'click':  var otherElement;  for (var index = 0; index < targetElement.parentNode.childNodes.length; index++) {  if ((otherElement = targetElement.parentNode.childNodes[index]) != targetElement) {  otherElement.style.backgroundColor = '';  document.getElementById(otherElement.id.replace(/\_Heading/, '_Sort')).src = (this.parameters.transparentURL || '/_iView/image/transparent.gif')  }  }  if ((sortName == this.dateTime.Sort) && !this.dateTime.Desc) {  this.dateTime.Desc = 'Desc';  var arrowElement = document.getElementById(sortName + '_Sort');  arrowElement.src = (this.parameters.arrowDownURL || '/_iView/image/arrow_down.gif');  DomAddEventListener(arrowElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  } else {  delete this.dateTime.Desc;  var arrowElement = document.getElementById(sortName + '_Sort');  arrowElement.src = (this.parameters.arrowUpURL || '/_iView/image/arrow_up.gif');  DomAddEventListener(arrowElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  }  this.dateTime.Sort = sortName;  this.load();  break;  }  }  DomCancelEvent(theEvent);  break;  case 'Up':  case 'Down':  switch (theEvent.type) {  case 'mouseout':  targetElement.className = 'scroll_control_arrow';  break;  case 'mouseup':  case 'mouseover':  targetElement.className = 'scroll_control_arrow_hover';  break;  case 'mousedown':  targetElement.className = 'scroll_control_arrow_hilite';  break;  case 'click':  this.parameters.Skip = (this.parameters.Skip || 0) + ((action == 'Up') ? -1 : 1) * (this.dateTime.Limit || 10);  if (this.dateTime.Period != 'Recent') {  this.parameters.Skip = Math.max(0, this.parameters.Skip || 0);  }  this.load();  break;  }  DomCancelEvent(theEvent);  break;  case 'Site':  switch (theEvent.type) {  case 'mouseover':  targetElement.style.backgroundColor = (this.highlightHeadingColor || '#DDDDDD');  break;  case 'mouseout':  targetElement.style.backgroundColor = '';  break;  case 'click':  var paths = (this.parameters.terms.Scope || location.pathname).replace(/^\//, '').replace(/\/$/, '').split('/');  var scopes = targetElement.getAttribute("drillpath").replace(/^[^\[]+\[([^\]]+)\].*$/, "$1").replace(/^\//, '').replace(/\/$/, '').split('/');  if (paths.length && scopes.length && (paths[0] != scopes[0])) {  this.parameters.terms.Scope = '/' + paths.join('/') + '/' + scopes.join('/');  } else if (scopes.length) {  this.parameters.terms.Scope = '/' + scopes.join('/');  } else if (paths.length) {  this.parameters.terms.Scope = '/' + paths.join('/');  }  this.parameters.terms.Scope = this.parameters.terms.Scope.replace(/\s+/g, '_');  this.subscription.broadcast('scope', this.parameters.terms.Scope);  this.load();  break;  }  DomCancelEvent(theEvent);  break;  case 'Row':  case 'Cell':  case 'Alarm':  switch (theEvent.type) {  case 'mouseover':  targetElement.style.backgroundColor = (this.highlightHeadingColor || '#DDDDDD');  break;  case 'mouseout':  targetElement.style.backgroundColor = '';  break;  case 'click':  var rowNumber = targetElement.getAttribute("rownumber") || targetElement.parentNode.getAttribute("rownumber");  switch (action) {  case 'Row':  this.subscription.broadcast('slide', [rowNumber, this.xmlDoc]);  break;  case 'Cell':  case 'Alarm':  var title = targetElement.getAttribute("coltitle");  if ((title == 'Source_Time') || (title == 'Server_Time') || (title == 'Path')) {  this.hideAll();  this.subscription.broadcast('related', [rowNumber, this.xmlDoc, title, this.parameters.terms.Scope])  } else if (this.parameters.graph) {  var records = (this.xmlDoc && this.xmlDoc.documentElement) ? this.xmlDoc.documentElement.getElementsByTagName("Record") : [];  if (records && records[rowNumber]) {  var sourceTime = records[rowNumber].getElementsByTagName("Source_Time")[0].firstChild.nodeValue;  if (sourceTime) {  this.graphPanel.setProperty('Scope', this.parameters.terms.Scope);  this.graphPanel.setProperty('Title', title.replace(/\_+/g, ' '));  this.graphPanel.setProperty('Names', title);  this.graphPanel.setProperty('Period', this.dateTime.Period);  this.graphPanel.setProperty('From', this.dateTime.From);  this.graphPanel.setProperty('To', this.dateTime.To);  this.graphPanel.setProperty('Group', this.dateTime.Group);  this.graphPanel.setProperty('Limit', this.dateTime.Limit || this.parameters.Limit);  if ((this.dateTime.Period == 'Last') || (this.dateTime.Period == 'Recent')) {  this.graphPanel.setProperty('Reverse', 'True');  }  if (this.parameters.Skip) {  this.graphPanel.setProperty('Offset', this.parameters.Skip);  }  this.graphPanel.setProperty('Constraint', this.parameters.terms.Constraint);  this.graphPanel.show(targetElement)  }  }  } else {  this.subscription.broadcast('identity', [rowNumber, this.xmlDoc])  }  break;  }  break;  }  DomCancelEvent(theEvent);  break;  } };  Report.prototype.showAll = function(rowNumber, show) {  var list = document.getElementsByName(rowNumber);  for (var index = 0; index < list.length; index++) {  list[index].style.display = show ? '' : 'none';  }  if (!show) {  var list = document.getElementsByName('detail_' + rowNumber);  for (var index = 0; index < list.length; index++) {  list[index].style.display = 'none';  }  } }; Report.prototype.traceDetail = function(rowNumber, show) {  var list = document.getElementsByName('detail_' + rowNumber);  for (var index = 0; index < list.length; index++) {  list[index].style.display = '';  }  this.subscription.broadcast('detail', [this.xmlDoc, rowNumber, this]); };  Report.prototype.startReloadAnimation = function(delay) {  this.stopReloadAnimation();  var report = this;  this.delay = delay || this.delay || 60000;  this.timeoutTask = setTimeout(function() { report.reload = true; report.load(); delete report.reload; }, this.delay); }; Report.prototype.stopReloadAnimation = function(delay) {  if (this.timeoutTask) {  clearTimeout(this.timeoutTask);  delete this.timeoutTask  } }; Report.prototype.hideReport = function() {  this.contentElement = document.getElementById(this.id + '_Content');  this.contentElement.innerHTML = '' }; Report.prototype.showReport = function() {  this.load() };  Report.prototype.load = function() {  var hashCache = [];  CopyHash(hashCache, this.dateTime);  CopyHash(hashCache, this.parameters.terms);   var html = '';  if (this.parameters.terms.Scope) {  html += 'Viewing: ' + this.parameters.terms.Scope.replace(/^\/+/, '').replace(/\/+/g, ' | ').replace(/\_/g, ' ') + '<br>';  hashCache.Scope = this.parameters.terms.Scope  }  html += 'Report Generated:<li/>' + NowUTC() + ' (UTC)';  html += '<li/>' + NowLocal() + ' (local)<br/>';  html += 'Period: ' + (this.dateTime.Period || 'Last') + '<br>';  if ((this.dateTime.Period == 'Other...') || (this.dateTime.Period == 'Other')) {  if (this.dateTime.From) {  html += '&nbsp;&nbsp;&nbsp;From: ' + this.dateTime.From + '<br>'  }  if (this.dateTime.To) {  html += '&nbsp;&nbsp;&nbsp;To: ' + this.dateTime.To + '<br>'  }  }  if (this.dateTime.Sort) {  html += 'Sort by: ' + this.dateTime.Sort.replace(/\_+/g, ' ') + '<br>';  if (this.dateTime.Desc) {  html += '&nbsp;&nbsp;&nbsp;Descending order<br>'  }  }  if (this.dateTime.Group && (this.dateTime.Group != '(None)')) {  html += 'Summarize by: ' + this.dateTime.Group + '<br>'  }  if (this.dateTime.Limit) {  html += 'Show: ' + this.dateTime.Limit + ' records<br>'  } else if ((this.parameters.Limit) && (this.parameters.Limit != 'undefined')) {  hashCache.Limit = this.parameters.Limit;  html += 'Show: ' + this.parameters.Limit + ' records<br>'  } else {  delete hashCache.Limit  }  if (!hashCache.Limit && ((this.dateTime.Period == 'Last') || (this.dateTime.Period == 'Recent'))) {  html += '(Show: 10 records)<br>'  }  if (this.parameters.Skip) {  html += '<li/>Skip: ' + this.parameters.Skip + ' records<br>';  hashCache.Offset = this.parameters.Skip  } else {  delete hashCache.Offset  }   document.getElementById(this.id + '_Legend').innerHTML = html;   if (this.parameters.terms.Constraint) {  hashCache.Constraint = this.parameters.terms.Constraint;  }   if (this.parameters.terms.Web) {  hashCache.Web = this.parameters.terms.Web  }   if (this.parameters.terms.FullName) {  hashCache.FullName = this.parameters.terms.FullName  }   if (this.parameters.terms.Cell) {  hashCache.Cell = 'Enable'  }   this.controlPanel.setProperty('url', this.url + '?' + PackHash(hashCache));   this.contentElement = document.getElementById(this.id + '_Content');  if (!this.reload) {  this.contentElement.innerHTML = '<img src="' + this.progressUrl + '"/>'  }   this.xmlStore.setProperty('url', this.url);  hashCache.Track = (new Date()).getTime() + Math.floor(100000 * Math.random());  this.xmlStore.setProperty('terms', this.reportTerms = hashCache);  this.xmlStore.load();  this.scrollUpdate() }; Report.prototype.stopLoad = function() {  this.stopReloadAnimation();  if (this.xmlStore) {  this.xmlStore.stopLoad()  } }; Report.prototype.hideAll = function() {  this.scrollUpPanel = document.getElementById(this.id + '_Scroll_Panel_Up');  this.scrollDownPanel = document.getElementById(this.id + '_Scroll_Panel_Down');  if (this.scrollUpPanel) {  this.scrollUpPanel.style.display = 'none'  }  if (this.scrollDownPanel) {  this.scrollDownPanel.style.display = 'none'  }  if (this.controlPanel) {  this.controlPanel.hide()  }  if (this.dateTimePanel) {  this.dateTimePanel.hide()  }  if (this.graphPanel) {  this.graphPanel.hide()  } };   /* Subscription */   Report.prototype.subscriptions = function() {  return ['xml', 'done', 'state', 'error', 'slide', 'scope', 'related'] };  Report.prototype.actions = function() {  return ['control', 'dateTime', 'animate', 'show', 'xml', 'xslt', 'state', 'error'] };  Report.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Report.prototype.receive = function(action, parameters) {  switch (action) {  case 'control':  this.control = [];  CopyHash(this.control, parameters);  this.load();  break;  case 'dateTime':  this.dateTime = [];  CopyHash(this.dateTime, parameters);  this.load();  break;  case 'animate':  delete this.control.Animate;  CopyHash(this.control, parameters);  if (this.control.Animate) {  this.startReloadAnimation()  } else {  this.stopReloadAnimation()  }  break;  case 'report':  this.control.SuppressDisplay = 'False';  CopyHash(this.control, parameters);  if (this.control.SuppressDisplay == 'True') {  this.parameters.SuppressDisplay = 'True';  this.hideReport()  } else {  this.parameters.SuppressDisplay = 'False';  this.showReport()  }  break;  case 'show':  this.control = [];  CopyHash(this.control, parameters);  document.getElementById(this.id + '_Legend').style.display = this.control.Legend ? 'none' : 'block';  break;  case 'open':  if (this.window = self.open(  location.pathname.replace(/\/[^\/]*$/, '/') +  '?' + parameters[0] + '&' + PackHash(this.dateTime) + '&' + PackHash(this.control) +  (this.parameters.terms.Scope ? ('&Scope=' + this.parameters.terms.Scope) : '') +  (this.parameters.terms.Constraint ? ('&Constraint=' + this.parameters.terms.Constraint) : '') +  (this.parameters.Skip ? ('&Skip=' + this.parameters.Skip) : '') +  (parameters[1] ? '&Print=True' : ''),  this.id + '_Window',  'directories=no,location=no,menubar=no,personalbar=no,toolbar=no,resizable=yes,scrollbars=auto,height=800,width=600,dependent=yes')) {  this.window.focus()  }  break;  case 'sql':  if (this.window = self.open(location.pathname.replace(/\/[^\/]*$/, '/') + '?Web=Fetch&Scope=' + this.parameters.terms.Scope,  this.id + '_Window',  'directories=no,location=no,menubar=no,personalbar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800,dependent=yes')) {  this.window.focus()  }  break;  case 'xml':  this.xmlDoc = parameters[0];   this.xsltStore.setProperty('url', this.url.replace(/\.xml/, '.xsl'));  if (this.reportTerms.XSLT) {  this.reportTerms[this.reportTerms.XSLT] = 'XSLT'  } else if (this.reportTerms.Web) {  this.reportTerms.Web = this.reportTerms.Web.replace(/XML/, 'XSLT')  }  this.xsltStore.setProperty('terms', this.reportTerms);  if (this.parameters.SuppressDisplay != 'True') {  this.xsltStore.load();  this.subscription.broadcast(action, parameters);  } else {   this.contentElement = document.getElementById(this.id + '_Content');  if (!this.reload) {  this.contentElement.innerHTML = ''  }   this.subscription.broadcast(action, parameters);  this.subscription.broadcast('done', parameters);  if (this.control.Animate) {  this.startReloadAnimation()  }  }  break;  case 'xslt':  this.xsltDoc = Xslt.create(parameters[0]);  if (this.xsltDoc) {  this.contentElement = document.getElementById(this.id + '_Content');  this.contentElement.innerHTML = '';  this.xsltDoc.transformToHtml(this.xmlDoc, this.contentElement)  }  this.subscription.broadcast('done', parameters);  if (this.control.Animate) {  this.startReloadAnimation()  }  break;  case 'state':  this.subscription.broadcast(action, parameters);  break;  case 'error':  document.getElementById(this.id + '_Content').innerHTML = parameters;  this.subscription.broadcast(action, parameters);  break;  } };    function ReportControl(name, parameters) {  this.name = name;  this.id = 'ReportControl_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.className = 'report_control';   this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   var panelParameters = [];  panelParameters.html = this.build();  this.controlPanel = new Panel(this.id + '_Panel', panelParameters);  this.controlPanel.model = this;   this.subscription = new Subscription() };   /* Construction */   ReportControl.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'url':  this.url = value;  break;  case 'SuppressDisplay':  this.configuration.SuppressDisplay = value;  break;  default:  this.controlPanel.style[property] = value;  break;  } };  ReportControl.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'url':  return this.url;  default:  return this.controlPanel.style[property];  } };  ReportControl.prototype.build = function() {  var id = this.id;  var className = this.className;   var html = '<form><table border="0" cellspacing="0" cellpadding="0"><tr vAlign="top">';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td nowrap="1">Report</td></tr>';  html += '<tr><td nowrap="1"><input type="button" value="Refresh" id="' + id + '_Control_Refresh" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '<tr><td nowrap="1"><input type="button" value="Print" id="' + id + '_Control_Print" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '</table></td>';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td nowrap="1">Open Report As...</td></tr>';  html += '<tr><td nowrap="1"><input type="button" value="Spreadsheet" id="' + id + '_Control_Spreadsheet" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '<tr><td nowrap="1"><input type="button" value="Text" id="' + id + '_Control_Text" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '<tr><td nowrap="1"><input type="button" value="Show SQL" id="' + id + '_Control_SQL" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '</table></td>';  html += '</tr><tr vAlign="bottom">';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td nowrap="1"><input type="checkbox" value="Legend"' + (this.configuration.Legend ? 'checked' : '') + ' id="' + id + '_Control_Legend" onclick="DomGetModel(this, 1).track(event)" \>Hide Legend</td></tr>';  html += '</table></td>';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td nowrap="1"><input type="checkbox" value="Animate"' + (this.configuration.Animate ? 'checked' : '') + ' id="' + id + '_Control_Animate" onclick="DomGetModel(this, 1).track(event)" \>Animate</td></tr>';  html += '<tr><td nowrap="1"><input type="checkbox" value="ShowReport"' + (this.configuration.SuppressDisplay ? '' : 'checked') + ' id="' + id + '_Control_SuppressDisplay" onclick="DomGetModel(this, 1).track(event)" \>Show Report</td></tr>';  html += '</table></td>';  html += '</tr><tr vAlign="bottom">';  html += '<td></td>';  html += '<td><table border="0" cellspacing="0" cellpadding="0">';  html += '<tr><td nowrap="1"><input type="button" value="Close" id="' + id + '_Control_Hide" onclick="DomGetModel(this, 1).track(event)" \></td></tr>';  html += '</table></td>';  html += '</tr></table></form>';   return html };   /* Animation */   ReportControl.prototype.track = function(theEvent) {  var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var ids = targetElement.id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Refresh':  switch (theEvent.type) {  case 'click':  this.subscription.broadcast('change', this.configuration);  break;  }  DomCancelEvent(theEvent);  break;  case 'Print':  switch (theEvent.type) {  case 'click':  this.open('Web=XML', true);  break;  }  DomCancelEvent(theEvent);  break;  case 'Legend':  switch (theEvent.type) {  case 'click':  if (targetElement.checked) {  this.configuration.Legend = 'True';  } else {  delete this.configuration.Legend;  }   SetCookie(id, PackHash(this.configuration, '|', '~'));   this.subscription.broadcast('show', this.configuration);  break;  }  DomCancelEvent(theEvent);  break;  case 'Animate':  switch (theEvent.type) {  case 'click':  if (targetElement.checked) {  this.configuration.Animate = 'True';  } else {  delete this.configuration.Animate;  }   SetCookie(id, PackHash(this.configuration, '|', '~'));   this.subscription.broadcast('animate', this.configuration);  break;  }  DomCancelEvent(theEvent);  break;  case 'SuppressDisplay':  switch (theEvent.type) {  case 'click':  if (targetElement.checked) {  this.configuration.SuppressDisplay = 'False'  } else {  this.configuration.SuppressDisplay = 'True'  }   SetCookie(id, PackHash(this.configuration, '|', '~'));   this.subscription.broadcast('report', this.configuration);  break;  }  DomCancelEvent(theEvent);  break;  case 'Spreadsheet':  switch (theEvent.type) {  case 'click':  this.open('Request=Spreadsheet');  break;  }  DomCancelEvent(theEvent);  break;  case 'Text':  switch (theEvent.type) {  case 'click':  this.open('Request=Text');  break;  }  DomCancelEvent(theEvent);  break;  case 'Hide':  switch (theEvent.type) {  case 'click':  this.hide();  break;  }  DomCancelEvent(theEvent);  break;  case 'SQL':  switch (theEvent.type) {  case 'click':  this.subscription.broadcast('sql', this.configuration);  break;  }  DomCancelEvent(theEvent);  break;  } };  ReportControl.prototype.show = function(targetElement) {  this.controlPanel.show(targetElement) };  ReportControl.prototype.hide = function() {  this.controlPanel.hide() };  ReportControl.prototype.open = function(type, print) {  this.subscription.broadcast('open', [type, print]) };   /* Subscription */   ReportControl.prototype.subscriptions = function() {  return ['change', 'animate', 'show'] };  ReportControl.prototype.actions = function() {  return ['value'] };  ReportControl.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  ReportControl.prototype.receive = function(action, parameters) {  switch (action) {  case 'value':  CopyHash(this.configuration, parameters);  this.controlPanel.setProperty('html', this.build());  break;  } };    function Tree(name, parameters) {  this.name = name;  this.id = 'Tree_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.type = (this.parameters.type || 'folder');   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;  if (false) {   var container = this.enclosureDocument.createElement('DIV');  this.enclosureElement.appendChild(container);   container.innerHTML = '<table id="' + this.id + '_Table" class="tree" width="1" border="0" cellPadding="0" cellSpacing="0">' +  '<tr><td><table width="1" border="0" cellPadding="0" cellSpacing="0"><tr>' +  '<td id="' + this.id + '_Margin"></td>' +  '<td><img border="0" style="cursor:pointer" id="' + this.id + '_Image" src="' + ((this.parameters.url || '/_iView/image/tree/') + ((this.type == 'doc') ? 'doc' : 'blank') + '.gif') + '" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></td>' +  '<td nowrap style="cursor:pointer" id="' + this.id + '_Title"' + (this.parameters.indent ? '' : (' class="' + this.className + '_selected"')) + ' onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></td>' +  '</tr></table></td></tr>' +  '<tr><td><table width="1" border="0" cellPadding="0" cellSpacing="0"><tr vAlign="top">' +  '<td noWrap><div id="' + this.id + '_Content" class="' + this.className + '" noWrap style="display:none"></div></td>' +  '</tr></table></td></tr>' +  '</table>';   this.tableElement = document.getElementById(this.id + '_Table');  this.imageElement = document.getElementById(this.id + '_Image');  this.marginCellElement = document.getElementById(this.id + '_Margin');  this.titleCellElement = document.getElementById(this.id + '_Title');  this.contentDivElement = document.getElementById(this.id + '_Content');  } else {   this.tableElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.tableElement);  this.tableElement.className = this.className = 'tree';  this.tableElement.style.width = LinearDimension(1);  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);  this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  var cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(cellElement);  var tableElement= this.enclosureDocument.createElement('TABLE');  cellElement.appendChild(tableElement);  tableElement.style.width = LinearDimension(1);  tableElement.setAttribute('border', 0);  tableElement.setAttribute('cellPadding', 0);  tableElement.setAttribute('cellSpacing', 0);  var tableBodyElement = this.enclosureDocument.createElement('TBODY');  tableElement.appendChild(tableBodyElement);  var subRowElement = this.enclosureDocument.createElement('TR');  tableBodyElement.appendChild(subRowElement);  this.marginCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(this.marginCellElement);  this.imageCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(this.imageCellElement);  this.imageElement = this.enclosureDocument.createElement('IMG');  this.imageCellElement.appendChild(this.imageElement);  this.imageElement.setAttribute('border', 0);  this.imageElement.style.cursor = 'pointer';  this.imageElement.id = this.id + '_Image';  DomAddEventListener(this.imageElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.imageElement, 'mouseover', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.imageElement, 'mouseout', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  this.imageElement.src = (this.parameters.url || '/_iView/image/tree/') + ((this.type == 'doc') ? 'doc' : 'blank') + '.gif';  this.titleCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(this.titleCellElement);  this.titleCellElement.setAttribute('noWrap', 1);  this.titleCellElement.style.cursor = 'pointer';  this.titleCellElement.id = this.id + '_Title';  if (!this.parameters.indent) {  this.titleCellElement.className = this.className + '_selected';  }  DomAddEventListener(this.titleCellElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.titleCellElement, 'mouseover', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.titleCellElement, 'mouseout', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(cellElement);  var tableElement= this.enclosureDocument.createElement('TABLE');  cellElement.appendChild(tableElement);  tableElement.style.width = LinearDimension(1);  tableElement.setAttribute('border', 0);  tableElement.setAttribute('cellPadding', 0);  tableElement.setAttribute('cellSpacing', 0);  var tableBodyElement = this.enclosureDocument.createElement('TBODY');  tableElement.appendChild(tableBodyElement);  subRowElement = this.enclosureDocument.createElement('TR');  tableBodyElement.appendChild(subRowElement);  subRowElement.setAttribute('vAlign', 'top');  var contentCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(contentCellElement);  contentCellElement.setAttribute('noWrap', '');  this.contentDivElement = this.enclosureDocument.createElement('DIV');  contentCellElement.appendChild(this.contentDivElement);  this.contentDivElement.className = this.className;  this.contentDivElement.setAttribute('noWrap', '');  this.contentDivElement.style.display = 'none';  };  this.url = '/_iView/image/tree/';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   var html = '';  var index;  var skip = this.skip || [];  for (index = 1; index < skip.length; index++) {  html += '<img src="' + this.url + skip[index] + '" border="0">'  }  if (this.indent > 0) {  html += '<img src="' + this.url + (this.last ? 'lastNode' : 'node') + '.gif" border="0">'  }  this.marginCellElement.innerHTML = html;   this.subordinates = [];  this.tableElement.model = this;  this.subscription = new Subscription();  this.built = true; };   /* Construction */    Tree.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.contentDivElement.className = this.className = value;  break;  case 'title':  this.titleCellElement.innerHTML = (value || '&nbsp;');  break;  case 'width':  case 'height':  this.contentDivElement.style[property] = LinearDimension(value);  break;  case 'border':  this.tableElement.style[property] = value;  break;  case 'path':  case 'scope':  this[property] = (value || '/');  break;  case 'type':  case 'subpaths':  case 'indent':  case 'skip':  case 'last':  this[property] = value;  break;  case 'url':  this.url = value;  break;  default:  this.contentDivElement.style[property] = value;  break;  } };  Tree.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.contentDivElement.style[property];  case 'selection':  return this.selection || ((this.path || '') + (this.scope || ''));  case 'border':  return this.tableElement.style[property];  case 'path':  case 'scope':  case 'type':  case 'subpaths':  case 'indent':  case 'skip':  case 'last':  return this[property];  case 'url':  return this[property];  default:  return this.contentDivElement.style[property];  } };   /* Animation */   Tree.prototype.clearSelection = function() {  this.titleCellElement.className = '';  for (var index = 0; index < this.subordinates.length; index++) {  this.subordinates[index].clearSelection()  } }; Tree.prototype.signalClear = function() {  if (this.branch) {  this.branch.signalClear()  } else {  this.clearSelection()  } }; Tree.prototype.select = function() {  this.selection = this.scope || (this.path || '').replace(/\/$/, '');  this.signalClear();  this.titleCellElement.className = this.className + '_selected';  this.broadcast('data', [this.selection, this.subpaths]) }; Tree.prototype.show = function(targetElement) {  this.imageElement.src = this.url + 'openfolder.gif';  if (!this.shown) {  var saveTargetElementForWait = targetElement;  setTimeout(function() { saveTargetElementForWait.style.cursor = 'pointer' }, 5000);  targetElement.style.cursor = 'wait';  for (var index = 0; index < this.subordinates.length; index++) {  this.subordinates[index].load()  }  this.shown = true  }  this.contentDivElement.style.display = 'block' }; Tree.prototype.hide = function(targetElement) {  this.imageElement.src = this.url + 'closedfolder.gif';  this.contentDivElement.style.display = 'none'; }; Tree.prototype.track = function(theEvent) {  var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var ids = targetElement.id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Image':  switch (theEvent.type) {  case 'click':  if (this.type == 'folder') {  if (this.open = !this.open) {  this.show(targetElement)  } else {  this.hide()  }  } else {  this.select()  }  break;  case 'mouseover':  if (this.type == 'folder') {  if (this.open) {  self.status = 'Click to close folder'  } else {  self.status = 'Click to open folder'  }  } else {  self.status = 'Click to view ' + this.title + ' data'  }  break;  case 'mouseout':  self.status = '';  break;  }  break;  case 'Title':  switch (theEvent.type) {  case 'click':  this.select();  break;  case 'mouseover':  self.status = 'Click to view ' + this.title + ' data';  break;  case 'mouseout':  self.status = '';  break;  }  break;  } };  Tree.prototype.load = function() {  this.storeParameters = [];  this.storeParameters.url = this.path || '/';  this.storeParameters.terms = [];  this.storeParameters.terms.Web = 'Tree';  this.storeParameters.terms.Scope = this.scope;  if (!this.store) {  this.store = new Store(this.id + '_Store', this.storeParameters);  this.store.subscribe(this, 'data', 'loaded');  this.store.subscribe(this, 'error', 'error');  }  this.store.load() };  /* Subscription */   Tree.prototype.subscriptions = function() {  return ['loaded', 'data'] };  Tree.prototype.actions = function() {  return ['loaded', 'error'] };  Tree.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Tree.prototype.broadcast = function(type, parameters) {  if (this.branch) {  this.branch.broadcast(type, parameters)  } else {  this.subscription.broadcast(type, parameters)  } };  Tree.prototype.receive = function(action, parameters) {  switch (action) {  case 'loaded':  this.contentDivElement.className = this.className;  this.xmlDoc = parameters[0];  var responseNodeList = this.store.GetNodeListByTagName('Node');  if (responseNodeList && (responseNodeList.length > 0)) {  this.titleCellElement.innerHTML = this.title = responseNodeList[0].getElementsByTagName('Title')[0].firstChild.nodeValue || '&nbsp;';  this.type = responseNodeList[0].getElementsByTagName('Type')[0].firstChild.nodeValue;  this.imageElement.src = (this.parameters.url || '/_iView/image/tree/') + ((this.type == 'doc') ? 'doc' : 'closedfolder') + '.gif';   var subaccounts = responseNodeList[0].getElementsByTagName('Subaccounts');  this.subaccounts = (subaccounts && subaccounts.length && subaccounts[0].firstChild) ? (subaccounts[0].firstChild.nodeValue || '').split(',') : [];   var subpaths = responseNodeList[0].getElementsByTagName('Subpaths');  this.subpaths = (subpaths && subpaths.length && subpaths[0].firstChild) ? (subpaths[0].firstChild.nodeValue || '').split(',') : [];   var fullpath = this.scope || (this.path || '').replace(/\/$/, '');  this.broadcast('loaded', [fullpath, this.subpaths]);  for (var index = 0; index < this.subaccounts.length; index++) {  var parameters = [];  parameters.insertion = this.contentDivElement;  parameters.path = (this.path || '/');  parameters.scope = fullpath + '/' + this.subaccounts[index];  parameters.indent = (this.indent || 0) + 1;  if (index >= (this.subaccounts.length - 1)) {  parameters.last = true  }  parameters.skip = CloneArrayValue(this.skip || []);  parameters.skip[parameters.skip.length] = this.last ? 'blank.gif' : 'vertical.gif';  var limb = new Tree(this.id + '_' + fullpath, parameters);  limb.branch = this;  this.subordinates[this.subordinates.length] = limb;  }  } else {  this.contentDivElement.className = this.className + '_warning';  this.contentDivElement.innerHTML = '(No Data)';  this.contentDivElement.style.display = 'block';  }  break;  case 'error':  this.contentDivElement.className = this.className + '_error';  this.contentDivElement.innerHTML = parameters[0];  this.contentDivElement.style.display = 'block';  break;  } }; /* color.js */  var browserColor = []; browserColor['aliceblue'] = ['F0', 'F8', 'FF']; browserColor['antiquewhite'] = ['FA', 'EB', 'D7']; browserColor['aqua'] = ['0', 'FF', 'FF']; browserColor['aquamarine'] = ['7F', 'FF', 'D4']; browserColor['azure'] = ['F0', 'FF', 'FF']; browserColor['beige'] = ['F5', 'F5', 'DC']; browserColor['bisque'] = ['FF', 'E4', 'C4']; browserColor['black'] = ['0', '0', '0']; browserColor['blanchedalmond'] = ['FF', 'EB', 'CD']; browserColor['blue'] = ['0', '0', 'FF']; browserColor['blueviolet'] = ['8A', '2B', 'E2']; browserColor['brown'] = ['A5', '2A', '2A']; browserColor['burlywood'] = ['DE', 'B8', '87']; browserColor['cadetblue'] = ['5F', '9E', 'A0']; browserColor['chartreuse'] = ['7F', 'FF', '0']; browserColor['chocolate'] = ['D2', '69', '1E']; browserColor['coral'] = ['FF', '7F', '50']; browserColor['cornflowerblue'] = ['64', '95', 'ED']; browserColor['cornsilk'] = ['FF', 'F8', 'DC']; browserColor['crimson'] = ['DC', '14', '3C']; browserColor['cyan'] = ['0', 'FF', 'FF']; browserColor['darkblue'] = ['0', '0', '8B']; browserColor['darkcyan'] = ['0', '8B', '8B']; browserColor['darkgoldenrod'] = ['B8', '86', '0B']; browserColor['darkgray'] = ['A9', 'A9', 'A9']; browserColor['darkgreen'] = ['0', '64', '0']; browserColor['darkkhaki'] = ['BD', 'B7', '6B']; browserColor['darkmagenta'] = ['8B', '0', '8B']; browserColor['darkolivegreen'] = ['55', '6B', '2F']; browserColor['darkorange'] = ['FF', '8C', '0']; browserColor['darkorchid'] = ['99', '32', 'CC']; browserColor['darkred'] = ['8B', '0', '0']; browserColor['darksalmon'] = ['E9', '96', '7A']; browserColor['darkseagreen'] = ['8F', 'BC', '8F']; browserColor['darkslateblue'] = ['48', '3D', '8B']; browserColor['darkslategray'] = ['2F', '4F', '4F']; browserColor['darkturquoise'] = ['0', 'CE', 'D1']; browserColor['darkviolet'] = ['94', '0', 'D3']; browserColor['deeppink'] = ['FF', '14', '93']; browserColor['deepskyblue'] = ['0', 'BF', 'FF']; browserColor['dimgray'] = ['69', '69', '69']; browserColor['dodgerblue'] = ['1E', '90', 'FF']; browserColor['firebrick'] = ['B2', '22', '22']; browserColor['floralwhite'] = ['FF', 'FA', 'F0']; browserColor['forestgreen'] = ['22', '8B', '22']; browserColor['fuchsia'] = ['FF', '0', 'FF']; browserColor['gainsboro'] = ['DC', 'DC', 'DC']; browserColor['ghostwhite'] = ['F8', 'F8', 'FF']; browserColor['gold'] = ['FF', 'D7', '0']; browserColor['goldenrod'] = ['DA', 'A5', '20']; browserColor['gray'] = ['80', '80', '80']; browserColor['green'] = ['0', '80', '0']; browserColor['greenyellow'] = ['AD', 'FF', '2F']; browserColor['honeydew'] = ['F0', 'FF', 'F0']; browserColor['hotpink'] = ['FF', '69', 'B4']; browserColor['indianred'] = ['CD', '5C', '5C']; browserColor['indigo'] = ['4B', '0', '82']; browserColor['ivory'] = ['FF', 'FF', 'F0']; browserColor['khaki'] = ['F0', 'E6', '8C']; browserColor['lavender'] = ['E6', 'E6', 'FA']; browserColor['lavenderblush'] = ['FF', 'F0', 'F5']; browserColor['lawngreen'] = ['7C', 'FC', '0']; browserColor['lemonchiffon'] = ['FF', 'FA', 'CD']; browserColor['lightblue'] = ['AD', 'D8', 'E6']; browserColor['lightcoral'] = ['F0', '80', '80']; browserColor['lightcyan'] = ['E0', 'FF', 'FF']; browserColor['lightgoldenrodyellow'] = ['FA', 'FA', 'D2']; browserColor['lightgreen'] = ['90', 'EE', '90']; browserColor['lightgrey'] = ['D3', 'D3', 'D3']; browserColor['lightpink'] = ['FF', 'B6', 'C1']; browserColor['lightsalmon'] = ['FF', 'A0', '7A']; browserColor['lightseagreen'] = ['20', 'B2', 'AA']; browserColor['lightskyblue'] = ['87', 'CE', 'FA']; browserColor['lightslategray'] = ['77', '88', '99']; browserColor['lightsteelblue'] = ['B0', 'C4', 'DE']; browserColor['lightyellow'] = ['FF', 'FF', 'E0']; browserColor['lime'] = ['0', 'FF', '0']; browserColor['limegreen'] = ['32', 'CD', '32']; browserColor['linen'] = ['FA', 'F0', 'E6']; browserColor['magenta'] = ['FF', '0', 'FF']; browserColor['maroon'] = ['80', '0', '0']; browserColor['mediumaquamarine'] = ['66', 'CD', 'AA']; browserColor['mediumblue'] = ['0', '0', 'CD']; browserColor['mediumorchid'] = ['BA', '55', 'D3']; browserColor['mediumpurple'] = ['93', '70', 'DB']; browserColor['mediumseagreen'] = ['3C', 'B3', '71']; browserColor['mediumslateblue'] = ['7B', '68', 'EE']; browserColor['mediumspringgreen'] = ['0', 'FA', '9A']; browserColor['mediumturquoise'] = ['48', 'D1', 'CC']; browserColor['mediumvioletred'] = ['C7', '15', '85']; browserColor['midnightblue'] = ['19', '19', '70']; browserColor['mintcream'] = ['F5', 'FF', 'FA']; browserColor['mistyrose'] = ['FF', 'E4', 'E1']; browserColor['moccasin'] = ['FF', 'E4', 'B5']; browserColor['navajowhite'] = ['FF', 'DE', 'AD']; browserColor['navy'] = ['0', '0', '80']; browserColor['oldlace'] = ['FD', 'F5', 'E6']; browserColor['olive'] = ['80', '80', '0']; browserColor['olivedrab'] = ['6B', '8E', '23']; browserColor['orange'] = ['FF', 'A5', '0']; browserColor['orangered'] = ['FF', '45', '0']; browserColor['orchid'] = ['DA', '70', 'D6']; browserColor['palegoldenrod'] = ['EE', 'E8', 'AA']; browserColor['palegreen'] = ['98', 'FB', '98']; browserColor['paleturquoise'] = ['AF', 'EE', 'EE']; browserColor['palevioletred'] = ['DB', '70', '93']; browserColor['papayawhip'] = ['FF', 'EF', 'D5']; browserColor['peachpuff'] = ['FF', 'DA', 'B9']; browserColor['peru'] = ['CD', '85', '3F']; browserColor['pink'] = ['FF', 'C0', 'CB']; browserColor['plum'] = ['DD', 'A0', 'DD']; browserColor['powderblue'] = ['B0', 'E0', 'E6']; browserColor['purple'] = ['80', '0', '80']; browserColor['red'] = ['FF', '0', '0']; browserColor['rosybrown'] = ['BC', '8F', '8F']; browserColor['royalblue'] = ['41', '69', 'E1']; browserColor['saddlebrown'] = ['8B', '45', '13']; browserColor['salmon'] = ['FA', '80', '72']; browserColor['sandybrown'] = ['F4', 'A4', '60']; browserColor['seagreen'] = ['2E', '8B', '57']; browserColor['seashell'] = ['FF', 'F5', 'EE']; browserColor['sienna'] = ['A0', '52', '2D']; browserColor['silver'] = ['C0', 'C0', 'C0']; browserColor['skyblue'] = ['87', 'CE', 'EB']; browserColor['slateblue'] = ['6A', '5A', 'CD']; browserColor['slategray'] = ['70', '80', '90']; browserColor['snow'] = ['FF', 'FA', 'FA']; browserColor['springgreen'] = ['0', 'FF', '7F']; browserColor['steelblue'] = ['46', '82', 'B4']; browserColor['tan'] = ['D2', 'B4', '8C']; browserColor['teal'] = ['0', '80', '80']; browserColor['thistle'] = ['D8', 'BF', 'D8']; browserColor['tomato'] = ['FF', '63', '47']; browserColor['turquoise'] = ['40', 'E0', 'D0']; browserColor['violet'] = ['EE', '82', 'EE']; browserColor['wheat'] = ['F5', 'DE', 'B3']; browserColor['white'] = ['FF', 'FF', 'FF']; browserColor['whitesmoke'] = ['F5', 'F5', 'F5']; browserColor['yellow'] = ['FF', 'FF', '0']; browserColor['yellowgreen'] = ['9A', 'CD', '32'];  function ExtractColorComponents(color) {  return (color.substring(0, 1) == "#") ? [color.substring(1, 3) || '00', color.substring(3, 5) || '00', color.substring(5, 7) || '00'] : (browserColor[color] || ['00', '00', '00']); }; function FormColorComponents(colorComponents) {  return '#' + (colorComponents[0] || '00') + (colorComponents[1] || '00') + (colorComponents[2] || '00'); }; var decimals = []; decimals['0'] = 0; decimals['1'] = 1; decimals['2'] = 2; decimals['3'] = 3; decimals['4'] = 4; decimals['5'] = 5; decimals['6'] = 6; decimals['7'] = 7; decimals['8'] = 8; decimals['9'] = 9; decimals['A'] = 10; decimals['B'] = 11; decimals['C'] = 12; decimals['D'] = 13; decimals['E'] = 14; decimals['F'] = 15;  var hexadecimals = []; hexadecimals[0] = '0'; hexadecimals[1] = '1'; hexadecimals[2] = '2'; hexadecimals[3] = '3'; hexadecimals[4] = '4'; hexadecimals[5] = '5'; hexadecimals[6] = '6'; hexadecimals[7] = '7'; hexadecimals[8] = '8'; hexadecimals[9] = '9'; hexadecimals[10] = 'A'; hexadecimals[11] = 'B'; hexadecimals[12] = 'C'; hexadecimals[13] = 'D'; hexadecimals[14] = 'E'; hexadecimals[15] = 'F';  function Hex2Dec(value) {  return 16 * decimals[value.substring(0, 1) || '0'] + decimals[value.substring(1, 2) || '0']; }; function Dec2Hex(value) {  value = Math.max(value, 0);  return hexadecimals[Math.floor(value / 16)] + hexadecimals[value % 16]; }; function Hex2Decs(values) {  return [Hex2Dec(values[0]), Hex2Dec(values[1]), Hex2Dec(values[2])]; }; function Dec2Hexes(values) {  return [Dec2Hex(values[0]), Dec2Hex(values[1]), Dec2Hex(values[2])]; }; function ColorMix(color1, color2, ratio) {  var colors1 = Hex2Decs(ExtractColorComponents(color1));  var colors2 = Hex2Decs(ExtractColorComponents(color2));  return FormColorComponents(Dec2Hexes([Math.round(ratio * colors1[0] + (1 - ratio) * colors2[0]), Math.round(ratio * colors1[1] + (1 - ratio) * colors2[1]), Math.round(ratio * colors1[2] + (1 - ratio) * colors2[2])])); };  function Decor(name, parameters) {  this.name = name;  this.id = 'Decor_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.decorElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.decorElement);  this.decorElement.className = 'decor';  this.decorElement.id = this.id + '_Frame';  this.decorElement.model = this;   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.decorElement.appendChild(this.tableBodyElement);   this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);   this.cellElement = this.enclosureDocument.createElement('TD');  this.rowElement.appendChild(this.cellElement);   this.contentElement = this.enclosureDocument.createElement('DIV');  this.cellElement.appendChild(this.contentElement);  this.contentElement.style.position = 'relative';  this.contentElement.style.height = '100%';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }  };   /* Construction */   Decor.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.decorElement.className = this.className = value;  break;  case 'bullet':  case 'number':  case 'start':  case 'compact':  case 'dwell':  case 'rate':  case 'speed':  break;  case 'width':  case 'height':  this.decorElement.style[property] = LinearDimension(value);  break;  case 'persist':  this[property] = value;  break;  case 'data':  this.value = value || [];  this.contentElement.innerHTML = this.build();  break;  default:  this.decorElement.style[property] = value;  } };  Decor.prototype.getProperty = function(property) {  switch (property) {  case 'bullet':  case 'number':  case 'start':  case 'compact':  case 'dwell':  case 'rate':  case 'speed':  return this.parameters[property];  case 'data':  return this.value;  default:  return this.decorElement.style[property];  } };  Decor.prototype.build = function() {  var className = this.className;  var id = this.id;  var html = '';   switch (this.parameters.type || 'Text') {   case 'Text':  html += this.value;  break;   case 'Image':  html += '<img src="' + this.value + '" border="0" suppress="true" class="' + className + '_image" />';  break;   case 'Bullet':  html += '<ul' + (this.parameters.bullet ? (' type="' + this.parameters.bullet + '"') : '') + ' class="' + className + '_bullet_list">';  for (var index = 0; index < this.value.length; index++) {  html += '<li class="' + className + '_bullet_item">' + this.value[index] + '</li>'  }  html += '</ul>';  break;   case 'Number':  html += '<ol' + (this.parameters.number ? (' type="' + this.parameters.number + '"') : '') + (this.parameters.start ? (' start="' + this.parameters.start + '"') : '') + ' class="' + className + '_number_list">';  for (var index = 0; index < this.value.length; index++) {  html += '<li class="' + className + '_number_item">' + this.value[index] + '</li>'  }  html += '</ol>';  break;   case 'Definition':  html += '<dl' + (this.parameters.compact ? ' compact' : '') + ' class="' + className + '_definition">';  for (var index = 0; index < this.value.length; index++) {  var record = EnsureRecord(this.value[index]);  if (record.length > 0) {  html += '<dt class="' + className + '"_definition_term>' + record[0] + ((record.length > 1) ? ('<dd class="' + className + '_definition_description">' + record[1] + '</dd>') : '') + '</dt>'  }  }  html += '</dl>';  break;   case 'Marquis':  case 'Panel':  if (this.persist) {  for (var index = 0; index < this.value.length; index++) {  html += '<div id="' + this.id + '_Marquis_Cache_' + index + '" style="position:absolute;visibility:hidden" class="' + className + '">' + (this.value[index] || '') + '</div>';  }  } else {  html += '<div id="' + this.id + '_Marquis_0" style="position:absolute;visibility:hidden" class="' + className + '"></div>';  html += '<div id="' + this.id + '_Marquis_1" style="position:absolute;visibility:hidden" class="' + className + '"></div>';  }  html += '&nbsp;';  break;   }  return html };  Decor.prototype.animate = function() {  var isPanel = (this.parameters.type == 'Panel');   var marquis = this;  this.animation = 0;  marquis.message0Element = document.getElementById(marquis.id + '_Marquis_0');  marquis.message1Element = document.getElementById(marquis.id + '_Marquis_1');   function MarquisScroll() {   if (marquis.persist) {  marquis.message0Element = document.getElementById(marquis.id + '_Marquis_Cache_' + marquis.animation);  marquis.message1Element = document.getElementById(marquis.id + '_Marquis_Cache_' + ((marquis.animation + 1) % marquis.value.length));  } else {  marquis.message0Element.innerHTML = marquis.value[marquis.animation];  marquis.message1Element.innerHTML = marquis.value[(marquis.animation + 1) % marquis.value.length];  }   marquis.animation = (marquis.animation + 1) % marquis.value.length;   var frameWidth = DomGetElementWidth(marquis.contentElement);  var frameHeight = DomGetElementHeight(marquis.contentElement);  var message0Width = DomGetElementWidth(marquis.message0Element);  var message0Height = DomGetElementHeight(marquis.message0Element);  var message1Width = DomGetElementWidth(marquis.message1Element);  var message1Height = DomGetElementHeight(marquis.message1Element);   if (frameHeight < message1Height) {  marquis.contentElement.style.height = frameHeight = message1Height;  }   if (frameWidth < message1Width) {  marquis.contentElement.style.width = frameWidth = message1Width;  }   var endPoints = [];  endPoints[0] = [];  endPoints[1] = [];  endPoints[0][0] = [];  endPoints[0][1] = [];  endPoints[1][0] = [];  endPoints[1][1] = [];  if (marquis.parameters.horizontal) {  endPoints[0][0][0] = 0;  endPoints[0][0][1] = 0;  endPoints[0][1][0] = 0 - message0Width;  endPoints[0][1][1] = 0;  endPoints[1][0][0] = 0 + Math.max(message0Width, frameWidth);  endPoints[1][0][1] = 0;  endPoints[1][1][0] = 0;  endPoints[1][1][1] = 0;  } else {  endPoints[0][0][0] = 0;  endPoints[0][0][1] = 0;  endPoints[0][1][0] = 0;  endPoints[0][1][1] = 0 - message0Height;  endPoints[1][0][0] = 0;  endPoints[1][0][1] = 0 + Math.max(message0Height, frameHeight);  endPoints[1][1][0] = 0;  endPoints[1][1][1] = 0;  }   var progress = 0;  var goal = 100;  var rate = marquis.parameters.rate || 5;  var speed = marquis.parameters.speed || 10;   function MarquisSlide() {  if (progress <= goal) {  var remaining = goal - progress;   var left = (progress * endPoints[0][1][0] + remaining * endPoints[0][0][0]) / goal;  marquis.message0Element.style.left = LinearDimension(left);  var top = (progress * endPoints[0][1][1] + remaining * endPoints[0][0][1]) / goal;  marquis.message0Element.style.top = LinearDimension(top);  marquis.message0Element.style.clip = 'rect(' + (-top) + 'px, ' + Math.max(0, frameWidth - left) + 'px, ' + Math.max(0, frameHeight - top) + 'px, ' + (-left) + 'px)';   left = (progress * endPoints[1][1][0] + remaining * endPoints[1][0][0]) / goal;  marquis.message1Element.style.left = LinearDimension(left);  top = (progress * endPoints[1][1][1] + remaining * endPoints[1][0][1]) / goal;  marquis.message1Element.style.top = LinearDimension(top);  marquis.message1Element.style.clip = 'rect(' + (-top) + 'px, ' + Math.max(0, frameWidth - left - 1) + 'px, ' + Math.max(0, frameHeight - top) + 'px, ' + (-left) + 'px)';  marquis.message1Element.style.visibility = 'visible';   progress += rate;  marquis.slideTask = setTimeout(MarquisSlide, speed)  }  marquis.message0Element.style.visibility = 'hidden';  };   MarquisSlide();  marquis.message0Element.style.visibility = 'visible';  if (marquis.running) {  marquis.scrollTask = setTimeout(MarquisScroll, marquis.parameters.dwell || 15000)  }  };   MarquisScroll() };  Decor.prototype.startAnimation = function(delay) {  this.running = true;  var anima = this;  setTimeout(function() { anima.animate() }, this.parameters.delay || delay || 1000); }; Decor.prototype.stopAnimation = function() {  this.running = false;  if (this.slideTask) {  clearTimeout(this.slideTask)  }  if (this.scrollTask) {  clearTimeout(this.scrollTask)  } }; Decor.prototype.hide = function() {  if (this.persist) {  for (var index = 0; index < this.value.length; index++) {  document.getElementById(this.id + '_Marquis_Cache_' + index).style.visibility = 'hidden'  }  } };  /* Subscription */   Decor.prototype.subscriptions = function() {  return [] };  Decor.prototype.actions = function() {  return ['data'] };  Decor.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Decor.prototype.receive = function(action, parameters) {  switch (action) {  case 'data':  this.setProperty('data', parameters);  break;  } };    function DecorPanelControl(name, parameters) {  this.name = name;  this.id = 'DecorPanelControl_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.className = 'scroll_control';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.scrollPanel = this.enclosureDocument.createElement('DIV');  this.enclosureElement.appendChild(this.scrollPanel);  this.scrollPanel.id = this.id + '_Frame';  this.scrollPanel.innerHTML = this.build();  this.hide();     this.scrollPanel.model = this;  this.subscription = new Subscription() };   /* Construction */   DecorPanelControl.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'html':  this.scrollPanel.innerHTML = value;  break;  default:  break;  } };  DecorPanelControl.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'html':  return this.scrollPanel.innerHTML;  default:  } };  DecorPanelControl.prototype.build = function() {  var id = this.id;  var className = this.className;   var html = '<table id="' + id + '_Scroll" style="background-color:#CCCC00;cursor:pointer;border:ridge" cellpadding="0" cellspacing="0">' +  '<tr><td align="center"><img id="' + id + '_Up" src="' + ((this.parameters.arrowURL || '/_iView/image/arrow_') + 'up.gif') + '" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></td></tr>' +  '<tr><td align="center"><img id="' + id + '_Down" src="' + ((this.parameters.arrowURL || '/_iView/image/arrow_') + 'down.gif') + '" onmouseover="DomGetModel(this).track(event)" onmouseout="DomGetModel(this).track(event)" onmousedown="DomGetModel(this).track(event)" onmouseup="DomGetModel(this).track(event)" onclick="DomGetModel(this).track(event)"></td></tr>' +  '</table>';   return html };   /* Animation */   DecorPanelControl.prototype.track = function(theEvent) {   var className = this.className;  var id = this.id;   var targetElement = DomGetTarget(theEvent);  var ids = targetElement.id.split('_');   var action = ids[ids.length - 1];  switch (action) {  case 'Up':  switch (theEvent.type) {  case 'mouseout':  targetElement.className = this.className + '_arrow';  break;  case 'mouseup':  case 'mouseover':  targetElement.className = this.className + '_arrow_hover';  break;  case 'mousedown':  targetElement.className = this.className + '_arrow_hilite';  break;  case 'click':  this.subscription.broadcast('scroll', -1);  break;  }  break;  case 'Down':  switch (theEvent.type) {  case 'mouseout':  targetElement.className = this.className + '_arrow';  break;  case 'mouseup':  case 'mouseover':  targetElement.className = this.className + '_arrow_hover';  break;  case 'mousedown':  targetElement.className = this.className + '_arrow_hilite';  break;  case 'click':  this.subscription.broadcast('scroll', +1);  break;  }  break;  } };  DecorPanelControl.prototype.show = function(targetElement) {  this.scrollPanel.style.display = 'block' };  DecorPanelControl.prototype.hide = function() {  this.scrollPanel.style.display = 'none' };   /* Subscription */   DecorPanelControl.prototype.subscriptions = function() {  return ['scroll'] };  DecorPanelControl.prototype.actions = function() {  return [] };  DecorPanelControl.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };      function Dial(name, parameters) {  this.name = name;  this.id = 'Dial_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  var enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.divElement = this.enclosureDocument.createElement('DIV');  enclosureElement.appendChild(this.divElement);  this.divElement.style.position = 'relative';   this.tableElement = this.enclosureDocument.createElement('TABLE');  this.divElement.appendChild(this.tableElement);  this.tableElement.style.vAlign = 'top';  this.tableElement.style.align = 'left';   DomAddEventListener(this.tableElement, 'mousedown', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).inhibit(true) }, false);  DomAddEventListener(this.tableElement, 'mouseup', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).inhibit(false) }, false);  DomAddEventListener(this.tableElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).page(theEvent) }, false);   this.indicatorParameters = [];  this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];  this.configuration.type = (this.configuration.type || 'Slide');   this.tableElement.className = 'dial';  this.tableElement.style.width = LinearDimension(1);  this.tableElement.style.cursor = 'pointer';  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);   this.cellElement = this.enclosureDocument.createElement('TD');  this.rowElement.appendChild(this.cellElement);   this.value = [];  this.subscription = new Subscription();  this.divElement.model = this };   /* Construction */   Dial.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.tableElement.className = value;  break;  case 'width':  case 'height':  this.tableElement.style[property] = LinearDimension(value);  break;  case 'partitions':  this[property] = value;  break;  case 'data':  if (!this.inhibitUpdate) {  var value = EnsureRecord(value);  this.value[0] = ExtractRecord(value, 0, this.value[0]);  this.value[0] = Math.max(0, Math.min(1, this.snap(this.value[0])));  if (this.value.length > 1) {  this.value[1] = ExtractRecord(value, 1, this.value[1]);  this.value[1] = Math.max(0, Math.min(1, this.snap(this.value[1])))  }  this.position(this.value)  }  break;  case 'extent':  var value = EnsureRecord(value);  this.primaryScale = ExtractRecord(value, 0, this.primaryScale);  if (this.primaryScale) {  this.primaryScale = Math.max(0, Math.min(1, this.primaryScale))  }  this.secondaryScale = ExtractRecord(value, 1, this.secondaryScale);  if (this.secondaryScale) {  this.secondaryScale = Math.max(0, Math.min(1, this.secondaryScale))  }  break;  default:  this.tableElement.style[property] = value;  } };  Dial.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.tableElement.className;  case 'partitions':  return this[property];  case 'data':  return this.value;  case 'extent':  return [this.primaryScale, this.secondaryScale];  default:  return this.tableElement.style[property];  } };  Dial.prototype.remove = function(element) {  this.cellElement.removeChild(element) };  Dial.prototype.insert = function(element, zIndex) {  this.cellElement.appendChild(element);  element.style.zIndex = (zIndex || 1) };  Dial.prototype.add = function(element, parameters) {  this.insert(this.indicatorElement = (element || this.enclosureDocument.createElement("DIV")));  DomAddEventListener(this.indicatorElement, 'mousedown', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.indicatorElement, 'mousemove', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.indicatorElement, 'mouseup', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.indicatorElement, 'mouseover', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.indicatorElement, 'mouseout', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.indicatorElement.className = this.tableElement.className + '_thumb';   parameters = parameters || [];  parameters.zIndex = parameters.zIndex || 100;  parameters.width = parameters.width || 16;  parameters.height = parameters.height || 16;  for (var key in parameters) {  switch (key) {  case 'className':  this.indicatorElement.className = parameters[key];  break;  case 'motion':  this.indicatorParameters[key] = parameters[key];  break;  case 'width':  case 'height':  this.indicatorElement.style[key] = LinearDimension(this.indicatorParameters[key] = parseInt(parameters[key]));  break;  default:  this.indicatorElement.style[key] = parameters[key];  break;  }  }  switch (this.indicatorParameters.motion) {  case 'horizontal':  this.indicatorElement.style.height = this.indicatorElement.style.height || this.cellElement.clientHeight;  break;  case 'vertical':  this.indicatorElement.style.width = this.indicatorElement.style.width || this.cellElement.clientWidth;  break;  }  this.indicatorElement.style.position = 'relative';  this.indicatorElement.style.cursor = 'pointer';   this.setProperty('data', 0) };   /* Animation */   Dial.prototype.hilite = function(hilite) {  var className = this.indicatorElement.className.replace(/\_hilite$/, '');  this.indicatorElement.className = className + (hilite ? '_hilite' : '') };  Dial.prototype.position = function(value) {  var value = EnsureRecord(value);  this.value[0] = ExtractRecord(value, 0, this.value[0]);  this.value[0] = Math.max(0, Math.min(1, this.value[0]));   switch (this.indicatorParameters.motion) {  case 'horizontal':  case 'both':  var width = this.indicatorParameters.width || (  (this.primaryScale == undefined) ? 1 : Math.max(1, this.primaryScale * this.cellElement.clientWidth));  this.indicatorElement.style.width = LinearDimension(width);  this.indicatorElement.style.left = LinearDimension(this.x = this.value[0] * (this.cellElement.clientWidth - width));  break;  case 'vertical':  var height = this.indicatorParameters.height || (  (this.primaryScale == undefined) ? 1 : Math.max(1, this.primaryScale * this.cellElement.clientHeight));  this.indicatorElement.style.height = LinearDimension(height);  this.y = this.value[0] * (this.cellElement.clientHeight - height);  this.indicatorElement.style.top = LinearDimension((this.value[0] - 0.5) * (this.cellElement.clientHeight - height));  break;  }   if ((value.length > 1) && (this.indicatorParameters.motion == 'both')) {  this.value[1] = ExtractRecord(value, 1, this.value[1]);  this.value[1] = Math.max(0, Math.min(1, this.value[1]));   var height = this.indicatorParameters.height || (  (this.secondaryScale == undefined) ? 1 : Math.max(1, this.secondaryScale * this.cellElement.clientHeight));  this.y = this.value[1] * (this.cellElement.clientHeight - height);  this.indicatorElement.style.top = LinearDimension((this.value[1] - 0.5) * (this.cellElement.clientHeight - height))  } };  Dial.prototype.page = function(theEvent) {  var target = DomGetTarget(theEvent);  if (target == DomGetModel(target).cellElement) {  var width = this.indicatorParameters.width || this.cellElement.clientWidth;  this.x = Math.min(this.cellElement.clientWidth, Math.max(0, this.x + ((DomGetLayerX(theEvent) <= (this.x + 2)) ? -width : width)));  var height = this.indicatorParameters.height || this.cellElement.clientHeight;  this.y = Math.min(this.cellElement.clientHeight, Math.max(0, this.y + ((DomGetLayerY(theEvent) <= (this.y + 2)) ? -height : height)));  switch (this.indicatorParameters.motion) {  case 'horizontal':  case 'both':  this.value[0] = this.x / (this.cellElement.clientWidth - width);  this.value[1] = this.y / (this.cellElement.clientHeight - height);  break;  case 'vertical':  this.value[0] = this.y / (this.cellElement.clientHeight - height);  this.value[1] = this.x / (this.cellElement.clientWidth - width);  break;  }  this.setProperty('data', this.value);  this.subscription.broadcast('change', this.value)  } };  Dial.prototype.track = function(theEvent) {  var target = DomGetTarget(theEvent);  if (target == DomGetModel(target).indicatorElement) {  var width = this.indicatorParameters.width || this.cellElement.clientWidth;  var height = this.indicatorParameters.height || this.cellElement.clientHeight;  var x = 0;  var y = 0;  switch (theEvent.type) {  case 'mousedown':  this.tracking = true;  this.downX = DomGetPageX(theEvent);  this.downY = DomGetPageY(theEvent);  this.startX = this.x || 0;  this.startY = this.y || 0;  break;  case 'mouseover':  this.hilite(true);  break;  case 'mouseout':  this.hilite(false);  case 'mouseup':  if (this.tracking) {  this.inhibit(false);  this.setProperty('data', this.value || 0);  this.subscription.broadcast('change', this.value || 0);  }  this.tracking = false;  break;  case 'mousemove':  if (this.tracking) {  this.x = Math.min(this.cellElement.clientWidth, Math.max(0, this.startX + DomGetPageX(theEvent) - this.downX));  this.y = Math.min(this.cellElement.clientHeight, Math.max(0, this.startY + DomGetPageY(theEvent) - this.downY));  switch (this.indicatorParameters.motion) {  case 'horizontal':  case 'both':  this.value[0] = this.x / (this.cellElement.clientWidth - width);  this.value[1] = this.y / (2 * (this.cellElement.clientHeight - height));  break;  case 'vertical':  this.value[0] = this.y / (this.cellElement.clientHeight - height);  this.value[1] = this.x / (2 * (this.cellElement.clientWidth - width));  break;  }  this.subscription.broadcast('track', this.value)  }  }  this.position(this.value || 0)  } };  Dial.prototype.inhibit = function(value) {  this.inhibitUpdate = value };  Dial.prototype.snap = function(value) {  return this.partitions ? Math.round(this.partitions * value) / this.partitions : value };   /* Subscription */   Dial.prototype.subscriptions = function() {  return ['change', 'track'] };  Dial.prototype.actions = function() {  return ['value', 'names', 'values'] };  Dial.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Dial.prototype.receive = function(action, parameters) {  switch (action) {  case 'data':  case 'value':  this.setProperty('data', ExtractRecord(EnsureRecord(parameters), 0));  break;  } };    function Text(name, parameters) {  this.name = name;  this.id = 'Text_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.tableElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.tableElement);  this.tableElement.className = this.className = 'text';  this.tableElement.style.width = LinearDimension(1);  this.tableElement.style.cursor = 'pointer';  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);  DomAddEventListener(this.tableElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.textParameters = [];  this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];  this.state = UnpackHash([], GetCookie(this.id + 'data'), '|', '~') || [];   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   if (this.parameters.title) {  var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  var cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(cellElement);  cellElement.innerHTML = this.parameters.title  }   var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  this.cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(this.cellElement);  this.cellElement.appendChild(this.build());  this.cellElement.style.border = 'inset';   this.subscription = new Subscription();  this.tableElement.model = this };   /* Construction */   Text.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'border':  this.tableElement.style[property] = value;  break;  case 'type':  this.configuration[property] = value;  break;  case 'title':  break;  case 'data':  this.state[this.id] = value;  switch (this.configuration.type || 'Text') {  case 'Textarea':  this.textElement.innerHTML = (this.state[this.id] || '');  break;  default:  this.textElement.value = (this.state[this.id] || '');  }  break;  case 'size':  case 'width':  case 'height':  this.textParameters[property] = value;  break;  default:  } };  Text.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'border':  return this.tableElement.style[property];  case 'type':  return this.configuration[property];  case 'data':  return this.state[this.id];  case 'size':  case 'width':  case 'height':  return this.textParameters[property];  default:  return this.parameters[property];  } };  Text.prototype.build = function() {  switch (this.configuration.type || 'Text') {  case 'Textarea':  this.textElement = this.enclosureDocument.createElement('TEXTAREA');  if (this.textParameters.width) {  this.textElement.setAttribute('cols', this.textParameters.width);  }  if (this.textParameters.height) {  this.textElement.setAttribute('rows', this.textParameters.height);  }  this.textElement.setAttribute('wrap', 'soft');  this.textElement.innerHTML = (this.state[this.id] || '');  DomAddEventListener(this.textElement, 'change', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  break;  default:  this.textElement = this.enclosureDocument.createElement('INPUT');  this.textElement.setAttribute('type', this.configuration.type || 'Text');  if (this.textParameters.width) {  this.textElement.setAttribute('size', this.textParameters.width);  }  if (this.textParameters.size) {  this.textElement.setAttribute('maxlength', this.textParameters.size);  this.textElement.setAttribute('maxLength', this.textParameters.size);  }  this.textElement.setAttribute('value', this.state[this.id] || '');  DomAddEventListener(this.textElement, (this.configuration.type == 'Password') ? 'blur' : 'change', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.textElement, 'focus', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  }  return this.textElement };  Text.prototype.rebuild = function() {  var oldObject;  while (oldObject = this.cellElement.lastChild) {  this.cellElement.removeChild(oldObject)  }   this.cellElement.appendChild(this.build()) };  var textNextType = []; textNextType.Text = 'Password'; textNextType.Password = 'Textarea'; textNextType.Textarea = 'Text';  Text.prototype.swap = function() {  if (!this.parameters.noSwap) {   this.configuration.type = textNextType[this.configuration.type || 'Text'];   SetCookie(this.id, PackHash(this.configuration, '|', '~'));   this.rebuild()  } };   /* Animation */   Text.prototype.track = function(theEvent) {  var targetElement = DomGetTarget(theEvent);  if (theEvent.altKey) {  this.swap()  } else {  var parameters = [];  switch (theEvent.type) {  case 'focus':  this.subscription.broadcast('focus', targetElement);  break;  case 'blur':  case 'change':  this.state = [];  this.state[this.id] = targetElement.value;   SetCookie(this.id + 'data', PackHash(this.state, '|', '~'));   this.subscription.broadcast('change', this.state);  break;  }  theEvent.cancelBubble = true  } };   /* Subscription */   Text.prototype.subscriptions = function() {  return ['change'] };  Text.prototype.actions = function() {  return ['change'] };  Text.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Text.prototype.receive = function(action, parameters) {  switch (action) {  case 'data':  case 'change':  case 'value':  this.setProperty('data', parameters);  break;  } };   function Button(name, parameters) {  this.name = name;  this.id = 'Button_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  var enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.tableElement = this.enclosureDocument.createElement('TABLE');  enclosureElement.appendChild(this.tableElement);  this.tableElement.className = this.className = 'button';  this.tableElement.style.width = LinearDimension(1);  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);  this.rowElement.className = this.className + '_row';   this.cellElement = this.enclosureDocument.createElement('TD');  this.rowElement.appendChild(this.cellElement);  this.cellElement.className = this.className + '_cell';  if (this.parameters.noWrap) {  this.cellElement.setAttribute('noWrap', this.parameters.noWrap);  }   if (this.parameters.url) {  this.buttonElement = this.enclosureDocument.createElement("IMG");  this.cellElement.appendChild(this.buttonElement);  } else {  this.buttonElement = this.cellElement;  }  this.buttonElement.style.cursor = 'pointer';  this.buttonElement.style.position = 'relative';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.buttonElement.className = this.className + '_thumb';   DomAddEventListener(this.buttonElement, 'mousedown', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.buttonElement, 'mouseup', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.buttonElement, 'mouseover', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.buttonElement, 'mouseout', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.buttonElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   if (this.parameters.url) {  this.buttonElement.src = this.parameters.url + this.parameters.extension  }   this.tableElement.model = this;  this.subscription = new Subscription();   this.data = [] };   /* Construction */    Button.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.tableElement.className = this.className = this.parameters[property];  break;  case 'width':  case 'height':  this.tableElement.style[property] = this.buttonElement.style[property] = LinearDimension(this.parameters[property]);  break;  case 'title':  if (!this.buttonElement.src && !this.parameters.url) {  this.buttonElement.innerHTML = (value || '')  }  break;  case 'value':  this.value = [this.parameters[property]];  break;  case 'data':  if (!this.inhibitUpdate) {  this.state = value ? (this.parameters.group ? (this.parameters.title || this.name) : (this.value || 1)) : '';  this.data[this.parameters.group || this.name || this.parameters.title] = this.state;  this.position(this.state)  }  break;  case 'bistate':  case 'group':  case 'url':  case 'hover':  case 'press':  case 'on':  case 'extension':  break;  default:  this.buttonElement.style[property] = this.parameters[property];  break;  } };  Button.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.buttonElement.style[property];  case 'value':  return this.value;  case 'data':  return this.data;  default:  return this.parameters[property];  } };   /* Animation */   Button.prototype.track = function(theEvent) {  var targetElement = DomGetTarget(theEvent);  if (targetElement == DomGetModel(targetElement).buttonElement) {  switch (theEvent.type) {  case 'mouseover':  this.hilite(true);  break;  case 'mouseout':  this.hilite(false);  case 'mouseup':  this.position(this.state ? (this.value || 1) : null);  break;  case 'mousedown':  this.position(this.value || 1);  if (!this.parameters.bistate && !this.parameters.group) {  var value = [];  value[this.parameters.title || this.name] = (this.value || 1);  this.subscription.broadcast('press', value);  }  break;  case 'click':  if (this.parameters.bistate || this.parameters.group) {  this.setProperty('data', !this.state);  }  this.subscription.broadcast('click', this.getProperty('data'));  break;  }  theEvent.cancelBubble = true  } };  Button.prototype.hilite = function(hilite) {  var className = this.buttonElement.className.replace(/\_hilite/, '');  this.buttonElement.className = className + (hilite ? '_hilite' : '') };  Button.prototype.position = function(value) {  var className = this.buttonElement.className.replace(/\_on/, '');  this.buttonElement.className = className + (value ? '_on' : ''); };  Button.prototype.inhibit = function(value) {  this.inhibitUpdate = value; };   /* Subscription */   Button.prototype.subscriptions = function() {  return ['press', 'click']; };  Button.prototype.actions = function() {  return ['data', 'value']; };  Button.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action); };  Button.prototype.receive = function(action, type, parameters) {  switch (action) {  case 'data':  case 'value':  this.setProperty(action, ExtractRecord(EnsureRecord(parameters), 0));  break;  } };    function Control(name, parameters) {  this.name = name;  this.id = 'Control_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.tableElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.tableElement);  this.tableElement.className = this.className = 'control';  this.tableElement.style.width = LinearDimension(1);  this.tableElement.style.cursor = 'pointer';  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);  DomAddEventListener(this.tableElement, 'click', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.tableElement, 'mouseover', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);  DomAddEventListener(this.tableElement, 'mouseout', function(theEvent) { DomGetModel(DomGetTarget(theEvent)).track(theEvent) }, false);   this.controlParameters = [];  this.configuration = UnpackHash([], GetCookie(this.id), '|', '~') || [];  this.state = UnpackHash([], GetCookie(this.id + 'data'), '|', '~') || [];  this.names = [];   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   if (this.parameters.title) {  this.title = this.parameters.title;  var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  this.titleElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(this.titleElement);  this.titleElement.innerHTML = this.parameters.title;   rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  var cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(cellElement);  var tableElement= this.enclosureDocument.createElement('TABLE');  cellElement.appendChild(tableElement);  tableElement.style.width = LinearDimension(1);  tableElement.setAttribute('border', 0);  tableElement.setAttribute('cellPadding', 0);  tableElement.setAttribute('cellSpacing', 0);  this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  tableElement.appendChild(this.tableBodyElement);  }   if (!this.parameters.Vertical) {  this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);  this.rowElement.className = this.className + '_row';  }   this.tableElement.model = this;  this.subscription = new Subscription();  this.built = true;   this.rebuild() };   /* Construction */    Control.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'noWrap':  this[property] = value;  break;  case 'border':  this.tableElement.style[property] = value;  break;  case 'type':  this.configuration[property] = value;  break;  case 'title':  if (this.titleElement) {  this.titleElement.innerHTML = value;  }  break;  case 'titles':  this.titles = EnsureRecord(value);  break;  case 'names':  this.names = EnsureRecord(value);  if (this.controlParameters.group) {  this.state[this.controlParameters.group] = this.names[0];  }  case 'Vertical':  this.rebuild();  break;  case 'data':  this.state = this.expand(value);  break;  case 'bistate':  case 'group':  case 'width':  case 'height':  case 'url':  case 'hover':  case 'press':  case 'on':  case 'extension':  this.controlParameters[property] = value;  break;  case 'font-size':  this.parameters[property] = value;  this.controlParameters[property] = value;  break;  default:  this.parameters[property] = value;  } };  Control.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'border':  return this.tableElement.style[property];  case 'type':  return this.configuration[property];  case 'titles':  return this.titles;  case 'names':  return this.names;  case 'data':  return this.compact(this.state);  case '':  return this.state;  case 'bistate':  case 'group':  case 'width':  case 'height':  case 'url':  case 'hover':  case 'press':  case 'on':  case 'extension':  return this.controlParameters[property];  default:  return this.parameters[property];  } };  Control.prototype.add = function(name, element, title) {  this.names[this.names.length] = name;   if (this.parameters.Vertical) {  this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);  this.rowElement.className = this.className + '_row'  }   var cellElement = this.enclosureDocument.createElement('TD');  this.rowElement.appendChild(cellElement);  cellElement.className = this.className + '_cell';   var controlElement;  if (element) {  controlElement = element  } else {  controlElement = this.build(name, 1 << Math.min(this.names.length - 1, 31), title)  }  cellElement.appendChild(controlElement) };  Control.prototype.build = function(name, value, title) {  var controlElement;  switch (this.configuration.type || 'Button') {  case 'Button':  var parameters = [];  CopyHash(parameters, this.controlParameters);  parameters.title = title || name;  parameters.value = value;  if (this.parameters.noWrap) {  parameters.noWrap = this.parameters.noWrap;  }  if (parameters.url) {  parameters.url = parameters.url + name;  }  this.controlButton = new Button(this.id + '_' + name, parameters);  controlElement = this.enclosureDocument.createElement('SPAN');  controlElement.appendChild(this.controlButton.tableElement);  this.controlButton.subscribe(this, 'press', 'change');  this.controlButton.subscribe(this, 'click', 'change');  if (parameters.group || parameters.bistate) {  this.controlButton.setProperty('data', parameters.group ? (this.state[parameters.group] == name) : this.state[name])  }  break;  case 'HTML':  controlElement = this.enclosureDocument.createElement('SPAN');  controlElement.innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td nowrap="1">' +  '<input type="' + (this.parameters.bistate ? 'checkbox' : this.parameters.group ? 'radio' : 'button') + '"' +  ' name="' + (this.parameters.group || (this.parameters.bistate ? name : (value || 1))) + '"' +  ' value="' + ((this.parameters.group || !this.parameters.bistate) ? name : (value || 1)) + '"' +  ((this.parameters.group ? (this.state[this.parameters.group] == name) : this.state[name]) ? ' checked' : '') +  ' onclick="DomGetModel(DomGetTarget(event)).track(event)"><span type="label" name="' + name + '">' +  ((this.parameters.bistate || this.parameters.group) ? (title || name) : '') +  '</span></td></tr></table>';  break;  case 'Select':  controlElement = this.enclosureDocument.createElement('SPAN');  if (value == 1) {  var html = '<select onchange="DomGetModel(DomGetTarget(event)).track(event)"' +  (this.parameters.group ? ' name="' + this.parameters.group + '"' : '') +  (this.parameters.bistate ? ' multiple' : '') +  ((this.parameters.bistate || this.parameters.size) ? (' size="' + (this.parameters.size || 4) + '"') : '') +  '>';  var titles = (this.titles && (this.titles.length > 0)) ? this.titles : this.names;  for (var index = 0; index < this.names.length; index++) {  html += '<option value="' + (this.parameters.group ? this.names[index] : (1 << index)) + '"' +  ((this.parameters.group ? (this.state[this.parameters.group] == this.names[index]) : this.state[this.names[index]]) ? ' selected' : '') +  '>' + titles[index] + '</option>';  }  html += '</select>';  controlElement.innerHTML = html;  }  break;  }  return controlElement; };  Control.prototype.rebuild = function() {  if (this.built) {  var oldChild;  while (oldChild = this.tableBodyElement.lastChild) {  this.tableBodyElement.removeChild(oldChild)  }   if (!this.parameters.Vertical) {  this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);  this.rowElement.className = this.className + '_row';  }   var parentNode = this.parameters.Vertical ? this.tableBodyElement : this.rowElement;  for (var index = 0; index < this.names.length; index++) {   if (this.parameters.Vertical) {  this.rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(this.rowElement);  this.rowElement.className = this.className + '_row'  }   var cellElement = this.enclosureDocument.createElement('TD');  this.rowElement.appendChild(cellElement);  cellElement.className = this.className + '_cell';   var controlElement = this.build(this.names[index], 1 << Math.min(index, 31), this.titles ? (this.titles[index] || '') : '');  cellElement.appendChild(controlElement)  }  } };  Control.prototype.swap = function() {  if (!this.parameters.noSwap) {  var controlNextType = [];  controlNextType.Button = 'HTML';  controlNextType.HTML = (this.parameters.group || this.parameters.bistate) ? 'Select' : 'Button';  controlNextType.Select = 'Button';   this.configuration.type = controlNextType[this.configuration.type || 'Button'];   SetCookie(this.id, PackHash(this.configuration, '|', '~'));   this.rebuild()  } };   /* Animation */   Control.prototype.compact = function(state) {  if (this.parameters.dense) {  if (this.parameters.group) {  for (var index = 0; index < this.names.length; index++) {  if (this.state[this.parameters.group] == this.names[index]) {  return index  }  }  } else {  var value = 0;  for (var index = 0; index < this.names.length; index++) {  if (this.state[this.names[index]]) {  value |= 1 << index  }  }  return value  }  } else {  return this.state  } };  Control.prototype.expand = function(value) {  if (this.parameters.dense) {  if (!this.state) {  this.state = [];  }  if (this.parameters.group) {  this.state[this.parameters.group] = this.names[value]  } else {  for (var index = 0; index < this.names.length; index++) {  this.state[this.names[index]] = value & 1;  value = value >> 1  }  }  } else {  this.state = value  } }; Control.prototype.track = function(theEvent) {  var targetElement = DomGetTarget(theEvent);  if (theEvent.altKey) {  this.swap()  } else {  var parameters = [];  switch (targetElement.type) {  case 'button':  if (theEvent.type == 'click') {  this.state = [];  parameters[targetElement.value] = targetElement.name;  this.subscription.broadcast('action', this.compact(parameters));  }  break;  case 'radio':  if (theEvent.type == 'click') {  this.state = [];  this.subscription.broadcast('action', this.compact(parameters));  }  case 'checkbox':  if (theEvent.type == 'click') {  parameters[targetElement.name] = targetElement.checked ? targetElement.value : '';  CopyHash(this.state, parameters);   SetCookie(this.id + 'data', PackHash(this.state, '|', '~'));   this.subscription.broadcast('change', this.compact(this.state));  }  break;  case undefined:  if (theEvent.type == 'mouseover') {  if (targetElement.getAttribute('type') == 'label') {  this.subscription.broadcast('mouseover', targetElement.getAttribute('name'));  }  } else if (theEvent.type == 'mouseout') {  if (targetElement.getAttribute('type') == 'label') {  this.subscription.broadcast('mouseout', targetElement.getAttribute('name'));  }  }  break;  default:  if (theEvent.type == 'change') {  var options = targetElement.childNodes;  for (var index = 0; index < options.length; index++) {  var option = options[index];  if (option.selected) {  if (this.parameters.group) {  parameters[parameters.length] = option.value  } else if (this.parameters.bistate) {  parameters[option.text] = option.value  }  }  }  this.state = [];  if (this.parameters.group) {  var values = [];  values[targetElement.name] = parameters.join(',');  CopyHash(this.state, values);  } else if (this.parameters.bistate) {  CopyHash(this.state, parameters)  }   SetCookie(this.id + 'data', PackHash(this.state, '|', '~'));   this.subscription.broadcast('change', this.compact(this.state));  }  }  DomCancelEvent(theEvent);  } };   /* Subscription */   Control.prototype.subscriptions = function() {  return ['action', 'change'] };  Control.prototype.actions = function() {  return ['action', 'change'] };  Control.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Control.prototype.receive = function(action, parameters) {  switch (action) {  case 'change':  var rows = this.tableBodyElement.childNodes;  for (var row = 0; row < rows.length; row++) {  var columns = rows[row].childNodes;  for (var column = 0; column < columns.length; column++) {  var control = DomGetModel(columns[column].firstChild.firstChild);  if (control.getProperty('group')) {  control.setProperty('data', parameters[control.getProperty('group')] == (control.getProperty('title') || control.getProperty('name')))  }  }  }  if (!this.parameters.bistate) {  this.state = []  }  CopyHash(this.state, parameters);   SetCookie(this.id + 'data', PackHash(this.state, '|', '~'));   this.subscription.broadcast('change', this.compact(this.state));  break;  case 'action':  this.subscription.broadcast('action', this.compact(parameters));  break;  case 'data':  case 'value':  this.setProperty(action, ExtractRecord(EnsureRecord(parameters), 0));  break;  } }; Control.prototype.clearAll = function() {  var rows = this.tableBodyElement.childNodes;  for (var row = 0; row < rows.length; row++) {  var columns = rows[row].childNodes;  for (var column = 0; column < columns.length; column++) {  var control = DomGetModel(columns[column].firstChild.firstChild);  control.setProperty('data', false)  }  } }; Control.prototype.select = function(selection) {  var index = 0;  var rows = this.tableBodyElement.childNodes;  for (var row = 0; row < rows.length; row++) {  var columns = rows[row].childNodes;  for (var column = 0; column < columns.length; column++) {  var control = DomGetModel(columns[column].firstChild.firstChild);  control.setProperty('data', (selection == index++) ? true : false)  }  } };   function Data(parameters) {   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = parameters.enclosure || document;  var enclosureElement = parameters.insertion || this.enclosureDocument.body;   this.tableElement = this.enclosureDocument.createElement('TABLE');  enclosureElement.appendChild(this.tableElement);   this.tableElement.className = this.className = (parameters.className || 'data');  this.tableElement.style.width = LinearDimension(1);   for (var key in parameters) {  switch (key) {  case 'width':  case 'height':  this.tableElement.style[key] = LinearDimension(parameters[key]);  break;  default:  this.tableElement.style[key] = parameters[key];  break;  }  }   this.columns = parameters.columns;   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement) };   /* Cell Access */   Data.prototype.getDimensions = function() {  return [this.tableRows.length, this.tableRows.length ? this.tableRows.item(this.tableRows.length - 1).childNodes.length : 0] };  Data.prototype.select = function(row, column) {  this.tableRows = this.tableElement.rows;  if (column == undefined) {  if (row == undefined) {  var dimensions = this.getDimensions();  this.row = Math.max(0, dimensions[0] - 1);  this.column = Math.max(0, dimensions[1] - 1)  } else {  if (this.columns) {  this.column = row % this.columns;  this.row = (row - this.column) / this.columns  } else {  this.column = row;  this.row = 0  }  }  } else {  this.row = row || 0;  if (this.columns) {  this.column = Math.min(column, this.columns - 1)  } else {  this.column = column  }  } };  Data.prototype.retrieve = function(row, column) {  this.select(row, column);  var rowNode = (this.row < this.tableRows.length) ? this.tableRows.item(this.row) : null;  var cellNode = rowNode ? ((this.column < rowNode.childNodes.length) ? rowNode.childNodes.item(this.column) : '') : null;  return cellNode ? cellNode.lastChild : '' };   /* Cell Edit */   Data.prototype.remove = function(row, column) {  var element = this.retrieve(row, column);  if (element) {  var cellNode = element.parentNode;  var rowNode = cellNode.parentNode;  rowNode.removeChild(cellNode);  if (rowNode.childNodes.length <= 0) {  rowNode.parentNode.removeChild(rowNode)  }  }  return element };  Data.prototype.insert = function(element, row, column) {  this.select(row, column);  if (column == undefined) {  this.column += 1  } else if (this.columns && (column > this.columns)) {  this.column += 1  }   if (this.columns && (this.column >= this.columns)) {  this.column = 0;  this.row += 1  }   if (this.row >= this.tableRows.length) {  var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  rowElement.style.vAlign = 'top';  this.row = this.tableRows.length - 1  }   var rowNode = this.tableRows.item(this.row);   if (this.column >= rowNode.childNodes.length) {  var cellElement = this.enclosureDocument.createElement('TD');  rowNode.appendChild(cellElement);  cellElement.className = this.className + '_cell';  cellElement.style.vAlign = 'top';  cellElement.model = this;  this.column = rowNode.childNodes.length - 1  }   var cellNode = rowNode.childNodes.item(this.column);  var oldElement;  while (cellNode.lastChild) {  cellNode.removeChild(oldElement = cellNode.lastChild)  }  cellNode.appendChild(element);  return oldElement };   /* Cell Selection */   Data.prototype.show = function(row, column) {  var globalDisplay = 'block';  if ((row != undefined) || (column != undefined)) {  globalDisplay = 'none';  if (column != undefined) {  row = column  }  if (this.columns) {  column = row % this.columns;  row = (row - column) / this.columns  } else {  column = row;  row = 0  }  }  for (var indexRow = 0; indexRow < this.tableRows.length; indexRow++) {  var rowNode = this.tableRows.item(indexRow);  for (var indexColumn = 0; indexColumn < rowNode.childNodes.length; indexColumn++) {  var display = ((row == indexRow) && (column == indexColumn)) ? 'inline' : globalDisplay;  var cellNode = rowNode.childNodes.item(indexColumn);  for (var indexCell = 0; indexCell < cellNode.childNodes.length; indexCell++) {  cellNode.childNodes.item(indexCell).style.display = display  }  }  } };   /* Table Attributes */   Data.prototype.setProperty = function(attribute, value) {  switch (attribute) {  case 'className':  this.tableElement.className = this.className = (value || 'data');  break;  case 'columns':  this.columns = value;  break;  default:  this.tableElement.style[attribute] = value  } };  Data.prototype.getProperty = function(attribute) {  switch (attribute) {  case 'className':  return this.tableElement.className;  case 'columns':  return this.columns;  default:  return this.tableElement.style[attribute]  } };  Data.prototype.setCellProperty = function(attribute, value) {  var rowNode = (this.row < this.tableRows.length) ? this.tableRows.item(this.row) : null;  if (rowNode) {  var cellNode = (this.column < rowNode.childNodes.length) ? rowNode.childNodes.item(this.column) : null;  if (cellNode) {  switch (attribute) {  case 'className':  cellNode.className = value;  break;  case 'align':  case 'vAlign':  case 'colSpan':  case 'rowSpan':  cellNode.setAttribute(attribute, value);  break;  default:  cellNode.style[attribute] = value  }  }  } };  Data.prototype.getCellProperty = function(attribute) {  var rowNode = (this.row < this.tableRows.length) ? this.tableRows.item(this.row) : null;  if (rowNode) {  var cellNode = (this.column < rowNode.childNodes.length) ? rowNode.childNodes.item(this.column) : null;  if (cellNode) {  switch (attribute) {  case 'className':  return cellNode.className;  case 'align':  case 'vAlign':  case 'colSpan':  case 'rowSpan':  return cellNode.getAttribute(attribute);  default:  return cellNode.style[attribute]  }  }  } };   function Elaboration(name, parameters) {  this.name = name;  this.id = 'Elaboration_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  this.enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.tableElement = this.enclosureDocument.createElement('TABLE');  this.enclosureElement.appendChild(this.tableElement);  this.tableElement.className = this.className = 'elaboration';  this.tableElement.style.width = LinearDimension(1);  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);  this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  var cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(cellElement);  var tableElement= this.enclosureDocument.createElement('TABLE');  cellElement.appendChild(tableElement);  tableElement.style.width = LinearDimension(1);  tableElement.setAttribute('border', 0);  tableElement.setAttribute('cellPadding', 0);  tableElement.setAttribute('cellSpacing', 0);  var tableBodyElement = this.enclosureDocument.createElement('TBODY');  tableElement.appendChild(tableBodyElement);  var subRowElement = this.enclosureDocument.createElement('TR');  tableBodyElement.appendChild(subRowElement);  this.titleCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(this.titleCellElement);  this.titleCellElement.setAttribute('noWrap', 1);   rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  cellElement = this.enclosureDocument.createElement('TD');  rowElement.appendChild(cellElement);  var tableElement= this.enclosureDocument.createElement('TABLE');  cellElement.appendChild(tableElement);  tableElement.style.width = LinearDimension(1);  tableElement.setAttribute('border', 0);  tableElement.setAttribute('cellPadding', 0);  tableElement.setAttribute('cellSpacing', 0);  var tableBodyElement = this.enclosureDocument.createElement('TBODY');  tableElement.appendChild(tableBodyElement);  subRowElement = this.enclosureDocument.createElement('TR');  tableBodyElement.appendChild(subRowElement);  subRowElement.setAttribute('vAlign', 'top');   this.arrowCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(this.arrowCellElement);  this.arrowCellElement.innerHTML = '<img src="' + (this.arrowURL || '/_iView/image/arrow_') + 'up.gif" id="' + this.id + '_Arrow" onclick="DomGetModel(DomGetTarget(event)).track(event)" style="cursor:pointer">';   var contentCellElement = this.enclosureDocument.createElement('TD');  subRowElement.appendChild(contentCellElement);  contentCellElement.setAttribute('noWrap', 1);   this.contentDivElement = this.enclosureDocument.createElement('DIV');  contentCellElement.appendChild(this.contentDivElement);  this.contentDivElement.className = this.className + '_content';  this.contentDivElement.setAttribute('noWrap', 1);  this.contentDivElement.innerHTML = '&nbsp;';    for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.tableElement.model = this;  this.built = true;  this.startLoading(100) };   /* Construction */    Elaboration.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.contentDivElement.className = this.className = value;  break;  case 'title':  this.titleCellElement.innerHTML = (value || '&nbsp;');  break;  case 'width':  case 'height':  this.contentDivElement.style[property] = LinearDimension(value);  break;  case 'arrowURL':  break;  case 'url':  this.url = value;  this.startLoading(100);  break;  case 'term':  this.terms[value[0]] = value[1];  this.startLoading(100);  break;  case 'terms':  this.terms = value;  this.startLoading(100);  break;  default:  this.contentDivElement.style[property] = value;  break;  } };  Elaboration.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.contentDivElement.style[property];  } };   /* Animation */   Elaboration.prototype.track = function(theEvent) {  var targetElement = DomGetTarget(theEvent);  switch (theEvent.type) {  case 'click':  if (this.elaborate = !this.elaborate) {  targetElement.src = (this.arrowURL || '/_iView/image/arrow_') + 'down.gif';  this.startLoading(100)  } else {  targetElement.src = (this.arrowURL || '/_iView/image/arrow_') + 'up.gif';  this.startLoading(100)  }  break;  } };  Elaboration.prototype.startLoading = function(delay) {  this.stopLoading();  var report = this;  delay = delay || this.delay || 60000;  if (this.built) {  this.timeoutTask = setTimeout(function() { report.load() }, delay);  } };  Elaboration.prototype.stopLoading = function() {  if (this.timeoutTask) {  clearTimeout(this.timeoutTask)  } };  Elaboration.prototype.load = function() {  var hashCache = [];  if (this.elaborate) {  hashCache.Elaborate = 'True'  }  this.storeParameters = [];  this.storeParameters.url = this.url;  this.storeParameters.terms = [];  CopyHash(this.storeParameters.terms, this.terms);  CopyHash(this.storeParameters.terms, hashCache);  this.store = new Store(this.id + '_Store', this.storeParameters);  this.store.subscribe(this, 'data', 'loaded');  this.store.subscribe(this, 'error', 'error');  this.store.load() };   /* Subscription */   Elaboration.prototype.subscriptions = function() {  return [] };  Elaboration.prototype.actions = function() {  return ['loaded', 'error'] };  Elaboration.prototype.subscribe = function(target, type, action) { };  Elaboration.prototype.receive = function(action, parameters) {  switch (action) {  case 'loaded':  this.contentDivElement.className = this.className + '_content';  this.xmlDoc = parameters[0];  var responseNodeList = this.store.GetNodeListByTagName(this.elaborate ? 'Elaboration' : 'Summary');  if (responseNodeList && (responseNodeList.length > 0)) {  this.contentDivElement.innerHTML = responseNodeList[0].firstChild.nodeValue || '&nbsp;'  } else {  this.contentDivElement.className = this.className + '_warning';  this.contentDivElement.innerHTML = '(No Data)'  }  this.startLoading();  break;  case 'error':  this.contentDivElement.className = this.className + '_error';  this.contentDivElement.innerHTML = parameters[0];  break;  } };  function Behavior(name, parameters) {  this.name = name;  this.id = 'Behavior_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.subscription = new Subscription(); };   /* Construction */   Behavior.prototype.setProperty = function(property, value) {  switch (property) {  default:  this[property] = (value || '');  } };  Behavior.prototype.getProperty = function(property) {  switch (property) {  default:  return this[property];  } };   /* Subscription */   Behavior.prototype.subscriptions = function() {  return [] };  Behavior.prototype.actions = function() {  return ['trigger'] };  Behavior.prototype.subscribe = function(target, type, action) {  this.subscription.subscribe(target, type, action) };  Behavior.prototype.receive = function(action, parameters) {  switch (action) {  case 'trigger':  if (this.action) {  this.action(parameters)  }  break;  } };   function Layout(parameters) {  this.parameters = parameters || [];   this.enclosureDocument = parameters.enclosure || document;  var enclosureElement = parameters.insertion || this.enclosureDocument.body;   this.tableElement = this.enclosureDocument.createElement('TABLE');  enclosureElement.appendChild(this.tableElement);   this.tableElement.className = this.className = (parameters.className || 'layout');  this.tableElement.style.width = LinearDimension(1);  this.tableElement.setAttribute('border', 0);  this.tableElement.setAttribute('cellPadding', 0);  this.tableElement.setAttribute('cellSpacing', 0);   this.columns = parameters.columns;   this.tableBodyElement = this.enclosureDocument.createElement('TBODY');  this.tableElement.appendChild(this.tableBodyElement);   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  } };   /* Cell Access */   Layout.prototype.getDimensions = function() {  return [this.tableRows.length, this.tableRows.length ? this.tableRows.item(this.tableRows.length - 1).childNodes.length : 0] };  Layout.prototype.select = function(row, column) {  this.tableRows = this.tableElement.rows;  if (column == undefined) {  if (row == undefined) {  var dimensions = this.getDimensions();  this.row = Math.max(0, dimensions[0] - 1);  this.column = Math.max(0, dimensions[1] - 1)  } else {  if (this.columns) {  this.column = row % this.columns;  this.row = (row - this.column) / this.columns  } else {  this.column = row;  this.row = 0  }  }  } else {  this.row = row || 0;  if (this.columns) {  this.column = Math.min(column, this.columns - 1)  } else {  this.column = column  }  } };  Layout.prototype.retrieve = function(row, column) {  this.select(row, column);  var rowNode = (this.row < this.tableRows.length) ? this.tableRows.item(this.row) : null;  var cellNode = rowNode ? ((this.column < rowNode.childNodes.length) ? rowNode.childNodes.item(this.column) : '') : null;  return cellNode ? cellNode.lastChild : '' };   /* Cell Edit */   Layout.prototype.remove = function(row, column) {  var element = this.retrieve(row, column);  if (element) {  var cellNode = element.parentNode;  var rowNode = cellNode.parentNode;  rowNode.removeChild(cellNode);  if (rowNode.childNodes.length <= 0) {  rowNode.parentNode.removeChild(rowNode)  }  }  return element };  Layout.prototype.insert = function(element, row, column) {  this.select(row, column);  if (column == undefined) {  this.column += 1  } else if (this.columns && (column > this.columns)) {  this.column += 1  }   if (this.columns && (this.column >= this.columns)) {  this.column = 0;  this.row += 1  }   if (this.row >= this.tableRows.length) {  var rowElement = this.enclosureDocument.createElement('TR');  this.tableBodyElement.appendChild(rowElement);  rowElement.className = this.className + '_row';  rowElement.setAttribute('vAlign', 'top');  this.row = this.tableRows.length - 1  }   var rowNode = this.tableRows.item(this.row);   if (this.column >= rowNode.childNodes.length) {  var cellElement = this.enclosureDocument.createElement('TD');  rowNode.appendChild(cellElement);  cellElement.className = this.className + '_cell';  cellElement.setAttribute('vAlign', 'top');  cellElement.model = this;  this.column = rowNode.childNodes.length - 1  }   var cellNode = rowNode.childNodes.item(this.column);  var oldElement;  while (cellNode.lastChild) {  cellNode.removeChild(oldElement = cellNode.lastChild)  }  if (!element) {  element = this.enclosureDocument.createElement('SPAN')  }  cellNode.appendChild(element);  return cellNode };   /* Cell Selection */   Layout.prototype.hide = function() {  for (var indexRow = 0; indexRow < (this.tableRows.length || 0); indexRow++) {  var rowNode = this.tableRows.item(indexRow);  for (var indexColumn = 0; indexColumn < rowNode.childNodes.length; indexColumn++) {  var cellNode = rowNode.childNodes.item(indexColumn);  for (var indexCell = 0; indexCell < cellNode.childNodes.length; indexCell++) {  cellNode.childNodes.item(indexCell).style.display = 'none'  }  }  } }; Layout.prototype.show = function(row, column, block) {  var globalDisplay = block ? 'block' : 'inline';  if ((row != undefined) || (column != undefined)) {  globalDisplay = 'none';  if (column != undefined) {  row = column  }  if (this.columns) {  column = row % this.columns;  row = (row - column) / this.columns  } else {  column = row;  row = 0  }  }  for (var indexRow = 0; indexRow < this.tableRows.length; indexRow++) {  var rowNode = this.tableRows.item(indexRow);  for (var indexColumn = 0; indexColumn < rowNode.childNodes.length; indexColumn++) {  var display = ((row == indexRow) && (column == indexColumn)) ? 'inline' : globalDisplay;  var cellNode = rowNode.childNodes.item(indexColumn);  for (var indexCell = 0; indexCell < cellNode.childNodes.length; indexCell++) {  cellNode.childNodes.item(indexCell).style.display = display  }  }  } };   /* Table Attributes */   Layout.prototype.setProperty = function(attribute, value) {  switch (attribute) {  case 'className':  this.tableElement.className = this.className = (value || 'layout');  break;  case 'columns':  this.columns = value;  break;  case 'width':  case 'height':  case 'visible':  this.tableElement.style[attribute] = LinearDimension(value);  break;  default:  this.tableElement.style[attribute] = value  } };  Layout.prototype.getProperty = function(attribute) {  switch (attribute) {  case 'className':  return this.tableElement.className;  case 'columns':  return this.columns;  default:  return this.tableElement.style[attribute]  } };  Layout.prototype.setCellProperty = function(attribute, value) {  var rowNode = (this.row < this.tableRows.length) ? this.tableRows.item(this.row) : null;  if (rowNode) {  var cellNode = (this.column < rowNode.childNodes.length) ? rowNode.childNodes.item(this.column) : null;  if (cellNode) {  switch (attribute) {  case 'className':  cellNode.className = value;  break;  case 'align':  case 'vAlign':  case 'colSpan':  case 'rowSpan':  cellNode.setAttribute(attribute, value);  break;  default:  cellNode.style[attribute] = value  }  }  } };  Layout.prototype.getCellProperty = function(attribute) {  var rowNode = (this.row < this.tableRows.length) ? this.tableRows.item(this.row) : null;  if (rowNode) {  var cellNode = (this.column < rowNode.childNodes.length) ? rowNode.childNodes.item(this.column) : null;  if (cellNode) {  switch (attribute) {  case 'className':  return cellNode.className;  case 'align':  case 'vAlign':  case 'colSpan':  case 'rowSpan':  return cellNode.getAttribute(attribute);  default:  return cellNode.style[attribute]  }  }  } };   function Map(name, parameters) {  this.name = name;  this.id = 'Map_' + name;   this.parameters = [];  CopyHash(this.parameters, parameters || []);   this.enclosureDocument = this.parameters.enclosure || document;  var enclosureElement = this.parameters.insertion || this.enclosureDocument.body;   this.className = 'map';   for (var key in this.parameters) {  this.setProperty(key, this.parameters[key])  }   this.mapElement = this.enclosureDocument.createElement('DIV');  enclosureElement.appendChild(this.mapElement);  this.mapElement.setAttribute('id', this.name);  this.mapElement.style.width = LinearDimension(this.parameters.width || 400);  this.mapElement.style.height = LinearDimension(this.parameters.height || 400);  this.mapElement.style.border = 'inset';   this.map = new GMap(this.mapElement);  if ((this.parameters.height || 400) > 300) {  this.map.addControl(new GLargeMapControl());  } else {  this.map.addControl(new GSmallMapControl());  }  if (this.parameters.typeControl) {  this.map.addControl(new GMapTypeControl());  }  this.map.centerAndZoom(new GPoint(  this.parameters.longitude || -121.985580,  this.parameters.latitude || 37.374271),  this.parameters.zoom || 3);  this.map.setMapType(this.parameters.type || G_HYBRID_MAP);   this.baseIcon = new GIcon();  this.baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";  this.baseIcon.iconSize = new GSize(20, 34);  this.baseIcon.shadowSize = new GSize(37, 34);  this.baseIcon.iconAnchor = new GPoint(9, 34);  this.baseIcon.infoWindowAnchor = new GPoint(9, 2);  this.baseIcon.infoShadowAnchor = new GPoint(18, 25);  };  /* Construction */    Map.prototype.setProperty = function(property, value) {  switch (property) {  case 'className':  this.className = value;  break;  case 'width':  case 'height':  if (!this.parameters.style) {  this.parameters.style = [];  }  this.parameters.style[property] = LinearDimension(value);  break;  default:  if (!this.parameters.style) {  this.parameters.style = [];  }  this.parameters.style[property] = value;  } };  Map.prototype.getProperty = function(property) {  switch (property) {  case 'className':  return this.className;  case 'width':  case 'height':  return this.mapElement.style[property];  default:  return this.mapElement.style[property];  } };  /* Animation */  Map.prototype.setCallback = function(event, method) {  GEvent.addListener(this.map, event, method); }; Map.prototype.goTo = function(latitude, longitude, zoom) {  this.map.centerAndZoom(new GPoint(longitude, latitude), zoom); }; Map.prototype.createMarker = function(point, index, message, common, base) {  var icon = new GIcon(this.baseIcon);  icon.image = "http://www.google.com/mapfiles/marker" +  (common ? '' : String.fromCharCode((base || 'A').charCodeAt(0) + index))  + ".png";  var marker = new GMarker(point, icon);  GEvent.addListener(marker, "click", function() {  marker.openInfoWindowHtml(message);  });  return marker; }; Map.prototype.deleteMarkers = function() {  if (this.markerOverlays) {  for (var index = 0; index < this.markerOverlays.length; index++) {  this.map.removeOverlay(this.markerOverlays[index]);  }  }  this.markerOverlays = []; }; Map.prototype.overlayMarkers = function(table, center, common, base, label, link, parameters) {  if (!this.markerOverlays) {  this.markerOverlays = [];  }  var minLatitude = 90;  var maxLatitude = -90;  var minLongitude = 180;  var maxLongitude = -180;  var maxMarkers = common ? 100 : 26;  var markerIndex = 0;  var recordIncrement = Math.max(Math.round(table.length / maxMarkers), 1);  for (var recordIndex = 0; recordIndex < table.length; recordIndex += recordIncrement) {  var record = table[recordIndex] || [];  var latitude = record[0] || 0;  var longitude = record[1] || 0;  var id = record[2] || '';  var time = record[3] || '';  if ((latitude != 0) && (longitude != 0)) {  latitude = Math.min(Math.max(latitude, -90), 90);  longitude = Math.min(Math.max(longitude, -180), 180);  var point = new GPoint(longitude, latitude);  var lat = String(latitude).replace(/^([^\.]+\.\d{6,6}).*$/, "$1");  var long = String(longitude).replace(/^([^\.]+\.\d{6,6}).*$/, "$1");  var message = (id ? (id + '<br>') : '') + (time ? (time + '<br>') : '') +  '[' + lat + 'N, ' + long + 'E]' +  (label ? ((link ? ('<br><a javascript:href="' + link + '(' + recordIndex + (parameters || '') + ')>') : '') + label + (link ? '</a>' : '')) : '');  var marker = this.createMarker(point, markerIndex, message, common, base);  this.map.addOverlay(marker);  this.markerOverlays[this.markerOverlays.length] = marker;  minLatitude = Math.min(minLatitude, latitude);  maxLatitude = Math.max(maxLatitude, latitude);  minLongitude = Math.min(minLongitude, longitude);  maxLongitude = Math.max(maxLongitude, longitude);  markerIndex += 1;  }  }  if (center && (this.markerOverlays.length > 0)) {  var center = new GPoint((maxLongitude + minLongitude)/2, (maxLatitude + minLatitude)/2);  var latitudeZoom = Math.round(Math.log(Math.abs(maxLatitude - minLatitude)/0.001688379)/Math.LN2);  var longitudeZoom = Math.round(Math.log(Math.abs(maxLongitude - minLongitude)/0.002639294)/Math.LN2);  var zoom = Math.min(Math.max(Math.max(latitudeZoom, longitudeZoom), 0), 16);  this.map.centerAndZoom(center, zoom);  } }; Map.prototype.parseXML = function(xmlDoc) { }; 