// JavaScript Document

function lookup(inputString) {
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$('#suggestions').hide();
	} else {
		$.post("/fonctions/rpc.php", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) {
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
			}
		});
	}
} // lookup

function fill(thisValue) {
	$('#inputString').val(thisValue);
	setTimeout("$('#suggestions').hide();", 200);
}


$(function() { 
    $("a").toolTips(); 
	<!--$("img").toolTips(); -->
}); 

function setCookie(cookieName,cookieValue) {
  document.cookie = cookieName + "=" + escape(cookieValue);
}

function getCookie(cookieName) {
  var cookieDataBeg, cookieDataEnd;
  cookieDataBeg = document.cookie.indexOf(cookieName + "=");
  if (cookieDataBeg >= 0) {
    cookieDataBeg += cookieName.length + 1;
    cookieDataEnd = document.cookie.indexOf(";",cookieDataBeg);
    if (cookieDataEnd < 0) cookieDataEnd = document.cookie.length;
    return unescape(document.cookie.substring(cookieDataBeg,cookieDataEnd));
  }
  return "";
}

function checkCookie() {
  var cookData = getCookie('popUnderEI');
  if ( cookData == "" ) {
    openSiteUnder();
    setCookie('popUnderEI','true');
  }
}

function openSiteUnder() {
  var siteUnder = window.open('http://sev4ifmxa.com/click/WEE6U2FsdGVkX18MfoMPdWgghfdZbKZxKB4rIwMJw1QsLzBS0WUdZZ0FHXlYzHysMh@3nU-eTQyRYyA=/head78', 'puei', 'left=0, top=0, width=' + screen.availWidth + ', height=' + screen.availHeight + ', scrollbars=1');
  if(siteUnder) {
    siteUnder.blur();
    window.focus();
  }
}
