/*
* Author:      Marco Kuiper (http://www.marcofolio.net/)
*/
/*
google.load("jquery", "1.3.1");
google.setOnLoadCallback(function()
{
	// Safely inject CSS3 and give the search results a shadow
	var cssObj = { 'box-shadow' : '#888 5px 10px 5px', // Added when CSS3 is standard
		'-webkit-box-shadow' : '#888 5px 5px 5px', // Safari
		'-moz-box-shadow' : '#888 5px 5px 5px'}; // Firefox 3.5+
	$("#suggestions").css(cssObj);
	
	// Fade out the suggestions box when not active
	 $("input").blur(function(){
	 	$('#suggestions').fadeOut();
	 });
});*/

function stripVowelAccent(str)
{
var s=str;

var rExps=[ /[\xC0-\xC2]/g, /[\xE0-\xE2]/g,
/[\xC8-\xCA]/g, /[\xE8-\xEB]/g,
/[\xCC-\xCE]/g, /[\xEC-\xEE]/g,
/[\xD2-\xD4]/g, /[\xF2-\xF4]/g,
/[\xD9-\xDB]/g, /[\xF9-\xFB]/g ];

var repChar=['A','a','E','e','I','i','O','o','U','u'];

for(var i=0; i<rExps.length; i++){
s=s.replace(rExps[i],repChar[i]);
}
return s;
}

function lookup(inputString) {
	inputString = stripVowelAccent(inputString);
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
		$.post("http://www.labo-sante.com/rpc.asp", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
		});
	}
}
