function get_ids_from_class(c)
{
	var r = new Array();
	var a;
	var i,j;
	var k = 0;

	a = getElementsByClassName(c);

	for (j = 0; j < a.length; j++)
	{
		r[k] = a[j].id;
		k++;
	}

	return r;
}

function hide_ids_from_class(c, id)
{
	var a = get_ids_from_class(c);

	for (var i = 0; i < a.length; i++)
	{
		if (a[i] != id) $(a[i]).setStyle({display: 'none'});
	}
}

function hide_class_show_id(c, id, gotolabel)
{
	if(gotolabel == null) gotolabel = false;

	hide_ids_from_class(c, id);
	show(id, gotolabel);
}

function gotoLabel(e)
{
	window.location = '#' + e.element.id;
}

function show(id, gotolabel)
{
	if(gotolabel == null) gotolabel = false;

	if(gotolabel) Effect.toggle(id, 'appear', {duration: 0.5, afterFinish: gotoLabel});
	else Effect.toggle(id, 'appear', {duration: 0.5});
}

function OpenCentered(psUrl, psName, piWidth, piHeight, psFlags)
{
	var iX=(screen.width-piWidth-20)/2;
	var iY=(screen.height-piHeight-30)/2;

	open(psUrl, psName, 'width=' + piWidth + ',height=' + piHeight + ',scrollbars=1,left=' + iX + ',top=' + iY +  ',screenX=' + iX + ',screenY=' + iY + psFlags);
}
