
jQuery(document).ready(function() {

	/*
	$.featureList(
		$("#tabs li a"),
		$("#output li"), {
			start_item	:	1
		}
	);
	*/
	// Alternative
	
	//jQuery('#marche-deroulant').html("pouetpouet").hide().slideToggle();
	jQuery('marquee').marquee().mouseover(function () {  jQuery(this).trigger('stop');}).mouseout(function () {  jQuery(this).trigger('start');});
	$('div.demo marquee').marquee('pointer').mouseover(function () { $(this).trigger('stop'); });		
	
	$("#recherche_field").autocomplete("http://www.primaliance.com/index.php/ajax/autocomplete/" );
	
	
	
});

function formatItem(row) {
	return row[0] + " (<strong>id: " + row[1] + "</strong>)";
}
function formatResult(row) {
	return row[0].replace(/(<.+?>)/gi, '');
}
	

function palmaresRendement()
{
	if( ! jQuery("#palmares_list_linkrendement").hasClass("selected") )
	{
		jQuery("#consult_list").hide();
		jQuery("#rendements_list").fadeIn();
		
		jQuery("#palmares_list_linkconsult").removeClass("selected");
		jQuery("#palmares_list_linkrendement").addClass("selected");
	}

}

function palmaresConsult()
{
	if( ! jQuery("#palmares_list_linkconsult").hasClass("selected") )
	{
		jQuery("#rendements_list").hide();
		jQuery("#consult_list").fadeIn();
		
		
		jQuery("#palmares_list_linkconsult").addClass("selected");
		jQuery("#palmares_list_linkrendement").removeClass("selected");
	}
	
}

function lookup(inputString) 
{
	if(inputString.length == 0) {
		$('#suggestions').hide();
	} else {
		$.post("http://www.primaliance.fr/index.php/ajax/autocomplete/", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) 
			{
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
			}
		});
	}
}

function fill(thisValue) 
{
	$('#recherche_field').val(thisValue);
	setTimeout("$('#suggestions').hide();", 200);
}   
			
			