
	// buttons
$(".buttonface").click(function() {
	if ($(this).attr("href"))
		return;
		// hack to trigger onsubmit as naturally as possible
	$(this).parents("form").append("<input type='submit' style='display:none;' id='_submit' />");
	$("#_submit").click();
	$("#_submit").remove();
});


	// table striping
function stripeTables()
{
	$("table.common tr:even").addClass("even");
	$("table.common tr:odd").addClass("odd");
}
stripeTables();

try
{
  Ajax.onupdate.push(stripeTables());
}
catch(e)
{

}

	// centeral msgs
$('.centerMsg').css('left',screen.width/2-125);
var close_button = '<a style="float:left; cursor:pointer; margin:5px;" onclick="$(this).parent().fadeOut(\'slow\');">x</a>';
$('.centerMsg').each(function() {
	$(this).html(close_button + $(this).html());
});
$('.toggleMsg').click(function() {
	var msg_id = $(this).attr('msg_id');
	var msg = $('#'+msg_id);
	if (msg.is(':visible'))
		msg.fadeOut('slow');
	else
	{
		$('.centerMsg').each(function() {$(this).fadeOut('slow');});
		msg.fadeIn('slow');
	}
});
