function show(name) {
document.all[name].style.display = 'inline';
}
function hide(name) {
document.all[name].style.display = 'none';
}

var mcTimer;
var anID=null;


function OptionHideWhat(DIV)
{
    anID = document.getElementById(DIV);
    anID.className = 'modalHidden';
}

function OptionHide()
{
	anID = document.getElementById('option');
	anID.className = 'NoDisplay';
}

function showOptions( GUID,what,CB )
{

	anID = document.getElementById('option');
	document.body.onclick=OptionHide;

	AJAXContentIntoID ( "emit.aspx?CB="+CB+"&what=" + what +"&GUID="+GUID);
	document.getElementById('option').className = 'showOptions';
}

function PUP_fixed ( DIV, GUID, what, CB )
{
	anID = document.getElementById(DIV);
	anID.className = 'full';
	anID.style.display = 'block';
//	anID.style.top = tempY ; //document.getElementById(aGUID).top ;
//	anID.style.left = tempX+30 ; // document.getElementById(aGUID).left ;
	AJAXContentIntoID ( "emit.aspx?CB="+CB+"&what=" + what +"&GUID="+GUID);
//	document.getElementById(DIV).className = 'showOptions';
}

function PUP( DIV,GUID,what,CB )
{
	anID = document.getElementById(DIV);
	anID.className = 'ro';
	anID.style.display = 'block';
	anID.style.position = 'fixed';
	anID.style.top = tempY ; //document.getElementById(aGUID).top ;
	anID.style.left = tempX+30 ; // document.getElementById(aGUID).left ;
	AJAXContentIntoID ( "emit.aspx?CB="+CB+"&what=" + what +"&GUID="+GUID);
//	document.getElementById(DIV).className = 'showOptions';
}
function PUP2( DIV,URL )
{
	anID = document.getElementById(DIV);
	anID.className = 'ro';
	anID.style.display = 'block';
	anID.style.top = tempY ; //document.getElementById(aGUID).top ;
	anID.style.left = tempX+30 ; // document.getElementById(aGUID).left ;
	AJAXContentIntoID ( URL );
	document.getElementById(DIV).className = 'showOptions';
}

function Classy( DIV,theClass )
{
	//  show the "opaquing" layer
	var d = document.getElementById('DisableLayer'); d.style.display = 'block';

//	setTimeout(function() { 	anID = document.getElementById(DIV);	document.getElementById(DIV).className = theClass;}, 500);
	anID = document.getElementById(DIV);
	document.getElementById(DIV).className = theClass;
//	document.getElementById('btRB').click();
	
}

function AJAXContentIntoID ( pURL )
{
  if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
      xmlhttp=new XMLHttpRequest();
      xmlhttp.onreadystatechange=postFileReadyByID;
      xmlhttp.open("GET", pURL, true);
      xmlhttp.send(null);
   } else if (window.ActiveXObject) { //IE
      xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
      if (xmlhttp) {
        xmlhttp.onreadystatechange = postFileReadyByID;
        xmlhttp.open('GET', pURL, true);
        xmlhttp.send();
      }
   }
}

// function to handle asynchronous call
function postFileReadyByID() {
   if (xmlhttp.readyState==4) {
      if (xmlhttp.status==200) {
         anID.innerHTML=xmlhttp.responseText;
      }
   }
}


function getFile(pURL,aGUID) {
	document.getElementById('topDiv').style.top = tempY ; 
 	document.getElementById('topDiv').style.left = tempX+30 ;
 	document.getElementById('topDiv').style.display = 'block';
 	document.getElementById('topDiv').className = 'ro';
 	clearTimeout ( mcTimer );

  if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
      xmlhttp=new XMLHttpRequest();
      xmlhttp.onreadystatechange=postFileReady;
      xmlhttp.open("GET", pURL, true);
      xmlhttp.send(null);
   } else if (window.ActiveXObject) { //IE
      xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
      if (xmlhttp) {
         xmlhttp.onreadystatechange=postFileReady;
         xmlhttp.open('GET', pURL, true);
         xmlhttp.send();
      }
   }
}

// function to handle asynchronous call
function postFileReady() {
   if (xmlhttp.readyState==4) {
      if (xmlhttp.status==200) {
         document.getElementById('topDiv').innerHTML=xmlhttp.responseText;
      }
   }
}
//
function mO()
{ 
	document.getElementById('topDiv').innerHTML = "<IMG SRC=images/bits/cleardot.gif height=200 border=0 width=200>";
	document.getElementById('topDiv').style.display = 'none';
}
function hider(aGUID)
{ 
	mcTimer=setTimeout("document.getElementById('topDiv').style.display = 'none';",1);
}
function hideItNow()
{ 	
	document.getElementById('topDiv').style.display = 'none';
}
function hideItNowWhat(what)
{ 	
	document.getElementById(what).style.display = 'none';
}

// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}

//  tempX = 100;
//  tempY = 100;
  	document.getElementById('topDiv').style.top = tempY+10 ; //document.getElementById(aGUID).top ;
 	document.getElementById('topDiv').style.left = tempX+10 ;
  // show the position values in the form named Show
  return true
  
}


