// JavaScript Document
function setSlideShowWidth()
{
  var windowWidth = null;
  var iSpaceForSlideshow = 10000;
  var iWrapperMargin = 0;

  if (window.innerWidth) 
  {
  // All browsers but IE
    windowWidth = parseInt(window.innerWidth);
	//alert("windowWidth=" + windowWidth);
	iWrapperMargin = parseInt(windowWidth / 20);
	//alert("iWrapperMargin=" + iWrapperMargin);
	iSpaceForSlideshow = windowWidth - 235 - iWrapperMargin;
	//alert("iSpaceForSlideshow=" + iSpaceForSlideshow);
  }
  else if (document.documentElement && document.documentElement.clientWidth)
  {
  // IE 6 when there is a DOCTYPE
    windowWidth = document.documentElement.clientWidth;
	windowWidth -= 27; //width of scrollbar
	iWrapperMargin = parseInt(windowWidth / 20);
	iSpaceForSlideshow = windowWidth - 235 - iWrapperMargin;
	//alert("window.document.documentElement.clientWidth=" + windowWidth);
  }
  else if (document.body.clientWidth)
  {
  // IE4, IE5, and IE6 without a DOCTYPE
    windowWidth = document.body.clientWidth;
	windowWidth -= 27; //width of scrollbar
	iWrapperMargin = parseInt(windowWidth / 20);
	iSpaceForSlideshow = windowWidth - 235 - iWrapperMargin;
	//alert("document.body.clientWidth=" + windowWidth);
  }
  
  //How may slides will fit in the available width?
  var iSlidesThatWillFit = parseInt(iSpaceForSlideshow / 200);
  //alert("iSlidesThatWillFit=" + iSlidesThatWillFit);
  var iPixelsForWidth = iSlidesThatWillFit * 200;
  //alert("iPixelsForWidth=" + iPixelsForWidth);

  var sWidthToSet = "" + (iSlidesThatWillFit * 200) + "px";
  var elementHandle = document.getElementById("slideshow");
  elementHandle.style.width = sWidthToSet;
  //alert("slideshow elementHandle.style.width is now " + elementHandle.style.width);
  elementHandle = document.getElementById("slideshowIntro");
  elementHandle.style.width = sWidthToSet;
  //alert("slideshowIntro elementHandle.style.width is now " + elementHandle.style.width);

  return windowWidth;
}