LiveWebsite.Modules = { };
LiveWebsite.Modules.MainClass = function() {
  this.Type = "module";
  this.ModName = "-noname-";
  this.build = function(aWidth) {};
  this.refresh = function(aWidth) {};
  this.init = function() {
    this.build();
    this.Container.ParentObject = this;
    DOM.addClass(this.Container, "Module");
  }
  this.getCoords = function() {
    this.Coords = DOM.getAbsolutePosition(this.Container);
    this.Coords.Width = parseInt(this.Container.parentNode.offsetWidth);
    this.Coords.Height = parseInt(this.Container.offsetHeight);
    return this.Coords;
  }
  this.showLoading = function(aSmall) {
    if (this.Website) {
      this.Website.showLoading();
    }
    if (aSmall) {
      this.Loading = DOM.createElement('div', null, 'MiniLoadingImage');
      this.Loading.style.left = Math.round(this.Container.parentNode.offsetWidth/2 - 8) + 'px';
      this.Loading.style.top = Math.round(this.Container.parentNode.offsetHeight/2 - 8) + 'px';
    } else {
      this.Loading = DOM.createElement('div', null, 'LoadingImage');
      this.Loading.style.left = Math.round(this.Container.parentNode.offsetWidth/2 - 46) + 'px';
      this.Loading.style.top = Math.round(this.Container.parentNode.offsetHeight/2 - 31) + 'px';
    }
    this.Container.appendChild(this.Loading);
  }
  this.hideLoading = function() {
    if (this.Website) {
      this.Website.hideLoading();
    }
    if (this.Loading && this.Loading.parentNode) {
      this.Loading.parentNode.removeChild(this.Loading);
      this.Loading = null;
    }
  }
}
LiveWebsite.Modules.HTMLText = new Object();
LiveWebsite.Modules.HTMLText.Module = function(aWebsite, aParams) {
  if (!aParams)
    return;
  this.Container = DOM.createElement('div', null, 'HTMLText');
  this._receiveText = function(aData, aModule) {
    aModule.hideLoading();
    aModule.Container.innerHTML = aData;
  }
  this.init = function() {
    this.showLoading(true);
    Ajax.makeRequest({
      URL: URI.pageURL(aParams, 'GetFieldDataJSON', '&aTab=Details&aFieldId=Text'),
      Function: this._receiveText,
      Method: 'GET',
      Params: this
    });
  }
}
LiveWebsite.Modules.HTMLText.Module.prototype = new LiveWebsite.Modules.MainClass;
LiveWebsite.Modules.RandomInCollection = new Object();
LiveWebsite.Modules.RandomInCollection.Module = function(aWebsite, aParams) {
  this.Container = DOM.createElement('div');
  this.Website = aWebsite;
  this.registerCollection = function() {
    if (typeof this.Website.AdCollections != 'object') {
      this.Website.AdCollections = new Array();
    }
    if (this.Data && aParams) {
      this.Website.AdCollections.push({ Collection: aParams, Data: this.Data });
    }
  }
  this.getCollection = function(aItemPath) {
    if (this.Website.AdCollections) {
      for (var i = 0; i < this.Website.AdCollections.length; i++) {
        if (this.Website.AdCollections[i].Collection == aItemPath && this.Website.AdCollections[i].Data.length > 0) {
          return this.Website.AdCollections[i].Data;
        }
      }
    }
    return null;
  }
  this.buildCore = function() {
    var zIndex = Math.round(Math.random() * (this.Data.length - 1));
    this.Image = DOM.createImage(this.Data[zIndex].ImageURL);
    if (this.Data[zIndex].OnClickURL) {
      this.Image.style.cursor = 'pointer';
      DOM.addEvent(this.Image, 'onclick', this._gotoHash, this.Data[zIndex].OnClickURL);
    }
    this.Data.splice(zIndex, 1);
    this.Container.appendChild(this.Image);
  }
  this._gotoHash = function(e, aHash) {
    if (aHash.indexOf('#') == 0)
      URI.goToHash(aHash);
    else
      window.location = aHash;
  }
  this.receiveImages = function(aData) {
    var zAdColl = this.getCollection(aParams);
    if (zAdColl) {
      this.Data = zAdColl;
      this.buildCore();
    }
    else if (aData.length > 0) {
      this.Data = aData;
      this.registerCollection();
      this.buildCore();
    }
  }
  this._receiveImages = function(aData, aModule) { aModule.receiveImages(aData); }
  Ajax.makeRequest({
    URL: URI.pageURL(aParams, 'GetFullAssets'),
    Function: this._receiveImages,
    Params: this,
    Method: 'GET'
  });
}
LiveWebsite.Modules.RandomInCollection.Module.prototype = new LiveWebsite.Modules.MainClass;
LiveWebsite.Modules.DirtyStyler = new Object();
LiveWebsite.Modules.DirtyStyler.Module = function(aWebsite, aParams) {
  this.Container = DOM.createElement('div', null, 'DirtyStyler');
  if (aParams) {
    this.Container.setAttribute('style', aParams);
    this.Container.style.cssText = aParams;
    this.Container.style.height = '100%';
    this.Container.style.width = '100%';
  }
}
LiveWebsite.Modules.DirtyStyler.Module.prototype = new LiveWebsite.Modules.MainClass;
LiveWebsite.Modules.NamedContainer = new Object();
LiveWebsite.Modules.NamedContainer.Module = function(aWebsite, aParams) {
  this.ModName = 'NamedContainer_' + aParams;
  this.Container = DOM.createElement('div', null, 'NamedContainer_' + aParams);
}
LiveWebsite.Modules.NamedContainer.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.Browse = new Object();
  LiveWebsite.Modules.Browse.Module = function(){
    this.Container = DOM.createElement('div');
    this.Container.className = 'BrowseAssetsContainer';
    this.BreadCrumb = new Array();
    this.Level = 0;
    this.init = function() {
      var zURL = '/voig/SystemReferenceList/AssetHierarchyList.GetSubItems?aLanguage=en-us';
      LiveRequest_MakeRequest(zURL, this._build,this);
    }
    this._build = function(aArray,aParent) {
      aParent.build(aArray);
    }
    this.build = function(aArray) {
      this.Container.Breadcrumbs = DOM.createElement('div',null,'Breadcrumbs');
      this.Container.Breadcrumbs.innerHTML = 'Please select platform.';
      this.Container.appendChild(this.Container.Breadcrumbs);
      this.Container.Platforms = DOM.createElement('div',null,'Platforms');
      this.Container.appendChild(this.Container.Platforms);
      this.Container.Results = DOM.createElement('div',null,'Results');
      this.Container.appendChild(this.Container.Results);
      this.createSubItems(this.Container.Platforms,aArray,'Platform',this._getSubItems,this.Level);
      this.getSubItems(aArray[0].URL, 1);
      this.buildBreadCrumb(aArray[0].Name,0,aArray[0].URL,aArray[0].Path);
    }
    this.buildBreadCrumb = function(aName,aLevel,aURL,aPath) {
      this.Container.Breadcrumbs.innerHTML = '';
      this.BreadCrumb[aLevel] = {
        Name: aName,
        URL: aURL,
        Path: aPath
      };
      for (var i=0;i <= aLevel; i++) {
        var zName = this.BreadCrumb[i].Name;
        if (this.BreadCrumb[i].Name.length >= 20) {
          zName = zName.substring(0,20) + '...';
        }
        var zBreadCrumb = DOM.createElement('div',null,'BreadCrumb');
            zBreadCrumb.innerHTML = zName;
            zBreadCrumb.Level = i;
            zBreadCrumb.Path = this.BreadCrumb[i].Path;
            this.Container.Breadcrumbs.appendChild(zBreadCrumb);
        if (i < aLevel ) {
          var zPipe = DOM.createElement('div',null,'Pipe');
              zPipe.innerHTML = ' | ';
              this.Container.Breadcrumbs.appendChild(zPipe);
        }
        DOM.addEvent(zBreadCrumb,'onclick',this._getSubItems,{Parent: this, URL: this.BreadCrumb[i].URL, Path: this.BreadCrumb[i].Path});
      }
    }
    this._getSubItems = function(e,aObj) {
      aObj.Parent.buildBreadCrumb(this.innerHTML,this.Level,aObj.URL,aObj.Path);
      if (this.Level > 0) {
        if (aObj.Parent.CurrentItem) {
          aObj.Parent.CurrentItem.className = 'SubItem';
        }
        aObj.Parent.CurrentItem = this;
        this.className = this.className + ' SelectedSubItem';
      } else {
        if (this.className != 'BreadCrumb') {
          if (aObj.Parent.CurrentPlatform) {
            aObj.Parent.CurrentPlatform.className = 'Platform';
          }
          aObj.Parent.CurrentPlatform = this;
          this.className = this.className + ' SelectedPlatform';
        }
      }
      for (var i=0; i < aObj.Parent.Deliver.length; i++) {
        if (aObj.Parent.Deliver[i].loading) {
          aObj.Parent.Deliver[i].loading();
        }
      }
      aObj.Parent.feed(aObj);
      if (this.Level < 2) {
        var aLevel = this.Level + 1;
        aObj.Parent.getSubItems(aObj.URL,aLevel);
      }
    }
    this.feed = function(aObj) {
      for (var i=0; i < aObj.Parent.Deliver.length; i++) {
        aObj.Parent.Deliver[i].receive(aObj.Path,aObj.Parent.Deliver[i]);
      }
    }
    this.getSubItems = function(aURL,aLevel) {
      LiveRequest_MakeRequest(aURL, this._createSubItems, {Parent: this, Level: aLevel});
    }
    this._createSubItems = function(aArray,aObj) {
      if (aArray.length > 0)
        aObj.Parent.createSubItems(aObj.Parent.Container.Results,aArray,'SubItem',aObj.Parent._getSubItems,aObj.Level);
    }
    this.createSubItems = function(aContainer,aArray,aClass,aEventFunction,aLevel) {
      while (aContainer.childNodes[0]) {
        aContainer.childNodes[0].parentNode.removeChild(aContainer.childNodes[0]);
      }
      var zScroller = new LiveGroup.Utils.ScrollingDiv(this.Container.Results);
      for (var i=0; i < aArray.length; i++) {
        var zSubItem = DOM.createElement('a',null,aClass);
            zSubItem.href = '#';
            zSubItem.innerHTML = unescape(aArray[i].Name);
            zSubItem.Level = aLevel;
            if (aLevel > 0) {
              zScroller.content.appendChild(zSubItem);
            } else {
              aContainer.appendChild(zSubItem);
            }
            DOM.addEvent(zSubItem,'onclick',aEventFunction,{Parent: this, URL: aArray[i].URL, Path: aArray[i].Path});
            aArray[i].Element = zSubItem;
      }
      zScroller.containerMaxY = zScroller.content.clientHeight - zScroller.container.clientHeight;
    }
  }
  LiveWebsite.Modules.Browse.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.Search = new Object();
  LiveWebsite.Modules.Search.Module = function(){
    this.Container = DOM.createElement('div');
    this.BaseTagArray = new Array();
    this.BreadCrumbArray = new Array();
    this.Level = 0;
    this.doSearch = function(txt) {
      this.sendTags(txt);
    }
    this.getTag = function(txt) {
      this.sendTags(txt);
    }
    this._sendTags = function(e,aParent) {
      var zStop;
      for (var i = aParent.BreadCrumbArray.length - 1; i > 0; i--) {
        if (aParent.BreadCrumbArray[i].Text != this.Text && zStop != 'Y') {
          aParent.BreadCrumbArray[i].parentNode.removeChild(aParent.BreadCrumbArray[i]);
          aParent.BreadCrumbArray.splice(i,1);
          aParent.handleOverflow();
        } else {
          zStop = 'Y';
        }
      }
      aParent.sendTags(this.Text);
    }
    this.sendTags = function(txt) {
      var zURL;
      this.Level = this.Level + 1;
      if (this.Level > 1) {
        zURL = '/voig/SystemReferenceList/TagListv2.GetTagsJSON?aText=' + txt + '&aType=' + this.Type;
      } else {
        zURL = '/voig/SystemReferenceList/TagListv2.GetInitialTagsJSON?aText=' + unescape(txt) + '&aType=' + this.Type;
      }
      LiveRequest_MakeRequest(zURL,this._receiveTags,txt);
    }
    this.feed = function(aArrayObj) {
      for (var i=0; i < this.Deliver.length; i++) {
        this.Deliver[i].push(aArrayObj,this.Deliver[i]);
      }
    }
    this._receiveTags = function(aArray,aText) {
      LiveGroup.CurrentTag.receiveTags(aArray,aText);
    }
    this.handleOverflow = function() {
      var fMaxSize = 45;
      var zCharCount = 0;
      var zCumulative = 0;
      for (var i = 0; i < this.BreadCrumbArray.length; i++) {
        zCharCount += this.BreadCrumbArray[i].innerHTML.length;
      }
      if (zCharCount > fMaxSize)
        this.BreadCrumbContainer.childNodes[0].style.display = 'inline';
      else
        this.BreadCrumbContainer.childNodes[0].style.display = 'none';
      for (var i = this.BreadCrumbArray.length - 1; i >= 0; i--) {
        zCumulative += this.BreadCrumbArray[i].innerHTML.length;
        if (zCharCount > fMaxSize && zCumulative > fMaxSize) {
          this.BreadCrumbArray[i].style.display = 'none';
        } else {
          this.BreadCrumbArray[i].style.display = 'inline';
        }
      }
    }
    this.receiveTags = function(aArray,aText) {
      this.feed(aArray);
      this.Count.update(aArray.DisplayCount);
      if (this.BreadCrumbArray.length >= 1) {
        var zArrow = ' > ';
      } else {
        var zArrow = '';
      }
      var zLastCrumb;
      if (this.BreadCrumbArray[this.BreadCrumbArray.length - 1]) {
        var zLastCrumb = this.BreadCrumbArray[this.BreadCrumbArray.length - 1].Text;
      }
      if (zLastCrumb != aText) {
        var zBreadCrumb = DOM.createElement('a',null,'BreadCrumb');
            zBreadCrumb.innerHTML = zArrow + aText;
            zBreadCrumb.Text = aText;
            this.BreadCrumbContainer.appendChild(zBreadCrumb);
        this.BreadCrumbArray.push(zBreadCrumb);
        DOM.addEvent(zBreadCrumb,'onclick',this._sendTags,this);
        this.handleOverflow();
      }
      this.BaseTagArray.push(aArray.BaseTag);
      var zTagArrayString = '';
      for (i=0;i < this.BaseTagArray.length;i++) {
        zTagArrayString = zTagArrayString + this.BaseTagArray[i].ItemPath;
        var zIteration = i + 1;
        if (zIteration != this.BaseTagArray.length) {
          zTagArrayString = zTagArrayString + ',';
        }
      }
      this.AssetLink.href = 'http://mmovie.voig.com' + this.AllAction + '&aTags=' + zTagArrayString ;
      this.Embed.loadTags(aArray.TagList,aText);
    }
  	this.getMovie = function(movieName) {
      if (navigator.appName.indexOf("Microsoft") != -1) {
  		  return window[movieName];
  		} else {
  		  return document[movieName];
  	  }
  	}
  	this.clear = function() {
      LiveGroup.CurrentTag.Level = 0;
      LiveGroup.CurrentTag.BaseTagArray = new Array();
      LiveGroup.CurrentTag.BreadCrumbArray = new Array();
      LiveGroup.CurrentTag.BreadCrumbContainer.childNodes[0].style.display = 'none';
      while (LiveGroup.CurrentTag.BreadCrumbContainer.childNodes[1]) {
        LiveGroup.CurrentTag.BreadCrumbContainer.removeChild(LiveGroup.CurrentTag.BreadCrumbContainer.childNodes[1]);
      }
      LiveGroup.CurrentTag.Embed.backToSearch();
    }
    this.init = function() {
      LiveGroup.CurrentTag = this;
      window.tagsearch_ready = function() {
        LiveGroup.CurrentTag.Embed = LiveGroup.CurrentTag.getMovie("tagbrowse");
        LiveGroup.CurrentTag.Embed.setFindCallback("LiveGroup.CurrentTag.doSearch");
        LiveGroup.CurrentTag.Embed.setGetCallback("LiveGroup.CurrentTag.getTag");
      }
      var so = new SWFObject('/l.c.bin/F/11757726/tagbrowse.swf','tagbrowse','288','270','9');
          so.addParam("allowScriptAccess","always");
          so.addParam("movie","/l.c.bin/F/11757726/tagbrowse.swf");
          so.addParam("quality","high");
          so.addParam("swLiveConnect","true");
          so.addParam("pluginspage","http://www.macromedia.com/go/getflashplayer");
          so.addParam("align", "Middle");
          so.addParam("wmode", "Transparent");
          so.addVariable("searchword",this.Type);
          so.write(this.Container);
      this.Control = DOM.createElement('div',null,'Control');
      this.Container.appendChild(this.Control);
      this.Clear = DOM.createElement('div',null,'ClearButton');
      this.Clear.innerHTML = 'Clear';
      this.Control.appendChild(this.Clear);
      DOM.addEvent(this.Clear,'onclick',this.clear);
      this.BreadCrumbContainer = DOM.createElement('div',null,'BreadCrumbContainer');
      this.Control.appendChild(this.BreadCrumbContainer);
      var zCrumbOverflowDots = DOM.createElement('div', null, 'BreadCrumb');
      zCrumbOverflowDots.innerHTML = '...';
      zCrumbOverflowDots.style.display = 'none';
      this.BreadCrumbContainer.appendChild(zCrumbOverflowDots);
    }
  }
  LiveWebsite.Modules.Search.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.VideoResults = new Object();
  LiveWebsite.Modules.VideoResults.Module = function(aSetup) {
    this.Container = DOM.createElement('div');
    this.Setup = aSetup;
    this.Path = aSetup.ItemPath;
    this.URL = this.Setup.ItemPath + this.Setup.Action;
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.ResultsTitle = DOM.createElement('div',null,'ResultsTitle');
      this.Container.appendChild(this.ResultsTitle);
      var zResultsText = DOM.createElement('span',null,'ResultsTitleText');
      zResultsText.innerHTML = this.Setup.Title;
      this.ResultsTitle.appendChild(zResultsText);
      this.TopAsset = DOM.createElement('div',null,'MainImage');
      this.Container.appendChild(this.TopAsset);
      this.SubItems = new Array();
      this.SubItems[0] = DOM.createElement('div');
      this.TopAsset.appendChild(this.SubItems[0]);
      this.SubItems[0].SWF = new SWFObject('http://ooyala.com/player.swf','swfooyalaPlayer','480','270','9')
      this.SubItems[0].SWF.addParam("allowScriptAccess","always");
      this.SubItems[0].SWF.addParam("quality","high");
      this.SubItems[0].SWF.addParam("swLiveConnect","true");
      this.SubItems[0].SWF.addParam("allowfullscreen","true");
      this.SubItems[0].SWF.addParam("type","application/x-shockwave-flash");
      this.SubItems[0].SWF.addParam("wmode","opaque");
      this.SubItems[0].SWF.addParam("pluginspage","http://www.adobe.com/go/getflashplayer");
      this.SubItems[0].SWF.addParam("align", "Middle");
      this.SubItems[0].SWF.addParam("wmode", "Transparent");
      this.SubItems[0].SWF.addVariable("me", "ooyalaPlayer8749896151200492023747");
      this.SubItems[0].SWF.addVariable("autoplay",1);
      this.SubItems[0].SWF.addVariable("text","vnBUNZ27eENh6tcSwb8CwcgghB97fUQlJbXvoDJiCKH4RXqjHqEvDyoiqLjiylIXDdNuGJsDDjD7mKfpj814Zrny08pmGRxExp1HZ56OkxaHiwHOwuOlpLQASBxm_QOpdY3nRIrLCEx2WL3dNFoYf0fIgEh0o9tuORKWBF4aFVzpUBnPgFGaPp194YResrZVD2Tt0idHPfkEGexusZtOYk10ifqXiseN3-2IVRFHyyDlWWNY8htrwhYbcf7bvIM0GFhIEnqR2WGTQpmiwuYD647Zocaefas1mKosGCYT8mVNteDWSzU8OQS8VyGta8FDkyMyFC2j4bf0kdLge7LbiDI5LRJ1LTRQ_LwXl8OfPCqVJg9hzpLMRMD1X7ocMHeRLobvRqjENx4VL61hDCcVZUD5Y72jQFE2bb4D54FxXtOxrMwX9TMkgk8iLOjWDsjhT_46oBTerN8kRthJQx0VaQ**");
      this.SubItems[0].SWF.write(this.SubItems[0]);
      var zAssetTitleBar = DOM.createElement('div',null,'AssetTitle');
      this.TopAsset.appendChild(zAssetTitleBar);
      var zAssetDetails = DOM.createElement('div',null,'AssetDetails');
      zAssetTitleBar.appendChild(zAssetDetails);
      this.SubItems[0].AssetLink = DOM.createElement('a',null,'AssetLink');
      zAssetDetails.appendChild(this.SubItems[0].AssetLink);
      this.SubItems[0].Byline = DOM.createElement('span',null,'Byline');
      this.SubItems[0].Byline.innerHTML = '<span class="Label">By: </span>';
      zAssetDetails.appendChild(this.SubItems[0].Byline);
      this.SubItems[0].CreatorLink = DOM.createElement('a',null,'CreatorLink');
      this.SubItems[0].Byline.appendChild(this.SubItems[0].CreatorLink);
      this.SubItems[0].Date = DOM.createElement('span',null,'Date');
      this.SubItems[0].Byline.appendChild(this.SubItems[0].Date);
      this.SubAssetsContainer = DOM.createElement('div',null,'SubAssetsContainer');
      this.Container.appendChild(this.SubAssetsContainer);
      for (var i=1;i <= 5;i++) {
        this.SubItems[i] = DOM.createElement('div');
        this.SubItems[i].Thumbnail = new Image(63,41);
        this.SubItems[i].Thumbnail.className = 'ResultThumb';
        this.SubItems[i].Thumbnail.LoaderContainer = DOM.createElement('div',null,'Opacity');
        this.SubAssetsContainer.appendChild(this.SubItems[i]);
        this.SubItems[i].appendChild(this.SubItems[i].Thumbnail);
        this.SubItems[i].getPage = function(e,aParent) {
          window.location = this.URL;
        }
        this.SubItems[i].Thumbnail.loaded = function(e) {
          if (this.LoaderContainer.parentNode) {
            this.LoaderContainer.parentNode.removeChild(this.LoaderContainer);
          }
        }
        DOM.addEvent(this.SubItems[i],'ondblclick',this.SubItems[i].getPage,this);
        DOM.addEvent(this.SubItems[i],'onclick',this._writeVideo,this);
        DOM.addEvent(this.SubItems[i].Thumbnail,'onload',this.SubItems[i].Thumbnail.loaded);
      }
      this.AllAssetsButton = DOM.createElement('a',null,'AllAssetsLink');
      this.AllAssetsButton.href = 'http://mmovie.voig.com' + this.Path + this.Setup.AllAction;
      this.SubAssetsContainer.appendChild(this.AllAssetsButton);
      this.loading();
      this.get();
    }
    this.get = function() {
      if (this.GetAssetsRequest  && this.GetAssetsRequest.HttpRequest.readyState != 4) {
        this.GetAssetsRequest.HttpRequest.abort();
      }
      this.GetAssetsRequest = LiveRequest_MakeRequest(this.URL, this._update, this);
    }
    this._update = function(aReturnObj,aParent) {
      if (aReturnObj) {
        aParent.Count.update(aReturnObj.DisplayCount)
        aParent.update(aReturnObj.AssetList);
      }
    }
    this.update = function(aArray) {
      if (aArray[0]) {
        this.writeVideo(aArray[0]);
      }
      for (var i=1;i < this.SubItems.length;i++) {
        if (aArray[i - 1]) {
          this.SubItems[i].EmbedCode = aArray[i - 1].EmbedCode;
          this.SubItems[i].ItemPath = aArray[i - 1].ItemPath;
          this.SubItems[i].Date = unescape(aArray[i - 1].Date);
          this.SubItems[i].Name = unescape(aArray[i - 1].Name);
          this.SubItems[i].Creator = aArray[i - 1].Creator;
          this.SubItems[i].URL = unescape(aArray[i - 1].URL);
          this.SubItems[i].Thumbnail.src = unescape(aArray[i - 1].ImageURL);;
          this.SubItems[i].Thumbnail.title = unescape(aArray[i - 1].Name);
          this.SubAssetsContainer.appendChild(this.SubItems[i]);
        } else {
          if (this.SubItems[i].parentNode)
            this.SubItems[i].parentNode.removeChild(this.SubItems[i]);
        }
      }
    }
    this._writeVideo = function(e,aParent) {
      aParent.writeVideo(this);
    }
    this.writeVideo = function(aObj) {
      this.SubItems[0].SWF.addVariable("embedCode",aObj.EmbedCode);
      this.SubItems[0].SWF.ItemPath = aObj.ItemPath;
      this.SubItems[0].SWF.write(this.SubItems[0]);
      var zTagURL = this.SubItems[0].SWF.ItemPath.replace(/\\/g, '/');
      var zSetup = {
        Container: this.ResultsTitle,
        ID: 'MainAssetTag',
        URL: zTagURL,
        Label: 'Add tag to this video'
      }
      if (this.TagButton && this.TagButton.TagContainer) {
        this.TagButton.Container.parentNode.removeChild(this.TagButton.Container);
        this.TagButton.TagContainer.parentNode.removeChild(this.TagButton.TagContainer);
      }
      this.TagButton = new LiveGroup.tag(zSetup);
      var zName = unescape(aObj.Name);
      if (zName.length >= 30) {
        zName = zName.substring(0,30) + '...';
      }
      this.SubItems[0].AssetLink.href = unescape(aObj.URL);
      this.SubItems[0].AssetLink.innerHTML = zName;
      this.SubItems[0].CreatorLink.innerHTML =  unescape(aObj.Creator.Name);
      this.SubItems[0].CreatorLink.href = unescape(aObj.Creator.URL);
      this.SubItems[0].Date.innerHTML = ' ' + unescape(aObj.Date);
    }
    this.displayAssets = function(e,aParent) {
      window.location = aParent.Path + '.DisplayAllAssets?aType=Video';
    }
    this.loading = function() {
      for (var i=1;i < this.SubItems.length;i++) {
        this.SubItems[i].appendChild(this.SubItems[i].Thumbnail.LoaderContainer);
      }
    }
    this.push = function(aJSON,aParent) {
      aParent.update(aJSON.TotalAssetList);
    }
    this.receive = function(aPath,aParent) {
      aParent.URL = aPath + this.Setup.Action;
      aParent.Path = aPath;
      aParent.get();
    }
  }
  LiveWebsite.Modules.VideoResults.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.FeaturedVideo = new Object();
  LiveWebsite.Modules.FeaturedVideo.Module = function(aSetup) {
    this.Container = DOM.createElement('div',null,'FeaturedAssetContainer');
    this.URL = aSetup.URL + aSetup.Action;
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.TopBar = DOM.createElement('div',null,'TopBar');
      this.Container.appendChild(this.TopBar);
      this.TopBar.Label = DOM.createElement('h3',null,'TopBarLabel');
      this.TopBar.Label.innerHTML = 'Now Playing';
      this.TopBar.appendChild(this.TopBar.Label);
      this.AssetContainer = DOM.createElement('div','AssetContainer','AssetContainer');
      this.Container.appendChild(this.AssetContainer);
      this.Asset = new SWFObject('http://ooyala.com/player.swf','FlashAssetContainer','549','307','9');
      this.Asset.addParam("allowScriptAccess","always");
      this.Asset.addParam("quality","high");
      this.Asset.addParam("swLiveConnect","true");
      this.Asset.addParam("allowfullscreen","true");
      this.Asset.addParam("type","application/x-shockwave-flash");
      this.Asset.addParam("wmode","opaque");
      this.Asset.addParam("pluginspage","http://www.adobe.com/go/getflashplayer");
      this.Asset.addParam("align", "Middle");
      this.Asset.addParam("wmode", "Transparent");
      this.Asset.addVariable("me", "ooyalaPlayer8749896151200492023747");
      this.Asset.addVariable("autoplay",1);
      this.Asset.addVariable("text","vnBUNZ27eENh6tcSwb8CwcgghB97fUQlJbXvoDJiCKH4RXqjHqEvDyoiqLjiylIXDdNuGJsDDjD7mKfpj814Zrny08pmGRxExp1HZ56OkxaHiwHOwuOlpLQASBxm_QOpdY3nRIrLCEx2WL3dNFoYf0fIgEh0o9tuORKWBF4aFVzpUBnPgFGaPp194YResrZVD2Tt0idHPfkEGexusZtOYk10ifqXiseN3-2IVRFHyyDlWWNY8htrwhYbcf7bvIM0GFhIEnqR2WGTQpmiwuYD647Zocaefas1mKosGCYT8mVNteDWSzU8OQS8VyGta8FDkyMyFC2j4bf0kdLge7LbiDI5LRJ1LTRQ_LwXl8OfPCqVJg9hzpLMRMD1X7ocMHeRLobvRqjENx4VL61hDCcVZUD5Y72jQFE2bb4D54FxXtOxrMwX9TMkgk8iLOjWDsjhT_46oBTerN8kRthJQx0VaQ**");
      this.AssetInfo = DOM.createElement('div','AssetInfo','AssetInfo');
      this.Container.appendChild(this.AssetInfo);
      this.AssetDetails = DOM.createElement('div','AssetDetails','AssetDetails');
      this.AssetInfo.appendChild(this.AssetDetails);
      this.Title = DOM.createElement('div',null,'Title');
      this.AssetDetails.appendChild(this.Title);
      this.Date = DOM.createElement('div',null,'Date');
      this.AssetDetails.appendChild(this.Date);
      this.Description = DOM.createElement('div',null,'Description');
      this.AssetDetails.appendChild(this.Description);
      this.Views = DOM.createElement('div',null,'Views');
      this.AssetInfo.appendChild(this.Views);
      this.get();
    }
    this.get = function() {
      LiveRequest_MakeRequest(this.URL, this._update, this);
    }
    this._update = function(aItem,aParent) {
      aParent.update(aItem);
    }
    this.update = function(aItem) {
      var zTagURL = aItem.ItemPath.replace(/\\/g, '/');
      var zSetup = {
        Container: this.TopBar,
        ID: 'FeaturedAssetTag',
        URL: zTagURL,
        Label: 'Add tag to this video'
      }
      this.TagButton = new LiveGroup.tag(zSetup);
      this.Asset.addVariable("embedCode",aItem.EmbedCode);
      this.Asset.write(this.AssetContainer);
      this.Title.innerHTML = unescape(aItem.Name);
      this.Date.innerHTML = 'Posted: ' + unescape(aItem.Date);
      this.Description.innerHTML = unescape(aItem.Description);
      this.Views.innerHTML = aItem.Statistics.Views.Total + ' views';
    }
  }
  LiveWebsite.Modules.FeaturedVideo.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.ScreenshotResults = new Object();
  LiveWebsite.Modules.ScreenshotResults.Module = function(aSetup) {
    this.Container = DOM.createElement('div');
    this.Setup = aSetup;
    this.Path = aSetup.ItemPath;
    this.URL = this.Setup.ItemPath + this.Setup.Action;
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.ResultsTitle = DOM.createElement('div',null,'ResultsTitle');
      this.Container.appendChild(this.ResultsTitle);
      var zResultsText = DOM.createElement('span',null,'ResultsTitleText');
      zResultsText.innerHTML = this.Setup.Title;
      this.ResultsTitle.appendChild(zResultsText);
      this.TopAsset = DOM.createElement('div',null,'MainImage');
      this.Container.appendChild(this.TopAsset);
      this.SubItems = new Array();
      this.SubItems[0] = DOM.createElement('div',null,'ImageContainer');
      this.TopAsset.appendChild(this.SubItems[0]);
      this.SubItems[0].Image = new Image();
      this.SubItems[0].appendChild(this.SubItems[0].Image);
      var zAssetTitleBar = DOM.createElement('div',null,'AssetTitle');
      this.TopAsset.appendChild(zAssetTitleBar);
      var zAssetDetails = DOM.createElement('div',null,'AssetDetails');
      zAssetTitleBar.appendChild(zAssetDetails);
      this.SubItems[0].AssetLink = DOM.createElement('a',null,'AssetLink');
      zAssetDetails.appendChild(this.SubItems[0].AssetLink);
      this.SubItems[0].Byline = DOM.createElement('span',null,'Byline');
      this.SubItems[0].Byline.innerHTML = '<span class="Label">By: </span>';
      zAssetDetails.appendChild(this.SubItems[0].Byline);
      this.SubItems[0].CreatorLink = DOM.createElement('a',null,'CreatorLink');
      this.SubItems[0].Byline.appendChild(this.SubItems[0].CreatorLink);
      this.SubItems[0].Date = DOM.createElement('span',null,'Date');
      this.SubItems[0].Byline.appendChild(this.SubItems[0].Date);
      this.SubAssetsContainer = DOM.createElement('div',null,'SubAssetsContainer');
      this.Container.appendChild(this.SubAssetsContainer);
      for (var i=1;i <= 5;i++) {
        this.SubItems[i] = DOM.createElement('div');
        this.SubItems[i].Thumbnail = new Image(63,41);
        this.SubItems[i].Thumbnail.className = 'ResultThumb';
        this.SubItems[i].Thumbnail.LoaderContainer = DOM.createElement('div',null,'Opacity');
        this.SubAssetsContainer.appendChild(this.SubItems[i]);
        this.SubItems[i].appendChild(this.SubItems[i].Thumbnail);
        this.SubItems[i].getPage = function(e,aParent) {
          window.location = this.URL;
        }
        this.SubItems[i].Thumbnail.loaded = function(e) {
          if (this.LoaderContainer.parentNode) {
            this.LoaderContainer.parentNode.removeChild(this.LoaderContainer);
          }
        }
        DOM.addEvent(this.SubItems[i],'ondblclick',this.SubItems[i].getPage,this);
        DOM.addEvent(this.SubItems[i],'onclick',this._writeScreen,this);
        DOM.addEvent(this.SubItems[i].Thumbnail,'onload',this.SubItems[i].Thumbnail.loaded);
      }
      this.AllAssetsButton = DOM.createElement('a',null,'AllAssetsLink');
      this.AllAssetsButton.href = 'http://mmovie.voig.com' + this.Path + this.Setup.AllAction;
      this.SubAssetsContainer.appendChild(this.AllAssetsButton);
      this.get();
    }
    this.displayAssets = function(e,aParent) {
      window.location = aParent.Path + '.DisplayAllAssets?aType=Screenshot';
    }
    this.loading = function() {
      for (var i=1;i < this.SubItems.length;i++) {
        this.SubItems[i].appendChild(this.SubItems[i].Thumbnail.LoaderContainer);
      }
    }
    this.push = function(aJSON,aParent) {
      aParent.update(aJSON.TotalAssetList);
    }
    this.receive = function(aPath,aParent) {
      aParent.URL = aPath + this.Setup.Action;
      aParent.Path = aPath;
      aParent.CallbackFunction = aParent._update;
      aParent.get();
    }
    this.get = function() {
      LiveRequest_MakeRequest(this.URL, this._update, this);
    }
    this._update = function(aReturnObj,aParent) {
      aParent.Count.update(aReturnObj.DisplayCount)
      aParent.update(aReturnObj.AssetList);
    }
    this.update = function(aArray) {
      if (aArray[0]) {
        this.writeScreen(aArray[0]);
      }
      for (var i=1;i < this.SubItems.length;i++) {
        if (aArray[i - 1]) {
          this.SubItems[i].ItemPath = aArray[i - 1].ItemPath;
          this.SubItems[i].Date = unescape(aArray[i - 1].Date);
          this.SubItems[i].Name = unescape(aArray[i - 1].Name);
          this.SubItems[i].Creator = aArray[i - 1].Creator;
          this.SubItems[i].URL = unescape(aArray[i - 1].URL);
          this.SubItems[i].FullImageURL = unescape(aArray[i - 1].FullImageURL);
          this.SubItems[i].Thumbnail.src = unescape(aArray[i - 1].ImageURL);;
          this.SubItems[i].Thumbnail.title = unescape(aArray[i - 1].Name);
          this.SubAssetsContainer.appendChild(this.SubItems[i]);
        } else {
          if (this.SubItems[i].parentNode)
            this.SubItems[i].parentNode.removeChild(this.SubItems[i]);
        }
      }
    }
    this._writeScreen = function(e,aParent) {
      aParent.writeScreen(this);
    }
    this.writeScreen = function(aObj) {
      this.SubItems[0].Image.src = unescape(aObj.FullImageURL);
      this.SubItems[0].Image.ItemPath = aObj.ItemPath;
      var zTagURL = this.SubItems[0].Image.ItemPath.replace(/\\/g, '/');
      var zSetup = {
        Container: this.ResultsTitle,
        ID: 'MainAssetTag',
        URL: zTagURL,
        Label: 'Add tag to this screen',
        Top: -3,
        Left: -282
      }
      if (this.TagButton && this.TagButton.TagContainer) {
        this.TagButton.Container.parentNode.removeChild(this.TagButton.Container);
        this.TagButton.TagContainer.parentNode.removeChild(this.TagButton.TagContainer);
      }
      this.TagButton = new LiveGroup.tag(zSetup);
      var zName = unescape(aObj.Name);
      if (zName.length >= 30) {
        zName = zName.substring(0,30) + '...';
      }
      this.SubItems[0].AssetLink.href = unescape(aObj.URL);
      this.SubItems[0].AssetLink.innerHTML = zName;
      this.SubItems[0].CreatorLink.innerHTML =  unescape(aObj.Creator.Name);
      this.SubItems[0].CreatorLink.href = unescape(aObj.Creator.URL);
      this.SubItems[0].Date.innerHTML = ' ' + unescape(aObj.Date);
    }
  }
  LiveWebsite.Modules.ScreenshotResults.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.FeaturedScreenshot = new Object();
  LiveWebsite.Modules.FeaturedScreenshot.Module = function(aSetup) {
    this.Container = DOM.createElement('div',null,'FeaturedAssetContainer');
    this.URL = aSetup.URL + aSetup.Action;
    this.Title = aSetup.Title;
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.TopBar = DOM.createElement('div',null,'TopBar');
      this.Container.appendChild(this.TopBar);
      this.TopBar.Label = DOM.createElement('h3',null,'TopBarLabel');
      if (this.Title){
        this.TopBar.Label.innerHTML = this.Title;
      } else {
        this.TopBar.Label.innerHTML = 'Now Playing';
      }
      this.TopBar.appendChild(this.TopBar.Label);
      this.AssetContainer = DOM.createElement('a','AssetContainer','AssetContainer');
      this.Container.appendChild(this.AssetContainer);
      this.AssetInfo = DOM.createElement('div','AssetInfo','AssetInfo');
      this.Container.appendChild(this.AssetInfo);
      this.AssetDetails = DOM.createElement('div','AssetDetails','AssetDetails');
      this.AssetInfo.appendChild(this.AssetDetails);
      this.Title = DOM.createElement('div',null,'Title');
      this.AssetDetails.appendChild(this.Title);
      this.Date = DOM.createElement('div',null,'Date');
      this.AssetDetails.appendChild(this.Date);
      this.Description = DOM.createElement('div',null,'Description');
      this.AssetDetails.appendChild(this.Description);
      this.Views = DOM.createElement('div',null,'Views');
      this.AssetInfo.appendChild(this.Views);
      this.get();
    }
    this.get = function() {
      LiveRequest_MakeRequest(this.URL, this._update, this);
    }
    this._update = function(aItem,aParent) {
      aParent.update(aItem);
    }
    this.update = function(aItem) {
      var zTagURL = aItem.ItemPath.replace(/\\/g, '/');
      var zSetup = {
        Container: this.TopBar,
        ID: 'FeaturedAssetTag',
        URL: zTagURL,
        Label: 'Add tag to this screenshot'
      }
      this.TagButton = new LiveGroup.tag(zSetup);
      if (this.Asset && this.Asset.parentNode) {
        this.Asset.parentNode.removeChild(this.Asset);
      }
      this.Asset = new Image();
      this.Asset.src = unescape(aItem.FullImageURL);
      LiveWebsite.Utils.ContainImage({
        Image: this.Asset,
        ImageWidth: aItem.ImageWidth,
        ImageHeight: aItem.ImageHeight,
        Container: this.AssetContainer,
        ContainerWidth: 551,
        ContainerHeight: 306
      });
      this.AssetContainer.href = unescape(aItem.FullImageURL);
      this.Title.innerHTML = unescape(aItem.Name);
      this.Date.innerHTML = 'Posted: ' + unescape(aItem.Date);
      this.Description.innerHTML = unescape(aItem.Description);
      this.Views.innerHTML = aItem.Statistics.Views.Total + ' views';
    }
  }
  LiveWebsite.Modules.FeaturedScreenshot.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveGroup.SiteModules.AssetList = function(aSetup) {
    this.modname = "AssetList";
    this.Setup = aSetup;
    this.Container = DOM.createElement("div", null, "ResultsContainer");
    this.SubItems = new Array();
    this.init = function(){
      LiveRequest_MakeRequest(this.Setup.URL, this._build,this);
    }
    this._build = function(aData,aParent) {
      aParent.build(aData);
    }
    this.Loaded = function(e,aParent) {
      if(aParent.LoadingContainer){
        aParent.removeChild(aParent.LoadingContainer);
      }
    }
    this.build = function(aData) {
      this.Data = aData;
      if (aData.AssetList.length != 0){
        this.RelatedContainer = DOM.createElement("div", null, "ListContainer");
        this.Container.appendChild(this.RelatedContainer);
        this.Title = DOM.createElement("div", null, "Title");
        this.Title.innerHTML = this.Setup.Title;
        this.RelatedContainer.appendChild(this.Title);
        for (var i=0; i < this.Data.AssetList.length; i++){
          if (this.Data.AssetList[i]) {
            this.SubItems[i] = DOM.createElement("a", null, "Asset");
            this.SubItems[i].href = unescape(this.Data.AssetList[i].URL);
            this.RelatedContainer.appendChild(this.SubItems[i]);
            this.SubItems[i].loaded = function(e,aParent) {
              aParent.removeChild(aParent.LoadingContainer);
            }
            this.SubItems[i].Thumbnail = new Image();
            this.SubItems[i].appendChild(this.SubItems[i].Thumbnail);
            this.SubItems[i].Thumbnail.src = unescape(this.Data.AssetList[i].ImageURL);
            this.SubItems[i].Thumbnail.title = unescape(this.Data.AssetList[i].Name);
          }
        }
      } else{
        $(this.Setup.ContainerID).style.display = 'none';
      }
    }
  }
  LiveGroup.SiteModules.AssetList.prototype = new LiveGroup.SiteModules.Module;
  LiveGroup.SiteModules.Comment = function(aSetup) {
    this.modname = "Comment";
    this.Setup = aSetup;
    this.Container = DOM.createElement("div", null, "CommentsContainer");
    this.init = function(){
      this.build();
    }
    this.build = function() {
      this.CommentBlock = DOM.createElement("div", "CommentBlock_Comments_Container", "CommentBlock_Container CommentBlock");
      this.Container.appendChild(this.CommentBlock);
      this.CommentBlockHeader = DOM.createElement("div", null, "CommentBlock_Header");
      this.CommentBlock.appendChild(this.CommentBlockHeader);
        var zCommentHeader = DOM.createElement("h3", null, "Expandable CommentBlockTitle");
        zCommentHeader.innerHTML = this.Setup.Title;
        this.CommentBlockHeader.appendChild(zCommentHeader);
        var zNumComments = DOM.createElement("span", "CommentBlock_Comments_Stats");
        this.CommentBlockHeader.appendChild(zNumComments);
        this.TriggerControl = DOM.createElement("div", "CommentBlock_Comments_PostComment", "PostComment");
        this.TriggerControl.innerHTML = "Post Comment";
        this.CommentBlockHeader.appendChild(this.TriggerControl);
      this.CommentBlockSubItems = DOM.createElement("div", "Open CommentBlock_Comments_ToggleContainer", "CommentBlockSubItems");
      this.CommentBlock.appendChild(this.CommentBlockSubItems);
        this.ButtonContainer = DOM.createElement("div", "CommentBlock_Comments_ButtonsContainer", "CommentBlock_ButtonsContainer");
        this.CommentBlockSubItems.appendChild(this.ButtonContainer);
          var zOldestButton = DOM.createElement("div", "CommentBlock_Comments_NextPage", "CommentBlock_ButtonOldest");
          zOldestButton.innerHTML = "Newest";
          this.ButtonContainer.appendChild(zOldestButton);
          var zNewestButton = DOM.createElement("div", "CommentBlock_Comments_PreviousPage", "CommentBlock_ButtonNewest");
          zNewestButton.innerHTML = "Oldest";
          this.ButtonContainer.appendChild(zNewestButton);
        this.CommentsContainer = DOM.createElement("div", "CommentBlock_Comments_CommentsContainer", "CommentBlock_CommentsContainer");
        this.CommentBlockSubItems.appendChild(this.CommentsContainer);
          this.NoCommentsText = DOM.createElement("span", null, "NoCommentsSpan");
          this.NoCommentsText.innerHTML = this.Setup.NoCommentsText;
          this.CommentsContainer.appendChild(this.NoCommentsText);
      this.ChatObject = new LiveGroup.Comment.ChatObject('Comments', this.Setup.SaveComments, this.Setup.GetComments, -1, 'CommentBlock_Comments_CommentsContainer', 'NewCommentContainer-Comments', this.Setup.DisplayCount, true);
      this.ChatObject.ItemBaseURL = '/voig/contentlist/digitalassetlibrary/assetlibrary/videolibrary/mmovie_list/episode1';
      this.ChatObject.SendNotification = 'N';
      var zPostComment_Comments_Setup = {
        ItemBaseURL: '/voig/contentlist/digitalassetlibrary/assetlibrary/videolibrary/mmovie_list/episode1',
        Title: 'Add Comment',
        ContentAction: '.PostComment?aObjectTypeAlias=LiveGroup_Comment&ActionBar=Y&aCommentsAlias=Comments',
        OnClickURL: '.SaveComment?aObjectTypeAlias=LiveGroup_Comment&ActionBar=Y&aCommentsAlias=Comments',
        Type: 'action',
        ActionName: 'Post',
        AddFields: ['inp_NewComment'],
        TriggerId: 'CommentBlock_Comments_PostComment',
        RequireLogin: true
      };
      this.ChatObject.Controls = new LiveGroup.ActionBar.Control(zPostComment_Comments_Setup);
      this.ChatObject.GetComments();
      var zChatObject = this.ChatObject;
      if (this.Setup.ReadOnly != "Y") {
        function CommentBlockCommentsInterval (){
          zChatObject.GetComments();
        }
        setInterval(CommentBlockCommentsInterval, '30000');
      }
    }
  }
  LiveGroup.SiteModules.Comment.prototype = new LiveGroup.SiteModules.Module;
  LiveGroup.tag = function(aSetup) {
    this.Setup = aSetup;
    this.ItemBaseURL = aSetup.URL;
    this.Container = DOM.createElement('div','MainAssetTag');
    aSetup.Container.appendChild(this.Container);
    this.get = function() {
      var zURL = 'http://mmovie.voig.com/' + unescape(this.ItemBaseURL) + '.GetTags';
      LiveRequest_MakeRequest(zURL,this._show,this);
      return true;
    }
    this.verify = function(e,aParent) {
      if (GetCookieValue('TLOAID') != '') {
        aParent.get();
      } else {
        var zLoginAction = {
          Title: 'Login',
          ContentAction: 'http://mmovie.voig.com/home.LoginForm?aObjectTypeAlias=LiveGroup_ActionBar&aActionBar=Y',
          Type: 'action',
          ActionName: 'Login',
          OnClickURL: 'http://mmovie.voig.com/home.LoginComplete?aObjectTypeAlias=LiveGroup_ActionBar&aActionBar=Y',
          AddFields: ['inpControlUserName', 'inpControlPassword'],
          noLink: true,
          OriginalAction: null
        }
        var aLoginControl = new LiveGroup.ActionBar.Control(zLoginAction);
        aLoginControl.Show(e, aLoginControl);
      }
    }
    this._show = function(aTags,aParent) {
      aParent.show(aTags);
    }
    this.show = function(aTags) {
      this.Tags = aTags.TagList;
      this.TagContainer = DOM.createElement('div',null,'TagContainer');
      this.Container.appendChild(this.TagContainer);
      this.FormContainer = DOM.createElement('div',null,'FormContainer');
      this.TagContainer.appendChild(this.FormContainer);
      this.SubItemContainer = DOM.createElement('div',null,'SubItemContainer');
      this.TagContainer.appendChild(this.SubItemContainer);
      var zInputContainer = DOM.createElement('div',null,'InputContainer');
          this.FormContainer.appendChild(zInputContainer);
      var zLabel = DOM.createElement('label',null,'Label');
          zLabel.name = "TagLabel";
          zLabel.innerHTML = this.Setup.Label;
          zInputContainer.appendChild(zLabel);
          this.Input = DOM.createElement("input",null,"Input");
          this.Input.name = "inpTag";
          this.Input.maxLength = 30;
          zInputContainer.appendChild(this.Input);
      var zButton = DOM.createElement("a",null,"AddButton");
          zButton.href = "javascript: void(0);";
          zInputContainer.appendChild(zButton);
      if (this.Tags) {
        for (var i=0;i < this.Tags.length;i++) {
          this.draw(this.Tags[i],this);
        }
      }
      DOM.addEvent(zButton,'onclick',this._add,this);
      DOM.addEvent(zButton,'onkeypress',this.keyPress,this);
      DOM.addEvent(this.Input,'onkeypress',this.keyPress,this);
      removeEventHandler(this.TagButton,"onclick",this.verify,this);
      DOM.addEvent(this.TagButton,"onclick",this.hide,this);
      return true;
    }
    this._add = function(e,aParent) {
      aParent.add();
    }
    this.add = function() {
      var zNewLowerCaseTag = this.Input.value.toLowerCase();
      if (this.Input.value != '') {
        if (this.Tags) {
          for (var i=0; i < this.Tags.length; i++) {
            var zExistingLowerCaseTag = this.Tags[i].Name.toLowerCase();
            if (zNewLowerCaseTag == zExistingLowerCaseTag) {
              var zDupe = 'Y';
            }
          }
        } else {
          this.Tags = new Array();
        }
        if (zDupe != 'Y') {
          var zURL = 'http://mmovie.voig.com/' + unescape(this.ItemBaseURL) + '.AddTag?aTag='+ this.Input.value;
          LiveRequest_MakeRequest(zURL,this._addComplete,this);
        } else {
          alert("Sorry :(. You've already added this tag.");
        }
      } else {
        alert('Please supply a valid tag!');
      }
    }
    this._addComplete = function(aTag,aParent) {
      aParent.addComplete(aTag);
    }
    this.addComplete = function(aTag) {
      this.Tags.push(aTag);
      this.draw(aTag,this);
      this.Input.value = '';
    }
    this.draw = function(aTag) {
      var zTagItemContainer = DOM.createElement('div',null,'TagItemContainer');
      this.SubItemContainer.appendChild(zTagItemContainer);
      var zRemove = DOM.createElement('div',null,'Remove');
      zRemove.innerHTML = 'x';
      zTagItemContainer.appendChild(zRemove);
      var zTagItem = DOM.createElement('div',null,'Tag');
      zTagItem.Container = zTagItemContainer;
      zTagItem.HierarchyPOS = aTag.HierarchyPos;
      zTagItem.innerHTML = unescape(aTag.Name);
      zTagItemContainer.appendChild(zTagItem);
      aTag.removeConfirm = function(e,aParent) {
        if (!this.Alert) {
          this.Alert = DOM.createElement('div',null,'AlertContainer');
          aParent.TagContainer.appendChild(this.Alert);
          var zText = DOM.createElement('div',null,'ConfirmationText');
          zText.innerHTML = 'Are you sure you want to remove this tag?';
          this.Alert.appendChild(zText);
          this.Remove = DOM.createElement('div',null,'Remove');
          this.Remove.Tag = zTagItem.Container;
          this.Remove.Container = this.Alert;
          this.Remove.HierarchyPOS = zTagItem.HierarchyPOS;
          this.Remove.innerHTML = 'Remove';
          this.Alert.appendChild(this.Remove);
          this.Cancel = DOM.createElement('div',null,'Cancel');
          this.Cancel.Container = this.Alert;
          this.Cancel.innerHTML = 'Cancel';
          this.Alert.appendChild(this.Cancel);
          DOM.addEvent(this.Remove,'onclick',aTag.remove,aParent);
          DOM.addEvent(this.Cancel,'onclick',aTag.cancel,aParent);
          this.Alert.Built = 'Y';
        } else {
          aParent.TagContainer.appendChild(this.Alert);
        }
      }
      aTag.remove = function(e,aParent) {
        var zURL = 'http://mmovie.voig.com/' + unescape(aParent.ItemBaseURL) + '.RemoveTag?aHierarchyPOS='+ this.HierarchyPOS;
        LiveRequest_MakeRequest(zURL, aTag.removeComplete,this)
      }
      aTag.removeComplete = function(aReturnObj,aTrigger) {
        aTrigger.Container.parentNode.removeChild(aTrigger.Container);
        aTrigger.Tag.parentNode.removeChild(aTrigger.Tag);
      }
      aTag.cancel = function(e,aParent) {
        this.Container.parentNode.removeChild(this.Container);
      }
      DOM.addEvent(zRemove,'onclick',aTag.removeConfirm,this);
      return true;
    }
    this.create = function () {
      this.Title = DOM.createElement('div',null,'TagTitle');
      this.Title.innerHTML = 'Tag ';
      this.Container.appendChild(this.Title);
      this.TagButton = DOM.createElement('div',null,'TagButton');
      this.Container.appendChild(this.TagButton);
      DOM.addEvent(this.TagButton,'onclick',this.verify,this);
    }
    this.keyPress = function(e,aParent) {
      if(e.keyCode == 13) {
        aParent.add();
      }
      return true;
    }
    this.display = function(e,aParent) {
      aParent.TagContainer.style.display = 'block';
      appendEventHandler(aParent.TagButton,"onclick",aParent.hide,aParent);
      removeEventHandler(aParent.TagButton,"onclick",aParent.display,aParent);
    }
    this.hide = function(e,aParent) {
      aParent.TagContainer.style.display = 'none';
      appendEventHandler(aParent.TagButton,"onclick",aParent.display,aParent);
      removeEventHandler(aParent.TagButton,"onclick",aParent.hide,aParent);
    }
    this.create();
    return true;
  }
  LiveWebsite.Modules.TabView = new Object();
  LiveWebsite.Modules.TabView.Module = function(aSetup) {
    this.Container = DOM.createElement('div');
    this.TabContainer = DOM.createElement('div',null,'TabContainer');
    this.Container.appendChild(this.TabContainer);
    this.Tabs = aSetup;
    this.init = function() {
      for (var i=0;i < this.Tabs.length ;i++) {
        this.Tabs[i].Trigger = DOM.createElement('div',null,'Tab');
        this.Tabs[i].Trigger.innerHTML = this.Tabs[i].Label;
        this.Tabs[i].Parent = this;
        this.Tabs[i].Trigger.Class = this.Tabs[i].Class;
        this.TabContainer.appendChild(this.Tabs[i].Trigger);
        DOM.addEvent(this.Tabs[i].Trigger,'onclick',this._change,this.Tabs[i]);
      }
      this.build(this.Tabs[0]);
    }
    this._change = function(e,aTab) {
      if (aTab.Built == 'Y') {
        aTab.Parent.change(aTab);
      } else {
        aTab.Parent.build(aTab);
      }
    }
    this.change = function(aTab) {
      if (this.Current) {
        this.Current.Class.Container.parentNode.removeChild(this.Current.Class.Container);
      }
      aTab.ParentContainer.appendChild(aTab.Class.Container);
      this.Current.Trigger.className = 'Tab';
      this.Current = aTab;
      this.Current.Trigger.className = 'Tab Selected';
    }
    this.build = function(aTab) {
      if (this.Current) {
        this.Current.Trigger.className = 'Tab';
        this.Current.Class.Container.parentNode.removeChild(this.Current.Class.Container);
      }
      aTab.ParentContainer.appendChild(aTab.Class.Container);
      this.Current = aTab;
      this.Current.Built = 'Y';
      this.Current.Trigger.className = 'Tab Selected';
      aTab.Class.init();
    }
  }
  LiveWebsite.Modules.TabView.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.Count = new Object();
  LiveWebsite.Modules.Count.Module = function() {
    this.Container = DOM.createElement('div');
    this.init = function() {
      this.CountContainer = DOM.createElement('div',null,'CountContainer');
      this.Container.appendChild(this.CountContainer);
      this.Count = DOM.createElement('span',null,'CountText');
      this.CountContainer.appendChild(this.Count);
      this.Go = DOM.createElement('div',null,'GoButton');
      this.CountContainer.appendChild(this.Go);
    }
    this.update = function(aNumber) {
      this.Count.innerHTML = aNumber + ' <span class="AssetType">' + zCount.Title + '</span>';
    }
  }
  LiveWebsite.Modules.Count.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.PageAssets = new Object();
  LiveWebsite.Modules.PageAssets.Module = function(aSetup) {
    this.Container = DOM.createElement('div');
    this.Setup = aSetup;
    this.Areas = new Array();
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.PagingTitle = DOM.createElement('div',null,'PagingTitle');
      this.PagingTitle.innerHTML = this.Setup.Title;
      this.Container.appendChild(this.PagingTitle);
      this.PagingContainer = DOM.createElement('div',null,'PagingContainer');
      this.Container.appendChild(this.PagingContainer);
      this.AssetContainer = DOM.createElement('div',null,'AssetContainer');
      this.Container.appendChild(this.AssetContainer);
      this.PageBack = DOM.createElement('div',null,'PageBackDisabled');
      this.PagingContainer.appendChild(this.PageBack);
      this.PageForward = DOM.createElement('div',null,'PageForwardDisabled');
      this.PagingContainer.appendChild(this.PageForward);
      this.ViewAll = DOM.createElement('a',null,'ViewAllButton');
      this.ViewAll.href = '#';
      this.ViewAll.innerHTML = 'View All';
      this.Container.appendChild(this.ViewAll);
      this.TabContainer = DOM.createElement('div',null,'TabContainer');
      this.Container.appendChild(this.TabContainer);
      DOM.addEvent(this.PageBack,'onclick',this._pageBack,this);
      DOM.addEvent(this.PageForward,'onclick',this._pageForward,this);
      for (var i=0; i < this.Setup.Areas.length; i++) {
        this.Areas[i] = DOM.createElement('div',null,'PageArea');
        this.Areas[i].style.display = 'none';
        this.Areas[i].Action = this.Setup.Areas[i].Action;
        this.Areas[i].AllAction = this.Setup.Areas[i].AllAction;
        this.Areas[i].Parent = this;
        this.Areas[i].SubItems = new Array();
        this.AssetContainer.appendChild(this.Areas[i]);
        this.Areas[i].loading = function() {
          for (var i=0; i < this.SubItems.length; i++) {
            this.SubItems[i].ThumbContainer.appendChild(this.SubItems[i].Thumbnail.LoadingContainer);
          }
        }
        this.Areas[i]._drawAssets = function(aArray,aParent) {
          aParent.Array = aArray.AssetList;
          aParent.Count = aArray.Count;
          aParent.drawAssets();
        }
        this.Areas[i].drawAssets = function() {
          for (var i=0; i < 6; i++) {
            this.SubItems[i] = DOM.createElement('div',null,'Asset');
            this.appendChild(this.SubItems[i]);
            this.SubItems[i].Number = DOM.createElement('div',null,'Number');
            this.SubItems[i].appendChild(this.SubItems[i].Number);
            var zLeftCorner = DOM.createElement('div',null,'Left');
            this.SubItems[i].Number.appendChild(zLeftCorner);
            this.SubItems[i].Number.InnerNumber = DOM.createElement('div',null,'InnerNumber');
            this.SubItems[i].Number.appendChild(this.SubItems[i].Number.InnerNumber);
            var zRightCorner = DOM.createElement('div',null,'Right');
            this.SubItems[i].Number.appendChild(zRightCorner);
            this.SubItems[i].ThumbContainer = DOM.createElement('a',null,'ThumbContainer');
            this.SubItems[i].appendChild(this.SubItems[i].ThumbContainer);
            this.SubItems[i].Thumbnail = new Image();
            this.SubItems[i].ThumbContainer.appendChild(this.SubItems[i].Thumbnail);
            this.SubItems[i].Thumbnail.LoadingContainer = DOM.createElement('div',null,'LoadingContainer');
            this.SubItems[i].Thumbnail.loaded = function() {
              if (this.LoadingContainer.parentNode) {
                this.LoadingContainer.parentNode.removeChild(this.LoadingContainer);
              }
            }
            DOM.addEvent(this.SubItems[i].Thumbnail,'onload',this.SubItems[i].Thumbnail.loaded,this.SubItems[i].Thumbnail);
            this.SubItems[i].Title = DOM.createElement('div',null,'Title');
            this.SubItems[i].appendChild(this.SubItems[i].Title);
            this.SubItems[i].Date = DOM.createElement('div',null,'Date');
            this.SubItems[i].appendChild(this.SubItems[i].Date);
            this.SubItems[i].Creator = DOM.createElement('div',null,'ByLine');
            this.SubItems[i].appendChild(this.SubItems[i].Creator);
          }
          this.CurrentPage = 0;
          this.updateAssets();
        }
        this.Areas[i]._updateAssets = function(aArray,aParent) {
          if (aArray) {
            aParent.Count = aArray.Count;
            aParent.Array = aArray.AssetList;
            aParent.updateAssets();
          }
        }
        this.Areas[i].updateAssets = function() {
          var zLimit = this.CurrentPage + 6;
          var zNumber = this.StartRow;
          var x = 0;
          var zPageBackNumber = zNumber - 6;
          var zPageForwardNumber = this.StartRow + 6;
          if (zPageBackNumber <= 0 ) {
            this.Parent.PageBack.className = 'PageBackDisabled';
          } else {
            this.Parent.PageBack.className = 'PageBack';
          }
          if (zPageForwardNumber > this.Count) {
            this.Parent.PageForward.className = 'PageForwardDisabled';
          } else {
            this.Parent.PageForward.className = 'PageForward';
          }
          for (var i = 0; i < 6; i++) {
            if (this.Array[i]) {
              this.SubItems[x].Number.InnerNumber.innerHTML = zNumber;
              this.SubItems[x].ThumbContainer.href = unescape(this.Array[i].URL);
              this.SubItems[x].Thumbnail.src = unescape(this.Array[i].ImageURL);
              this.SubItems[x].Thumbnail.title = unescape(this.Array[i].Name);
              var zName = unescape(this.Array[i].Name);
              if (this.Array[i].Name.length >=13) {
                zName = zName.substring(0,13) + '...';
              }
              this.SubItems[x].Title.innerHTML = zName;
              this.SubItems[x].Date.innerHTML = unescape(this.Array[i].Date);
              this.SubItems[x].Creator.innerHTML = '<span class="ByLine">By:</span> <a href="' + unescape(this.Array[i].Creator.URL) + '">' + unescape(this.Array[i].Creator.Name) + '</a>';
              this.appendChild(this.SubItems[x]);
            } else {
              if (this.SubItems[x].parentNode) {
                this.SubItems[x].parentNode.removeChild(this.SubItems[x]);
              }
            }
            zNumber++;
            x++;
          }
        }
        this.Areas[i].getAssets = function(aPath) {
          this.StartRow = 1;
          this.Path = aPath;
          this.URL = this.Path + this.Action;
          this.GetAssetsRequest = LiveRequest_MakeRequest(this.URL, this._drawAssets, this);
        }
        if (this.Setup.DisplayTabs != 'N') {
          this.Areas[i].Tab = DOM.createElement('div',null,'Tab');
          this.Areas[i].Tab.innerHTML = this.Setup.Areas[i].Title;
          this.Areas[i].Tab.Area = this.Areas[i];
          this.TabContainer.appendChild(this.Areas[i].Tab);
          DOM.addEvent(this.Areas[i].Tab,'onclick',this._switch,this);
        }
        this.Areas[i].getAssets(this.Setup.ItemPath);
      }
      this.Areas[0].style.display = 'block';
      if (this.Areas[0].Tab) {
        this.Areas[0].Tab.className = 'Selected Tab';
      }
      this.CurrentArea = this.Areas[0];
      this.ViewAll.href = this.CurrentArea.Path + this.CurrentArea.AllAction;
    }
    this.push = function() {
    }
    this._pageForward = function(e,aParent) {
      aParent.pageForward();
    }
    this._pageBack = function(e,aParent) {
      aParent.pageBack();
    }
    this.pageForward = function() {
      if (this.CurrentArea.StartRow + 6 <= this.CurrentArea.Count) {
        if (this.PageRequest  && this.PageRequest.HttpRequest.readyState != 4) {
          this.PageRequest.HttpRequest.abort();
        }
        this.CurrentArea.loading();
        this.CurrentArea.StartRow = this.CurrentArea.StartRow + 6;
        this.CurrentArea.URL = this.CurrentArea.Path + this.CurrentArea.Action + '&aStartRow=' + this.CurrentArea.StartRow;
        this.PageRequest = LiveRequest_MakeRequest(this.CurrentArea.URL, this.CurrentArea._updateAssets, this.CurrentArea);
      }
    }
    this.pageBack = function() {
      if (this.CurrentArea.StartRow - 6 > 0) {
        if (this.PageRequest  && this.PageRequest.HttpRequest.readyState != 4) {
          this.PageRequest.HttpRequest.abort();
        }
        this.CurrentArea.loading();
        this.CurrentArea.StartRow = this.CurrentArea.StartRow - 6;
        this.CurrentArea.URL = this.CurrentArea.Path + this.CurrentArea.Action + '&aStartRow=' + this.CurrentArea.StartRow;
        this.PageRequest = LiveRequest_MakeRequest(this.CurrentArea.URL, this.CurrentArea._updateAssets, this.CurrentArea);
      }
    }
    this.receive = function(aPath,aParent) {
      aParent.updateAreas(aPath);
    }
    this.updateAreas = function(aPath) {
      for (var i=0; i < this.Areas.length;i++) {
        if (this.Areas[i].GetAssetsRequest  && this.Areas[i].GetAssetsRequest.HttpRequest.readyState != 4) {
          this.Areas[i].GetAssetsRequest.HttpRequest.abort();
        }
        this.Areas[i].StartRow = 1;
        this.Areas[i].Path = aPath;
        this.Areas[i].URL = this.Areas[i].Path + this.Areas[i].Action;
        this.Areas[i].GetAssetsRequest = LiveRequest_MakeRequest(this.Areas[i].URL, this.Areas[i]._updateAssets, this.Areas[i]);
      }
      this.ViewAll.href = this.CurrentArea.Path + this.CurrentArea.AllAction;
    }
    this.loading = function() {
      for (var i=0; i < this.Areas.length; i++) {
        this.Areas[i].loading();
      }
    }
    this._switch = function(e,aParent) {
      aParent.CurrentArea.Tab.className = 'Tab';
      aParent.CurrentArea.style.display = 'none';
      this.Area.style.display = 'block';
      this.className = 'Selected Tab';
      aParent.CurrentArea = this.Area;
      aParent.ViewAll.href = aParent.CurrentArea.Path + aParent.CurrentArea.AllAction;
    }
  }
  LiveWebsite.Modules.PageAssets.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.AssetGrid = new Object();
  LiveWebsite.Modules.AssetGrid.Module = function(aSetup) {
    this.Container = DOM.createElement('div');
    this.StartRow = 0;
    this.RowCount = 30;
    this.Setup = aSetup;
    this.Action = aSetup.Action
    this.SubItems = new Array();
    this.CurrentPage = 1;
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.Container.AssetContainer = DOM.createElement('div',null,'AssetContainer');
      this.Container.appendChild(this.Container.AssetContainer);
      this.PageNumbersContainer = DOM.createElement('div',null,'PageNumbersContainer');
      this.PageNumbersContainer.Page = new Array();
      this.Container.appendChild(this.PageNumbersContainer);
      this.PagingContainer = DOM.createElement('div',null,'PagingContainer');
      this.Container.appendChild(this.PagingContainer);
      this.PageBack = DOM.createElement('div',null,'PageBack');
      this.PagingContainer.appendChild(this.PageBack);
      this.PageForward = DOM.createElement('div',null,'PageForward');
      this.PagingContainer.appendChild(this.PageForward);
      DOM.addEvent(this.PageForward,'onclick',this.pageForward,this);
      DOM.addEvent(this.PageBack,'onclick',this.pageBack,this);
      for (var i = 0; i < this.RowCount; i++) {
        this.SubItems[i] = DOM.createElement('div',null,'Asset');
        this.SubItems[i].Thumbnail = new Image();
        this.SubItems[i].Thumbnail.width = 100;
        this.SubItems[i].Thumbnail.height = 75;
        this.SubItems[i].LoadingContainer = DOM.createElement('div',null,'LoadingContainer');
        this.SubItems[i].appendChild(this.SubItems[i].Thumbnail);
        this.SubItems[i].loaded = function(e,aParent) {
          if (aParent.LoadingContainer.parentNode) {
            aParent.LoadingContainer.parentNode.removeChild(aParent.LoadingContainer);
          }
        }
        this.SubItems[i].getPage = function() {
          window.location = this.URL;
        }
        DOM.addEvent(this.SubItems[i],'onclick',this.SubItems[i].getPage)
        DOM.addEvent(this.SubItems[i].Thumbnail,'onload',this.SubItems[i].loaded,this.SubItems[i]);
      }
      this.URL = this.Setup.ItemPath + this.Setup.Action;
      this.get();
    }
    this.loading = function () {
      for (var i = 0; i < this.SubItems.length; i++) {
        this.SubItems[i].appendChild(this.SubItems[i].LoadingContainer);
      }
    }
    this.receive = function(a,b,c) {
      this.URL = a + this.Action;
      this.get();
    }
    this.get = function() {
      LiveRequest_MakeRequest(this.URL + '&aStartRow=1&aRowCount=' + this.RowCount, this.receiveData, this);
    }
    this.pageForward = function(e,aParent) {
      if (aParent.StartRow + aParent.RowCount < aParent.TotalResults) {
        aParent.loading();
        aParent.StartRow = aParent.StartRow + aParent.RowCount;
        aParent.PageNumber = (aParent.StartRow / aParent.RowCount) + 1;
        aParent.CurrentPage.style.backgroundColor = '#fff';
        aParent.CurrentPage = aParent.PageNumbersContainer.Page[aParent.PageNumber];
        var aStartRow = aParent.StartRow + 1;
        LiveRequest_MakeRequest(aParent.URL + '&aStartRow=' + aStartRow + '&aRowCount=' + aParent.RowCount, aParent._update, aParent);
      }
    }
    this.pageBack = function(e,aParent) {
      if (aParent.StartRow - aParent.RowCount >= 0) {
        aParent.loading();
        aParent.StartRow = aParent.StartRow - aParent.RowCount;
        aParent.PageNumber = (aParent.StartRow / aParent.RowCount) + 1;
        if (aParent.PageNumber) {
          aParent.CurrentPage.style.backgroundColor = '#fff';
          aParent.CurrentPage = aParent.PageNumbersContainer.Page[aParent.PageNumber];
        }
        var aStartRow = aParent.StartRow + 1;
        LiveRequest_MakeRequest(aParent.URL + '&aStartRow=' + aStartRow + '&aRowCount=' + aParent.RowCount, aParent._update, aParent);
      }
    }
    this.buildPagination = function() {
      if (this.CurrentPage != 1){
        var zCurrentPage = parseInt(this.CurrentPage.innerHTML);
      }
      this.Container.removeChild(this.PageNumbersContainer);
      this.PageNumbersContainer = DOM.createElement('div',null,'PageNumbersContainer');
      this.PageNumbersContainer.Page = new Array();
      this.Container.appendChild(this.PageNumbersContainer);
      var zPageTotal = this.TotalResults / this.RowCount;
          zPageTotal = Math.ceil(zPageTotal);
      var zMaxPage;
      var zMinPage = 1;
      if (zPageTotal > 10){
        if (zCurrentPage > 5) {
          zMaxPage = zCurrentPage + 5;
          zMinPage = zCurrentPage - 4;
        } else {
          zMinPage = 1;
          zMaxPage = 10;
        }
        if (zPageTotal < (zMinPage + 10)){
          zMinPage = zPageTotal - 9;
        }
      } else if (zPageTotal > 10 ) {
        zMaxPage = 10;
      } else {
        zMaxPage = zPageTotal;
      }
      if (zMaxPage > zPageTotal){
        zMaxPage = zPageTotal;
      }
      if (zMinPage < 1){
        zMinPage = 1;
      }
      if (zMinPage != 1){
        this.PageNumbersContainer.Page[1] = DOM.createElement('a',null,'PageNumber');
        this.PageNumbersContainer.Page[1].innerHTML = 1;
        this.PageNumbersContainer.Page[1].href = null;
        this.PageNumbersContainer.Page[1].StartRow = 0;
        this.PageNumbersContainer.Page[1].StartPage = zMinPage;
        this.PageNumbersContainer.Page[1].EndPage = zMaxPage;
        this.PageNumbersContainer.appendChild(this.PageNumbersContainer.Page[1]);
        DOM.addEvent(this.PageNumbersContainer.Page[1],'onclick',this.pageNumber,this);
        if (zMinPage != 2){
          this.PageNumbersContainer.Page[2] = DOM.createElement('div',null,'PageNumber');
          this.PageNumbersContainer.Page[2].innerHTML = '...';
          this.PageNumbersContainer.appendChild(this.PageNumbersContainer.Page[2]);
        }
      }
      for (var i=zMinPage; i <= zMaxPage; i++) {
        this.PageNumbersContainer.Page[i] = DOM.createElement('a',null,'PageNumber');
        this.PageNumbersContainer.Page[i].innerHTML = i;
        this.PageNumbersContainer.Page[i].href = null;
        this.PageNumbersContainer.Page[i].StartRow = (i - 1) * this.RowCount;
        this.PageNumbersContainer.Page[i].StartPage = zMinPage;
        this.PageNumbersContainer.Page[i].EndPage = zMaxPage;
        this.PageNumbersContainer.appendChild(this.PageNumbersContainer.Page[i]);
        DOM.addEvent(this.PageNumbersContainer.Page[i],'onclick',this.pageNumber,this);
      }
      if (zMaxPage < (zPageTotal - 1)){
        this.PageNumbersContainer.Page[(zPageTotal - 1)] = DOM.createElement('div',null,'PageNumber');
        this.PageNumbersContainer.Page[(zPageTotal - 1)].innerHTML = '...';
        this.PageNumbersContainer.appendChild(this.PageNumbersContainer.Page[(zPageTotal - 1)]);
      }
      if (zMaxPage < zPageTotal){
        this.PageNumbersContainer.Page[zPageTotal] = DOM.createElement('a',null,'PageNumber');
        this.PageNumbersContainer.Page[zPageTotal].innerHTML = zPageTotal;
        this.PageNumbersContainer.Page[zPageTotal].href = null;
        this.PageNumbersContainer.Page[zPageTotal].StartRow = (zPageTotal - 1) * this.RowCount;
        this.PageNumbersContainer.Page[zPageTotal].StartPage = zMinPage;
        this.PageNumbersContainer.Page[zPageTotal].EndPage = zMaxPage;
        this.PageNumbersContainer.appendChild(this.PageNumbersContainer.Page[zPageTotal]);
        DOM.addEvent(this.PageNumbersContainer.Page[zPageTotal],'onclick',this.pageNumber,this);
      }
      if (zCurrentPage){
        this.PageNumbersContainer.Page[zCurrentPage].style.backgroundColor = '#bbd';
      }
    }
    this.pageNumber = function(e,aParent) {
      aParent.CurrentPage.style.backgroundColor = '#fff';
      aParent.loading();
      aParent.StartRow = this.StartRow;
      aParent.CurrentPage = this;
      var aStartRow = aParent.StartRow + 1;
      LiveRequest_MakeRequest(aParent.URL + '&aStartRow=' + aStartRow + '&aRowCount=' + aParent.RowCount, aParent._update, aParent);
    }
    this.receiveData = function(aArray,aParent) {
      aParent.Assets = aArray.AssetList;
      aParent.TotalResults = aArray.Count;
      aParent.buildPagination();
      aParent.StartRow = 0;
      aParent.CurrentPage = aParent.PageNumbersContainer.Page[1];
      aParent.CurrentPage.style.backgroundColor = '#bbd';
      aParent.update();
    }
    this._update = function(aArray,aParent){
      aParent.Assets = aArray.AssetList;
      aParent.TotalResults = aArray.Count;
      aParent.buildPagination();
      aParent.update();
    }
    this.update = function() {
      for (var i = 0; i < this.RowCount; i++) {
        if (this.Assets[i]) {
          this.SubItems[i].Thumbnail.src = unescape(this.Assets[i].ImageURL);
          this.SubItems[i].Thumbnail.title = unescape(this.Assets[i].Name);
          this.SubItems[i].URL = unescape(this.Assets[i].URL);
          this.Container.AssetContainer.appendChild(this.SubItems[i]);
        }  else if (this.SubItems[i] && this.SubItems[i].parentNode) {
          this.SubItems[i].parentNode.removeChild(this.SubItems[i]);
        }
      }
    }
  }
  LiveWebsite.Modules.AssetGrid.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.SocialBookmarks = new Object();
  LiveWebsite.Modules.SocialBookmarks.Module = function(aSetup) {
    this.Container = DOM.createElement('div',null,'SocialBookmarkContainer');
    this.URL = aSetup.URL;
    this.Title = aSetup.Title
    this.Params = '';
    this.Bookmark = new Array();
    this.Setup = aSetup;
    this.init = function() {
      this.getBookmarks();
    }
    this.getBookmarks = function() {
      for (var i = 0; i < this.Setup.Bookmarks.length; i++) {
        this.Params = this.Params + '&aNo' + this.Setup.Bookmarks[i] + '=N';
      }
      this.Params = this.Params + '&aURL=' + this.URL;
      this.Params = this.Params + '&aTitle=' + this.Title;
      zURL = '/voig/contentlist/digitalassetlibrary/assetlibrary/videolibrary/mmovie_list/episode1.SocialBookmarks?aLanguage=en-us&aObjectTypeAlias=LiveGroup_Module&aActionBar=Y' + this.Params;
      LiveRequest_MakeRequest(zURL, this.receiveBookmarks, this);
    }
    this.receiveBookmarks = function(aArray,aParent) {
      aParent.drawBookmarks(aArray);
    }
    this.drawBookmarks = function(aArray) {
      for (var i=0; i < aArray.length; i++) {
        this.Bookmark[i] = DOM.createElement('a',null,'SocialBookmark');
        this.Bookmark[i].title = aArray[i].Title;
        this.Bookmark[i].href = aArray[i].OnClickURL;
        this.Bookmark[i].target = '_blank';
        this.Container.appendChild(this.Bookmark[i]);
        this.Bookmark[i].Image = new Image();
        this.Bookmark[i].Image.src = aArray[i].ImageURL;
        this.Bookmark[i].appendChild(this.Bookmark[i].Image);
      }
    }
  }
  LiveWebsite.Modules.SocialBookmarks.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.PlayerCard = new Object();
  LiveWebsite.Modules.PlayerCard.Module = function(aSetup) {
    this.Container = DOM.createElement('div',null,'Card');
    this.Setup = aSetup;
    this.init = function() {
      this.Card = new LiveGroup.Database.Card(this.Setup);
    }
  }
  LiveWebsite.Modules.PlayerCard.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.Ratings = new Object();
  LiveWebsite.Modules.Ratings.Module = function(aSetup) {
    this.Container = DOM.createElement('div',null,'Ratings');
    this.Average = aSetup.Average;
    this.Max = aSetup.Max;
    this.URL = aSetup.URL;
    this.Id = aSetup.Id;
    this.Rating = new Array();
    this.Rated = aSetup.Rated;
    this.init = function() {
      this.build();
    }
    this.build = function() {
      for (var i=1; i<= this.Max; i++) {
        this.Rating[i] = DOM.createElement('div');
        this.Rating[i].id = i;
        this.Container.appendChild(this.Rating[i]);
        if (this.Rated != 'Y') {
          DOM.addEvent(this.Rating[i],'onmouseover',this._activeState,this);
          DOM.addEvent(this.Rating[i],'onmouseout',this._naturalState,this);
          DOM.addEvent(this.Rating[i],'onclick',this._save,this);
        }
      }
      this.naturalState();
    }
    this._activeState = function(e,aParent) {
      aParent.activeState(this);
    }
    this._naturalState = function(e,aParent) {
      aParent.naturalState(this);
    }
    this.activeState = function(aRating) {
      var zClassName;
      for (var i=1; i <= this.Max; i++) {
        if (i <= aRating.id) {
          zClassName = ' Full';
        } else {
          zClassName = ' Empty';
        }
        this.Rating[i].className = 'Rating' + zClassName;
      }
    }
    this.naturalState = function() {
      var zClassName;
      for (var i=1; i<= this.Max; i++) {
        if (i <= this.Average) {
          zClassName = ' Full';
        } else {
          if ((i - 1) < this.AverageRating) {
            zClassName = ' Half';
          } else {
            zClassName = ' Empty';
          }
        }
        this.Rating[i].className = 'Rating' + zClassName;
      }
    }
    this._save = function(e,aParent) {
      aParent.save(this.id);
    }
    this.save = function(aRating) {
      this.Params = '&aRatingValue=' + aRating;
      this.Params = this.Params + '&aItemId=' + this.Id;
      this.URL = this.URL + this.Params;
      LiveRequest_MakeRequest(this.URL, this._confirm, this);
    }
    this._confirm = function(aData,aParent) {
      aParent.confirm();
    }
    this.confirm = function() {
      while (this.Container.childNodes[0]) {
        this.Container.removeChild(this.Container.childNodes[0]);
      }
      this.Container.innerHTML = 'Rated!';
    }
  }
  LiveWebsite.Modules.Ratings.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveGroup.SiteModules.TopicList = function(aSetup) {
    this.modname = "TopicList";
    this.Setup = aSetup;
    this.Container = DOM.createElement("div", null, "ResultsContainer");
    this.init = function(){
      LiveRequest_MakeRequest(this.Setup.URL, this._build,this);
    }
    this._build = function(aData,aParent) {
      aParent.build(aData);
    }
    this.build = function(aData) {
      this.Data = aData;
      if (aData.TopicList.length != 0){
        this.RelatedContainer = DOM.createElement("div", null, "ListContainer");
        this.Container.appendChild(this.RelatedContainer);
        this.Title = DOM.createElement("div", null, "Title");
        this.Title.innerHTML = this.Setup.Title;
        this.RelatedContainer.appendChild(this.Title);
        for (var i=0; i<this.Data.TopicList.length; i++){
          var zTopicLink = DOM.createElement("a", null, "TopicLink");
          zTopicLink.href = unescape(this.Data.TopicList[i].URL);
          var zName = unescape(this.Data.TopicList[i].Name);
          if (zName.length > 30) {
            zName = zName.substring(0,28) + "...";
          }
          zTopicLink.innerHTML = zName;
          this.RelatedContainer.appendChild(zTopicLink);
        }
      } else {
        $(this.Setup.ContainerID).style.display = 'none';
      }
    }
  }
  LiveGroup.SiteModules.TopicList.prototype = new LiveGroup.SiteModules.Module;
  LiveGroup.SiteModules.AssetListDetails = function(aSetup) {
    this.modname = "AssetListDetails";
    this.Setup = aSetup;
    this.Container = DOM.createElement("div", null, "RelatedSearches");
    this.SubItems = new Array();
    this.init = function(){
      LiveRequest_MakeRequest(this.Setup.URL, this._build,this);
    }
    this._build = function(aData,aParent) {
      aParent.build(aData);
    }
    this.build = function(aData) {
      this.Data = aData;
      this.RelatedContainer = DOM.createElement("div", null, "RelatedContainer");
      this.Container.appendChild(this.RelatedContainer);
      this.Title = DOM.createElement("h3", null, "Title");
      this.Title.innerHTML = this.Setup.Title;
      this.RelatedContainer.appendChild(this.Title);
      for (var i=0; i < this.Data.AssetList.length; i++){
        if (this.Data.AssetList[i]) {
          this.AssetContainer = DOM.createElement("div", null, "AssetDetailsContainer");
          this.RelatedContainer.appendChild(this.AssetContainer);
          this.SubItems[i] = DOM.createElement("a", null, "Asset");
          this.SubItems[i].href = unescape(this.Data.AssetList[i].URL);
          this.AssetContainer.appendChild(this.SubItems[i]);
          this.SubItems[i].Thumbnail = new Image();
          this.SubItems[i].Thumbnail.src = unescape(this.Data.AssetList[i].ImageURL);
          this.SubItems[i].Thumbnail.title = unescape(this.Data.AssetList[i].Name);
          this.SubItems[i].appendChild(this.SubItems[i].Thumbnail);
          this.SubItems[i].Name = DOM.createElement("div", null, "Name");
          var zName = unescape(this.Data.AssetList[i].Name);
          if (zName.length > 17) {
            zName = zName.substring(0,15) + "...";
          }
          this.SubItems[i].Name.innerHTML = zName;
          this.AssetContainer.appendChild(this.SubItems[i].Name);
          this.SubItems[i].Creator = DOM.createElement("label", null, "Creator");
          this.SubItems[i].Creator.innerHTML = "By: ";
          this.AssetContainer.appendChild(this.SubItems[i].Creator);
          this.SubItems[i].CreatorLink = DOM.createElement("a", null, "Link");
          this.SubItems[i].CreatorLink.href = "http://" + unescape(this.Data.AssetList[i].Creator.URL);
          this.SubItems[i].CreatorLink.innerHTML = unescape(this.Data.AssetList[i].Creator.Name);
          this.AssetContainer.appendChild(this.SubItems[i].CreatorLink);
          this.SubItems[i].Date = DOM.createElement("div", null, "Date");
          this.SubItems[i].Date.innerHTML = unescape(this.Data.AssetList[i].Date);
          this.AssetContainer.appendChild(this.SubItems[i].Date);
          this.SubItems[i].Views = DOM.createElement("div", null, "Views");
          this.SubItems[i].Views.innerHTML = this.Data.AssetList[i].Statistics.Views.Total + " Total Views";
          this.AssetContainer.appendChild(this.SubItems[i].Views);
        }
        if (aData.AssetList.length == 0){
          var zNoRelatedAssets = DOM.createElement("div", null, "NoRelatedAssets");
          zNoRelatedAssets.innerHTML = "There were no " + this.Setup.Title + " found.";
          this.RelatedContainer.appendChild(zNoRelatedAssets);
        }
        if (this.Setup.MoreLink){
          var zMoreLink = DOM.createElement("a", null, "MoreLink");
          zMoreLink.href = this.Setup.MoreLink;
          this.RelatedContainer.appendChild(zMoreLink);
        }
      }
    }
  }
  LiveGroup.SiteModules.AssetListDetails.prototype = new LiveGroup.SiteModules.Module;
  LiveGroup.SiteModules.DatabaseDetails = function(aSetup) {
    this.modname = "DatabaseDetails";
    this.Setup = aSetup;
    this.Container = DOM.createElement("div", null, "RelatedSearches");
    this.SubItems = new Array();
    this.init = function(){
      LiveRequest_MakeRequest(this.Setup.URL, this._build,this);
    }
    this._build = function(aData,aParent) {
      aParent.build(aData);
    }
    this.build = function(aData) {
      this.Data = aData;
      if (aData.DatabaseList.length != 0){
        this.RelatedContainer = DOM.createElement("div", null, "RelatedContainer");
        this.Container.appendChild(this.RelatedContainer);
        this.Title = DOM.createElement("div", null, "Title");
        this.Title.innerHTML = this.Setup.Title;
        this.RelatedContainer.appendChild(this.Title);
        for (var i=0; i < this.Data.DatabaseList.length; i++){
          this.AvatarContainer = DOM.createElement("a", null, "AvatarContainer");
          this.AvatarContainer.href = unescape(this.Data.DatabaseList[i].DatabaseURL);
          this.RelatedContainer.appendChild(this.AvatarContainer);
          this.Avatar = new Image();
          this.Avatar.src = unescape(this.Data.DatabaseList[i].AvatarURL);
          this.Avatar.title = unescape(this.Data.DatabaseList[i].Name);
          this.Avatar.alt = unescape(this.Data.DatabaseList[i].Name);
          this.AvatarContainer.appendChild(this.Avatar);
        }
      } else {
        $(this.Setup.ContainerID).style.display = 'none';
      }
    }
  }
  LiveGroup.SiteModules.DatabaseDetails.prototype = new LiveGroup.SiteModules.Module;
  LiveWebsite.Modules.AreaLink = new Object();
  LiveWebsite.Modules.AreaLink.Module = function() {
    this.Container = DOM.createElement('div',null,'AreaLink');
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.Container.id = this.Id;
      this.Link = DOM.createElement('a',null,'AreaLink');
      if (this.Title) {
        this.Link.innerHTML = this.Title;
      }
      this.Link.href= this.URL;
      this.Container.appendChild(this.Link);
    }
  }
  LiveWebsite.Modules.AreaLink.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Modules.PayPal = new Object();
  LiveWebsite.Modules.PayPal.Module = function() {
    this.Container = DOM.createElement('div',null,'PayPalContainer');
    this.init = function() {
      this.build();
    }
    this.build = function() {
      this.Form = DOM.createElement('form',null,'PayPalForm');
      this.Form.action = 'https://www.paypal.com/cgi-bin/webscr';
      this.Form.method = 'post';
      this.Container.appendChild(this.Form);
      var zCMD = DOM.createElement('input');
      zCMD.type = 'hidden';
      zCMD.name = 'cmd';
      zCMD.value = '_s-xclick';
      this.Form.appendChild(zCMD);
      var zImageInput = DOM.createElement('input');
      zImageInput.type = 'image';
      zImageInput.src = 'https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif';
      zImageInput.border = '0';
      zImageInput.name = 'submit';
      zImageInput.alt = 'Make payments with PayPal - its fast, free and secure!';
      this.Form.appendChild(zImageInput);
      var zImage = new Image();
      zImage.src = 'https://www.paypal.com/en_US/i/scr/pixel.gif';
      zImage.width = '1';
      zImage.height = '1';
      this.Form.appendChild(zImage);
      var zEncryptionInput = DOM.createElement('input');
      zEncryptionInput.type = 'hidden';
      zEncryptionInput.name = 'encrypted';
      zEncryptionInput.value = '-----BEGIN PKCS7-----MIIHVwYJKoZIhvcNAQcEoIIHSDCCB0QCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAnMq/hNbeCAesVNPFqF9LsUHhAhdt2czTVQQ0/5h2W8xK1O5eIn6G3cAO4GVrrBTgXxiodWnVmZDTIWEbnqbkBiHkoFIKY4AbVp5vf8iHUIA6CVJsDAYDjIYgNHjPLTX+ROzI35Zb1MrtJqUvkQAXWz2SCfadyp8F66PGZClQ/mjELMAkGBSsOAwIaBQAwgdQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIZjK7/7wEl4iAgbBlVQkIntBwDBLJCB+vTHBJc6811BD17kkuflV4N1shKAB6HeB0hF8+zx3tqbDk8uxemqwmcHCwa3NDd1glkulM1AuHbGnqLkb8I3idh1tOxMVmHsEfUeEDtukS48MO+01GsgMpbKsSNvXZd+hHl6WVWKca0Cjfa4YXfXc3CYKOHcVVytPGoAiJm9IXACizb4WTod5b3r4fT4cBqTKieSixGxbG3eXeOG2LInD1Tzb5SqCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA4MDMxMDE0MjA0N1owIwYJKoZIhvcNAQkEMRYEFPHOCL1ZpwwGkptXGPnnMUJ+Qh65MA0GCSqGSIb3DQEBAQUABIGAAO1b8wU4Y9NMJGJMDlA7Lhv+bmUB20KLQ623QciyKLRSb6a/d4clT6oDLdLoCedMxf2wa1wIqJmF7Ur4VGVVAm5Mk+DTXsz4/Xrrrnw32rXXsjBGX6kFVfUmrfYVsdPLEXCebZMEOII937jRZ44rTYkv0EX+UrB0ZEYCR/oodAY=-----END PKCS7-----';
      this.Form.appendChild(zEncryptionInput);
    }
  }
  LiveWebsite.Modules.PayPal.Module.prototype = new LiveWebsite.Modules.MainClass;
  LiveWebsite.Utils = {
    ContainImage: function(aOptions) {
      var zImageAspect = aOptions.ImageWidth / aOptions.ImageHeight;
      var zContainerAspect = aOptions.ContainerWidth / aOptions.ContainerHeight;
      if (zImageAspect < zContainerAspect) {
        var zScalingRatio = aOptions.ImageHeight / aOptions.ContainerHeight;
        aOptions.Image.height = aOptions.ContainerHeight;
        aOptions.Image.style.height = aOptions.ContainerHeight + 'px';
        aOptions.Image.width = aOptions.ContainerHeight * zImageAspect;
        aOptions.Image.style.width = aOptions.Image.width + "px";
      }
      else if (zImageAspect > zContainerAspect) {
        var zHeight = aOptions.ContainerWidth / zImageAspect;
        aOptions.Image.width = (aOptions.ContainerWidth - 2);
        aOptions.Image.style.width = (aOptions.ContainerWidth - 2) + 'px';
        aOptions.Image.height = Math.round(zHeight);
        aOptions.Image.style.height = Math.round(zHeight) + 'px';
        var zMargin = Math.round((aOptions.ContainerHeight - aOptions.Image.height) / 2 - 1);
        aOptions.Image.style.marginTop = aOptions.Image.style.marginBottom = zMargin + "px";
      }
      else {
        aOptions.Image.style.width = aOptions.Image.style.height = aOptions.ContainerWidth + "px";
        aOptions.Image.width = aOptions.Image.height = aOptions.ContainerWidth;
      }
      aOptions.Container.appendChild(aOptions.Image);
    }
  }
