function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its Id
    if(document.getElementById && document.getElementById(objectId)) {
        // W3C DOM
        return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
        // MSIE 4 DOM
        return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
        // NN 4 DOM.. note: this won't find nested layers
        return document.layers[objectId];
    } else {
        return false;
    }
} // getStyleObject

function closeDiv(CloseDivId)
{
  var the_style = getStyleObject(CloseDivId);
  the_style.display = "none";
} // closeDiv

function toggleDisplay(toggleDisplay, toggleId) {
    var theStyle = getStyleObject(toggleId);
    switch (toggleDisplay) {
        case 'on' : theStyle.display = 'block';
        break
        case 'off' : theStyle.display = 'none';
        break
        default : if (theStyle.display=='block'){theStyle.display = 'none';} else {theStyle.display = 'block';} // swap
	}
} // toggleDisplay

function getWindowWidth() {
    var adjustWidth = 0;
    if (isIE) {adjustWidth = 7};
    if (isWindows && isFox) {adjustWidth = -12};
    if (isMac && isFox) {adjustWidth = -5};
    if (isSafari) {adjustWidth = -7};
    if (typeof( window.innerWidth ) == 'number' ) {
      // W3C and others
      return (window.innerWidth + adjustWidth );
    } else if (document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      // IE 6 in 'standards compliant mode'
      return (document.documentElement.clientWidth + adjustWidth) ;
    } else if (document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      // IE 4
      return (document.body.clientWidth + adjustWidth);
    } else { return 750;}
} // getWindowWidth

function getWindowHeight() {
    var adjustHeight = 0;
//    if (isIE) {adjustHeight = 7};
//   if (isWindows && isFox) {adjustHeight = -12};
//    if (isMac && isFox) {adjustHeight = -5};
//    if (isSafari) {adjustHeight = -7};
    if (typeof( window.innerHeight ) == 'number' ) {
      // W3C and others
      return (window.innerHeight + adjustHeight );
    } else if (document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      // IE 6 in 'standards compliant mode'
      return (document.documentElement.clientHeight + adjustHeight) ;
    } else if (document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
      // IE 4
      return (document.body.clientHeight + adjustHeight);
    } else { return 550;}
} // getWindowHeight

var globalSlideFullWidth;
var globalSlideInc;
var globalSlideSpeed
function makeDivWider(theDivId, fullWidth, slideSpeed)
{
    globalSlideFullWidth = fullWidth + 1;
    globalSlideSpeed = slideSpeed;
    globalSlideInc = globalSlideSpeed;

    my_timeout = setTimeout(function () { stretchDiv(theDivId) }, 1);
    // get it moving
} // makeDivWider

function stretchDiv(theDivId)
{
    if (globalSlideInc < globalSlideFullWidth)
    {
      var the_style = getStyleObject(theDivId); // get Div style
      the_style.width = globalSlideInc +"px";
      globalSlideInc = globalSlideInc + globalSlideSpeed;

      my_timeout = setTimeout(function () { stretchDiv(theDivId) }, 1);
      // keep it moving
    }
} // stretchDiv