function Ref()
{Comesfrom=document.referrer;
	fin=Comesfrom.length;
	separateur=0;
	if (Comesfrom.lastIndexOf("/") >-1) {separateur=Comesfrom.lastIndexOf("/");}
	if (Comesfrom.lastIndexOf("?") >-1) {fin=Comesfrom.lastIndexOf("?");}
	page=Comesfrom.substring(separateur+1,fin);
return page;}

function Referee(){
showlink=false;
Comesfrom=Ref();
if ((Comesfrom=="bacteriocinslist.php")){showlink=true;}
else if ((Comesfrom=="bacteriocinslist1.php")){showlink=true;}
else if ((Comesfrom=="bacteriocins3dlist.php")){showlink=true;}
if (showlink==true){document.write('<a href="'); document.write(Comesfrom); document.write('">Back to List</a>&nbsp;');}
}
function ScreenResolutionWidth() {
   var width;
   if(window.innerWidth) {width = window.innerWidth;}
   else if(document.documentElement.clientWidth) {width = document.documentElement.clientWidth;}
   else if(document.body.clientWidth) {width = document.body.clientWidth;}
return width;
}

function ScreenResolutionHeight() {
   var height;
   if(window.innerWidth) {height = window.innerHeight;}
   else if(document.documentElement.clientWidth) {height = document.documentElement.clientHeight;}
   else if(document.body.clientWidth) {height = document.body.clientHeight;}
return height;
}

// Update links according selected rows
function ew_UpdateselectedRows() {
	var table = parent.document.getElementById(tablename);
	var TotalSelectedNumber = 0;
	var TotalSelected ='';
	for (var i = firstrowoffset; i < table.rows.length; i++) {
		var thisrow = table.rows[i];
		if (thisrow.selected) {
			TotalSelectedNumber++;
			TotalSelected += thisrow.id + ",";
		}
	}
	if (TotalSelectedNumber == 1) {
		TotalSelected = TotalSelected.substring(0,TotalSelected.length-1);
		document.BlastAlign.program.value = "blast";
		document.BlastAlign.sequence.value = TotalSelected;
		parent.document.getElementById("Blast").href= "javascript:sendjob();";
		parent.document.getElementById("Blast").style.display="inline";
		parent.document.getElementById("Align").style.display="none";

	}else if (TotalSelectedNumber>1) {
		TotalSelected = TotalSelected.substring(0,TotalSelected.length-1);
		parent.document.BlastAlign.program.value = "clustal";
		parent.document.BlastAlign.sequence.value = TotalSelected;
		parent.document.getElementById("Align").href= "javascript:sendjob();";
		parent.document.getElementById("Align").style.display="inline";
		parent.document.getElementById("Blast").style.display="none";

	}else {
		parent.document.getElementById("Blast").style.display="none";
		parent.document.getElementById("Align").style.display="none";
	}
}
function sendjob(){
	parent.document.BlastAlign.submit();
}

function icon_mouseover(icone){
	icone.style.height= (icone.height+2) +"px";
	icone.style.width = (icone.width +2) +"px";
}

function icon_mouseout(icone){
	icone.style.height= (icone.height-2) +"px";
	icone.style.width = (icone.width -2)+"px";
}

	function lookup(inputString) {
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			// post data to our php processing page and if there is a return greater than zero
			// show the suggestions box
			$.post("string_search.php", {mysearchString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} //end
	
	// if user clicks a suggestion, fill the text box.
	function fill(thisValue) {
		$('#jtextsearch').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
