
/*
* Convenience function to map a variable from one coordinate space
* stolen from proce55ing src!!!!
*/
function map(value, istart, istop, ostart, ostop) {
    return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
}

function buildLifestreamGradiant() {
	if($('lifestream')) {
		var ls_elems = $('lifestream').childElements();
		var top = 0;
		var bottom = ls_elems.length;
		for(var i=0;i<ls_elems.length;i++) {
			var cur_opacity = map((bottom-i),1,(bottom),0,1);
			ls_elems[i].setOpacity(cur_opacity);
		}
	}
}
Event.observe(window, 'load', function() {
	buildLifestreamGradiant();
});

function toggleSubItem() {
	// throw url / params in alt/some attr? dynamically populate that shit...
	// but still try to keep human-readable URLs...
}

Event.observe(window,'load',function() {
	Event.observe($$('subnav_item'),'click',function() {
		toggleSubItem();
	});
});
