function ShowItOff()
{
	var myBodyOverlay = document.getElementById('bodyOverlay');
	var myBehindAgain = document.getElementById('behindAgain');
	var myInternalPage = document.getElementById('displayBox');
	
	myBodyOverlay.style.display='inline';
	myBehindAgain.style.display='inline';
	myBehindAgain.style.marginLeft='auto';
	myBehindAgain.style.marginRight='auto';
	if (myInternalPage)
	{
		myInternalPage.style.position='fixed';
		myInternalPage.style.display='inline';
	}
}

function HideIt()
{
	var myBodyOverlay = document.getElementById('bodyOverlay');
	var myBehindAgain = document.getElementById('behindAgain');
	var myInternalPage = document.getElementById('displayBox');

	if (myInternalPage)
	{
		myInternalPage.style.display='none';
	}
	
	myBodyOverlay.style.display='none';
	myBehindAgain.style.display='none';
	
	return false
}


function WindowOverlay(theID,Opacity)
{
	var theID;
	var Opacity;

	if(theID.length != 0)
	{
		
		if (Opacity > 0)
		{
			theID.style.opacity=Opacity;
			theID.style.display='block';
		}
		else
		{
			theID.style.display='none';
		}
	}	
}

function setBackgroundColor(DivID,FFcolor)
{
	if(DivID.length>0 && FFcolor.length>0)
	{
		DivID.style.background = FFcolor;
		DivID.style.opacity='1';
	}
}

function SetDivWidthHeight(x,y)
{
	var myInternalPage = document.getElementById('displayBox');
	if(myInternalPage)
	{
		myInternalPage.style.width = x;
		myInternalPage.style.height = y;
	}
}

//var internalPage
function getSubPage(b2)
{
var myInternalPage = document.getElementById('displayBox');
myInternalPage.content = GetXmlHttpObject();
if (myInternalPage.content==null)
  	{
  		alert ("Your browser does not support XMLHTTP!");
  		return;
  	}	
var url=b2;
url+"&sid="+Math.random()
myInternalPage.content.onreadystatechange=stateChanged;
myInternalPage.content.open("GET",url,true);
myInternalPage.content.send(null);
//dumpProps(myInternalPage.content.responseStream);
return myInternalPage.content.responseStream;


}



var xmlhttp
function showHint(str)
{
if (str.length==0)
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="gethint.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
var myInternalPage = document.getElementById('displayBox');
if (myInternalPage.content.readyState==4)
  {
	myInternalPage.innerHTML=myInternalPage.content.responseText;
	//document.getElementById("internalPage")
	//dumpProps(internalPage);
  }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function dumpProps(obj, parent) {
   // Go through all the properties of the passed-in object 
   for (var i in obj) {
      // if a parent (2nd parameter) was passed in, then use that to 
      // build the message. Message includes i (the object's property name) 
      // then the object's property value on a new line 
      if (parent) { var msg = parent + "." + i + "\n" + obj[i]; } else { var msg = i + "\n" + obj[i]; }
      // Display the message. If the user clicks "OK", then continue. If they 
      // click "CANCEL" then quit this level of recursion 
      if (!confirm(msg)) { return; }
      // If this property (i) is an object, then recursively process the object 
      if (typeof obj[i] == "object") { 
         if (parent) { dumpProps(obj[i], parent + "." + i); } else { dumpProps(obj[i], i); }
      }
   }
}

function ClearInput(value, id)
{ 
	var input = document.getElementById(id);
	input.style.color = "black"
	
	if(value == input.value)
	{	
		input.value = '';
	}
	else
	{
		input.value = input.value;
	} // End Else.
}
