function CollectiveFeed(file)
{
	mainfeed = this;
	this.font = "small";
	this.page = 0;
	this.pageS = 14;
	this.totP = 0;
	this.filter = 0;
	this.filter_ar = [
		{l:"SpaceCollective"}
	];
	
	this.xmlFile = file;
	
	this.item_ar = [];
	//this.autoLayout = new AutoLayout(this);
		
	this.init = function()
	{
		this.createBlock("items");
		var d = this.getAnchor();
		this.loadPageItems();
	}
	
	this.createBlock = function(_id)
	{
		var d = document.createElement('DIV');
		d.id = _id;
		document.body.appendChild(d);
	}
	
	this.getAnchor = function()
	{
		var q = self.location+"";		
		var start = q.indexOf ("#");
		if (start == -1) return false;
		return unescape (q.substring (++start, q.length));
	}
	
	
	this.loadPageItems = function()
	{	
		//document.getElementById('items').innerHTML = '<img style="margin-top:25px;margin-left:0px;" src="_gfx/loadingAnim.gif" />';
		//var url = "projectfeed/XML/all_data.xml";
		var url = "projectfeed/XML/"+this.xmlFile+".xml";
		this.loadXML(url,"mainfeed.onGetItems");
	}
	
	
	this.onGetItems = function(xml)
	{
		if (xml.readyState==4){
				xml = xml.responseXML.documentElement;
				
				var tot = xml.getElementsByTagName("total")[0].firstChild.data;
				
				this.item_ar = [];
				
				var ar = xml.getElementsByTagName('item');
				
				for(var i=0; i<ar.length; i++)
				{
					var id = ar[i].getElementsByTagName('id')[0].firstChild.data;
					var name = ar[i].getElementsByTagName('name')[0].firstChild.data;
					var date = ar[i].getElementsByTagName('date')[0].firstChild.data;
					
					var bdy = ar[i].getElementsByTagName('body')[0];
					if (bdy.firstChild != null) bdy = bdy.firstChild.data;
					else bdy = "";
					
					var lnk = ar[i].getElementsByTagName('link')[0];
					if (lnk.firstChild != null) lnk = lnk.firstChild.data;
					else lnk = "";
					
					var img = ar[i].getElementsByTagName('img')[0];
					if (img.firstChild != null) img = img.firstChild.data;
					else img = "";
					
					if(img && img!="0"){
						img = {
							f:ar[i].getElementsByTagName('img')[0].firstChild.data,
							w:ar[i].getElementsByTagName('img')[0].getAttribute("W"),
							h:ar[i].getElementsByTagName('img')[0].getAttribute("H")
						};
					}
					
					var author = ar[i].getElementsByTagName('author')[0];
					author = (author.firstChild!=null) ? author.firstChild.data : null;
					
					var W = Number(ar[i].getElementsByTagName('W')[0].firstChild.data);
					
					var cat = Number(ar[i].getElementsByTagName('cat_id')[0].firstChild.data);
					
					this.item_ar.push({id:id,name:name,lnk:lnk,date:date,bdy:bdy,img:img,W:W,author:author,cat:cat});
				}
				
				//this.autoLayout.init();
				//this.autoLayout.draw();
		}
	}
	
	
	this.loadXML = function(url,action){
		var oXML = this.getXMLHttpObj();
		oXML.onreadystatechange = function(){
			eval(action+"(oXML)");
		}
		oXML.open('GET', url, true);
		oXML.send('');
	}
	this.getXMLHttpObj = function()
	{
		if(typeof(XMLHttpRequest)!='undefined')
			return new XMLHttpRequest();
	
		var axO=['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0',
			'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'], i;
		
		for(i=0; i<axO.length; i++)
			try{
				return new ActiveXObject(axO[i]);
			}catch(e){}
			
		return null;
	}
	
	this.init();
}