var HTMLString;
var btyp;
var PDFOffset;
var OP, NC4, NC6, IE;
var Offsetx, Offsety;
var PDFTop, PDFLeft;
HTMLString = "";
NC6 = 0;
NC4 = 1;
OP = 2;
IE = 3;
PDFOffset = 0;
Offsetx = 0;
Offsety = 0;
PDFTop = 0;
PDFLeft = 0;

function block(top,left,color,width,height)
{
	//E FE
	PDFTop = top + PDFOffset + Offsetx;
	PDFLeft = left + Offsety;
	if (btyp != NC4)
	{
		HTMLString = "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 cellpadding=0 cellspacing=0 style='font-size:1px;background-color:" + color + ";width:" + width + "px;height:" + height + "px'><tr><td style='font-size:1px'>&nbsp;</td></tr></table></div>";
		document.write(HTMLString);
	}
	else
	{
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + width + "px height=" + height + "px></layer>";
	}
}


function ring(top,left,color,width,height,thick)
{
	//E RE
	PDFTop = top + PDFOffset + Offsetx;
	PDFLeft = left + Offsety;
	if (btyp != NC4)
	{
		if (btyp == OP)
		{
			HTMLString = "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 cellpadding=0 cellspacing=0 style='font-size:1px;border:solid " + color + " " + thick + "px;width:" + (width-thick) + "px;height:" + (height-thick) + "px'><tr><td style='font-size: 1px'>&nbsp;</td></tr></table></div>";
		}
		else
		{
			HTMLString = "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 cellpadding=0 cellspacing=0 style='font-size:1px;border:solid " + color + " " + thick + "px;width:" + (width+thick) + "px;height:" + (height+thick) + "px'><tr><td style='font-size: 1px'>&nbsp;</td></tr></table></div>";
		}
		document.write(HTMLString);
	}
	else
	{
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + width + "px height=" + thick + "px></layer>";
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + thick + "px height=" + height + "px></layer>";
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + eval(PDFTop + height) + "px BGCOLOR=" + color + " width=" + eval(width + thick) + "px height=" + thick + "px></layer>";
		HTMLString += "<layer LEFT=" + eval(PDFLeft + width) + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + thick + "px height=" + eval(height  + thick) + "px></layer>";
	}
}


function bar(top,left,tablewidth,tableheight,color,width1,width2,width3)
{
	//BAR
	PDFTop = top + PDFOffset + Offsetx;
	PDFLeft = left + Offsety;
	if (btyp != NC4)
	{
		HTMLString = "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 cellpadding=0 cellspacing=0 style='font-size:1px;border:solid #000000 1px;width:" + tablewidth + "px;height:" + tableheight + "px'><tr>";
		if (width1!=0)
		{
			HTMLString += "<td style='font-size:1px;width:" + width1 + "px'>&nbsp;</td>";
		}
		if (width2!=0)
		{
			HTMLString += "<td style='font-size:1px;width:" + width2 + "px;background-color:" + color + "'>&nbsp;</td>";
		}
		else
		{
			HTMLString += "<td style='font-size:1px;width:" + width2 + "px'>&nbsp;</td>";
		}
		if (width3!=0)
		{
			HTMLString += "<td style='font-size:1px;width:" + width3 + "px'>&nbsp;</td>";
		}
		HTMLString += "</tr></table></div>";
		document.write(HTMLString);
	}
	else
	{
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=#000000 width=1px height=" + tableheight + "px></layer>";
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=#000000 width=" + tablewidth + "px height=1px></layer>";
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + eval(top + tableheight) + "px BGCOLOR=#000000 width=" + eval(tablewidth + 1) + "px height=1px></layer>";
		HTMLString += "<layer LEFT=" + eval(PDFLeft + tablewidth) + "px TOP=" + PDFTop + "px BGCOLOR=#000000 width=1px height=" + eval(tableheight + 1) + "px></layer>";
		HTMLString += "<layer LEFT=" + eval(PDFLeft + width1) + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + width2 + "px height=" + tableheight + "px></layer>";
	}
}


function text(top,left,align,f,s,c,a,tw,text)
{
	PDFTop = top + Offsetx;
	PDFLeft = left + Offsety;
	
	if(align=="left")
	{
	HTMLString += "<div style='position:absolute;top:" + PDFTop + "px;left:" + (PDFLeft+4) + "px'>";
	HTMLString += "<b id=" + f + "><b style='font-size:" + s + "px;'><b id=" + c + "><b id=" + a + "><nobr>" + text + "</nobr></b></b></b></b></div>";
	}
	else
	{
	HTMLString += "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'>";
	HTMLString += "<table cellspacing=0 cellpadding=0 border=0 width=" + tw + "><tr>";
	HTMLString += "<td align=" + align + "><b id=" + f + "><b style='font-size:" + s + "px;'><b id=" + c + "><b id=" + a + ">" + text + "</b></b></b></b></td>";
	HTMLString += "</tr></table></div>";
	}
	if (btyp != NC4)
	{
		document.write(HTMLString);
		HTMLString = "";
	}
}


function line(top,left,color,width,height,thick)
{
	//not E -
	PDFTop = top + PDFOffset + Offsetx;
	PDFLeft = left + Offsety;
	if (btyp != NC4)
	{
		if (height==1)
		{
			HTMLString = "<div style='font-size:0.1px;position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 style='border-top:solid " + color + " " + thick + "px;height:1px;width:" + width + "px'><td>&nbsp;</td></table></div>";			
		}
		else
		{
			HTMLString = "<div style='font-size:0.1px;position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 style='border-left:solid " + color + " " + thick + "px;height:" + height + "px;width:1px'><td>&nbsp;</td></table></div>";			
		}
		document.write(HTMLString);
	}
	else
	{
		if (height==1)
		{
			HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + width + "px height=" + thick + "px></layer>";
		}
		else
		{
			HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BGCOLOR=" + color + " width=" + thick + "px height=" + height + "px></layer>";
		}
	}
}


function grafik (top, left, width, height, picname, link)
{
	if (picname != "")
	{
		PDFTop = top + PDFOffset + Offsetx;
		PDFLeft = left + Offsety;
		HTMLString += "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'>"
		if (link != "")
			HTMLString += link;

		HTMLString += "<img border=0 src=" + picname;
		if (width != 0)
			HTMLString += " width=" + width;
		if (height != 0)
			HTMLString += " height=" + height;

		if (link != "")
		{
			HTMLString += "></a>";
			HTMLString += "</div>";
		}
		else
		{
			HTMLString += "></div>";
		}
			
		if (btyp != NC4)
		{
			document.write(HTMLString);
			HTMLString="";
		}
	}
}


function inputtext(top,left,tw,align,styleclass,formname,sizeofinput,valueofinput,nameofinput)
{
	PDFTop = top + PDFOffset + Offsetx;
	PDFLeft = left + Offsety;
	HTMLString += "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'>";
	HTMLString += "<table border=0 width=" + tw + "><tr>";
	HTMLString += "<td align=" + align + " class=" + styleclass + "><form name='" + formname + "'><input type=text size=" + sizeofinput + " value=" + valueofinput + " name=" + nameofinput + "></form></td>";
	HTMLString += "</tr></table></div>";
	if (btyp != NC4)
	{
		document.write(HTMLString);
		HTMLString="";
	}
}


function blockpic(top,left,picture,width,height)
{
	PDFTop = top + PDFOffset + Offsetx;
	PDFLeft = left + Offsety;
	if (btyp != NC4)
	{
		HTMLString = "<div style='position:absolute;top:" + PDFTop + "px;left:" + PDFLeft + "px'><table border=0 cellpadding=0 cellspacing=0 background='" + picture + "' style='font-size:1px;width:" + width + "px;height:" + height + "px'><tr><td style='font-size:1px'>&nbsp;</td></tr></table></div>";
		document.write(HTMLString);
	}
	else
	{
		HTMLString += "<layer LEFT=" + PDFLeft + "px TOP=" + PDFTop + "px BACKGROUND='" + picture + "' width=" + width + "px height=" + height + "px></layer>";
	}
}




if (navigator.userAgent.indexOf("Opera") != -1)
{
    btyp= OP;
}
else
{
	if (navigator.appName == "Netscape")
	{
		if (navigator.userAgent.indexOf("Mozilla/4.") != -1)
		{
			btyp= NC4;
		}
		else
		{
			btyp= NC6;
		}
	}
	else if (navigator.appName == "Microsoft Internet Explorer")
	{
		btyp= IE;
	}
}


