function change(oItems, flag1, flag2, count)
{
	if (document.getElementById("_"+oItems).style.display == "none")
	{
		all_close(flag1, count);
		document.getElementById("_"+oItems).style.display = "block";
	}
	else
	{
		if (flag2 == false)
		{
			document.getElementById("_"+oItems).style.display = "none";
		}
	}
}
function all_close(flag, count)
{
	for (counter = 1; counter <= count; counter++)
	{
		if (document.getElementById("_"+counter))
		document.getElementById("_"+counter).style.display = "none";
	}

}

function all_open(count)
{
	for (counter = 1; counter <= count; counter++)
	{
		document.getElementById("_"+counter).style.display = "block";
	}

}
{
	var parentId = 'illImg';
	if(this.cont == null)
	this.cont = document.getElementById(parentId).innerHTML;
	document.getElementById(parentId).innerHTML = this.cont;
}

function Clear()
{
	var parentId = 'illImg';
	if(this.cont == null)
	this.cont = document.getElementById(parentId).innerHTML;
	document.getElementById(parentId).innerHTML = this.cont;
}

function DrawRectangle(coords, pncid)
{
	Clear();
	if(this.pncid == pncid)
	{
		this.pncid = null;
		return;
	}
	var parentId = 'illImg';
	var c = coords.split(';');
	for(var i = 0; i < c.length; i++)
	{
		var flag = true;
		var xy = c[i].split(',');
		if(xy != "")
		{
			var div = document.createElement('div');
			div.id = 'divSegment' + pncid + i;
			div.className = 'segment';

			var x1 = xy[0];
			var y1 = xy[1];
			var x2 = xy[2];
			var y2 = xy[3];

			div.style.top = Math.min(y1-1, y2-1) + 'px';
			div.style.left = Math.min(x1-1, x2-1) + 'px';
			div.style.width = Math.abs(x1 - x2) + 'px';
			div.style.height = Math.abs(y1 - y2) + 'px';

			div.style.display = 'block';
			document.getElementById(parentId).appendChild(div);
		}
	}
	this.pncid = pncid;
}
