
var Topic = 
{
	innerHTML : ""	
}
Topic.loadXML = function(xmlFile)
{
    var xmlDoc;
    if(window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
        xmlDoc.async = false;
        xmlDoc.load(xmlFile);
    }
    else if (document.implementation&&document.implementation.createDocument)
    {
		xmlDoc=document.implementation.createDocument("","",null);
		xmlDoc.async=false;
		xmlDoc.load(xmlFile);
    }
    else
    {
        return null;
    }
    
    return xmlDoc;
};

Topic.init = function() 
{
	var xmlDoc = Topic.loadXML("/js/topic.asp");
	if(xmlDoc==null)return "";
	var items = xmlDoc.getElementsByTagName('item');
	var html = "";
	for(var i = 0 ; i < items.length ; ++i)
	{
		if(i%5==0)html += '</ul></td><td width="25%"><ul style="margin:0px;padding:0px;list-style:none;">';
		if(window.ActiveXObject)
		{
			html += '<li><a href="' + items[i].childNodes[2].text + '" title="' 
			 + items[i].childNodes[1].text.replace(/[\"\s]*/g,'').substring(0,30) + '">' 
			 + items[i].childNodes[0].text.substring(0,14) + '...</a></li>';
		}
		else if (document.implementation&&document.implementation.createDocument)
		{
			html += '<li><a href="' + items[i].childNodes[5].textContent + '" title="' 
			 + items[i].childNodes[3].textContent.replace(/[\"\s]*/g,'').substring(0,30) + '">' 
			 + items[i].childNodes[1].textContent.substring(0,14) + '...</a></li>';
		}
	}
	html = '<table cellspacing="0" cellpadding="0" width="100%" border="0" ><tr>'
		+html.substring('</ul></td>'.length,html.length)
		+'</ul></td></tr></table>';
	return html;
};

Topic.innerHTML = Topic.init();