Content = new (function() {
   var _hash, _currentMovie = undefined, _this = this, _flashObject = undefined, _docReady = false;
   
   _this.constructor = undefined;
   
   _this.setPageTitle = function(key, obj) {
      Utils.log('deprecated setPageTitle() called in Content.js');
      var p;
      
      if(typeof obj == 'string')
         p = obj;
      else if((typeof obj == 'object') && (typeof obj.innerHTML == 'string'))
         p = obj.innerHTML;
      else
         p = 'Live it';
      
      Utils.log('setPageTitle:'+ p);
      document.title = p.replace('&amp;', '&');
   }
   
   _this.show = function(id) {
      alert('deprecated show('+ id +') called in Content.js');
   }
   
   _this.showBox = function(mode) {
      Utils.log('deprecated showBox('+ mode +') called in Content.js');
   }

   _this.loadMovie = function(url) {
      if((url === undefined) && (_currentMovie === undefined))
         return;

      if((url !== undefined) && (_currentMovie === url))
         return;
      
      _currentMovie = url ? url : _currentMovie;
      
      if(_docReady == false)
         return;
      
      try {
         swfobject.embedSWF(_currentMovie, 'flashObject', '655', '225', '9.0.0', 'expressInstall.swf',
               {}, { wmode: 'transparent' }, {} );
      }
      finally {
      }
   }
   
   _this.showProduct = function(id) {
      Utils.log('deprecated showProduct('+ id +') called in Content.js');
   }

   _this.showCategory = function(id, obj) {
      Utils.log('deprecated showCategory('+ id +', '+ obj.href +') called in Content.js');
      location = obj.href;
   }
   
   _this.load = function(options) {
      
      /* This is the old, deprecated, way. */
      if ((typeof options != 'object'))
      {
         Utils.log('Content.load('+ options +') called in Content.js');
         location = options;
         return;
      }
      
      Utils.log('Content.load('+ options.url +') called in Content.js');
      
      location = options.url;
      return;
   }

   this.redrawRight = function() {
      var html;
      
      html  = '';
   
      var img = Cart.hasGiftVoucher() ? '/images/kuvert.jpg' : '/images/liveitbox_frontpage.jpg';
      
      html += '<img style="display:block;margin-left:auto;margin-right:auto;margin-bottom:10px;" src="' + 
                  img + '" style="margin-left: 10px; margin-top: 10px;"/>';
      
      html +=
         '<div class="tS" style="width:170px;">' +
         '<ul>';
      
      if (Cart.hasGiftVoucher() == false)
         html += '<li>Förpackad i en Live it-box</li>';
      
      html +=
         '<li>1 års giltighetstid</li>' +
         '<li>Fri bytesrätt</li>' +
         '<li><a href="/forsakring">Försäkring</a> ingår i Sverige</li>' +
         '<li>Express fram till 15.00</li>' +
         '<li>Kan hämtas i vår butik</li>' +
         '<li>Kundtjänst 6 dagar i veckan</li>' +
         '</ul>' +
         '</div>';
      
      $('#lg #productBanners').html(html);
   }
   
   $('document').ready(function() {
      _docReady = true;
      
      var matches;
      
      if((matches = location.hash.match(/^#(?!s=s)(.*)$/)) != null) {
         Content.load(matches[1]);
      }
   
      else {
         _this.loadMovie();
      }
   });
   
   
});



