// JavaScript Document

function loadRSS(id,intlink,headlines,URL,more)
{
	
	
	// Create the XML request  
	xmlReq = null;
	if(window.XMLHttpRequest) 		xmlReq = new XMLHttpRequest();
	else if(window.ActiveXObject) 	xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
	if(xmlReq==null) return; // Failed to create the request

// Anonymous function to handle changed request states
	xmlReq.onreadystatechange = function()
	{
		switch(xmlReq.readyState)
		{
		case 0:	// Uninitialized
			break;
		case 1: // Loading
			document.getElementById(intlink + id + "_d").innerHTML = "<div style='height:46px; padding:20px 0px 0px 0px; text-align:center; font-size:24px; font-weight:normal; color:#CCC;'>Loading your news ...</div>";
			break;
		case 2: // Loaded
			break;
		case 3: // Interactive
			break;
		case 4:	// Done!
		// Retrieve headlines
			
			// Begin formatting
			
			var content = ""; 
			var i = 1; 
			
			while (i <= headlines) {
			content = content + '<table cellpadding="0" cellspacing="0"><tr><td valign="top"><div id="expand_' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '" class="intlink_bullet_expand" onclick=showSummary("' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '");></div><div id="collapse_' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '" class="intlink_bullet_collapse" onclick=hideSummary("' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '");></div></td><td valign="top"><a href="' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '">' + xmlReq.responseXML.getElementsByTagName('title')[i].firstChild.data + '</a></td></tr></table><table cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top"><div id="summary_' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '" style="display:none; clear:both;"><div style="auto; padding:5px 20px 5px 20px; margin-bottom: 5px;"><span style="font-family: Arial, Tahoma, Helvetica, Verdana, sans-serif; font-size:11px; line-height:13px; color:#333; font-weight:normal; ">' + xmlReq.responseXML.getElementsByTagName('description')[i].firstChild.data + '&nbsp;<a href="' + xmlReq.responseXML.getElementsByTagName('link')[i].firstChild.data + '" style="color:#3564b8;">Launch &raquo;</a></div></div></td></tr></table><div style="clear:both; width:auto; margin:3px 0px 3px 0px; border-bottom:1px dashed #CCC;"></div>';			

i++;

}

			
			if (more != '') {
				content = content + "<a href='" + more + "' style='clear:both; text-decoration:none; background-color:#fff;'><img src='/graphics/beta/more.gif' style='border:0px; padding:5px 0px 0px 0px;'></a>";
			}
			
			else {
				content = content;
			}

			
			document.getElementById(intlink + id + "_d").innerHTML = content;
			
			// End formatting
			
			break;
			default:
			break;
		}
	}

// Make the request
	xmlReq.open ('GET', URL, true);
	xmlReq.send (null);
	
}
