
var oPortfolio = new Class({
	cell: function(iRows, sCol) {
		return this.rows[iRows].get(sCol);
	},
	transform: function() {
		var arrRows = new Array();
		var dt = this.source.getElementsByTagName("Table");
		for (i=0; i<dt.length; i++) // rows
		{
			var hash = new Hash();
			for (j=0; j<dt[i].childNodes.length; j++)
			{
				if (dt[i].childNodes[j].nodeType != 3) // avoid whitespace (MOZ/SAF)
				{
				    try {
					    hash.set(dt[i].childNodes[j].nodeName, dt[i].childNodes[j].childNodes[0].nodeValue);
					} catch(e) {
					    hash.set(dt[i].childNodes[j].nodeName, "");
					}
				}
			}
			arrRows.push(hash);
		}
		
		return arrRows;
	},
	rowcount: function() {
		return this.rows.length;
	},
	initialize: function(oXml) {
		this.source = oXml;
		this.rows = this.transform();
	}
});

function ShowPortfolio(id)
{
	$$('div.pf_top').each(function(el){
		el.style.display = "none";
	});
	$("pf" + id).style.display = "block";
	
	$$('div.pf_lineone img').each(function(el){
		el.removeClass("pf-current");
	});
	$$('div.pf_linetwo img').each(function(el){
		el.removeClass("pf-current");
	});
	$("pi" + id).addClass("pf-current");
}
