// 14-08-2006 - AL - created this class to hide multiple divs at once if they are visible
// this function changes the visibility of advanced features between hidden/visible
// This function is just a modified version of hideDiv.js
function hideDivs(div_id1, div_id2, div_id3, div_id4, div_id5, div_id6, div_id7, div_id8, div_id9, div_id10, div_id11)
{
  var style_sheet1 = getStyleObjects(div_id1);
  var style_sheet2 = getStyleObjects(div_id2);
  var style_sheet3 = getStyleObjects(div_id3);
  var style_sheet4 = getStyleObjects(div_id4);
  var style_sheet5 = getStyleObjects(div_id5);
  var style_sheet6 = getStyleObjects(div_id6);
  var style_sheet7 = getStyleObjects(div_id7);
  var style_sheet8 = getStyleObjects(div_id8);
  var style_sheet9 = getStyleObjects(div_id9);
  var style_sheet10 = getStyleObjects(div_id10);
  var style_sheet11 = getStyleObjects(div_id11);

  if (style_sheet1)
  {
    hideObjects(div_id1);
  }
  if (style_sheet2)
  {
    hideObjects(div_id2);
  }
  if (style_sheet3)
  {
    hideObjects(div_id3);
  }
  if (style_sheet4)
  {
    hideObjects(div_id4);
  }
  if (style_sheet5)
  {
    hideObjects(div_id5);
  }
   if (style_sheet6)
  {
    hideObjects(div_id6);
  }
  if (style_sheet7)
  {
    hideObjects(div_id7);
  }
  if (style_sheet8)
  {
    hideObjects(div_id8);
  }
  if (style_sheet9)
  {
    hideObjects(div_id9);
  }
  if (style_sheet10)
  {
    hideObjects(div_id10);
  }
  if (style_sheet11)
  {
    hideObjects(div_id11);
  }

  /*
  else 
  {
    alert("sorry, this only works in browsers that do Dynamic HTML");
  }
  */
 
}

// function getStyleObjects(string) -> returns style object given a string containing the id of an object
//  the function returns the stylesheet of that object or false if it can't find a stylesheet.  Handles
//  cross-browser compatibility issues.

function getStyleObjects(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.

  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function hideObjects(objectId) {
    // first get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObjects(objectId);
    if(styleObject) {
	if (styleObject.visibility == 'visible'){
 		styleObject.visibility = "hidden";
		styleObject.position = "absolute";
	}
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
}
