<!-- search insitus by a large set of options customizable -->
<html>
<head>
<title>ANISEED - Expression data search (Ciona intestinalis, Halocynthia roretzi)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="This page combines the search options of the Find Ciona intestinalis or Halocynthia roretzi genes expressed in territories of interested and Find the Ciona intestinalis or Halocynthia roretzi in situs patterns associated to a gene/clone pages.">
<meta name="keywords" content="Ciona intestinalis, Halocynthia roretzi, ascidian database, ciona intestinalis database, expression data, in situ data, search interface">
<meta name = "robots" content = "index, follow, all">
<META HTTP-EQUIV="Content-Language" CONTENT="EN">
<style type="text/css">
</style>
</head>


<?php
/*
    ANISEED, NISEED System and Database
    Copyright (C) 2007 Olivier Tassy, Fabrice Daian, Patrick Lemaire

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
    //connection
	include("connection.php");

	$regionarray=array();
	array_pop($regionarray);
	$idanatarray=array();
	array_pop($idanatarray);
	
//le dual
	$notregionarray=array();
	array_pop($notregionarray);
	$notidanatarray=array();
	array_pop($notidanatarray);

	
	if(isset($_POST["celllist"])){
		$regionarray=split(":",$_POST["celllist"]);
		array_pop($regionarray);
	    $idanatarray=$regionarray;
        array_pop($idanatarray);
	}else{
	
	if(isset($_GET["region"])){
		$regionarray=split(":",$_GET["region"]);
		array_pop($regionarray);
	}
    if(isset($_GET["idanat"])){
	    $idanatarray=split(":",$_GET["idanat"]);
        array_pop($idanatarray);
	}
	
	}

//le dual
	if(isset($_POST["notcelllist"])){
		$notregionarray=split(":",$_POST["notcelllist"]);
		array_pop($notregionarray);
	    $notidanatarray=$notregionarray;
        array_pop($notidanatarray);
	}else{
	
	if(isset($_GET["notregion"])){
		$notregionarray=split(":",$_GET["notregion"]);
		array_pop($notregionarray);
	}
    if(isset($_GET["notidanat"])){
	    $notidanatarray=split(":",$_GET["notidanat"]);
        array_pop($notidanatarray);
	}
	
	}
	
?>

<SCRIPT>

var selected_part_region=new Array();
var selected_part_notregion=new Array();

<?php

    //init du tableau avec les valeurs de l'espece precedente
	if(count($regionarray)==count($idanatarray)){
		for($a=0;$a<count($regionarray);++$a){
			print "self.addtoarray_region('$regionarray[$a]','$idanatarray[$a]');";
		}
	}

//Le dual
    //init du tableau avec les valeurs de l'espece precedente
	if(count($notregionarray)==count($notidanatarray)){
		for($a=0;$a<count($notregionarray);++$a){
			print "self.addtoarray_notregion('$notregionarray[$a]','$notidanatarray[$a]');";
		}
	}



?>

function popup_anatomy_selector_region() {

  tab=window.document.formulaire2.iddev.value.split(":");
  dev = "";
  names = "";
  for(a=1; a<window.document.formulaire.devstage.options.length; ++a){
  	if(window.document.formulaire.devstage.options[a].selected==true){
	  	dev+= tab[a-1]+':';
		names+= window.document.formulaire.devstage.options[a].text+':';
	}
  }
  if(dev.length<=1){
  	alert("Select an Ascidian species and specific developmental stages first");
	return;
  }
  
  species=window.document.formulaire.species.options[window.document.formulaire.species.selectedIndex].text;

  if ((window.document.anat_keywords == null) || (window.document.anat_keywords.closed == true)) {
    window.document.anat_keywords = window.open("anatomytreestain.php?namedev="+names+"&iddev="+dev+"&species="+species,"anat_keywords","menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,height=500,width=600");
  } else {
    window.document.anat_keywords.focus();
  } 
}

function popup_anatomy_selector_notregion() {

  tab=window.document.formulaire2.iddev.value.split(":");
  dev = "";
  names = "";
  for(a=1; a<window.document.formulaire.devstage.options.length; ++a){
  	if(window.document.formulaire.devstage.options[a].selected==true){
	  	dev+= tab[a-1]+':';
		names+= window.document.formulaire.devstage.options[a].text+':';
	}
  }
  if(dev.length<=1){
  	alert("Select an Ascidian species and specific developmental stages first");
	return;
  }
  
  species=window.document.formulaire.species.options[window.document.formulaire.species.selectedIndex].text;

  if ((window.document.anat_keywords == null) || (window.document.anat_keywords.closed == true)) {
    window.document.anat_keywords = window.open("anatomytreeunstain.php?namedev="+names+"&iddev="+dev+"&species="+species,"anat_keywords","menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,height=500,width=600");
  } else {
    window.document.anat_keywords.focus();
  } 
}




function reset_structures_region(){
	window.document.formulaire.region.options.length=1;
	selected_part_region=new Array();
	window.document.formulaire.idanat.value='';
	reloadit();
}
//Le dual
function reset_structures_notregion(){
	window.document.formulaire.notregion.options.length=1;
	selected_part_notregion=new Array();
	window.document.formulaire.notidanat.value='';
	reloadit();
}


function remove_structures_region(){
	
	for(a=0; a<selected_part_region.length; ++a){
		if(window.document.formulaire.region.options[a+1].selected == true){
			selected_part_region.splice(a,1);
			window.document.formulaire.region.options[a+1]=null;
			a-=1;
		}
	}
	update_region();
	reloadit();
}
//Le dual
function remove_structures_notregion(){
	
	for(a=0; a<selected_part_notregion.length; ++a){
		if(window.document.formulaire.notregion.options[a+1].selected == true){
			selected_part_notregion.splice(a,1);
			window.document.formulaire.notregion.options[a+1]=null;
			a-=1;
		}
	}
	update_notregion();
	reloadit();
}



function addtoarray_region(name,value){
for (a=0;a<window.document.formulaire.devstage.length;a++)
{
if (window.document.formulaire.devstage.options[a].selected==true) break;
}

//Avec le stade de developpement mais ca plante, a reprendre ...
//selected_part_region[selected_part_region.length]=[name+" ("+window.document.formulaire.devstage.options[a].text+") " ,value];
selected_part_region[selected_part_region.length]=[name,value];
}
//Le dual
function addtoarray_notregion(name,value){
for (a=0;a<window.document.formulaire.devstage.length;a++)
{
if (window.document.formulaire.devstage.options[a].selected==true) break;
}
//Avec le stade de developpement mais ca plante, a reprendre ...
//selected_part_notregion[selected_part_notregion.length]=[name+" ("+window.document.formulaire.devstage.options[a].text+") ",value];
selected_part_notregion[selected_part_notregion.length]=[name,value];
}


function retrenchtoarray_region(num){
	selected_part_region.splice(num,1);
}
//Le dual
function retrenchtoarray_notregion(num){
	selected_part_notregion.splice(num,1);
}

function update_region(){
	window.document.formulaire.region.options.length = selected_part_region.length + 1;
	ids="";
	for(a=0; a<selected_part_region.length; ++a){
		window.document.formulaire.region.options[a+1].text = selected_part_region[a][0];//+" ("+selected_part[a][1]+")";
		ids+=selected_part_region[a][1]+":";
	}
	window.document.formulaire.idanat.value=ids;
	
}
//Le dual
function update_notregion(){
	window.document.formulaire.notregion.options.length = selected_part_notregion.length + 1;
	ids="";
	for(a=0; a<selected_part_notregion.length; ++a){
		window.document.formulaire.notregion.options[a+1].text = selected_part_notregion[a][0];//+" ("+selected_part[a][1]+")";
		ids+=selected_part_notregion[a][1]+":";
	}
	window.document.formulaire.notidanat.value=ids;
	
}

function reloadit(){
  	tab=window.document.formulaire2.iddev.value.split(":");
	dev='';
	for(a=1; a<window.document.formulaire.devstage.options.length; ++a){
  		if(window.document.formulaire.devstage.options[a].selected==true){
	  		dev+= tab[a-1]+':';
		}	
  	}
	window.document.formulaire.selectediddev.value=dev;
	
	
	if( (window.document.anat_keywords != null)&&(window.document.anat_keywords.closed == false) ) {
		window.document.anat_keywords.close();
		popup_anatomy_selector();
	}
}

function getSelectedAnatomy_region(){
    str="";
    for(a=1; a<window.document.formulaire.region.options.length ;++a){
	    str+=window.document.formulaire.region.options[a].text+":";
	}
	return (str);
}
function getSelectedAnatomy_notregion(){
    str="";
    for(a=1; a<window.document.formulaire.notregion.options.length ;++a){
	    str+=window.document.formulaire.notregion.options[a].text+":";
	}
	return (str);
}

function getTarget(){
/*
    var targ="";

	var maReg = new RegExp( ":", "gi" ) ;
	var Chaine = window.document.formulaire.target.value;
	var tab = Chaine.match(maReg);

	if(tab.length<=100){
	*/
	    targ=window.document.formulaire.target.value;
	/*
	}else{
	    targ="";
	    alert("Sorry, due to performance reasons, you cannot search for more than 100 molecules with this tool");
	}
    */
	return (targ);
}


function enableField(){
    if(window.document.formulaire.fatemode[0].checked==true){
        window.document.formulaire.region.disabled=false;
	window.document.formulaire.notregion.disabled=false;
		window.document.formulaire.elements['fate[]'].disabled=true;
		window.document.formulaire.elements['notfate[]'].disabled=true;
	}else{
        window.document.formulaire.region.disabled=true;
	window.document.formulaire.notregion.disabled=true;
		window.document.formulaire.elements['fate[]'].disabled=false;
		window.document.formulaire.elements['notfate[]'].disabled=false;
	}
}
</SCRIPT>


<?php
    include("frames_header.php");

?>

<?php
    $species="";
	if (isset($_GET["species"])) $species=$_GET["species"];

	/* A OLIVIER
	if(strlen($species)>0){
		$query="SELECT NAME, DEV_STAGE_ID FROM CIONA_DESIGN.DEV_STAGE WHERE SPECIES='$species' ORDER BY DEV_PERCENT";
		$stmt = OCIParse($connection, $query);
		OCIExecute($stmt);
	}*/
	
	/* A MOI */
	if(strlen($species)>0){
	$requete="SELECT \"NAME\", \"DEV_STAGE_ID\" FROM \"DEV_STAGE\" WHERE \"SPECIES\"='$species' ORDER BY \"DEV_PERCENT\"";
		$query=pg_query($c,$requete);
		
	}
	/* --- */
	$author="";
	if((isset($_GET["author"]))and(strlen($_GET["author"])>0))
	    $author=$_GET["author"];
	
	$pmid="";
	if((isset($_GET["pmid"]))and(strlen($_GET["pmid"])>0))
	    $pmid=$_GET["pmid"];

	$mutant="";
	if((isset($_GET["mutant"]))and(strlen($_GET["mutant"])>0))
	    $mutant=$_GET["mutant"];
	/*
	$moltype="";
	if((isset($_GET["MOLtype"]))and(strlen($_GET["MOLtype"])>0))
	    $moltype=$_GET["MOLtype"];
	*/
	
	$moltype="";
	if((isset($_GET["MOLtype"]))and(strlen($_GET["MOLtype"])>0))
	    $moltype=$_GET["MOLtype"];
	else
	    //$moltype="2";
	    $moltype="10";
	
	$target="";
	if((isset($_GET["target"]))and(strlen($_GET["target"])>0))
	    $target=$_GET["target"];
	else{
	    if((isset($_POST["genelist"]))and(strlen($_POST["genelist"])>0)){ //get the gene set to refine
		if (substr_count($_POST["genelist"],":")<=100)
		       { 
			
			$target=$_POST["genelist"];
			//$moltype=2;
			$moltype=10;
			}
		else
			{
			$target="Error! \nTOO MANY MOLECULES ...\nLimit: 100 molecules ";
			}
		}
	}
	
		
	$order="DEV_STAGE_ID";
	/*if((isset($_GET["Order"]))and(strlen($_GET["Order"])>0))
	    $order=$_GET["Order"];
	else
	    $order="SPECIES";*/
		
	$boolmut="";
	if((isset($_GET["BOOLmut"]))and(strlen($_GET["BOOLmut"])>0))
	    $boolmut=$_GET["BOOLmut"];
	else
	    $boolmut="3";
		
	$booltarg="";
	if((isset($_GET["BOOLtarg"]))and(strlen($_GET["BOOLtarg"])>0))
	    $booltarg=$_GET["BOOLtarg"];
	else
	    $booltarg="0";
		
	$only="";
	if((isset($_GET["only"]))and(strlen($_GET["only"])>0))
	    $only=$_GET["only"];
	else
	    $only="0";
		
	$boolanat="";
	if((isset($_GET["BOOLanat"]))and(strlen($_GET["BOOLanat"])>0))
	    $boolanat=$_GET["BOOLanat"];
	else
	    $boolanat="0";
		
	$boolmanip="";
	if((isset($_GET["BOOLmanip"]))and(strlen($_GET["BOOLmanip"])>0))
	    $boolmanip=$_GET["BOOLmanip"];
	else
	    $boolmanip="2";
	/*
	$fateonly="";
	if((isset($_GET["fateonly"]))and(strlen($_GET["fateonly"])>0))
	    $fateonly=$_GET["fateonly"];
	else
	    $fateonly="0";
	*/
	$fatemode="";
	if((isset($_GET["fatemode"]))and(strlen($_GET["fatemode"])>0))
	    $fatemode=$_GET["fatemode"];
	else
	    $fatemode="0";
?>
		
<div style="border-top:0px solid black;border-bottom:1px solid black;">
<font color="#D64242" size="3"><b>In situ staining advanced search.</b></font><br>
</div><br>
This page combines the search options of the Find genes expressed in
territories of interestand Find the In Situs patterns associated to
a gene/clone pages.
<br>
<br>
               <center>

		<form Method="POST" Action="insitu-result-POST.php" name="formulaire" target="_blank">




            <table width="99%" border="0" cellspacing="0" cellpadding="0">
              
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>


                <td> <center>
                    <font color="#456898" size="2"><b>Developmental stages:</b></font></center></td>
              </tr>
              <tr> 
                <td align="right"><center>
                    <font color="#456898" size="2"><b>Species:</b></font></center></td>
                <td> <div align="left"> 
                    
					<select name="species" size="1" onChange="javascript: self.location.href = 'insitu-search.php?species=' + this.options[ this.selectedIndex ].value + '&author=' + window.document.formulaire.author.value + '&pmid=' + window.document.formulaire.pmid.value    + '&Order=' + window.document.formulaire2.radioOrder.value + '&BOOLmut=' + window.document.formulaire2.radioBOOLmut.value + '&MOLtype=' + window.document.formulaire2.radioMOLtype.value + '&BOOLtarg=' + window.document.formulaire2.radioBOOLtarg.value + '&only=' + window.document.formulaire2.radioOnly.value + '&BOOLanat=' + window.document.formulaire2.radioBOOLanat.value + '&idanat=' + window.document.formulaire.idanat.value+ '&notidanat=' + window.document.formulaire.notidanat.value + '&BOOLmanip=' + window.document.formulaire2.radioBOOLmanip.value + '&fatemode=' + window.document.formulaire2.radiofatemode.value + '&region=' + self.getSelectedAnatomy_region() +'&notregion=' + self.getSelectedAnatomy_notregion() + '&target=' + self.getTarget();">
					  <option ></option>
                      <?php
							$requete5="Select \"NAME\" from \"SPECIES\" order by \"NAME\"";

							$query5=pg_query($c,$requete5);							

							while( $row5=pg_fetch_array($query5) ){
								$name=$row5["NAME"];
								print "<option value=\"$name\"";
								if($species==$name)
									print " selected";
								print ">$name</option>";
							}
					  /*
					  if ($species=="Ciona intestinalis")
						echo "<option value=\"Ciona intestinalis\" selected>Ciona intestinalis</option>";
					  else
						echo "<option value=\"Ciona intestinalis\">Ciona intestinalis</option>";

					  if ($species=="Halocynthia roretzi")
						echo "<option value=\"Halocynthia roretzi\" selected>Halocynthia roretzi</option>";
					  else
						echo "<option value=\"Halocynthia roretzi\">Halocynthia roretzi</option>";
				      */
					
					?>
                    </select>
                  </div></td>
                <td>&nbsp;</td>

                <td align="center"> <select name="devstage" size="5" multiple onChange="self.reloadit()">
                    <option>_____________any____________</option>
                    <?php
						 $id="";
						 while($row=pg_fetch_array($query))
						 {
							print "<option value=\"".$row["DEV_STAGE_ID"]."\">";
							print $row["NAME"]."</option>\n";
							
							$id .= $row["DEV_STAGE_ID"].":";
						 }
					  	?>
                  </select> <input type="hidden" name="selectediddev" value=""> 
                  <input type="hidden" name="idanat" value="<?php if (isset ($_GET["idanat"])) print $_GET["idanat"]; else if (isset ($_POST["celllist"])) print $_POST["celllist"];?>"> 
<!-- dual -->
<input type="hidden" name="notidanat" value="<?php if (isset ($_GET["notidanat"])) print $_GET["notidanat"]; else if (isset ($_POST["notcelllist"])) print $_POST["notcelllist"];?>"> 

                </td>
              </tr>
              <tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>
              <tr> 
                <td><font color="#456898" size="2"><b>Search by:</b></font></td>
                <td align="left"> 
				    <input name="fatemode" type="radio" value="0" onClick="javascript: self.enableField();" <?php if($fatemode=="0") print "checked"; ?> >
                    <font color="#456898" size="2"><b>Stained anatomy parts*:</b></font></td>
                <td>&nbsp;</td>
                <td align="center"> <center>
                    <input name="fatemode" type="radio" value="1"  onClick="javascript: self.enableField();  if(this.checked){window.document.formulaire2.radiofatemode.value='1'};" <?php if($fatemode=="1") print "checked"; ?> >
                    <font color="#456898" size="2"><b>Cell fates: </b></font>
                  </center>
		</td>

              </tr>
              <tr> 
                <td>&nbsp;</td>
                <td align="left" valign="top"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td align="left" valign="top"> <select name="region" size="10" multiple>
                          <option>__________________________</option>
                          <?php
							  for($a=0;$a<count($regionarray);++$a)
							      print "<option>".$regionarray[$a]."</option>";
						  ?>
                        </select>
                        <br> 
                        <input name="only" type="radio" value="0" <?php if($only=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioOnly.value='0';}">
                        <font color="#656565" size="-1">At least</font> 
                        <input name="only" type="radio" value="1" <?php if($only=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioOnly.value='1';}">
                        <font color="#656565" size="-1">Only</font> 
					  </td>
                      <td align="left"> &nbsp;&nbsp;<img src="pictures/button-add.jpg" onClick="self.popup_anatomy_selector_region();" border="0">&nbsp;&nbsp;<br> 
                        &nbsp;&nbsp;<img src="pictures/button-remove.jpg" onClick="self.remove_structures_region();" border="0">&nbsp;&nbsp;<br> 
                        &nbsp;&nbsp;<img src="pictures/button-reset.jpg" onClick="self.reset_structures_region();" border="0">&nbsp;&nbsp;<br> 
                        &nbsp;&nbsp; <input name="BOOLanat" type="radio" value="1" <?php if($boolanat=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLanat.value='1';}">
                        <font color="#656565" size="-1">and</font><br> &nbsp;&nbsp; <input name="BOOLanat" type="radio" value="0" <?php if($boolanat=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLanat.value='0';}">
                        <font color="#656565" size="-1">or</font><br> </td>
                    </tr>
                  </table>
				
				</td>
                <td>&nbsp;</td>

                <td valign="top" align="center">

						   <select name="fate[]" size="10" multiple <?php if($fatemode=="0")print "disabled"; ?>>
							  <option>__________________________</option>
							  <?php

								$requete="SELECT \"KEYWORDS\" FROM \"FATE_KW\" ORDER BY \"KEYWORDS\"";
								  $query=pg_query($c,$requete);
									while($row=pg_fetch_array($query))
									  print "<option>".$row["KEYWORDS"]."</option>";
							  ?>
						   </select>
							<!--  
							<br><br>
							<center>
							<input name="fateonly" type="radio" value="0" onClick="javascript: if(this.checked){window.document.formulaire2.radiofateonly.value='0'};" <?php //if($fateonly=="0")print"checked"; ?>>
							At least 
							<input name="fateonly" type="radio" value="1" onClick="javascript: if(this.checked){window.document.formulaire2.radiofateonly.value='1'};" <?php //if($fateonly=="1")print"checked"; ?>>
							Only </center>
							-->

	      </td>
	      </tr>
    <tr> 
                <td></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>

	      <tr>
	      
	      
		<td></td>
	      <td align="left">
		<font color="#456898" size="2"><b>Unstained anatomy parts*: </b></font></td>
                <td>&nbsp;</td>
		
		<td><font color="#456898" size="2"><b><center>Excluded from:</center></b></font></td>		
              <tr>
	      <td></td>
<!--Unstained -->
	      <td align="left" valign="top"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td align="left" valign="top"> <select name="notregion" size="10" multiple>
                          <option>__________________________</option>
                          <?php
							  for($a=0;$a<count($notregionarray);++$a)
							      print "<option>".$notregionarray[$a]."</option>";
						  ?>
                        </select>
                        <br> 
			<!--<center>
                        <input name="only" type="radio" value="0" <?php if($only=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioOnly.value='0';}">
                        At least 
                        <input name="only" type="radio" value="1" <?php if($only=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioOnly.value='1';}">
                        Only 
			</center>-->
					  </td>
                      <td align="left"> &nbsp;&nbsp;<img src="pictures/button-add.jpg" onClick="self.popup_anatomy_selector_notregion();" border="0">&nbsp;&nbsp;<br> 
                        &nbsp;&nbsp;<img src="pictures/button-remove.jpg" onClick="self.remove_structures_notregion();" border="0">&nbsp;&nbsp;<br> 
                        &nbsp;&nbsp;<img src="pictures/button-reset.jpg" onClick="self.reset_structures_notregion();" border="0">&nbsp;&nbsp;<br> 
                        &nbsp;&nbsp; <input name="BOOLanat" type="radio" value="1" <?php if($boolanat=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLanat.value='1';}">
                        <font color="#656565" size="-1">and</font><br> &nbsp;&nbsp; <input name="BOOLanat" type="radio" value="0" <?php if($boolanat=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLanat.value='0';}">
                        <font color="#656565" size="-1">or</font><br> </td>
                    </tr>
                  </table>
				
		</td>
<!--Fin Unstained -->
		<td></td>
<!--Ajout -->
                <td valign="top" align="center">

						   <select name="notfate[]" size="10" multiple <?php if($fatemode=="0")print "disabled"; ?>>
							  <option>__________________________</option>
							  <?php

								$requete="SELECT \"KEYWORDS\" FROM \"FATE_KW\" ORDER BY \"KEYWORDS\"";
								  $query=pg_query($c,$requete);
									while($row=pg_fetch_array($query))
									  print "<option>".$row["KEYWORDS"]."</option>";
							  ?>
						   </select>
						

	      </td>


<!--Fin Ajout -->
      </tr>
              <tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>
              <tr valign="top"> 
                <td align="right"><center>
                    <font color="#456898" size="2"><b>Stained molecule*:</b></font></center></td>
                <td> <div align="left"> 
					<textarea name="target" cols="25" rows="2"><?php print $target ?></textarea>
                  </div></td>
                <td align="left"> <input name="BOOLtarg" type="radio" value="1" <?php if($booltarg=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLtarg.value='1';}">
                  <font color="#656565" size="-1">and</font> <br> <input name="BOOLtarg" type="radio" value="0" <?php if($booltarg=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLtarg.value='0';}">
                  <font color="#656565" size="-1">or</font> <br> </td>
                <td>&nbsp;</td>
              </tr>
              <tr valign="top"> 
                <td height="26" align="right">&nbsp;</td>
                <td> 
		<input name="MOLtype" type="radio" value="1" <?php if($moltype=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioMOLtype.value='1';}"><font color="#656565" size="-1">Clone<br>
                  (e.g. 002ZE11, AF305499)</font> <br> 
		<input name="MOLtype" type="radio" value="2" <?php if($moltype=="2")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioMOLtype.value='2';}"> <font color="#656565" size="-1">Transcripts model (e.g. ci0100133709, KYOTOGRAIL2005.98.32.1, ENSCINT00000018028, ...)</font> <br>
		<input name="MOLtype" type="radio" value="10" <?php if ($moltype=="10") print "checked"; ?>
		onclick="javascript: if (this.checked) {window.document.formulaire2.radioMOLtype.value='10';}"> <font color="#656565" size="-1"> Aniseed Gene model (e.g. aniseedV3_3592, ...)</font><br>

                </td>
                <td>&nbsp;</td>
                <td> <!--<font color="#656565" size="-1"><u>Note: </u>You can search your molecule ID using the "</font><a href="molecule-search.php"  target="_blank"><font size="-1" color="#3366CC">molecule 
                  search tool</font></a>".--> &nbsp;</td>
              </tr>
              <tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>
              <tr valign="top"> 
                <td height="26" align="right"><center>
                    <font color="#456898" size="2"><b>Deregulated molecule*: </b></font></center></td>
                <td> <input name="mutant" type="text" size="30" value="<?php print $mutant; ?>"> 
                  <center>
                    <input name="BOOLmut" type="radio" value="2" <?php if($boolmut=="2")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmut.value='2';}">
                    <font color="#656565" size="-1">any </font>
                    <input name="BOOLmut" type="radio" value="3" <?php if($boolmut=="3")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmut.value='3';}">
                    <font color="#656565" size="-1">none</font> <br>
                    <font size="-1">(e.g. ci0100140606)</font> </center></td>
                <td align="left"> <input name="BOOLmut" type="radio" value="1" <?php if($boolmut=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmut.value='1';}">
                  <font color="#656565" size="-1">and </font><br> <input name="BOOLmut" type="radio" value="0" <?php if($boolmut=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmut.value='0';}">
                  <font color="#656565" size="-1">or</font> </td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>
              <tr valign="top"> 
                <td height="26" align="right"><center>
                   <font color="#456898" size="2"><b>Embryo manipulation: </b></font></center></td>
                <td> <center>
                    <input name="BOOLmanip" type="radio" value="0" <?php if($boolmanip=="0")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmanip.value='0';}">
                    <font color="#656565" size="-1">include</font>
                    <input name="BOOLmanip" type="radio" value="1" <?php if($boolmanip=="1")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmanip.value='1';}">
                    <font color="#656565" size="-1">any</font>
                    <input name="BOOLmanip" type="radio" value="2" <?php if($boolmanip=="2")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioBOOLmanip.value='2';}">
                    <font color="#656565" size="-1">none</font> </center></td>
                <td>&nbsp; </td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>
              <!--
              <tr bgcolor="#CCCC99"> 
                <td align="right"><font color="#000000"><strong>Removed structures:</strong></font></td>
                <td><select name="amputation" size="10" multiple="multiple">
                    <option>_________________________</option>
                  </select> 
                <td align="left">
					<img src="pictures/button-add.jpg" onClick="self.popup_anatomy_selector();" border="0"><br>
					<img src="pictures/button-remove.jpg" onClick="self.remove_structures();" border="0"><br>
					<img src="pictures/button-reset.jpg" onClick="self.reset_structures();" border="0"><br>
					<input name="BOOLamput" type="radio" value="1"><font color="#000000">and</font><br>
					<input name="BOOLamput" type="radio" value="0" checked><font color="#000000">or</font><br>
                </td>
                <td>&nbsp; </td>
              </tr>
			  // -->
              <tr valign="top"> 
                <td height="28" align="right"><center>
                    <font color="#456898" size="2"><b>Author name*:</b></font></center></td>
                <td> <input name="author" type="text" size="30" value="<?php print $author; ?>"> 
                  <br> <font size="-1">(e.g. Lemaire)</font> </td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>

<!-- AJOUT -->

              <tr valign="top"> 
                <td height="28" align="right"><center>
                   <font color="#456898" size="2"><b>Search by Pubmed id:</b></font></center></td>
                <td> <input name="pmid" type="text" size="30" value="<?php print $pmid; ?>"> 
                  <br> <font size="-1">(e.g. 12441299)</font> </td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td><hr color="#505f70" size="1"></td>
                <td><hr color="#505f70" size="1"></td>
                <td><hr color="#505f70" size="1"></td>
                <td><hr color="#505f70" size="1"></td>
              </tr>


<!-- FIN AJOUT -->





              <tr> 
                <td align="right"><center>
                    <font color="#456898" size="2"><b>Order results by:</b></font></center></td>
                <td> <input type="radio" name="Order" value="SPECIES" <?php if($order=="SPECIES") print "checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioOrder.value='SPECIES';}">
                  <font color="#656565" size="-1">Species</font> <br> <input type="radio" name="Order" value="DEV_STAGE_ID" <?php if($order=="DEV_STAGE_ID")print"checked"; ?> onclick="javascript:if(this.checked){window.document.formulaire2.radioOrder.value='DEV_STAGE_ID';}">
                  <font color="#656565" size="-1">Developmental stage</font> <br> </td>
                <td>&nbsp;</td>
                <td align="right"> <input name="submit" type="image" src="pictures/button-submit.jpg" onClick="submit"> 
                  &nbsp;&nbsp; </td>
              </tr>
<?// Rajout de la possibilité de faire afficher les résultats d'insitu sous forme de fichier plats ?>
		<tr> 
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
                <td><hr color="#505F70" size="1"></td>
              </tr>
<!--		<tr>
		<td>
		<center><strong>Display</strong></center>
		</td>
 <td> <input type="radio" name="Display" value="classic"  onclick="javascript:if(this.checked){window.document.formulaire2.radioOrder.value='classic';}" checked="true">
                  Classic <br> <input type="radio" name="Display" value="raw"  onclick="javascript:if(this.checked){window.document.formulaire2.radioOrder.value='raw';}">
                  Raw text format <small>(max: 200 records)</small> <br> </td>
		
		


	
		</tr>    -->
<? // fin ?>

            </table>
			
			
		</form>
		
	  </center>
	  
        <strong>Notes:</strong><br>
* You can enter several names by separating your entries with the ":"
symbol.<br>
If you are searching for a C.intestinalis gene model please use its
JGIv1.0, Kyotograil or ENSEMBL model ID found using the <a href="molecule-search.php"  target="_blank"><font color="#3366CC">"Find a gene model by its name"</font></font></a> interface
        <br><br>
		
        ** In order to use the &quot;Stained anatomy parts&quot; field, please 
        select first an Ascidian species and one or several development stages 
        then press the 'add' button.<br><br>

        <form name="formulaire2">
          <input type="hidden" name="radioOrder" value="<?php print $order; ?>">
          <input type="hidden" name="radioBOOLmanip" value="<?php print $boolmanip; ?>">
          <input type="hidden" name="radioBOOLmut" value="<?php print $boolmut; ?>">
          <input type="hidden" name="radioMOLtype" value="<?php print $moltype; ?>">
          <input type="hidden" name="radioBOOLtarg" value="<?php print $booltarg; ?>">
          <input type="hidden" name="radioOnly" value="<?php print $only; ?>">
          <input type="hidden" name="radioBOOLanat" value="<?php print $boolanat; ?>">
		  <input type="hidden" name="iddev" value="<?php print $id; ?>">
		  <input type="hidden" name="radiofatemode" value="<?php print $fatemode; ?>">

		  <!--  
		  <input type="hidden" name="radiofateonly" value="<?php //print $fateonly; ?>">
		  -->
        </form>

<?php
    include("frames_footer.php");
?> 
