/* site specific scripts */

function siteInit(){
  // Called with the body onload event.
  // Customise according to site requirements.
  //window.onresize = redrawLayout;

  if(document.body.className.indexOf("ForumItem") >= 0){
    adjustAuthorDetails();
    redrawLayout();
  }
}

function getSections() {
  sections = new Array();

  sections[0] = document.getElementById('main-banner');
  sections[1] = document.getElementById('main-left');
  sections[2] = document.getElementById('main-right');
  sections[3] = document.getElementById('page-border');
  sections[4] = document.getElementById('main-content');
  sections[5] = document.getElementById('main-footer');

  return sections;
}

function adjustAuthorDetails() {
  var authorDetails;
  var container;
  var forumReplies = getSubElementByClass(messages, "forumItemContentRow");  
  var messages = new Array();
  var documentDivs = document.getElementsByTagName('div')
  for(var i in documentDivs) {
    if(typeof(documentDivs[i]) == 'object' && documentDivs[i] != null) {
      if(documentDivs[i].className.indexOf('forumItem') > 0 || documentDivs[i].className.indexOf('forumReply') > 0) {
        messages.push(documentDivs[i]);
      }
    }
  }
  for(var i in messages) {
    if(typeof(messages[i]) == 'object' && messages[i] != null) {
      container = getSubElementByClass(messages[i], 'forumMessageContentRow');
      if(typeof(container) == 'object' && container != null) {
        authorDetails = getSubElementByClass(container, 'authorDetails');
        authorDetails.style.height = container.offsetHeight + "px";
      }
    }
  }
}


SIZE_UP_MSG = "Increase text size";
SIZE_DOWN_MSG = "Decrease text size";
