W.Holdings = {

	source	: 'about.xml',
	elem	: null,



	init : function(param)
	{
		this.source	= param.source || this.source;
		this.elem	= W.$(param.elem);
		
		return this;
	},
	
	
	populate : function()
	{
		var obj	= this;
		
		new W.Request('GET', this.source).call(obj.parse.bind(obj));
	},
	
	
	
	parse : function(req)
	{
		var holdings	= req.responseXML.getElementsByTagName('holding');
		var node, id, caption;

		for (var i = 0, max = holdings.length; i < max; ++i) {
			node	= holdings[i];
			url		= node.getElementsByTagName('url')[0].firstChild.data
			image	= node.getElementsByTagName('image')[0].firstChild.data
			caption	= node.getElementsByTagName('caption')[0].firstChild.data
			
			this.add_photo(url, image, caption);
		}
		
		new W.Fader({auto: true, caption: true, pause: 5000, duration: 15, crossfade: true}).init_nav('photo');
	},
	
	
	
	add_photo : function(url, image, caption)
	{
		var div			= document.createElement('div');
		var img			= document.createElement('img');
		var a			= document.createElement('a');
		
		a.href			= url;
		
		img.src			= image;
		img.border		= 0;
		img.title		= caption;
		
		div.className	= 'photo';
		
		a.appendChild(img);
		div.appendChild(a);
		this.elem.appendChild(div);
	}
};