var opened = "none";

function divRef(divID) {
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document.getElementById ) { //IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { // IE4
        return document.all[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}

function showDiv(divID_as_a_string) {
    opened = divID_as_a_string;
    //get a reference as above ...
    ref = divRef(divID_as_a_string);
    if( !ref) {
		  return false; //don't go any further
		}
		
    //now we have a reference to it
    if( ref.style ) { //DOM & proprietary DOM
        ref.style.visibility = 'visible';
    } else {
        if( ref.visibility ) { //Netscape
            ref.visibility = 'show';
        } else {
            return false; //don't go any further
        }
    }
    return true;
}

function hideDiv(divID_as_a_string) {
    if(divID_as_a_string != "none"){
		  var strng = divID_as_a_string.substring(0,3);
  		//get a reference as above ...
  		ref = divRef(divID_as_a_string);
      if( !ref ) {
          return false; //don't go any further
      } 
  		
      //now we have a reference to it
      if( ref.style ) { //DOM 
          ref.style.visibility = 'hidden';
  				opened = 'none'
      } else {
          if( ref.visibility ) { //Netscape
              ref.visibility = 'hide';
  						opened = 'none'
          } else {
              return false; //don't go any further
          }
      }
		  if(strng = 'bru')chngBack('brush','#ff9900')
			if(strng = 'buf')chngBack('buff','#ffcc00')
			if(strng = 'mar')chngBack('marine','#ff99ff')
		}
		
		 
		return true;
}

function chngBckgrnd(divID_as_a_string,culor){
  ref = divRef(divID_as_a_string);
	if(ref.style) { ref = ref.style;}
	ref.bgcolor = culor;
	ref.background = culor;
	ref.backgroundColor = culor;
	}
	
function chngBack(divID_as_a_string,culor){
  ref = divRef(divID_as_a_string,culor);
	if(ref.style) { ref = ref.style;}
	ref.bgcolor = culor;
	ref.background = culor;
	ref.backgroundColor = culor;
	}
