// I know that everyone is looking to copy Portal of Dreams
// But trust me when I tell you, I am going to AGGRESIVELY
// protect the code that I write.  If I find that this code
// is being used in any form.  I promise as the sun will
// rise tomorrow, that I will prosecute, and will love
// every minute of it.
// This code is indeed Copyright, Minogue Technologies

function grayOut(vis) {
  var options = options || {}; 
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 50;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#000000';
  var dark=document.getElementById('darkenThePage');
  if (!dark) {
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');
        tnode.style.position='absolute';
        tnode.style.top='0px';
        tnode.style.left='0px';
        tnode.style.overflow='hidden';
        tnode.style.display='none';
        tnode.id='darkenThePage';
    tbody.appendChild(tnode);
    dark=document.getElementById('darkenThePage')
  }
  if (vis) {
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
    dark.style.opacity = opaque;                      
    dark.style.MozOpacity = opaque;                   
    dark.style.filter = 'alpha(opacity='+opacity+')'; 
    dark.style.zIndex = zindex;        
    dark.style.backgroundColor = bgcolor;  
    dark.style.width = pageWidth;
    dark.style.height = pageHeight;
    dark.style.display = 'block';                          
  } else {
     dark.style.display = 'none';
  }
}

function showFontList() {
	grayOut(true);
	sfl = document.getElementById("fontList");
	sfl.style.visibility = "visible";
}

function hideFontList() {
	hfl = document.getElementById("fontList");
	hfl.style.visibility = "hidden";
	grayOut(false);
}

function showColorTable() {
	grayOut(true);
	sct = document.getElementById("colorTable");
	sct.style.visibility = "visible";
}

function hideColorTable() {
	hct = document.getElementById("colorTable");
	hct.style.visibility = "hidden";
	grayOut(false);
}


