// JavaScript Document
/*
 * page suivante
 * incrémente l'index
 * !attention! au += javascript: d'abord idx = idx/1 pour conversion en nombre
 redéfinit l'action du formulaire
 */
function next()
{
    document.searchform.action = document.location;
    var idx = document.searchform.idx.value;
    idx = idx/1;
    idx += 1;
    document.searchform.idx.value = idx;
    document.searchform.submit();
}

function gotopage(value)
{
    document.searchform.action = document.location;
    document.searchform.idx.value = value;
    document.searchform.submit();
}

/*
 * page suivante
 * incrémente l'index
 * redéfinit l'action du formulaire
 */
function previous()
{
    document.searchform.action = document.location;
    var idx = document.searchform.idx.value;
    idx -= 1;
    document.searchform.idx.value = idx;
    document.searchform.submit();
}

function research()
{
    document.searchform.action = document.location;
    document.searchform.idx.value = 1;
    document.searchform.submit();
}

function author(id,name)
{
    document.searchform.action = "search.php";
	document.getElementById('author_name_id').innerHTML =
		"<input type='hidden' name='author_name' value='" + name + "'>" +
		"<input type='hidden' name='list_author' value='" + id + "'>" +
		"<input type='hidden' name='search_idx' value='" + document.searchform.idx.value + "'>" +
		"<input type='hidden' name='search_order' value='" + document.searchform.order.value + "'>";
    document.searchform.idx.value = 1;
    document.searchform.submit();
}

function browsecat(id)
{
    document.searchform.action = "search.php";
	document.searchform.idx.value = 1;
    if (id != '0')
		document.searchform.category_id.value = id;
    document.searchform.submit();
}

function detail(isbn)
{
    document.searchform.action = "search.php";
	document.getElementById('author_name_id').innerHTML =
		"<input type='hidden' name='detail' value='" + isbn + "'>";
    document.searchform.submit();
}

function backtosearch()
{
    document.searchform.action = "search.php";
	document.searchform.list_author.value = "";
    document.searchform.idx.value = document.searchform.search_idx.value;
	document.searchform.order.value = document.searchform.search_order.value;
    document.searchform.submit();
}