﻿///////////////////////////////////////////////////////////////////////////////
//
//  wcoPageManager.js
//
// © 2007-2011 Wco iEnterprise Solutions Pty Ltd. ALL RIGHTS RESERVED.
// This file is licensed as part of the DataPortal 3.0 Managed Web Presence Solution, for details look here: http://www.wco.com.au
//
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
/*<remarks>
Method:      constructor
Description: Instantiates a new instance of the pageManager object, making it ready to receive and process calls to the DataPortal Web service.
Parameters:  [none]
</remarks>*/
HtmlPageManagerObject = function() {
  
  this.titlebarElement = $('#titlebarElement')[0];
  this.locationListElement = $('#locationListElement')[0];
  this.mainElement = $('#mainElement')[0];
  this.footerElement = $('#footerElement')[0];
  
}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/*<remarks>
  Description: Defines the Class methods.
</remarks>*/
HtmlPageManagerObject.prototype = {
  /*<remarks>
  Method:      init
  Description: Initialises the object's members and runs through any required startup procedures.
  Parameters:  [none]
  </remarks>*/
  init: function() {
    this.mainElement.innerHTML = '';

    // now all the elements have completed loading and are correctly positioned,
    // display the ui
    this.titlebarElement.style.display = 'block';
    this.mainElement.style.display = 'block';
    this.footerElement.style.display = 'block';
    
    // load the store locations
    this.storeLocator = new HtmlStoreLocatorObject(this);
    
    // load the slides
    this.slideshow = new HtmlSlideshowObject(this);

//    // display the temporary home page
//    var html = '<div id="slideshowElement">';
//    html += '<div id="slide0" class="slide">';
//    html += '<img src="ssl/images/VT2011STempHomePage.png" style="width:966px; height:600px;" alt="" />';
//    html += '</div>';
//    html += '</div>';
//    $(this.mainElement).append(html);
//    var slideCss = {
//      'top':'2px',
//      'display':'block'
//    };
//    $('#slide0').css(slideCss);
//  
  }

//  splash: function() {
//    this.titlebarElement.style.display = 'block';
//    this.mainElement.style.display = 'block';
//    this.storeLocator = new HtmlStoreLocatorObject(this);
//    
//    //var html = '<div id="splashElement" style="width:966px; height:397px; margin:60px 0 0 0; background-image:url(\'ssl/images/VT-Warehouse-Ad-2.jpg\'); background-repeat:no-repeat;">';
//    //html += '</div>';
//    var html = '<div id="splashElement" style="padding:30px 0 0 0; cursor:pointer;">';
//    html += '<p style="color:#FFFFFF; font-family:\'Verdana\', \'Arial\'; font-size:12pt;">[CLOSE and continue to Winter 2010 Collection]</p>';
//    html += '<p><img src="ssl/images/VT-Warehouse-Ad-2.jpg" style="width:966px; height:337px; border:0px none" /></p>';
//    html += '<p style="color:#FFFFFF; font-family:\'Verdana\', \'Arial\'; font-size:12pt;">[CLOSE and continue to Winter 2010 Collection]</p>';
//    html += '</div>';
//    var newContent = document.createElement('DIV');
//    newContent.id = 'newContent';
//    newContent.innerHTML = html;
//    newContent.style.display = 'none';
//    var splash = newContent.childNodes[0];
//    
//    this.mainElement.appendChild(splash);
//  
//    splash.onmouseup = function () {
//      positioning.delayStop();
//      pageManager.init();
//    };

//    positioning.delayAction(60000, positioning.createDelegate(this, this.init));
//  }

}

