function show_motif( show_num, num_motifs )
{
	// show and hide
	for( i=1; i<=num_motifs; i++ )
	{
		hide_element = "motif" + i;
		document.getElementById( hide_element ).style.display = 'none';
	}
	show_element = "motif" + show_num;
	document.getElementById( show_element ).style.display = 'block';

	if( num_motifs > 1 )
	{
		// highlight link
		for( i=1; i<=num_motifs; i++ )
		{
			motif_js_link_i = "motif_js_link" + i;
			document.getElementById( motif_js_link_i ).style.background = "transparent";
		}
		motif_js_link_i = "motif_js_link" + show_num;
		document.getElementById( motif_js_link_i ).style.background = "#555;";
		

		// set prev and next	
		prev = show_num - 1;
		if( prev <= 0 )
			prev = num_motifs;
	
		document.getElementById( "motif_js_link_prev" ).setAttribute( "href", "javascript:show_motif( " + prev + ", " + num_motifs + ")" );
			
		next = show_num + 1;
		if( next > num_motifs )
			next = 1;

		document.getElementById( "motif_js_link_next" ).setAttribute( "href", "javascript:show_motif( " + next + ", " + num_motifs + ")" );
	}
}
