/////////////////////////////////////////////////////////////////////////////////
function DivShow(w, d)
//
////////////////////////////////////////////////////////////////////////////////
{
	var div;
	if(browsertype=="NS")
  {
  	if(browser==NS6)
    {
      div=eval( "(document.getElementById('" + d + "')).style");
    } 
    else
    {
      div=eval("w.document." + d);
    }
  }
  else
  {
		div=eval("w." + d + ".style");
  }

	if(div)
		div.visibility="visible";
}

////////////////////////////////////////////////////////////////////////////////
function DivHide(w, d)
//
////////////////////////////////////////////////////////////////////////////////
{

	var div;

	if(browsertype=="NS")
  {
		if(browser==NS6)
    {
      div=eval( "(document.getElementById('" + d + "')).style");
    } 
    else
    {
      div=eval("w.document." + d);
    }
	}
  else
  {
		div=eval("w." + d + ".style");
  }



	if(div)
		div.visibility="hidden";

}
////////////////////////////////////////////////////////////////////////////////
function DivWrite(w, d, s, c)
//
////////////////////////////////////////////////////////////////////////////////
{
	var div;
	
	if(browsertype=="NS")
	{
		if(w)
			div=eval("w.document." + d);
		if(div)
		{
			div.document.open();
			if(c)
				document.clear();
			///do not clear here; resets macintosh documnet, not just div tag.
			div.document.write(s);
			div.document.close();
		}
		else
		{
			cInsight.Debug("bad div: " + d);
		}
	}
	else
	{
		
		if(w)
			div=eval("w." + d);
		if(div)
			div.innerHTML=s;
	}
	return;
}
////////////////////////////////////////////////////////////////////////////////
function DivMove(w, d, ttop, left)
//
////////////////////////////////////////////////////////////////////////////////
{
	var div;

	if(browsertype=="NS")
		div=eval("w.document." + d);
	else
		div=eval("w." + d + ".style");


	//////for some reason, NS doesn't like to convert decimals under 1 to
	//////integers.. this sets them to 0 (close enough)
	if(isNaN(ttop))
		ttop=0;
	if(isNaN(left))
		left=0;
		
	if(div && top!=-1)	
		div.top=ttop;
	if(div && left!=-1)		
		div.left=left;

	return;
}
////////////////////////////////////////////////////////////////////////////////
function DivSize(w, d, width, height)
//
////////////////////////////////////////////////////////////////////////////////
{
	//////////there is probably a better way of figuring this out!
	var div;
	if(browsertype=="NS")
		div=eval("w.document." + d);
	else
		div=eval("w." + d + ".style");

	//////for some reason, NS doesn't like to convert decimals under 1 to
	//////integers.. this sets them to 0 (close enough)
	if(isNaN(height))
		height=0;
	if(isNaN(width))
		width=0;
		

	if(height!=-1)	
		div.height=height;	
	if(width!=-1)		
		div.width=width;


	return;
}
////////////////////////////////////////////////////////////////////////////////
function DivVisible(w, d)
//
////////////////////////////////////////////////////////////////////////////////
{
	var div;
	if(browsertype=="NS")
		div=eval("w.document." + d);
	else
		div=eval("w." + d + ".style");

	if(div.visibility=="visible" || div.visibility=="show")
		return true;
	else
		return false;
}
////////////////////////////////////////////////////////////////////////////////
function GetDivLeft(w, d)
//
////////////////////////////////////////////////////////////////////////////////
{
	var div;
	if(browsertype=="NS")
		div=eval("w.document." + d);
	else
		div=eval("w." + d + ".style");
	return parseInt(div.left);
}
////////////////////////////////////////////////////////////////////////////////
function GetDivTop(w, d)
//
////////////////////////////////////////////////////////////////////////////////
{
	var div;
	if(browsertype=="NS")
		div=eval("w.document." + d);
	else
		div=eval("w." + d + ".style");
	return parseInt(div.top);
}

