var $j = jQuery.noConflict();

$j(document).ready(function(){
	
	// +/- authors:
	$j("*[id*='moreAuthorsLink']").bind("click",function(){
		return showMoreAuthors(getAuthorParameter($j(this)));
	});
	$j("*[id*='fewerAuthorsLink']").bind("click",function(){
		return showFewerAuthors(getAuthorParameter($j(this)));
	});
});

/*****************************************************************
show/hide more authors
*****************************************************************/

function getAuthorParameter(linkInst){
	var id = linkInst.attr("id");
	return  id.substr(id.indexOf("_")+1);
}

function showMoreAuthors(who){
	$j(document.getElementById("firstAuthor_"+who)).slideUp("normal");
	$j(document.getElementById("moreAuthors_"+who)).slideDown("normal");
	return false;
}

function showFewerAuthors(who){
	$j(document.getElementById("firstAuthor_"+who)).slideDown("normal");
	$j(document.getElementById("moreAuthors_"+who)).slideUp("normal");
	return false;
}

function clearFormFields(){
	$j("input[name$='Text']").val("");
	$j("select[name$='Mode']").children(":first-child").attr("selected","selected");
	$j("input[name='mainTitleText']").focus();
}
