<!--
//bg_image.js
//copyright Andrew Rule, 2010

//works in Gecko bassed browsers, up to Moz 1.6, Gecko/20040413 at least.
//Then Gecko/20040626 puts a hor. scroll on pages with a vertical scroll. 
//(v. little movement on scrollbar)
//Gecko/20040614 puts a smaller hor. scroll (no movement on scrollbar)

//Works for IE5.1:mac but the width and height found include the scrollbars.
//(Therefore you always scroll the width of the scrollbars.)

//IE 5+ on windows needs to leave a 9px gap at the bottom!!
//It also won't make the width smaller on resize. 
//(But is otherwise OK, though slow.)
//IE 6 - now resize bug workaround implemented, it works.
//but resizeing down in size doesn't work properly.

//Safari & Konq 3.2 - OK, but height is content height (not window) until
//you resize the window.  Then it springs to fit!
//won't position footer right, and Safari doesn't respect RH border for text
//and resize shrinks the bg image shockingly

//Konq 3.1 - PNGs OK, but degrades for background sizing.

//Opera 7 - Works, but not for horizontal scroll - then imgs just window width

//Browser Detection********************************************

function stringToVerNum(Str)
{
  var verArr = Str.split('.',5);
  if (verArr.length < 1)
  {
    alert('cannot parse version');
    this.major = 0;
  }else{
    if (verArr.length >= 1)
    { this.major = verArr[0]; }
    if (verArr.length >= 2)
    { this.minor = verArr[1]; }
    if (verArr.length >= 3)
    { this.revision = verArr[2]; }
  }
}

function IsGt(That)
{
  //this is Greater Than that
  if (this.major > That.major)
  { return true; }
  else
  {
    if (this.major < That.major)
    { return false; }
    else
    {
      if (this.minor == That.minor)
      {
        if (this.revision > That.revision)
        { return true; }
        else
        { return false; }
      }
      else
      {
        if (this.minor > That.minor)
        { return true; }
        else
        { return false; }
      }
    }
  }
}

function IsGtEq(That)
{
  //this is Greater Than or equal to that
  if (this.major < That.major)
  { return false; }
  else
  {
    if (this.major > That.major)
    { return true; }
    else
    {
      if (this.minor == That.minor)
      {
        if (this.revision >= That.revision)
        { return true; }
        else
        { return false; }
      }
      else
      {
        if (this.minor > That.minor)
        { return true; }
        else
        { return false; }
      }
    }
  }
}

function IsGtEqStr(thatStr)
{
  var TmpVerNum = new VersionNum();
  TmpVerNum.stringToVersionNum(thatStr);
  return this.gtEq(TmpVerNum);
}

function IsGtStr(thatStr)
{
  var TmpVerNum = new VersionNum();
  TmpVerNum.stringToVersionNum(thatStr);
  return this.gt(TmpVerNum);
}

function VerNum2Str()
{
  return this.major + "." + this.minor + "." + this.revision;
}

function VersionNum()
{
  //object properties
  this.major = 0;
  this.minor = 0;
  this.revision = 0;
  //define method
  this.stringToVersionNum = stringToVerNum;
  this.toString = VerNum2Str;
  this.gt = IsGt;
  this.gtEq = IsGtEq;
  this.gtStr = IsGtStr;
  this.gtEqStr = IsGtEqStr;
}

function getVerStr(Str,prefix)
{
  var verStrA, idx, subStr;
  idx=Str.indexOf(prefix);
  subStr = Str.substring(idx);
  regExp1 = new RegExp('[0-9]+[0-9\.]*','i');
  verStrA = subStr.match(regExp1);
  if (verStrA == null) { alert('cannot get version'); return "0"; }
  else { 
    //test
    return verStrA[0];
  }
}

var versionNum = new VersionNum();
var versionStr;
var IE5plus, geckoPos, gecko, konq, IE5mac, Opera7plus, Safari, IE55plus, IE6, IE;
var iePos, operaPos, konqPos, konq3_2plus, gecko14plus, Windoze, rvPos, NN;
var konq3_3plus;

geckoPos = navigator.userAgent.toLowerCase().indexOf('gecko/');
gecko = ((!document.all && !window.opera && document.getElementById)
         &&(geckoPos != -1));
if (gecko)
{
  rvPos = navigator.userAgent.indexOf('rv:');
  versionStr = getVerStr(navigator.userAgent, 'rv:');
  versionNum.stringToVersionNum(versionStr);
}
gecko14plus = (gecko && (versionNum.gtStr("1.4")));  //rv > 1.4
iePos = navigator.userAgent.toLowerCase().indexOf('msie');
IE = ((iePos != -1)&&
      (navigator.userAgent.toLowerCase().indexOf('opera') == -1));
if ((iePos !=-1)&&(IE))
{
  versionStr = getVerStr(navigator.userAgent, 'MSIE ');
  versionNum.stringToVersionNum(versionStr);
}
IE5plus = (IE && (versionNum.major >= 5));
IE55plus = (IE5plus && (versionNum.gtStr("5.5")));
IE6 = (IE55plus && (versionNum.major == 6));
IE5mac = (IE5plus && (navigator.userAgent.toLowerCase().indexOf('mac') != -1));
operaPos = navigator.userAgent.toLowerCase().indexOf('opera');
if (operaPos !=-1)
{
  versionStr = getVerStr(navigator.userAgent, 'Opera');
  versionNum.stringToVersionNum(versionStr);
}
Opera7plus = (((operaPos != -1)&&(versionNum.major >= 7))||
              (window.opera && document.createComment));
Opera8plus = (Opera7plus && (versionNum.major >= 8));
konqPos = navigator.userAgent.toLowerCase().indexOf('konq');
if (konqPos != -1)
{
  KHTMLPos = navigator.userAgent.indexOf('KHTML/');
  if (KHTMLPos != -1)
  { 
    versionStr = getVerStr(navigator.userAgent, 'KHTML');
    versionNum.stringToVersionNum(versionStr);
  }
  else
  {
    versionStr = getVerStr(navigator.userAgent, 'Konqueror');
    versionNum.stringToVersionNum(versionStr);
  }
}
konq = (konqPos != -1);
konq3_2plus = ((konq)&&(versionNum.gtStr("3.2")));
konq3_3plus = ((konq)&&(versionNum.gtStr("3.3")));
Safari = (navigator.userAgent.toLowerCase().indexOf('safari') != -1);
AppleWebKitPos = navigator.userAgent.toLowerCase().indexOf('applewebkit');
if (AppleWebKitPos != -1)
{
  versionStr = getVerStr(navigator.userAgent, 'AppleWebKit/');
  versionNum.stringToVersionNum(versionStr);
  AppleWebKit = true;
} else { AppleWebKit = false; }
NN = ((! Safari)&&(operaPos == -1)&&(konqPos == -1)&&(iePos == -1)&&(! gecko)&& document.layers);
if (NN)
{
  versionStr = getVerStr(navigator.userAgent, 'Mozilla');
  if (! versionStr.match('[0-9]+\.[0-9][0-9]')) { versionStr = versionStr.concat("0"); }
  versionNum.stringToVersionNum(versionStr);
}
Windoze = (navigator.platform.match(/win/i));
//End Browser Detection*****************************************

var e, bg_name, concertDates;

//Need to check resize event for IE!!
var g_PrevWinSize = WindowDimensions();

function positionBg(e,bg_name,concertDates)
{
  //Also stretches the lines across the page.
  var bg, content, nav, lines, bodyHeight, windowHeight, height, bodyWidth, windowWidth, width, footer;
  var leftSpace = 51; //white border:50, 1px bg border
  var topSpace = 11; //white border:10, 1px bg border
  var leftBorder = 50;
  var topBorder = 10;//values must match style sheet

  if ((! e)&&(window.event))
  {
    e = window.event;
  } 

  //Find html elements we need
  if ( document.getElementById )
  {
    bg = document.getElementById('bg');
    content = document.getElementById('content');
    nav = document.getElementById('nav');
    lines = document.getElementById('lines');
    footer = document.getElementById('footer');
  }
  else if ( document.all )
  {
    bg = document.all['bg'];
    content = document.all['content'];
    nav = document.all['nav'];
    lines = document.all['lines'];
    footer = document.all['footer'];
  }
  else
    return true;

  if ( IE5plus )
  {
    //document.getElementById('topQuote').style.marginLeft = (leftSpace + 1) +"px";
    if ( ! ( ( IE && ( versionNum.major >= 6 ) ) || IE5mac ) )
    {
      if ( concertDates )
      {
        content.style.width = "80%";
	if (document.getElementById('skills'))
	  document.getElementById('skills').style.right = leftBorder+"px";
      }
      if ( document.getElementById('ie_spacer') )
      {
        document.getElementById('ie_spacer').style.display = "none";
      }
      
      if (document.getElementById('footerSpacer'))
      {
        var fspacer=document.getElementById('footerSpacer');
	var fscopy = fspacer.cloneNode(1);
        var dad = fspacer.parentNode;
        dad.removeChild(fspacer);
        document.body.insertBefore(fscopy,footer);
      }
    }
    else
    {
      if ((! IE5mac)&&(document.getElementById('topQuote')))
        document.getElementById('topQuote').style.marginTop = "7px";
    }
  }

  //Hack for Safari, Konq, Opera and IE5+ - which doesn't do resize for another reason - line 91
  if (((konq||Safari||window.opera||IE5plus)&&(e.type.toString() == 'resize'))&&(!konq3_3plus)&&(!(window.opera &&((versionNum.gtEqStr("9"))||window.getSelection )))
      &&(!(AppleWebKit &&(versionNum.gtEqStr("522.11.3"))))) //522.11.3 is OK (Safari 3.0)
  {
    //because it always sizes only to the window size not the document size
    //Can we find out the real document size in konq/Safari?
    //konq 3.3.2 /sometimes/ works properly, but not always!
    //Opera 8 still doesn't do it.  Opera 9 does though!
    var CurrentWinSize = WindowDimensions();
    if ((CurrentWinSize[0] != g_PrevWinSize[0])||(CurrentWinSize[1] != g_PrevWinSize[1]))
    {
      //a real resize event.
      g_PrevWinSize = CurrentWinSize;
    }
    else
    {
      //not a real resize event.
      return true;
    }
    if (! (IE && versionNum.gtEqStr("6")))
      return true; //drop out if not IE 6 or above
  }
  else if (konq3_3plus && (e.type == "resize"))
  {
    //works NOT (resize) for: 
    //Songs/CD.shtml, Songs/index.shtml, Profiles/*, recruitment.shtml, 
    //Concerts/concertdates.shtml, site_map.shtml, privacy_policy.shtml

    //Konq 4.3.2: recruitment.shtml and privacy_policy.shtml work if resize is getting bigger.  Can I code for that??
    if ((document.URL.indexOf('Profiles/') != -1) ||
        (document.URL.indexOf('Songs/') != -1) || (document.URL.indexOf('recruitment.shtml') != -1) ||
        (document.URL.indexOf('Concerts/concertdates.shtml') != -1) ||
        (document.URL.indexOf('site_map.shtml') != -1) || (document.URL.indexOf('privacy_policy.shtml') != -1))
    {
      return true;
    }
  }

  if (konq3_2plus||Safari)
  {
    if (document.getElementById('footerSpacer'))
    {
      document.getElementById('footerSpacer').style.height = "0em";
    }
  }

  //Hack for old gecko
  if (gecko && (!gecko14plus))
  {
    if (document.getElementById('footerSpacer'))
    {
      document.getElementById('footerSpacer').style.height = "2.9em";
    }
  }

  //Hack for Opera 7
  if (Opera7plus || IE5mac)
  {
    if (document.getElementById('footerSpacer'))
    {
      document.getElementById('footerSpacer').style.height = "3.5em";
    }
  }

  //Start of trying to position the background: prepare
  if ( bg.setAttribute || bg.style )
  {
    if (gecko || IE5plus || Opera7plus || Safari || konq3_2plus || AppleWebKit)
    {
      if ( bg.style.position )
        bg.style.position = "absolute";
      else if ( bg.setAttribute )
        bg.setAttribute('style', "position: absolute;");
      if ( bg.style.margin )
        bg.style.margin = "0";
      else if ( bg.style.marginTop )
      {
        bg.style.marginTop = "0";
        bg.style.marginLeft = "0";
        bg.style.marginRight = "0";
        bg.style.marginBottom = "0";
      } 
      else if ( bg.setAttribute )
        bg.setAttribute('style', "position: absolute; margin: 0;");

      if ( bg.setAttribute )
        bg.setAttribute('src', bg_name+"_bg_big.jpeg");

      if ( document.body.style )
      {
        //Tries to remove old background.  Fails?
        document.body.style.backgroundImage = "none";
      }
    }
    else
    {
      //try to set the background image for the body tag (fallback)
      if ( document.body.style )
      {
        document.body.style.backgroundImage = "url("+bg_name+"_bg_big.jpeg)";
        document.body.style.backgroundRepeat = "no-repeat";
        document.body.style.backgroundPosition = "50% 50%";
      }
    }

    var dimensions = WindowDimensions();
    windowWidth = dimensions[0];
    windowHeight = dimensions[1];

    //Hack for new gecko <shrug>!!!
    if (gecko && versionNum.gtEqStr("1.6") )
    {
      var D;
      D = DocumentDimensions();
      if ( windowHeight < D[1] )
      {
        windowWidth = windowWidth - 4;   //Stops hor. scroll when there shouldn't be on resize.
        if ( Windoze ) //windows has windows has wider scroll bars
        {
          windowWidth = windowWidth - 2;
        }
      }
      windowHeight = windowHeight - 2; //Stops there being a vert. scroll when there shouldn't be on resize.
    }

    //Set bg image to window size so document will never be
    //longer than it should on account of the image alone.
    //(Allows resizeing image to work when window gets smaller.)
    if (gecko || IE5plus || Opera7plus || Safari || konq3_2plus || AppleWebKit)
    {    
      bg.style.width = (windowWidth - (2*leftBorder))+ "px"; //was windowWidth
      bg.style.height = (windowHeight - (2*topBorder)) + "px";//was windowHeight
      if ( footer.style && content.style )
      {
        footer.style.bottom = topSpace+"px";
        footer.style.width = (windowWidth - (2*leftSpace + 20)) + "px";
        content.style.width = windowWidth - leftSpace + "px";
        //footer.style.right = leftSpace"px";
      }
      if ( lines )
        lines.style.width = windowWidth + "px";
    }

    //Hack so IE5+ gets right bodyHeight
    //cos if changing width of content changes height of body
    //can get text flowing off background (eg. Profiles)
    //done for gecko by recalculating doc height
    if ((! gecko) && content.style)
    {
      //Doesn't quite do the trick for Konqueror
      //(Only affects "profiles" page)
      content.style.top = topSpace+"px";
      content.style.left = "0px";
      content.style.width = (windowWidth - leftSpace) + "px";
      if ((IE && (versionNum.gtEqStr("6"))) && (document.documentElement.scrollWidth < 700) && (document.URL.indexOf('Profiles/index.shtml') != -1))
      {
        content.style.width = 
          document.documentElement.scrollWidth - (2*leftBorder + 20) + "px";
      }
    }

    //Find document measurements.
    dimensions = DocumentDimensions();
    bodyWidth = dimensions[0];
    bodyHeight = dimensions[1];

    //Hack for new gecko <shrug>!!!
    if (gecko && versionNum.gtEqStr("1.6"))
      bodyWidth = bodyWidth - 4;

    //hack - konq 3.2, privacy_policy.shtml ?Safari?
    if ((konq3_2plus)&&(document.URL.indexOf('privacy_policy.shtml')!=-1))
      bodyHeight = bodyHeight + 23;

    if ( bodyHeight > windowHeight )
      height = bodyHeight;
    else
      height = windowHeight;

    if ( bodyWidth > windowWidth )
      width = bodyWidth;
    else
      width = windowWidth;

    //Start laying out the page
    if (gecko || IE5plus || Opera7plus || Safari || konq3_2plus || AppleWebKit)
    {
      //common stuff for browsers that can cope
      if ( ! ( IE5plus||IE5mac ) )
      {
        //to give bottom big border on gecko
        document.documentElement.style.marginBottom = topBorder+"px";
        //This, however, doesn't work for Opera 7
      }
//These two now in style sheet.
//      bg.style.top = topBorder+"px";//was 0px
//      bg.style.left = leftBorder+"px";//was 0px
      if ( IE5plus )//works in IE5 win, IE6
      {
        bg.style.marginTop = topBorder+"px";
	bg.style.marginLeft = leftBorder+"px";
	bg.style.top = "0";
	bg.style.left = "0";
      }
      if ( content.style && document.getElementById )
      {
        content.style.position = "absolute";
        content.style.top = topSpace+"px";
        content.style.left = "0px";
        if (IE5plus)
        {
          if ((IE && (versionNum.gtEqStr("6"))) && (document.documentElement.scrollWidth < 700) && (document.URL.indexOf('Profiles/index.shtml') != -1))
          {
            content.style.width = 
              document.documentElement.scrollWidth - (2*leftBorder+20) + "px";
          }
          else
            content.style.width = (width - leftSpace) + "px";
        }
        else
        {
          if (bodyHeight > windowHeight)
          {
            content.style.width = (width - (leftSpace + 10)) + "px";
          }
          else
            content.style.width = (width - leftSpace) + "px";
        }
      }
      else if ( content.setAttribute )
        content.setAttribute('style',
	"position: absolute; top: 11; width: "+(width-leftSpace)+"px; left: 0;");

      //Re-calculate document height in case increased!
      dimensions = DocumentDimensions();
      if ( dimensions[1] > bodyHeight )
      {
        bodyHeight = dimensions[1];
        if ( bodyHeight > windowHeight )
          height = bodyHeight;
        else
          height = windowHeight;
      }

      //The background:
      bg.style.display = "block";

      if (IE5plus && ! IE5mac)
      {
        //IE for Win has issues with the height!
        bg.style.height = (height - (2*topBorder)) + "px";
	bg.style.width = (width - 2*leftBorder) + "px"; //works but fails to get smaller

	if ( versionNum.major < 6 )
          footer.style.width = (width - 10) + "px";//Right for IE 5
        else if ( versionNum.gtEqStr("6") )
        {
          footer.style.width = (width - (10 + 2*leftBorder)) + "px";//Right for IE6
        }

	if ((bodyHeight - windowHeight)>0)
        {
          if ((IE && (versionNum.gtEqStr("6"))) && (document.documentElement.scrollWidth < 700) && (document.URL.indexOf('Profiles/index.shtml') != -1))
            footer.style.bottom = 
	      (((bodyHeight-windowHeight)*-1) +25) + "px";
          else
	    footer.style.bottom = 
	      (((bodyHeight-windowHeight)*-1) +11) + "px";
        }
	else
	  footer.style.bottom = topSpace+"px";

	if ( lines )
	{
	  lines.style.width = width + "px";
	}
      }
      else
      {
        //Why topSpace here, not topBorder??
        if ((! window.opera)|| (versionNum.gtEqStr("7")))
          bg.style.height = (height - 2*topSpace) + "px";
        else
        {
          bg.style.height = (height -topSpace) + "px";
        }
        //cos width includes scrollbar width!!
        if (bodyHeight <= windowHeight)
        {
          bg.style.width = (width - 2*leftBorder) + "px";
          footer.style.width = (width - (2*leftBorder + 10)) + "px";
        }
        else
        {
	  bg.style.width = (width - (2*leftBorder + 10)) + "px";
          //17 should be for gecko
          footer.style.width = (width - (2*leftBorder + 19)) + "px";
        }

	if (bodyHeight > windowHeight)
        {
          if (IE5mac)
          {
	    //Would set footer.style.bottom, but 
	    //we have trouble with -ve values.
	    //Would set 
	    //footer.style.position = "inline";
	    //But it errors, and works without.
          }
          else
	  {
            footer.style.bottom = 
	      (((bodyHeight-windowHeight)*-1) +11) + "px";
	  }
          //This is a shocking HACK! OK on FB @ school, check @ home
	  if ((width == bodyWidth)&&(width != windowWidth)&& gecko && (versionNum.gtEqStr("1.6")))
	  {
	    footer.style.bottom = 
              (((bodyHeight-windowHeight)*-1) +23) + "px";
	  }
        }
	else
	{
          if ((konq||Safari)&&(! konq3_4plus))
            footer.style.bottom = "32px";
          else
	  {
	    if (IE5mac)
	      footer.style.bottom = "6px";
	    else
	      footer.style.bottom = topSpace+"px";
	  }
        }

        if ( lines )
	  lines.style.width = width + "px";
      }
    }

    //Another issue, Konq and IE leave too much space at the top!
    if (IE5plus)
        content.style.margin = "0 0 0 0";
    else if ( (konq)&&(! konq3_2plus) )
    {
        content.style.marginTop = "-1.1em";
    }
  }

  return true;
}

function swapGifToPng(colour, path)
{
  var navUl;
  //Tried it with IE 5:mac, and it doesn't display well.
  //Only for screens with a good few colours...
  if ((gecko || konq || Opera7plus || Safari || AppleWebKit || ( IE && (versionNum.gtEqStr("7")) ) )&&((screen.colorDepth > 8)||(gecko && screen.colorDepth > 7)))
  {
    if ( document.getElementById )
      navUl = document.getElementById('nav');
    else if ( document.all )
      navUl = document.all['nav'];
    if ( navUl.hasChildNodes() )
    {
      var i;
      for (i=0;i<navUl.childNodes.length;i++)
      {
        if (navUl.childNodes[i].nodeName.toLowerCase() == 'li')
        {
          if ( navUl.childNodes[i].style )
            navUl.childNodes[i].style.backgroundImage = "url("+path+colour+"_link_bg.png)";
          else if ( navUl.childNodes[i].setAttribute )
            navUl.childNodes[i].setAttribute('style','background-image: url("+path+colour+"_link_bg.png);');
        }
      }
    }
  }

  return true;
}

function maybeBigChoirImg()
{
  var windowWidth;

  //Find Window measurements.
  var dimensions = WindowDimensions();
  if (( dimensions[0] == 0 )|| IE5mac) //IE5mac won't display bg after resizing choir pic!
    return true;
  else
    windowWidth = dimensions[0];

  if ((IE5plus) && (document.getElementById) && (versionNum.gtEqStr("6")))
  {
    document.getElementById('LHcol').style.position = "static";
    document.getElementById('allTheChoir').style.zIndex = "-1";
  }
  if ( document.images && ( parseInt(windowWidth) > 857 ) )
  {
    var i;
    for (i = 0; i < document.images.length; i++)
    {
      if ( ( document.images[i].src.indexOf('allTheChoir') != -1 ) &&
           ( document.images[i].complete ) )
      {
        document.images[i].width = 592;
        document.images[i].height = 290;
	document.images[i].useMap = "#mapBig";
	document.images[i].setAttribute("usemap", "#mapBig");
	if ((document.getElementById)&&(document.getElementById('spacer')))
          document.getElementById('spacer').style.height = "275px";
	//if (IE5plus)
	  //document.getElementById('allTheChoir').style.top = "198px";
      }
    }
  }
  else if ( document.images && ( parseInt(windowWidth) <= 857 ) )
  {
    var i;
    for (i = 0; i < document.images.length; i++)
    {
      if ( ( document.images[i].src.indexOf('allTheChoir') != -1 ) &&
           ( document.images[i].complete ) )
      {
        document.images[i].width = 533;
        document.images[i].height = 261;
	document.images[i].useMap = "#mapSmall";
	document.images[i].setAttribute("usemap", "#mapSmall");
	if ((document.getElementById)&&(document.getElementById('spacer')))
          document.getElementById('spacer').style.height = "246px";
	//if (IE5plus)
          //document.getElementById('allTheChoir').style.top = "187px";
      }
    }
  }

  return true;
}

function WindowDimensions()
{
    var windowWidth, windowHeight;
    //Find Window measurements.
    //These also should not include scrollbars
    if( typeof( window.innerWidth ) == 'number' )
    {
      windowHeight = window.innerHeight;
      windowWidth = window.innerWidth;
    }
    else if ( document.documentElement && (! window.opera) && 
              ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
      windowHeight = document.documentElement.clientHeight;
      windowWidth = document.documentElement.clientWidth;
    }
    else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
      windowHeight = document.body.clientHeight;
      windowWidth = document.body.clientWidth;
    }
    else
    {
       windowWidth = 0;
       windowHeight = 0;
    }
    return new Array(windowWidth, windowHeight);
}

function DocumentDimensions()
{
  var bodyWidth, bodyHeight;

  //For Gecko (newer than 1.4, anyway), *bodyHeight*
  //includes the scrollbar (but width doesn't)  Check these carefully.

  //bodyHeight and bodyWidth do *NOT* want to include scrollbar widths.
  if (( document.documentElement && document.documentElement.scrollHeight )&&
      (( ! (IE5plus) )||( (IE && (versionNum.gtEqStr("6"))) ))&&(! (AppleWebKit || konq3_2plus)) )
  {
    //IE6, Gecko, konq, Opera 7+
    if (IE6 &&(document.compatMode=='CSS1Compat'))
    {
      bodyHeight = document.documentElement.scrollHeight;
      bodyWidth = document.documentElement.scrollWidth;
    }
    else if (IE6)
    {
      bodyHeight = document.body.scrollHeight;
      bodyWidth = document.body.scrollWidth;
    }
    else
    {
      bodyHeight = document.documentElement.scrollHeight;
      bodyWidth = document.documentElement.scrollWidth;
    }
//    if ( ( IE6 ) && ( window.event.type == "load" ) ) //only for onload.
//      bodyHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
  }
  else if (( document.body.scrollHeight )&&(! (IE5mac)) )
  {
    //IE5, IE5.5, AppleWebKit konq3_2plus - 
    //well, I assume Konq will use this when it works, as it is so similar to AppleWebKit
    bodyHeight = document.body.scrollHeight;
    bodyWidth = document.body.scrollWidth;
  }
  else if ( document.documentElement.offsetHeight )
  {
    //IE5mac
    bodyHeight = document.documentElement.offsetHeight;
     // - document.body.clientHeight + document.getElementById('footer').offsetHeight;
    bodyWidth = document.documentElement.offsetWidth;//maybe content.offsetWidth better?
  }
  else if ( document.body.offsetHeight )
  {
    //Opera ? v6?
    bodyHeight = document.body.offsetHeight;
    bodyWidth = document.body.offsetWidth;
  }
  else if ( document.height )
  {
    bodyHeight = document.height;
    bodyWidth = document.width;
  }

  return new Array(bodyWidth,bodyHeight);
}

//-->
