//checkboxes: put label before checkbox field
$(document).ready(function(){
	$('div.checkbox').each(function(){
		$(this).find('label').before($(this).find('input'));
	});
});

//function used to display hidden items (eg authors in the abstract form)
function addItem(itemType, maxNoItems)
{
    var maxItems = maxNoItems;
    
	for(var i=2;i<=maxItems;i++)
	{
		
		var a = $("."+itemType+i);
		var itemAdded = false;
		
		a.each(function()
		{
			if (this.style.display == '' || this.style.display == 'none')
			{
				this.style.display = 'block';
				itemAdded = true;
			}
		});
		
		if (itemAdded)
		{
			if (i == maxItems)
			{
				$("#add_"+itemType).hide();
			}
			
			break;
		}
	}
}
