feed=function feed( url , dbfp , callback)
{
	this.url = url;
	this.title = "";
	this.link = "";
	this.description = "";
	this.language="";
	this.copyright="";
	this.pubDate="";
	this.lastBuildDate="";
	this.xmlitem = null;
	this.status = 0;	
	this.items = new Array();
	this.count = 10;
	this.callbackfunction = callback;
	this.init = function init()
	{
		if (status == 0)
		{
			/* START BY GETTING THE XML FEED */
			this.url = "/" + dbfp + "/ajaxpassthru?openagent&now="+new Date()+"&url=" + this.url;
			this.load();
		}
	}	
	this.addItem = function add()
	{		
		this.items[this.items.length] = new this.item( "", "","","","" )  
		return this.items[this.items.length-1];
	}
	
	this.parse = function parse(xmlitem)
	{
		this.status = 2;
		this.chanElement = xmlitem.getElementsByTagName("channel")[0];
		this.itemElements = xmlitem.getElementsByTagName("item");
		
		this.properties = new Array("title", "link", "description", "author", "pubDate");
		
		for (i=0 ; i < this.itemElements.length; i++)
		{
			if ( i >= this.count )
			{break;}
			this.obj = this.addItem();
			this.tmpElement = null;
			for ( ii=0;  ii<this.properties.length; ii++)
			{
				try
				{
					this.tmpElement = this.itemElements[i].getElementsByTagName(this.properties[ii])[0];
					if (this.tmpElement != null)
					{
						eval("this.obj."+this.properties[ii]+"=this.tmpElement.childNodes[0].nodeValue");
					}
				}catch(iiii){}
			}
		}
		this.properties = new Array("title", "link", "description", "language", "copyright",  "pubDate", "lastBuildDate");
		this.tmpElement = null;
		for (var i=0; i<this.properties.length; i++)
		{
			try
			{
				this.tmpElement = this.chanElement.getElementsByTagName(this.properties[i])[0];
				if (this.tmpElement!= null)
				{
					eval("this."+this.properties[i]+"=this.tmpElement.childNodes[0].nodeValue");
				}
			}catch(iiii){}
		}
		this.status = 200;
		this.inform();
	}
	this.inform = function inform()
	{
		try
		{
	
			eval( this.callbackfunction);
		}catch(oou){}
	}
		
	this.item = function item( title , description ,  date , link , author)
	{
		this.title = title;
		this.description = description;
		this.date = date;
		this.link = link;
		this.author = author;
	}
	
	this.load = function load()
	{
		if(navigator.appName == "Microsoft Internet Explorer"){
			this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}else{ 
			this.xmlhttp = new XMLHttpRequest(); 
		}
		if (this.xmlhttp)
		{		
			var oThis = this;
			this.xmlhttp.onreadystatechange = function() { oThis.callback() }
			this.xmlhttp.open("GET",this.url,true)
			this.xmlhttp.send(null);
			this.status  = 1;
		}
	}
	this.callback = function()
	{
	
		if (this.xmlhttp.readyState==4)
		{
			if (this.xmlhttp.status==200)
	    		{
				this.parse( this.xmlhttp.responseXML);
			}else
			{this.status = 404;}
		}  
	}
	
	this.version = function version(){return "0.9";}		
}
function getObject( szobj )
{
	try
	{
		if (document.all)
		{
			return eval( "document.all." +  szobj );
		}else
		{
			return eval( document.getElementById( szobj ) );
		}	
	}catch(oopsy){ window.status = "unable:" + szobj}
}
