window.onload = function()
{
		var stretchers = document.getElementsByClassName('toggle');
		var toggles = document.getElementsByClassName('display');
		var myAccordion = new fx.Accordion(
			toggles, stretchers, {opacity: true, duration: 400}
		);
		var found = false;
		toggles.each(function(h3, i){
			var div = Element.find(h3, 'nextSibling'); //element.find is located in prototype.lite
			if (window.location.href.indexOf(h3.title) > 0) {
				myAccordion.showThisHideOpen(div);
				ch_col(document.getElementById(h3.title));
				found = true;
			}
		});
		//if (!found) myAccordion.showThisHideOpen(stretchers[0], 0);
}
function ch_col(o)
{
	var s = document.getElementsByClassName('selected');
	s.each(function(ss) { ss.className=''});
	o.className = 'selected';
}
function open_win(loc, id, width, height, resize, scroll)
{
    var top = (screen.height - height) / 2;
    var left = (screen.width - width) / 2;
    window.open(loc,id,"width="+width+",height="+height+",left="+left+",top="+top+",scrollbars="+scroll+",resizable="+resize+",status=yes");
}
function photo(photo_id, width, height)
{
    open_win('/photo.php?'+photo_id, 'photo', width, height, 'no', 'no');
}
