<!-- "Time_Digital.htc" -->
<HEAD>
<PUBLIC:COMPONENT tagName=TODO_HTC>
	<PUBLIC:PROPERTY Name=items />
  	<PUBLIC:ATTACH event="oncontentready" onevent="fnInit()"/>
</PUBLIC:COMPONENT>
<STYLE>
	body
	{
		background:lightgray;
	}
  	#todolist
	{
               	border:solid 1px;
               	border-color:#D6D3CE;
		text-align:letf;
		color:blue;
		font-size:12;
		font-weight:normal;	
		width:160;
		overflow:hidden;
        }
</STYLE>
<SCRIPT LANGUAGE="JScript">
// Entry point
function fnInit()
{
  	defaults.viewLink = document;
	var listitems = items.split("|")
	newlist=document.createElement("ol")
	for(var i=0;i<listitems.length;i++)
	{
		newItem=document.createElement("li")
		newItem.className = "todoitem"
		newItemCheck=document.createElement("input")
		newItemCheck.type="checkbox"
		newItemText=document.createTextNode(listitems[i])
		newItem.appendChild(newItemCheck)
		newItem.appendChild(newItemText)
		newlist.appendChild(newItem)
	}
	if(listitems.length>0)
		todolist.appendChild(newlist)
}
function addItem()
{
	var userItem = prompt("Enter the thing to do","")
	if(userItem!="")
	{
		newItem=document.createElement("li")
		newItemCheck=document.createElement("input")
		newItemCheck.type="checkbox"
		newItemText=document.createTextNode(userItem)
		newItem.appendChild(newItemCheck)
		newItem.appendChild(newItemText)
		newlist.appendChild(newItem)
		todolist.appendChild(newlist)
	}
}
function clearItems()
{
	var cnt = 0
	var ti = document.getElementsByTagName("input")
	for(var i=0;i<3;i++)
	for(var n in ti)
	{
		if(ti[n].className = "todoitem")
		{
			if(ti[n].checked==true)
			{
				ti[n].parentNode.removeNode(ti[n])
			}
		}
	}
}
</SCRIPT>
</HEAD>
<BODY>
<div id="todolist">
Things To Do...<br>
</div>
<button onclick="addItem()">Addto List</button>
<button onclick="clearItems()">Clear</button>
</BODY>