// JavaScript Document

function selectAll(cbList,bSelect) {
  for (var i=0; i<cbList.length; i++) 
    cbList[i].selected = cbList[i].checked = bSelect;
}
 
function selectAllByName(cbList,names,saBox) {
  	for (var i=0; i<cbList.length; i++) {
		if(cbList[i].name == saBox){
			bSelect = cbList[i].checked;
		}
	}
	for (var i=0; i<cbList.length; i++) {
		if(cbList[i].name == names){
			cbList[i].selected = cbList[i].checked = bSelect;
		}
	}
}

function selectAllcb(cbList,saBox) {
  	for (var i=0; i<cbList.length; i++) {
		if(cbList[i].name == saBox){
			bSelect = cbList[i].checked;
		}
	}
	for (var i=0; i<cbList.length; i++) {
		cbList[i].selected = cbList[i].checked = bSelect;
	}
}

function selectAllByNameButton(cbList,names,bSelect) {
	for (var i=0; i<cbList.length; i++) {
		if(cbList[i].name == names){
			cbList[i].selected = cbList[i].checked = bSelect;
		}
	}
}

function PopulateSearchChoices() {

   var taxlist = document.search_form.taxid;
   
   // Clear out the list of teams
   ClearOptions(document.search_form.return_data);
   
//   alert(taxlist[taxlist.selectedIndex].value);
   if (taxlist[taxlist.selectedIndex].value == "7227") {
      
      AddToOptionList(document.search_form.return_data, "9", "RNAi / Expression data", "default");
	  AddToOptionList(document.search_form.return_data, "1", "Gene data", "gene");
	  AddToOptionList(document.search_form.return_data, "2", "Protein data", "protein");	  
	  AddToOptionList(document.search_form.return_data, "3", "Homology data", "homology");	  	  
	  AddToOptionList(document.search_form.return_data, "4", "InterPro Motifs", "ipr");	  	  	  
	  AddToOptionList(document.search_form.return_data, "5", "GO Terms", "go");	  
	  AddToOptionList(document.search_form.return_data, "8", "Protein interactions", "p2pi");
	  AddToOptionList(document.search_form.return_data, "10", "Primers", "primer");
	  AddToOptionList(document.search_form.return_data, "0", "Everything", "all");	 
   }

   if (taxlist[taxlist.selectedIndex].value != "7227") {
      AddToOptionList(document.search_form.return_data, "3", "Homology data", "homology");	
	  AddToOptionList(document.search_form.return_data, "1", "Gene data", "gene");
	  AddToOptionList(document.search_form.return_data, "2", "Protein data", "protein");	    
	  AddToOptionList(document.search_form.return_data, "4", "InterPro Motifs", "ipr");	  	  	  
	  AddToOptionList(document.search_form.return_data, "5", "GO Terms", "go");	 
	  AddToOptionList(document.search_form.return_data, "6", "RNAi experiments", "rnai");	  
	  AddToOptionList(document.search_form.return_data, "8", "Protein interactions", "p2pi");	
	  AddToOptionList(document.search_form.return_data, "0", "Everything", "all");
   }

}

function ClearOptions(OptionList) {
   // Always clear an option list from the last entry to the first
   for (x = OptionList.length; x >= 0; x = x - 1) {
      OptionList[x] = null;
   }
}

function AddToOptionList(OptionList, OptionValue, OptionText, OptionName) {
   // Add option to the bottom of the list
   OptionList[OptionList.length] = new Option(OptionText, OptionValue);
   if (OptionName != null)
     OptionList[OptionList.length-1].name = OptionName;
}

function PopulateImageParameterChoices() {
   var type = document.parameter_choice.param_type;
   ClearOptions(document.parameter_choice.parameter);
   if (type[type.selectedIndex].value == "Cell") {
	      AddToOptionList(document.parameter_choice.parameter, "NA", "None", "0");
	      AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITY_BLUE", "Integrated Intensity Blue", "1");
	      AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITY_BLUE", "Mean Intensity Blue", "2");
	      AddToOptionList(document.parameter_choice.parameter, "STDINTENSITY_BLUE", "Standard deviation in Intensity Blue", "3");
	      AddToOptionList(document.parameter_choice.parameter, "MININTENSITY_BLUE", "Minimum Intensity Blue", "4");
	      AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITY_BLUE", "Maximum Intensity Blue", "5");
	      AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITYEDGE_BLUE", "Integrated Intensity Edge Blue", "6");
	      AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITYEDGE_BLUE", "Mean Intensity Edge Blue", "7");
	      AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_BLUE", "Standard deviation in Intensity Edge Blue", "8");
	      AddToOptionList(document.parameter_choice.parameter, "MININTENSITYEDGE_BLUE", "Minimum Intensity Edge Blue", "9");
	      AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITYEDGE_BLUE", "Maximum Intensity Edge Blue", "10");
	      AddToOptionList(document.parameter_choice.parameter, "MASSDISPLACEMENT_BLUE", "Mass Displacement Blue", "11");
	      AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITY_RED", "Integrated Intensity Red", "12");
	      AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITY_RED", "Mean Intensity Red", "13");
	      AddToOptionList(document.parameter_choice.parameter, "STDINTENSITY_RED", "Standard deviation in Intensity Red", "14");
	      AddToOptionList(document.parameter_choice.parameter, "MININTENSITY_RED", "Minimum Intensity Red", "15");
	      AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITY_RED", "Maximum Intensity Red", "16");
	      AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITYEDGE_RED", "Integrated Intensity Edge Red", "17");
	      AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITYEDGE_RED", "Mean Intensity Edge Red", "18");
	      AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_RED", "Standard deviation in Intensity Edge Red", "19");
		AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_RED", "Standard deviation in Intensity Edge Red", "20");
		AddToOptionList(document.parameter_choice.parameter, "MININTENSITYEDGE_RED", "Minimum Intensity Edge Red", "21");
		AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITYEDGE_RED", "Maximum Intensity Edge Red", "22");
		AddToOptionList(document.parameter_choice.parameter, "MASSDISPLACEMENT_RED", "Mass Displacement Red", "23");
		AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITY_GREEN", "Integrated Intensity Green", "24");
		AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITY_GREEN", "Mean Intensity Green", "25");
		AddToOptionList(document.parameter_choice.parameter, "STDINTENSITY_GREEN", "Standard deviation in Intensity Green", "26");
		AddToOptionList(document.parameter_choice.parameter, "MININTENSITY_GREEN", "Minimum Intensity Green", "27");
		AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITY_GREEN", "Maximum Intensity Green", "28");
		AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITYEDGE_GREEN", "Integrated Intensity Edge Green", "29");
		AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITYEDGE_GREEN", "Mean Intensity Edge Green", "30");
		AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_GREEN", "Standard deviation in Intensity Edge Green", "31");
		AddToOptionList(document.parameter_choice.parameter, "MININTENSITYEDGE_GREEN", "Minimum Intensity Edge Green", "32");
		AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITYEDGE_GREEN", "Maximum Intensity Edge Green", "33");
		AddToOptionList(document.parameter_choice.parameter, "MASSDISPLACEMENT_GREEN", "Mass Displacement Green", "34");
		AddToOptionList(document.parameter_choice.parameter, "AREA", "Area", "35");
		AddToOptionList(document.parameter_choice.parameter, "ECCENTRICITY", "Eccentricity", "36");
		AddToOptionList(document.parameter_choice.parameter, "SOLIDITY", "Solidity", "37");
		AddToOptionList(document.parameter_choice.parameter, "EXTENT", "Extent", "38");
		AddToOptionList(document.parameter_choice.parameter, "EULERNUMBER", "Euler Number", "39");
		AddToOptionList(document.parameter_choice.parameter, "PERIMETER", "Perimeter", "40");
		AddToOptionList(document.parameter_choice.parameter, "FORMFACTOR", "Form factor", "41");
		AddToOptionList(document.parameter_choice.parameter, "MAJORAXISLENGTH", "Major Axis length", "42");
		AddToOptionList(document.parameter_choice.parameter, "MINORAXISLENGTH", "Minor axis length", "43");
		AddToOptionList(document.parameter_choice.parameter, "ORIENTATION", "Orientation", "44");
		AddToOptionList(document.parameter_choice.parameter, "ANGULARSECONDMOMENT_GREEN", "Angular Second Moment Green", "45");
		AddToOptionList(document.parameter_choice.parameter, "CONTRAST_GREEN", "Contrast Green", "45");
		AddToOptionList(document.parameter_choice.parameter, "CORRELATION_GREEN", "Correlation Green", "46");
		AddToOptionList(document.parameter_choice.parameter, "VARIANCE_GREEN", "Variance Green", "47");
		AddToOptionList(document.parameter_choice.parameter, "INVERSEDIFFERENCEMOMENT_GREEN", "Inverse Difference Moment Green", "48");
		AddToOptionList(document.parameter_choice.parameter, "SUMAVERAGE_GREEN", "Sum Average Green", "49");
		AddToOptionList(document.parameter_choice.parameter, "SUMVARIANCE_GREEN", "Sum Variance Green", "50");
		AddToOptionList(document.parameter_choice.parameter, "SUMENTROPY_GREEN", "Sum Entropy Green", "51");
		AddToOptionList(document.parameter_choice.parameter, "ENTROPY_GREEN", "Entropy Green", "52");
		AddToOptionList(document.parameter_choice.parameter, "DIFFERENCEVARIANCE_GREEN", "Difference Variation Green", "53");
		AddToOptionList(document.parameter_choice.parameter, "DIFFERENCEENTROPY_GREEN", "Difference Entropy Green", "54");
		AddToOptionList(document.parameter_choice.parameter, "INFORMATIONMEASURE1_GREEN", "Information Measure 1 Green", "55");
		AddToOptionList(document.parameter_choice.parameter, "INFORMATIONMEASURE2_GREEN", "Information Measure 2 Green", "56");
		AddToOptionList(document.parameter_choice.parameter, "GABORX_GREEN", "Gabor X Green", "57");
		AddToOptionList(document.parameter_choice.parameter, "GABORY_GREEN", "Gabor Y Green", "58");
		AddToOptionList(document.parameter_choice.parameter, "ANGULARSECONDMOMENT_RED", "Angular Second Moment Red", "59");
		AddToOptionList(document.parameter_choice.parameter, "CONTRAST_RED", "Contrast Red", "60");
		AddToOptionList(document.parameter_choice.parameter, "CORRELATION_RED", "Correlation Red", "61");
		AddToOptionList(document.parameter_choice.parameter, "VARIANCE_RED", "Variance Red", "62");
		AddToOptionList(document.parameter_choice.parameter, "INVERSEDIFFERENCEMOMENT_RED", "Inverse Difference Moment Red", "63");
		AddToOptionList(document.parameter_choice.parameter, "SUMAVERAGE_RED", "Sum Average Red", "64");
		AddToOptionList(document.parameter_choice.parameter, "SUMVARIANCE_RED", "Sum Variance Red", "65");
		AddToOptionList(document.parameter_choice.parameter, "SUMENTROPY_RED", "Sum Entropy Red", "66");
		AddToOptionList(document.parameter_choice.parameter, "ENTROPY_RED", "Entropy Red", "67");
		AddToOptionList(document.parameter_choice.parameter, "DIFFERENCEVARIANCE_RED", "Difference Variation Red", "68");
		AddToOptionList(document.parameter_choice.parameter, "DIFFERENCEENTROPY_RED", "Difference Entropy Red", "69");
		AddToOptionList(document.parameter_choice.parameter, "INFORMATIONMEASURE1_RED", "Information Measure 1 Red", "70");
		AddToOptionList(document.parameter_choice.parameter, "INFORMATIONMEASURE2_RED", "Information Measure 2 Red", "71");
		AddToOptionList(document.parameter_choice.parameter, "GABORX_RED", "Gabor X Red", "72");
		AddToOptionList(document.parameter_choice.parameter, "GABORY_RED", "Gabor Y Red", "73");

   }
   else if (type[type.selectedIndex].value == "Nuclear") {
			AddToOptionList(document.parameter_choice.parameter, "NA", "None", "1");
			AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITY_BLUE", "Integrated Intensity Blue", "2");
			AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITY_BLUE", "Mean Intensity Blue", "3");
			AddToOptionList(document.parameter_choice.parameter, "STDINTENSITY_BLUE", "Standard deviation in Intensity Blue", "4");
			AddToOptionList(document.parameter_choice.parameter, "MININTENSITY_BLUE", "Minimum Intensity Blue", "5");
			AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITY_BLUE", "Maximum Intensity Blue", "6");
			AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITYEDGE_BLUE", "Integrated Intensity Edge Blue", "7");
			AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITYEDGE_BLUE", "Mean Intensity Edge Blue", "8");
			AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_BLUE", "Standard deviation in Intensity Edge Blue", "9");
			AddToOptionList(document.parameter_choice.parameter, "MININTENSITYEDGE_BLUE", "Minimum Intensity Edge Blue", "10");
			AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITYEDGE_BLUE", "Maximum Intensity Edge Blue", "11");
			AddToOptionList(document.parameter_choice.parameter, "MASSDISPLACEMENT_BLUE", "Mass Displacement Blue", "12");
			AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITY_RED", "Integrated Intensity Red", "13");
			AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITY_RED", "Mean Intensity Red", "14");
			AddToOptionList(document.parameter_choice.parameter, "STDINTENSITY_RED", "Standard deviation in Intensity Red", "15");
			AddToOptionList(document.parameter_choice.parameter, "MININTENSITY_RED", "Minimum Intensity Red", "16");
			AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITY_RED", "Maximum Intensity Red", "17");
			AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITYEDGE_RED", "Integrated Intensity Edge Red", "18");
			AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITYEDGE_RED", "Mean Intensity Edge Red", "19");
			AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_RED", "Standard deviation in Intensity Edge Red", "20");
			AddToOptionList(document.parameter_choice.parameter, "MININTENSITYEDGE_RED", "Minimum Intensity Edge Red", "21");
			AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITYEDGE_RED", "Maximum Intensity Edge Red", "22");
			AddToOptionList(document.parameter_choice.parameter, "MASSDISPLACEMENT_RED", "Mass Displacement Red", "23");
			AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITY_GREEN", "Integrated Intensity Green", "24");
			AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITY_GREEN", "Mean Intensity Green", "25");
			AddToOptionList(document.parameter_choice.parameter, "STDINTENSITY_GREEN", "Standard deviation in Intensity Green", "26");
			AddToOptionList(document.parameter_choice.parameter, "MININTENSITY_GREEN", "Minimum Intensity Green", "27");
			AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITY_GREEN", "Maximum Intensity Green", "28");
			AddToOptionList(document.parameter_choice.parameter, "INTEGRATEDINTENSITYEDGE_GREEN", "Integrated Intensity Edge Green", "29");
			AddToOptionList(document.parameter_choice.parameter, "MEANINTENSITYEDGE_GREEN", "Mean Intensity Edge Green", "30");
			AddToOptionList(document.parameter_choice.parameter, "STDINTENSITYEDGE_GREEN", "Standard deviation in Intensity Edge Green", "31");
			AddToOptionList(document.parameter_choice.parameter, "MININTENSITYEDGE_GREEN", "Minimum Intensity Edge Green", "32");
			AddToOptionList(document.parameter_choice.parameter, "MAXINTENSITYEDGE_GREEN", "Maximum Intensity Edge Green", "33");
			AddToOptionList(document.parameter_choice.parameter, "MASSDISPLACEMENT_GREEN", "Mass Displacement Green", "34");
			AddToOptionList(document.parameter_choice.parameter, "AREA", "Area", "35");
			AddToOptionList(document.parameter_choice.parameter, "ECCENTRICITY", "Eccentricity", "36");
			AddToOptionList(document.parameter_choice.parameter, "SOLIDITY", "Solidity", "37");
			AddToOptionList(document.parameter_choice.parameter, "EXTENT", "Extent", "38");
			AddToOptionList(document.parameter_choice.parameter, "EULERNUMBER", "Euler Number", "39");
			AddToOptionList(document.parameter_choice.parameter, "PERIMETER", "Perimeter", "40");
			AddToOptionList(document.parameter_choice.parameter, "FORMFACTOR", "Form factor", "41");
			AddToOptionList(document.parameter_choice.parameter, "MAJORAXISLENGTH", "Major Axis length", "42");
			AddToOptionList(document.parameter_choice.parameter, "MINORAXISLENGTH", "Minor axis length", "43");
			AddToOptionList(document.parameter_choice.parameter, "ORIENTATION", "Orientation", "44");
   }
}

function PopulateHomologyChoices() {
   var taxlist = document.homology_form.in_species;
   var dataset = document.homology_form.dataset;
   // Clear out the list of teams
   ClearOptions(document.homology_form.out_species);
   
	//Alert(taxlist[taxlist.selectedIndex].value);
   if (taxlist[taxlist.selectedIndex].value == "7227") {
      if (dataset[dataset.selectedIndex].value == "homologene") {
	      AddToOptionList(document.homology_form.out_species, "9606", "Homo sapiens", "0");
	      AddToOptionList(document.homology_form.out_species, "10090", "Mus musculus", "1");
		  AddToOptionList(document.homology_form.out_species, "10116", "Rattus norvegicus", "2");
		  AddToOptionList(document.homology_form.out_species, "6239", "Caenorhabditis elegans", "3");	  
		  AddToOptionList(document.homology_form.out_species, "4896", "Schizosaccharomyces pombe", "4");	  	  
		  AddToOptionList(document.homology_form.out_species, "4932", "Saccharomyces cerevisiae", "5");	  	  	  
		  AddToOptionList(document.homology_form.out_species, "7165", "Anopheles gambiae", "6");	  
		  AddToOptionList(document.homology_form.out_species, "9031", "Gallus gallus", "7");
		  AddToOptionList(document.homology_form.out_species, "9598", "Pan troglodytes", "8");
		  AddToOptionList(document.homology_form.out_species, "3702", "Arabidopsis thaliana", "9");	
	   }
	   else if (dataset[dataset.selectedIndex].value == "inparanoid") {
	      AddToOptionList(document.homology_form.out_species, "9606", "Homo sapiens", "0");
	      AddToOptionList(document.homology_form.out_species, "10090", "Mus musculus", "1");
		  AddToOptionList(document.homology_form.out_species, "10116", "Rattus norvegicus", "2");
		  AddToOptionList(document.homology_form.out_species, "6239", "Caenorhabditis elegans", "3");	  
		  AddToOptionList(document.homology_form.out_species, "4896", "Schizosaccharomyces pombe", "4");	  	  
		  AddToOptionList(document.homology_form.out_species, "4932", "Saccharomyces cerevisiae", "5");	  	  	  
		  AddToOptionList(document.homology_form.out_species, "7165", "Anopheles gambiae", "6");	  
		  AddToOptionList(document.homology_form.out_species, "9031", "Gallus gallus", "7");
		  AddToOptionList(document.homology_form.out_species, "9598", "Pan troglodytes", "8");
		  AddToOptionList(document.homology_form.out_species, "3702", "Arabidopsis thaliana", "9");	
	   }
	   else if (dataset[dataset.selectedIndex].value == "blast") {
	      AddToOptionList(document.homology_form.out_species, "9606", "Homo sapiens", "0");
	      AddToOptionList(document.homology_form.out_species, "10090", "Mus musculus", "1");
		  AddToOptionList(document.homology_form.out_species, "6239", "Caenorhabditis elegans", "3");	  
		  AddToOptionList(document.homology_form.out_species, "4896", "Schizosaccharomyces pombe", "4");	  	  
		  AddToOptionList(document.homology_form.out_species, "4932", "Saccharomyces cerevisiae", "5");	  	  	  
		  AddToOptionList(document.homology_form.out_species, "7165", "Anopheles gambiae", "6");	  
	   }
   }
   else {
      AddToOptionList(document.homology_form.out_species, "7227", "Drosophila melanogaster", "10");	
   }
}

function PopulateHomologyChoicesLink() {
   var dataset = document.homology_form.dataset;
   // Clear out the list of teams
   ClearOptions(document.homology_form.out_species);
   
      if (dataset[dataset.selectedIndex].value == "homologene") {
	      AddToOptionList(document.homology_form.out_species, "9606", "Homo sapiens", "0");
	      AddToOptionList(document.homology_form.out_species, "10090", "Mus musculus", "1");
		  AddToOptionList(document.homology_form.out_species, "10116", "Rattus norvegicus", "2");
		  AddToOptionList(document.homology_form.out_species, "6239", "Caenorhabditis elegans", "3");	  
		  AddToOptionList(document.homology_form.out_species, "4896", "Schizosaccharomyces pombe", "4");	  	  
		  AddToOptionList(document.homology_form.out_species, "4932", "Saccharomyces cerevisiae", "5");	  	  	  
		  AddToOptionList(document.homology_form.out_species, "7165", "Anopheles gambiae", "6");	  
		  AddToOptionList(document.homology_form.out_species, "9031", "Gallus gallus", "7");
		  AddToOptionList(document.homology_form.out_species, "9598", "Pan troglodytes", "8");
		  AddToOptionList(document.homology_form.out_species, "3702", "Arabidopsis thaliana", "9");	
	   }
	   else if (dataset[dataset.selectedIndex].value == "inparanoid") {
	      AddToOptionList(document.homology_form.out_species, "9606", "Homo sapiens", "0");
	      AddToOptionList(document.homology_form.out_species, "10090", "Mus musculus", "1");
		  AddToOptionList(document.homology_form.out_species, "10116", "Rattus norvegicus", "2");
		  AddToOptionList(document.homology_form.out_species, "6239", "Caenorhabditis elegans", "3");	  
		  AddToOptionList(document.homology_form.out_species, "4896", "Schizosaccharomyces pombe", "4");	  	  
		  AddToOptionList(document.homology_form.out_species, "4932", "Saccharomyces cerevisiae", "5");	  	  	  
		  AddToOptionList(document.homology_form.out_species, "7165", "Anopheles gambiae", "6");	  
		  AddToOptionList(document.homology_form.out_species, "9031", "Gallus gallus", "7");
		  AddToOptionList(document.homology_form.out_species, "9598", "Pan troglodytes", "8");
		  AddToOptionList(document.homology_form.out_species, "3702", "Arabidopsis thaliana", "9");	
	   }
	   else if (dataset[dataset.selectedIndex].value == "blast") {
	      AddToOptionList(document.homology_form.out_species, "9606", "Homo sapiens", "0");
	      AddToOptionList(document.homology_form.out_species, "10090", "Mus musculus", "1");
		  AddToOptionList(document.homology_form.out_species, "6239", "Caenorhabditis elegans", "3");	  
		  AddToOptionList(document.homology_form.out_species, "4896", "Schizosaccharomyces pombe", "4");	  	  
		  AddToOptionList(document.homology_form.out_species, "4932", "Saccharomyces cerevisiae", "5");	  	  	  
		  AddToOptionList(document.homology_form.out_species, "7165", "Anopheles gambiae", "6");	  
	   }
}

function changeCellLine()
{
	var val1 = document.sample_edit_form.sample_type.options(document.sample_edit_form.sample_type.selectedIndex).value;
	if (val1 == "cell_line") {
		document.getElementById("sample_type_cell").style.visibility="visible";
		document.getElementById("sample_type_cell").style.width = "auto";			
		document.getElementById("sample_type_cell").name = "value_sample_obj_id";
		document.getElementById("sample_type_organism").style.visibility="hidden";
		document.getElementById("sample_type_organism").style.width = 0;			
		document.getElementById("sample_type_organism").name = "";
		document.sample_edit_form.value_sample_obj_type.value = "Cell line";
	}
	else if (val1 == "organism") {
		document.getElementById("sample_type_cell").style.visibility="hidden";
		document.getElementById("sample_type_cell").style.width = 0;
		document.getElementById("sample_type_cell").name = "";
		document.getElementById("sample_type_organism").style.visibility="visible";
		document.getElementById("sample_type_organism").style.width = "auto";
		document.getElementById("sample_type_organism").name = "value_sample_obj_id";			
		document.sample_edit_form.value_sample_obj_type.value = "Organism";
	}
}