
/*
jQuery.fn.set_TermListEvent = function( options ){
	var settings = { debug: false };
	if ( options ){ 
		jQuery.extend(settings, options);
	}
	$(this).load("/faq/glossary/term.php", {category:options}, function(){$('ul.double > li').set_height({ items_per_row:2, group_by_parent: 'ul', delay:100 });});
};
*/

jQuery.fn.set_FaqTermListEvent = function( options ){
	var settings = { debug: false };
	if ( options ){ 
		jQuery.extend(settings, options);
	}
	else
	{
		this.each(
			function()
			{
				var id = ($(this).attr('id')).split('category')[1];
				$(this).click(
					function()
					{
						_getTermList( id, this );
						return false;
					}
				);
			}
		);
	}
	
};


function _getTermList( $id, $this )
{
	$id   = $id ? $id : 10;
	$this = $this ? $this : $('a#category' + $id);

	$('a.getTerm').removeClass('active');
	$($this).addClass('active');
	$.post("/faq/glossary/term.php", {category:$id, mode:'ajax'},function($response)
	{
		$("#termList").html($response);
	});
}

function putKeyword($keyword)
{
	$s = ( ($('input[@name=keyword]').val()).length ) ? ' ' : '';
	$('input[@name=keyword]').val( $('input[@name=keyword]').val() + $s + $keyword + " ");
	return false;
}

jQuery(document).ready(function(){
	$('a.getTerm').set_FaqTermListEvent();
});