////////////////////////////////////
// DHTML.js - Author Suhanov Artem
////////////////////////////////////

	var g_sHTML = "";

function Write(s)
{
	g_sHTML += s;
}

function Writeln(s)
{
	g_sHTML += s;
}

function DocWrite()
{
	document.write(g_sHTML);
	g_sHTML = "";
}

function BeginDiv(nTop, nLeft, nWidth, nHeight, zIndex, sId, bVis, sOver, sOut)
{
	var sVis = " ";
	var sM = " ";
	var sSize = " ";
	var nW = new Number(nWidth);
	var nH = new Number(nHeight);

	if ( (sOver != "") && (sOver != null) )
		sM += " onmouseover=\""+sOver+"\" ";
	if ( (sOut != "") && (sOut != null) )
		sM += " onmouseover=\""+sOut+"\"";

	if (IsNN())
	{
		if (nW != 0) sSize +=" width="+nW+" ";
		if (nH != 0) sSize +=" height="+nH+" ";
		if (bVis == NO) sVis = " visibility=hide";
	}
	else if (IsIE())
	{
		if (nW != 0) sSize +=" width: "+nW+"px; ";
		if (nH != 0) sSize +=" height: "+nH+"px; ";
		if (bVis == NO) sVis = " visibility: hidden;"
	}

	if (IsIE()) var sValue = "<DIV"+sM+" id="+sId+" STYLE=\"POSITION: absolute; TOP: "+nTop+"px; LEFT: "+nLeft+"px;"+sSize+"z-Index: "+zIndex+";"+sVis+"\">"
	else if (IsNN()) var sValue = "<LAYER"+sM+" id="+sId+" TOP="+nTop+" LEFT="+nLeft+" z-Index="+zIndex+sSize+sVis+">"

	Writeln(sValue);
}

function EndDiv()
{
	if (IsIE()) var sValue = "</DIV>"
	else if (IsNN()) var sValue = "</LAYER>"
	Writeln(sValue);
}

function ShowObj(name)
{
	if (IsNN()) document.layers[name].visibility = "show"
	else if (IsIE()) document.all[name].style.visibility = "visible"
}

function HideObj(name)
{
	if (IsNN()) document.layers[name].visibility = "hide"
	else if (IsIE()) document.all[name].style.visibility = "hidden"
}

