source: geisa/web/initGeisa_script.jsp @ 615

Last change on this file since 615 was 615, checked in by npipsl, 12 years ago

noms de telechargement des fichiers

File size: 128.0 KB
Line 
1<%@ page import="com.ether.Controller" %>
2<%@ page import="com.ether.IsotopeG03" %>
3<%@ page import="com.ether.IsotopeIasiG03" %>
4<%@ page import="com.ether.IsotopeG09" %>
5<%@ page import="com.ether.IsotopeIasiG09" %>
6
7<script type="text/javascript">
8
9
10
11//permet de deselectionner la molecule quand on deselectionne un isotope (toutes les options sauf lst)
12/*function decliquemol( name )
13 {
14
15 var inputs = document.getElementsByTagName( 'input' );
16 var count = inputs.length;
17 for( i = 0; i < count; i++ )
18 {
19 input = inputs.item( i );
20 if( input.type == 'checkbox' && input.id == (name + '-all') && input.checked == true )
21 {
22 input.checked = false;
23 }
24 }
25 } */
26
27
28var InterfaceInit = Class.create( {
29
30            initialize: function()
31            {
32                /** *********** CONTAINERS *********** **/
33                this.containerFormSpectralRangeLower = $( "#spectralRangeLower" );
34                this.containerFormSpectralRangeUpper = $( "#spectralRangeUpper" );
35                this.containerFormIntensityLower = $( "#intensityLower" );
36                this.containerFormIntensityUpper = $( "#intensityUpper" );
37                this.containerFormMeanValue1 = $( "#meanValue1" );
38                this.containerDownload = $( "#downloadContainer" );
39                this.containerLoading = $( "#loading" );
40                /** *********** VARIABLE *********** **/
41                <%--this.pathImg = <%=Controller.PATH_IMAGES%>;--%>
42
43                this.initializeMolecules();
44                this.createForm();
45
46                var downloadButton = new Button( {value:"Download", parent:$( "#downloadContainer" ), id:"button_submit_2", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickDownload, this )} );
47            },
48
49            initializeMolecules: function()
50            {
51                this.arrayGeisa2011 = new Array();
52                this.arrayGeisa2003 = new Array();
53                this.arrayGeisaIasi2011 = new Array();
54                this.arrayGeisaIasi2003 = new Array();
55
56                var molecule = new Object();
57                molecule.id="h2o";
58                molecule.name="H<sub>2</sub>O";
59                molecule.isotopesArray = ["161", "162", "171", "181", "182", "172"];
60                this.arrayGeisa2011.push(molecule);
61                this.arrayGeisa2003.push(molecule);
62                this.arrayGeisaIasi2011.push(molecule);
63                this.arrayGeisaIasi2003.push(molecule);
64
65                var molecule = new Object();
66                molecule.id="co2";
67                molecule.name="CO<sub>2</sub>";
68                molecule.isotopesArray = ["626", "627", "628", "636", "637", "638", "728", "828", "838"];
69                this.arrayGeisa2003.push(molecule);
70                this.arrayGeisa2011.push(molecule);
71                this.arrayGeisaIasi2011.push(molecule);
72                this.arrayGeisaIasi2003.push(molecule);
73
74                var molecule = new Object();
75                molecule.id="o3";
76                molecule.name="O<sub>3</sub>";
77                molecule.isotopesArray = ["666", "668", "686", "667", "676"];
78                this.arrayGeisa2003.push(molecule);
79                this.arrayGeisa2011.push(molecule);
80                this.arrayGeisaIasi2011.push(molecule);
81                this.arrayGeisaIasi2003.push(molecule);
82
83                var molecule = new Object();
84                molecule.id="n2o";
85                molecule.name="N<sub>2</sub>O";
86                molecule.isotopesArray = ["446", "447", "448", "456","458", "546", "548", "556"];
87                this.arrayGeisa2011.push(molecule);
88                this.arrayGeisaIasi2011.push(molecule);
89
90                var molecule = new Object();
91                molecule.id="n2o";
92                molecule.name="N<sub>2</sub>O";
93                molecule.isotopesArray = ["446", "447", "448", "456", "546"];
94                this.arrayGeisa2003.push(molecule);
95                this.arrayGeisaIasi2003.push(molecule);
96
97                var molecule = new Object();
98                molecule.id="co";
99                molecule.name="CO";
100                molecule.isotopesArray = ["26", "36", "28", "27", "38", "37"];
101                this.arrayGeisa2011.push(molecule);
102                this.arrayGeisa2003.push(molecule);
103                this.arrayGeisaIasi2011.push(molecule);
104                this.arrayGeisaIasi2003.push(molecule);
105
106                var molecule = new Object();
107                molecule.id="ch4";
108                molecule.name="CH<sub>4</sub>";
109                molecule.isotopesArray = ["211", "311"];
110                this.arrayGeisa2011.push(molecule);
111                this.arrayGeisa2003.push(molecule);
112
113                var molecule = new Object();
114                molecule.id="ch4";
115                molecule.name="CH<sub>4</sub>";
116                molecule.isotopesArray = ["211", "311", "212", "312"];
117                this.arrayGeisaIasi2011.push(molecule);
118
119                var molecule = new Object();
120                molecule.id="ch4";
121                molecule.name="CH<sub>4</sub>";
122                molecule.isotopesArray = ["211", "311", "212"];
123                this.arrayGeisaIasi2003.push(molecule);
124
125                var molecule = new Object();
126                molecule.id="o2";
127                molecule.name="O<sub>2</sub>";
128                molecule.isotopesArray = ["66", "67", "68"];
129                this.arrayGeisa2011.push(molecule);
130                this.arrayGeisa2003.push(molecule);
131
132                var molecule = new Object();
133                molecule.id="o2";
134                molecule.name="O<sub>2</sub>";
135                molecule.isotopesArray = ["66"];
136                this.arrayGeisaIasi2011.push(molecule);
137                this.arrayGeisaIasi2003.push(molecule);
138
139                var molecule = new Object();
140                molecule.id="no";
141                molecule.name="NO";
142                molecule.isotopesArray = ["46", "48", "56"];
143                this.arrayGeisa2011.push(molecule);
144                this.arrayGeisa2003.push(molecule);
145                this.arrayGeisaIasi2011.push(molecule);
146                this.arrayGeisaIasi2003.push(molecule);
147
148                var molecule = new Object();
149                molecule.id="so2";
150                molecule.name="SO<sub>2</sub>";
151                molecule.isotopesArray = ["626", "646"];
152                this.arrayGeisa2011.push(molecule);
153                this.arrayGeisa2003.push(molecule);
154                this.arrayGeisaIasi2011.push(molecule);
155                this.arrayGeisaIasi2003.push(molecule);
156
157                var molecule = new Object();
158                molecule.id="no2";
159                molecule.name="NO<sub>2</sub>";
160                molecule.isotopesArray = ["646"];
161                this.arrayGeisa2011.push(molecule);
162                this.arrayGeisa2003.push(molecule);
163                this.arrayGeisaIasi2011.push(molecule);
164                this.arrayGeisaIasi2003.push(molecule);
165
166                var molecule = new Object();
167                molecule.id="nh3";
168                molecule.name="NH<sub>3</sub>";
169                molecule.isotopesArray = ["411", "511" ];
170                this.arrayGeisa2011.push(molecule);
171                this.arrayGeisa2003.push(molecule);
172                this.arrayGeisaIasi2011.push(molecule);
173
174                var molecule = new Object();
175                molecule.id="ph3";
176                molecule.name="PH<sub>3</sub>";
177                molecule.isotopesArray = ["131" ];
178                this.arrayGeisa2011.push(molecule);
179                this.arrayGeisa2003.push(molecule);
180
181                var molecule = new Object();
182                molecule.id="hno3";
183                molecule.name="HNO<sub>3</sub>";
184                molecule.isotopesArray = ["146" ];
185                this.arrayGeisa2011.push(molecule);
186                this.arrayGeisa2003.push(molecule);
187                this.arrayGeisaIasi2011.push(molecule);
188                this.arrayGeisaIasi2003.push(molecule);
189
190                var molecule = new Object();
191                molecule.id="oh";
192                molecule.name="OH";
193                molecule.isotopesArray = ["61", "62", "81" ];
194                this.arrayGeisa2011.push(molecule);
195                this.arrayGeisa2003.push(molecule);
196
197                var molecule = new Object();
198                molecule.id="hf";
199                molecule.name="HF";
200                molecule.isotopesArray = ["19" ];
201                this.arrayGeisa2011.push(molecule);
202                this.arrayGeisa2003.push(molecule);
203
204                var molecule = new Object();
205                molecule.id="hcl";
206                molecule.name="HCL";
207                molecule.isotopesArray = ["15", "17" ];
208                this.arrayGeisa2011.push(molecule);
209                this.arrayGeisa2003.push(molecule);
210
211                var molecule = new Object();
212                molecule.id="hbr";
213                molecule.name="HBR";
214                molecule.isotopesArray = ["11", "19" ];
215                this.arrayGeisa2011.push(molecule);
216                this.arrayGeisa2003.push(molecule);
217
218                var molecule = new Object();
219                molecule.id="hi";
220                molecule.name="HI";
221                molecule.isotopesArray = ["17" ];
222                this.arrayGeisa2011.push(molecule);
223                this.arrayGeisa2003.push(molecule);
224
225                var molecule = new Object();
226                molecule.id="clo";
227                molecule.name="ClO";
228                molecule.isotopesArray = ["56", "76" ];
229                this.arrayGeisa2011.push(molecule);
230                this.arrayGeisa2003.push(molecule);
231
232                var molecule = new Object();
233                molecule.id="ocs";
234                molecule.name="OCS";
235                molecule.isotopesArray = ["622", "624", "632", "623", "822", "634"];
236                this.arrayGeisa2011.push(molecule);
237                this.arrayGeisa2003.push(molecule);
238                this.arrayGeisaIasi2011.push(molecule);
239                this.arrayGeisaIasi2003.push(molecule);
240
241                var molecule = new Object();
242                molecule.id="h2co";
243                molecule.name="H<sub>2</sub>CO";
244                molecule.isotopesArray = ["126", "128", "136"];
245                this.arrayGeisa2011.push(molecule);
246                this.arrayGeisa2003.push(molecule);
247
248                var molecule = new Object();
249                molecule.id="h2co";
250                molecule.name="H<sub>2</sub>CO";
251                molecule.isotopesArray = ["126"];
252                this.arrayGeisaIasi2011.push(molecule);
253
254                var molecule = new Object();
255                molecule.id="c2h6";
256                molecule.name="C<sub>2</sub>H<sub>6</sub>";
257                molecule.isotopesArray = ["226", "236"];
258                this.arrayGeisa2011.push(molecule);
259                this.arrayGeisa2003.push(molecule);
260
261                var molecule = new Object();
262                molecule.id="ch3d";
263                molecule.name="CH<sub>3</sub>D";
264                molecule.isotopesArray = ["212", "312"];
265                this.arrayGeisa2011.push(molecule);
266
267                var molecule = new Object();
268                molecule.id="ch3d";
269                molecule.name="CH<sub>3</sub>D";
270                molecule.isotopesArray = ["212"];
271                this.arrayGeisa2003.push(molecule);
272
273                var molecule = new Object();
274                molecule.id="c2h2";
275                molecule.name="C<sub>2</sub>H<sub>2</sub>";
276                molecule.isotopesArray = ["221", "231"];
277                this.arrayGeisa2011.push(molecule);
278                this.arrayGeisa2003.push(molecule);
279                this.arrayGeisaIasi2011.push(molecule);
280                this.arrayGeisaIasi2003.push(molecule);
281
282                var molecule = new Object();
283                molecule.id="c2h4";
284                molecule.name="C<sub>2</sub>H<sub>4</sub>";
285                molecule.isotopesArray = ["211", "311"];
286                this.arrayGeisa2011.push(molecule);
287                this.arrayGeisa2003.push(molecule);
288                this.arrayGeisaIasi2011.push(molecule);
289
290                var molecule = new Object();
291                molecule.id="geh4";
292                molecule.name="GeH<sub>4</sub>";
293                molecule.isotopesArray = ["411"];
294                this.arrayGeisa2011.push(molecule);
295                this.arrayGeisa2003.push(molecule);
296
297                var molecule = new Object();
298                molecule.id="hcn";
299                molecule.name="HCN";
300                molecule.isotopesArray = ["124", "125", "134", "224"];
301                this.arrayGeisa2011.push(molecule);
302                this.arrayGeisaIasi2011.push(molecule);
303
304                var molecule = new Object();
305                molecule.id="hcn";
306                molecule.name="HCN";
307                molecule.isotopesArray = ["124", "125", "134"];
308                this.arrayGeisa2003.push(molecule);
309
310                var molecule = new Object();
311                molecule.id="c3h8";
312                molecule.name="C<sub>3</sub>H<sub>8</sub>";
313                molecule.isotopesArray = ["221"];
314                this.arrayGeisa2011.push(molecule);
315                this.arrayGeisa2003.push(molecule);
316
317                var molecule = new Object();
318                molecule.id="c2n2";
319                molecule.name="C<sub>2</sub>N<sub>2</sub>";
320                molecule.isotopesArray = ["224"];
321                this.arrayGeisa2011.push(molecule);
322                this.arrayGeisa2003.push(molecule);
323
324                var molecule = new Object();
325                molecule.id="c4h2";
326                molecule.name="C<sub>4</sub>H<sub>2</sub>";
327                molecule.isotopesArray = ["211"];
328                this.arrayGeisa2011.push(molecule);
329                this.arrayGeisa2003.push(molecule);
330
331                var molecule = new Object();
332                molecule.id="hc3n";
333                molecule.name="HC<sub>3</sub>N";
334                molecule.isotopesArray = ["124"];
335                this.arrayGeisa2011.push(molecule);
336                this.arrayGeisa2003.push(molecule);
337
338                var molecule = new Object();
339                molecule.id="hocl";
340                molecule.name="HOCl";
341                molecule.isotopesArray = ["165", "167"];
342                this.arrayGeisa2011.push(molecule);
343                this.arrayGeisa2003.push(molecule);
344
345                var molecule = new Object();
346                molecule.id="n2";
347                molecule.name="N<sub>2</sub>";
348                molecule.isotopesArray = ["44"];
349                this.arrayGeisa2011.push(molecule);
350                this.arrayGeisa2003.push(molecule);
351                this.arrayGeisaIasi2011.push(molecule);
352                this.arrayGeisaIasi2003.push(molecule);
353
354                var molecule = new Object();
355                molecule.id="ch3cl";
356                molecule.name="CH<sub>3</sub>Cl";
357                molecule.isotopesArray = ["215", "217"];
358                this.arrayGeisa2011.push(molecule);
359                this.arrayGeisa2003.push(molecule);
360
361                var molecule = new Object();
362                molecule.id="h2o2";
363                molecule.name="H<sub>2</sub>O<sub>2</sub>";
364                molecule.isotopesArray = ["166"];
365                this.arrayGeisa2011.push(molecule);
366                this.arrayGeisa2003.push(molecule);
367
368                var molecule = new Object();
369                molecule.id="h2s";
370                molecule.name="H<sub>2</sub>S";
371                molecule.isotopesArray = ["121", "141", "131"];
372                this.arrayGeisa2011.push(molecule);
373                this.arrayGeisa2003.push(molecule);
374
375                var molecule = new Object();
376                molecule.id="hcooh";
377                molecule.name="HCOOH";
378                molecule.isotopesArray = ["261"];
379                this.arrayGeisa2011.push(molecule);
380                this.arrayGeisa2003.push(molecule);
381                this.arrayGeisaIasi2011.push(molecule);
382
383                var molecule = new Object();
384                molecule.id="cof2";
385                molecule.name="COF<sub>2</sub>";
386                molecule.isotopesArray = ["269"];
387                this.arrayGeisa2011.push(molecule);
388                this.arrayGeisa2003.push(molecule);
389
390                var molecule = new Object();
391                molecule.id="sf6";
392                molecule.name="SF<sub>6</sub>";
393                molecule.isotopesArray = ["29"];
394                this.arrayGeisa2011.push(molecule);
395                this.arrayGeisa2003.push(molecule);
396
397                var molecule = new Object();
398                molecule.id="c3h4";
399                molecule.name="C<sub>3</sub>H<sub>4</sub>";
400                molecule.isotopesArray = ["341"];
401                this.arrayGeisa2011.push(molecule);
402                this.arrayGeisa2003.push(molecule);
403
404                var molecule = new Object();
405                molecule.id="ho2";
406                molecule.name="HO<sub>2</sub>";
407                molecule.isotopesArray = ["166"];
408                this.arrayGeisa2011.push(molecule);
409                this.arrayGeisa2003.push(molecule);
410
411                var molecule = new Object();
412                molecule.id="clono2";
413                molecule.name="ClONO<sub>2</sub>";
414                molecule.isotopesArray = ["564", "764"];
415                this.arrayGeisa2011.push(molecule);
416                this.arrayGeisa2003.push(molecule);
417
418                var molecule = new Object();
419                molecule.id="ch3br";
420                molecule.name="CH<sub>3</sub>Br";
421                molecule.isotopesArray = ["79", "81"];
422                this.arrayGeisa2011.push(molecule);
423
424                var molecule = new Object();
425                molecule.id="ch3oh";
426                molecule.name="CH<sub>3</sub>OH";
427                molecule.isotopesArray = ["216"];
428                this.arrayGeisa2011.push(molecule);
429                this.arrayGeisaIasi2011.push(molecule);
430
431                var molecule = new Object();
432                molecule.id="noplus";
433                molecule.name="NO<sup>+</sup>";
434                molecule.isotopesArray = ["46"];
435                this.arrayGeisa2011.push(molecule);
436
437                var molecule = new Object();
438                molecule.id="hnc";
439                molecule.name="HNC";
440                molecule.isotopesArray = ["142"];
441                this.arrayGeisa2011.push(molecule);
442
443                var molecule = new Object();
444                molecule.id="c6h6";
445                molecule.name="C<sub>6</sub>H<sub>6</sub>";
446                molecule.isotopesArray = ["266"];
447                this.arrayGeisa2011.push(molecule);
448
449                var molecule = new Object();
450                molecule.id="c2hd";
451                molecule.name="C<sub>2</sub>HD";
452                molecule.isotopesArray = ["122"];
453                this.arrayGeisa2011.push(molecule);
454
455                var molecule = new Object();
456                molecule.id="cf4";
457                molecule.name="CF<sub>4</sub>";
458                molecule.isotopesArray = ["291"];
459                this.arrayGeisa2011.push(molecule);
460
461                var molecule = new Object();
462                molecule.id="ch3cn";
463                molecule.name="CH<sub>3</sub>CN";
464                molecule.isotopesArray = ["234"];
465                this.arrayGeisa2011.push(molecule);
466
467
468            },
469
470// CREATES ********************************************************
471            createForm: function()
472            {
473                //Titre de la page
474                var titlePage = document.createTextNode("Graphic vizualisation of the  GEISA  database");
475                document.getElementById("titlePage").appendChild(titlePage);
476
477                // Create menu deroulant  choix de la base
478                var paramDatabase = new Object();
479                paramDatabase.id = "selectDatabase";
480                paramDatabase.parent = $("#database1");
481                this.selectDatabase = new Select( paramDatabase );
482                this.selectDatabase.add( 'GEISA2011', "GEISA 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG09.class%>' );
483                this.selectDatabase.add( 'GEISAIASI2011', "GEISA-IASI 2011", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG09.class%>' );
484                this.selectDatabase.add( 'GEISA2003', "GEISA 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeG03.class%>' );
485                this.selectDatabase.add( 'GEISAIASI2003', "GEISA-IASI 2003", jQuery.proxy(this.onClickSelectDatabase, this), '<%=IsotopeIasiG03.class%>' );
486                this.selectDatabase.selectFirst( false );
487                 var bob = this.selectDatabase.getValues();
488
489
490                //création du bloc des molécules
491                this.createMolecules($('#BDD-GEISA2011'), this.arrayGeisa2011, "GEISA2011");
492                this.createMolecules($('#BDD-GEISA2003'), this.arrayGeisa2003, "GEISA2003");
493                this.createMolecules($('#BDD-GEISAIASI2011'), this.arrayGeisaIasi2011, "GEISAIASI2011");
494                this.createMolecules($('#BDD-GEISAIASI2003'), this.arrayGeisaIasi2003, "GEISAIASI2003");
495
496                //bouton selection-deselection toutes les molécules et isotopes
497                this.selectButton = new Button( {value:"Select all isotopologues", parent:$( "#selectAndShow" ), id:"buttonSelect", className: "gray_button", onClick:jQuery.proxy( this.selectAll, this )} );
498                //bouton montrer-cacher les isotopes
499                this.showButton = new Button( {value:"View all isotopologues", parent:$( "#selectAndShow" ), id:"buttonShow", className: "gray_button", onClick:jQuery.proxy( this.viewAll, this )} );
500
501
502
503                //Zone texte  SpectralRange
504                //Titre général (qui changera en fonction de la base geisa choisie)
505                document.getElementById('spectralRangeTitre').innerHTML = "";
506                document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
507
508                //Titre
509                //var titleSpectralRangeLower = document.createTextNode("Upper Bound :");
510               // document.getElementById("spectralRangeLower").appendChild(titleSpectralRangeLower);
511                document.getElementById("spectralRangeLower").innerHTML = "Lower value, cm<sup>-1</sup> : ";
512                //var titleSpectralRangeUpper = document.createTextNode("Upper Bound :");
513               // document.getElementById("spectralRangeUpper").appendChild(titleSpectralRangeUpper);
514                document.getElementById("spectralRangeUpper").innerHTML = "Upper value, cm<sup>-1</sup> : ";
515                document.getElementById("samplingStep").innerHTML = "<br>Sampling step : ";
516                //zone texte  SpectralRangeLower
517                var inputSpectralRangeLower = $( document.createElement( "input" ) );
518                inputSpectralRangeLower.attr( {id:"rangeLower", class:"styleInputs"} );
519                inputSpectralRangeLower.val(0);
520                //pour mettre à jour le menu déroulant des transitions
521                inputSpectralRangeLower.bind( 'blur', this, jQuery.proxy( this.requestTransition, this ));
522                this.containerFormSpectralRangeLower.append( inputSpectralRangeLower );
523                //zone texte   SpectralRangeUpper
524                var inputSpectralRangeUpper = $( document.createElement( "input" ) );
525                inputSpectralRangeUpper.attr( {id:"rangeUpper"} );
526                inputSpectralRangeUpper.val(35877.030506);
527                //pour mettre à jour le menu déroulant des transitions lorsque l'on change la valeur du spectral range
528                inputSpectralRangeUpper.bind( 'blur', this, jQuery.proxy( this.requestTransition, this ));
529                this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper );
530                //zone texte   Sampling step
531                var inputSamplingStep = $( document.createElement( "input" ) );
532                inputSamplingStep.attr( {id:"sampStep", size:6} );
533                $("#samplingStep").append( inputSamplingStep );
534
535                 //Zone texte Intensity
536                //Titre
537                //var titleIntensityLower = document.createTextNode("Lower Bound :");
538                //document.getElementById("intensityLower").appendChild(titleIntensityLower);
539                //var titleIntensityUpper = document.createTextNode("Upper Bound :");
540                //document.getElementById("intensityUpper").appendChild(titleIntensityUpper);
541                  document.getElementById("intensityLower").innerHTML = "Lower value, cm/mol. : "
542                  document.getElementById("intensityUpper").innerHTML = "Upper value, cm/mol. : "
543
544                //zone texte    IntensityLower
545                var inputIntensityLower = $( document.createElement( "input" ) );
546                inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} );
547                inputIntensityLower.val(0);
548                this.containerFormIntensityLower.append( inputIntensityLower );
549                //zone texte    IntensityUpper
550                var inputIntensityUpper = $( document.createElement( "input" ) );
551                inputIntensityUpper.attr( {id:"intensityUp"} );
552                inputIntensityUpper.val(1e-16);
553                this.containerFormIntensityUpper.append( inputIntensityUpper );
554
555
556                // Create menu deroulant  1er choix axe des y
557                //Titre
558                var titleAxeY1 = document.createTextNode("Select parameter (left Y-axis)");
559                document.getElementById("axeY1").appendChild(titleAxeY1);
560                var spaceBr = document.createElement ("br");
561                document.getElementById("axeY1").appendChild(spaceBr);
562                //menu déroulant
563                var paramSelectAxeY1 = new Object();
564                paramSelectAxeY1.id = "selectAxeY1";
565                paramSelectAxeY1.parent = $("#axeY1");
566                this.selectTraceAxeY1 = new Select( paramSelectAxeY1 );
567                this.selectTraceAxeY1.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY1, this ));
568                this.selectTraceAxeY1.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
569                this.selectTraceAxeY1.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
570                this.selectTraceAxeY1.add( 'F', "Temperature of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
571                this.selectTraceAxeY1.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
572                this.selectTraceAxeY1.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
573                this.selectTraceAxeY1.add( 'R', "Temperature of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
574                this.selectTraceAxeY1.selectFirst( false );
575               //  this.selectTraceAxeY1 = $( document.createElement( "select" ) );
576               // this.selectTraceAxeY1.attr( {id:"selectAxeY1" } );
577                //this.selectTraceAxeY1.css("width", "100px");
578               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"B", text:"Intensity"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "B" ])));
579               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"C", text:"Air broadening pressure halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "C" ])));
580               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"D", text:"Energy of the lower transition level"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "D" ])));
581               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"F", text:"Temperature of the air broadening halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "F" ])));
582               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"N", text:"Self broadening pressure halfwidth (HWHM)"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "N" ])));
583               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"O", text:"Air pressure shift of the line transition"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "O" ])));
584               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"R", text:"Temperature of the air pressure shift"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "R" ])));
585               // $("#axeY1").append(this.selectTraceAxeY1);
586
587
588
589                // Create menu deroulant  type de graphe
590                 //Titre
591                var titleTypeTrace = document.createTextNode("Type of graph");
592                document.getElementById("nbCourbes").appendChild(titleTypeTrace);
593                var spaceBr = document.createElement ("br");
594                document.getElementById("nbCourbes").appendChild(spaceBr);
595                //menu déroulant
596                var paramNbCourbes = new Object();
597                paramNbCourbes.id = "selectNbCourbes";
598                paramNbCourbes.parent = $("#nbCourbes");
599                this.selectNbCourbes = new Select( paramNbCourbes );
600                this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
601                this.selectNbCourbes.add( 'cm', "Separated molecules : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
602                this.selectNbCourbes.add( 'gm', "Separated molecules : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
603                this.selectNbCourbes.add( 'gi', "Separated isotopologues : different graphs", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
604                this.selectNbCourbes.add( 'ci', "Separated isotopologues : same graph", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
605                this.selectNbCourbes.selectFirst( false );
606                // this.selectNbCourbes = $( document.createElement( "select" ) );
607                //this.selectNbCourbes.attr( {id:"selectNbCourbes"} );
608               // this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"ca", text:"One curve for all selection"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "ca" ])));
609                //this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"cm", text:"One curve for each molecule selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "cm" ])));
610                //this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"ci", text:"One curve for each isotopologue selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "ci" ])));
611               // this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"gm", text:"One graph for each molecule selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "gm" ])));
612                //this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"gi", text:"One graph for each isotopologue selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "gi" ])));
613                //$("#nbCourbes").append(this.selectNbCourbes);
614
615
616                // Create menu deroulant  type d'échelle linéaire ou logarithmique  pour le choix y1
617                //Titre
618                var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)");
619                document.getElementById("scaleY1Titre").appendChild(titleScaleY1);
620                //menu déroulant
621                var paramSelectScaleY1 = new Object();
622                paramSelectScaleY1.id = "selectScaleY1";
623                paramSelectScaleY1.parent = $("#scaleY1");
624                this.selectScaleY1 = new Select( paramSelectScaleY1 );
625                this.selectScaleY1.add( 'l', "Linear" );
626                this.selectScaleY1.add( '-log_scale', "Logarithmic" );
627                this.selectScaleY1.selectFirst( false );
628                //this.selectScaleY1 = $( document.createElement( "select" ) );
629               // this.selectScaleY1.attr( {id:"selectScaleY1"} );
630               // var optSelectScaleY1 = $( document.createElement( "option" ) );
631               // optSelectScaleY1.attr( {value:"l", text:"Linear"} );
632               // this.selectScaleY1.append(optSelectScaleY1);
633               // var optSelectScaleY1 = $( document.createElement( "option" ) );
634                //optSelectScaleY1.attr( {value:"-log_scale", text:"Logarithmic"} );
635               // this.selectScaleY1.append(optSelectScaleY1);
636               // $("#scaleY1").append(this.selectScaleY1);
637
638
639                // Create menu deroulant  style de tracer   Y1
640                //Titre
641                var titleTypeTrace = document.createTextNode("Select the type of plot");
642                document.getElementById("typePlotY1").appendChild(titleTypeTrace);
643                var spaceBr = document.createElement ("br");
644                document.getElementById("typePlotY1").appendChild(spaceBr);
645                //menu déroulant
646                var paramSelectTypeTraceY1 = new Object();
647                paramSelectTypeTraceY1.id = "selectTypePlotY1";
648                paramSelectTypeTraceY1.parent = $("#typePlotY1");
649                this.selectTypeTraceY1 = new Select( paramSelectTypeTraceY1 );
650                this.selectTypeTraceY1.add( 'l', "Lines" );
651                this.selectTypeTraceY1.add( 'p', "Dots" );
652                this.selectTypeTraceY1.add( 'i', "Peaks" );
653                this.selectTypeTraceY1.add( 'lp', "Lines and Dots" );
654                this.selectTypeTraceY1.selectFirst( false );
655                //this.selectTypeTraceY1 = $( document.createElement( "select" ) );
656                //this.selectTypeTraceY1.attr( {id:"selectTypePlotY1"} );
657                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"l", text:"Lines"} ));
658                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"p", text:"Dots"} ));
659                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"i", text:"Peaks"} ));
660                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"lp", text:"Lines and Dots"} ));
661                //$("#typePlotY1").append(this.selectTypeTraceY1);
662
663
664
665
666                //lien pour montrer ou cacher le bloc "advanced options"
667                var showHide = $(document.createElement("a"));
668                showHide.html("Show advanced options");
669                showHide.attr( {id:"aShowHide", class:"fieldsetGeneralTitle"} );
670                showHide.bind( 'click', this, jQuery.proxy( this.onClickShowAdvancedOptions));
671                $("#showAdvancedOptions").append(showHide);
672
673
674                //titre  menu deroulant  transition upper
675                var titleTransitionUpper = document.createTextNode("Upper state : ");
676                document.getElementById("transitionUpper").appendChild(titleTransitionUpper);
677
678
679                // Create menu deroulant  transition upper
680//                var paramSelectTransitionUpper = new Object();
681//                paramSelectTransitionUpper.id = "transition1";
682//                paramSelectTransitionUpper.parent = $("#transitionUpper");
683//                this.selectTransitionUpper = new Select( paramSelectTransitionUpper );
684//                this.selectTransitionUpper.add( '-1', "Select a molecule" );
685//                this.selectTransitionUpper.selectFirst( false );
686
687                this.selectTransitionUpper = $( document.createElement( "select" ) );
688                this.selectTransitionUpper.attr( {id:"transition1"} );
689                //fonction sur le menu déroulant (des qu'on clique dessus) et non sur chacune des options
690                this.selectTransitionUpper.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this));
691                var optTransitionUpper = $( document.createElement( "option" ) );
692                optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} );
693                //var  transitionsLower ="000";
694                // opt2.bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
695                this.selectTransitionUpper.append(optTransitionUpper);
696                $("#transitionUpper").append(this.selectTransitionUpper);
697
698
699                //titre  menu deroulant  transition lower
700                var titleTransitionLower = document.createTextNode("Lower state : ");
701                document.getElementById("transitionLower").appendChild(titleTransitionLower);
702
703                // Create menu deroulant  transition lower
704//                var paramSelectTransitionLower = new Object();
705//                paramSelectTransitionLower.id = "transition2";
706//                paramSelectTransitionLower.parent = $("#transitionLower");
707//                this.selectTransitionLower = new Select( paramSelectTransitionLower );
708//                this.selectTransitionLower.add( '-1', "Select a molecule");
709//                this.selectTransitionLower.selectFirst( false );
710                this.selectTransitionLower = $( document.createElement( "select" ) );
711                this.selectTransitionLower.attr( {id:"transition2"} );
712                this.selectTransitionLower.bind( 'click', jQuery.proxy(this.OnclickVerifTransition, this));
713                var optTransitionLower = $( document.createElement( "option" ) );
714                optTransitionLower.attr( {value:"-1", text:"Select a molecule"} );
715                this.selectTransitionLower.append(optTransitionLower);
716                $("#transitionLower").append(this.selectTransitionLower);
717
718                //bouton reset pour les transition
719                var resetButton = new Button( {value:"Reset", parent:$( "#transitionReset" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.requestTransition, this )} );
720
721
722//                //menu déroulant  js   en javascript    sans passer par le modele
723//                var select = document.createElement('select');
724//                select.id = "transiEssai";
725//                select.name ="transiEssai";
726//
727//                var opt = document.createElement('option');
728//                opt.setAttribute('value','id1');
729//                var theText = document.createTextNode("id1");
730//                opt.appendChild(theText);
731//                select.appendChild(opt);
732//
733//                var opt = document.createElement('option');
734//                opt.setAttribute('value','id2');
735//                var theText = document.createTextNode("id2");
736//                opt.appendChild(theText);
737//
738//                //opt.onclick=jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]);
739//                    select.appendChild(opt);
740//                    document.getElementById("transitionLower").appendChild(select);
741
742
743                //menu déroulant en jquery    sans passer par le modele
744//                this.select2 = $( document.createElement( "select" ) );
745//                this.select2.attr( {id:"transiEssai2", name:"transiEssai2"} );
746//                var opt2 = $( document.createElement( "option" ) );
747//                opt2.attr( {value:"id3", text:"zzz"} );
748//                //var  transitionsLower ="000";
749//                // opt2.bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
750//                this.select2.append(opt2);
751//                $("#transitionLower").append(this.select2);
752
753
754
755
756                //Zone text Mean Value
757                //Titre
758                var titleMeanValue = document.createTextNode("Step : ");
759                document.getElementById("meanValue1").appendChild(titleMeanValue);
760                //champ input
761                var inputMeanValue = $( document.createElement( "input" ) );
762                inputMeanValue.attr( {id:"meanValue2", size:6} );
763                inputMeanValue.val(0);
764                this.containerFormMeanValue1.append( inputMeanValue );
765                inputMeanValue.bind( 'blur', this, jQuery.proxy( this.onBlurInputMeanValue, this ));
766
767
768                // Create menu deroulant  2eme choix axe des y
769                //Titre
770                var titleAxeY2 = document.createTextNode("Select secondary parameter (right Y-axis)");
771                document.getElementById("axeY2Titre").appendChild(titleAxeY2);
772                //menu déroulant
773                var paramSelectAxeY2 = new Object();
774                paramSelectAxeY2.id = "selectAxeY2";
775                paramSelectAxeY2.parent = $("#axeY2");
776                this.selectTraceAxeY2 = new Select( paramSelectAxeY2 );
777                this.selectTraceAxeY2.add( 'no', "None", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
778                this.selectTraceAxeY2.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
779                this.selectTraceAxeY2.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
780                this.selectTraceAxeY2.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
781                this.selectTraceAxeY2.add( 'F', "Temperature of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
782                this.selectTraceAxeY2.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
783                this.selectTraceAxeY2.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
784                this.selectTraceAxeY2.add( 'R', "Temperature of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
785                this.selectTraceAxeY2.selectFirst( false );
786                //this.selectTraceAxeY2 = $( document.createElement( "select" ) );
787                //this.selectTraceAxeY2.attr( {id:"selectAxeY2"} );
788                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"no", text:"None"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "no" ])));
789                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"B", text:"Intensity"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "B" ])));
790                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"C", text:"Air broadening pressure halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "C" ])));
791                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"D", text:"Energy of the lower transition level"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "D" ])));
792                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"F", text:"Temperature of the air broadening halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "F" ])));
793                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"N", text:"Self broadening pressure halfwidth (HWHM)"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "N" ])));
794                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"O", text:"Air pressure shift of the line transition"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "O" ])));
795                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"R", text:"Temperature of the air pressure shift"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "R" ])));
796                //$("#axeY2").append(this.selectTraceAxeY2);
797
798
799                // Create menu deroulant  type d'échelle linéaire ou logarithmique  pour le choix y2
800                //Titre
801                var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)");
802                document.getElementById("scaleY2Titre").appendChild(titleScaleY2);
803                //menu déroulant
804                var paramSelectScaleY2 = new Object();
805                paramSelectScaleY2.id = "SelectScaleY2";
806                paramSelectScaleY2.parent = $("#scaleY2");
807                this.selectScaleY2 = new Select( paramSelectScaleY2 );
808                this.selectScaleY2.add( 'l', "Linear" );
809                this.selectScaleY2.add( '-log_scale2', "Logarithmic" );
810                this.selectScaleY2.selectFirst( false );
811                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
812                document.getElementById("scaleY2Titre").className = "notActiveText";
813                this.selectScaleY2.disable();
814
815
816                //this.selectScaleY2 = $( document.createElement( "select" ) );
817                //this.selectScaleY2.attr( {id:"selectScaleY2"} );
818                //var optSelectScaleY2 = $( document.createElement( "option" ) );
819                //optSelectScaleY2.attr( {value:"l", text:"Linear"} );
820               // this.selectScaleY2.append(optSelectScaleY2);
821               // var optSelectScaleY2 = $( document.createElement( "option" ) );
822               // optSelectScaleY2.attr( {value:"-log_scale2", text:"Logarithmic"} );
823                //this.selectScaleY2.append(optSelectScaleY2);
824                //$("#scaleY2").append(this.selectScaleY2);
825                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
826                //document.getElementById("scaleY2Titre").className = "notActiveText";
827                //document.getElementById("selectScaleY2" ).disabled=true;
828
829
830                // Create menu deroulant  style de tracer       Y2
831                //Titre
832                var titleTypeTrace = document.createTextNode("Select the type of plot");
833                document.getElementById("typePlotY2Titre").appendChild(titleTypeTrace);
834                //menu déroulant
835                var paramSelectTypeTraceY2 = new Object();
836                paramSelectTypeTraceY2.id = "selectTypePlotY2";
837                paramSelectTypeTraceY2.parent = $("#typePlotY2");
838                this.selectTypeTraceY2 = new Select( paramSelectTypeTraceY2 );
839                this.selectTypeTraceY2.add( 'l', "Lines" );
840                this.selectTypeTraceY2.add( 'p', "Dots" );
841                this.selectTypeTraceY2.add( 'i', "Peaks" );
842                this.selectTypeTraceY2.add( 'lp', "Lines and Dots" );
843                this.selectTypeTraceY2.selectFirst( false );
844                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
845                document.getElementById("typePlotY2Titre").className = "notActiveText";
846                this.selectTypeTraceY2.disable();
847                //this.selectTypeTraceY2 = $( document.createElement( "select" ) );
848                //this.selectTypeTraceY2.attr( {id:"selectTypePlotY2"} );
849                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"l", text:"Lines"} ));
850                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"p", text:"Dots"} ));
851                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"i", text:"Peaks"} ));
852                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"lp", text:"Lines and Dots"} ));
853                //$("#typePlotY2").append(this.selectTypeTraceY2);
854                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
855               // document.getElementById("typePlotY2Titre").className = "notActiveText";
856               // document.getElementById("selectTypePlotY2" ).disabled=true;
857
858
859
860                //création de l'image d'attente
861                var param = new Object();
862               param.id = "loadingForGraphics";
863               param.parent = this.containerLoading;
864               this.loadingGraphics = new Loading( param );
865              // this.loadingGraphics.display();
866               //this.loadingGraphics.hide();
867
868
869                // var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} );
870                var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} );
871                 //bouton reset pour toute la page
872                var resetPageButton = new Button( {value:"Reset", parent:$( "#boutonSubmit" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.resetPage, this )} );
873
874
875                //this.resetEssai = $( document.createElement( "input" ) );
876                //this.resetEssai.attr( {type:"reset", name:"reset"} );
877                //$("#boutonSubmit").append(this.resetEssai);
878            },
879
880
881
882
883            /**
884             * This method creates the case to check for the moles
885             * create cases à cocher pour les molécules
886             * @param container
887             * @param moleculesArray
888             */
889                //createMolecules: function(container, moleculesArray)
890            createMolecules: function(container, moleculesArray, BddVersion)
891            {
892                var table = $(document.createElement("table"));
893                container.append(table);
894                // var tr = $(document.createElement("tr"));
895                // tr.attr({valign: "top"});
896                // table.append(tr);
897                var i=0;
898                //nombre de molecules par ligne
899                var l=11;
900                //taille du tableau
901                //alert("l" +moleculesArray.length);
902                // parseInt : partie entiÚre
903                // var res =  parseInt(8/3);
904                //alert("res="+res);
905
906                $.each(moleculesArray, jQuery.proxy( function(index, moleculeElement )
907                {
908
909
910                    //this.tr et non var tr pour que tr existe encore à la sortie du if
911                    if ( index == (i*l))
912                    {
913                        //alert(index);
914                        this.tr = $(document.createElement("tr"));
915                        this.tr.attr({valign: "top"});
916                        table.append(this.tr);
917                        i=i+1;
918
919                    }
920                    var td = $(document.createElement("td"));
921                    this.tr.append(td);
922
923                    var span= $(document.createElement("span"));
924                    span.addClass("molecule");
925                    td.append(span);
926
927                    var input = $(document.createElement("input"));
928                    input.attr({type:"checkbox", id:"all-"+moleculeElement.id+"-"+BddVersion});
929                    input.bind( 'click', this, jQuery.proxy( this.cliquetout, [this, moleculeElement.id, BddVersion ] ));
930                    span.append(input);
931
932                    var a = $(document.createElement("a"));
933                    a.html("<b>"+moleculeElement.name+"</b>");
934
935                    a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] ));
936                    span.append(a);
937
938                    var div= $(document.createElement("div"));
939                    div.addClass("divViolet");
940                    div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"});
941                    td.append(div);
942
943                    var spanIsotopes= $(document.createElement("span"));
944                    spanIsotopes.addClass("isotope");
945                    spanIsotopes.attr({id:moleculeElement.id+"Isotope"+BddVersion});
946                    div.append(spanIsotopes);
947
948
949                    this.createIsotopes($("#"+moleculeElement.id+"Isotope"+BddVersion), moleculeElement.isotopesArray, moleculeElement.id, BddVersion);
950
951
952                }, this) );
953
954
955            },
956
957            createIsotopes: function(container, isotopesArray, moleculeElement, BddVersion )
958            {
959
960
961                $.each(isotopesArray, jQuery.proxy( function( index, isotopeElement )
962                {
963                    container.append("&nbsp;&nbsp;&nbsp;");
964                    var inputIsotopes = $(document.createElement("input"));
965                    inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement});
966                    inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, moleculeElement, BddVersion ] ));
967                    container.append(inputIsotopes);
968                    container.append(isotopeElement);
969                    var br = $(document.createElement("br"));
970                    container.append(br);
971
972                }, this) );
973            },
974
975            // <table><tr><td>
976            // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA2011 onclick="cliquetout('this, ch3cn, GEISA2011');">
977            //          <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B>
978            // </span>
979            // <div class="divViolet" id="Cache-ch3cn" style="display:none;">
980            //          <span class="isotope" id="ch3cnIsotopeGEISA2011">&nbsp;&nbsp;&nbsp;<input type=checkbox id=chk-ch3cn_234-GEISA2011 name=moles value=ch3cn_234 onclick="cliqueIsotope('this, ch3cn_234, GEISA2011');">234<br></span>
981            // </div>
982            // </td></tr></table>
983
984// REQUESTS ********************************************************
985            //récupération de toutes les valeurs choisies par l'utilisateur et transformation de ces valeurs pour les inclure dans la requête fortran
986            requestGeisa: function()
987            {
988
989                //on va chercher les chemin déclaré dans le controller
990                this.pathProcess = "<%=Controller.PATH_PROCESS%>";
991                this.LongPathImages = "<%=Controller.LONG_PATH_IMAGES%>";
992
993
994
995                 //sélection du fichier binaire de la base geisa sélectionnée
996                var paramBase = "";
997                switch (this.selectDatabase.getValue()) {
998                    case 'GEISA2003':
999                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISA2003_asc_gs03_v1.0 -input_format asc -database_name GEISA2003 -database_type gs03";
1000                        break;
1001                    case 'GEISA2011':
1002                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISA2009_bin -database_name GEISA2011 -database_type gs08";
1003                        break;
1004                    case 'GEISAIASI2003':
1005                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISAIASI2003_asc_gsi03_v1.0 -input_format asc -database_name GEISAIASI2003 -database_type gsi03";
1006                        break;
1007                    case 'GEISAIASI2011':
1008                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISAIASI2011_bin_gsi08_v1.0 -database_name GEISAIASI2011 -database_type gsi08";
1009                        break;
1010                }
1011
1012
1013                //molécules
1014                //récupération des molécules sélectionnées
1015                var inputs = document.getElementsByTagName( 'input' );
1016                var count = inputs.length;
1017                var isotopesSelectedName ="";
1018              //  alert(this.selectDatabase.getValue());
1019                var i=0;
1020                this.nbIsotopes = 0;
1021                this.nbMolecules = 0;
1022                this.nbGraph = 0;
1023                for( i = 0; i < count; i++ )
1024                {
1025                    var input = inputs.item( i );
1026                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1027                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1028                    {
1029                        //nombre d'isotopes sélectionnés
1030                        this.nbIsotopes =  this.nbIsotopes + 1;
1031
1032                        var molN=input.value;
1033                        var molN1=molN.replace("_", ":");
1034                        // exemple : -moleisot h2o:161 -moleisot h2o:162 -moleisot co2:626 -moleisot co2:627 -moleisot o3:666 -moleisot o3:668
1035                        isotopesSelectedName = isotopesSelectedName+"-moleisot "+molN1+" ";
1036                    }
1037                    //récupération du nombre de molécules sélectionnées
1038                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1039                    {
1040                        //nombre d'isotopes sélectionnés
1041                        this.nbMolecules =  this.nbMolecules + 1;
1042                    }
1043                }
1044
1045
1046                //averti l'utilisateur qu'il faut au moins sélectionner un isotope
1047                if (this.nbIsotopes ==  0) {
1048                    alert("Error : no molecule or isotopoloque was selected");
1049                    return;
1050                }
1051
1052
1053
1054                //sélection du nombre de courbes ou de graphs
1055
1056                var nbCourbes = "";
1057
1058                switch (this.selectNbCourbes.getValue()) {
1059                //sswitch (document.getElementById('selectNbCourbes').options[document.getElementById('selectNbCourbes').selectedIndex].value) {
1060                    case 'cm':
1061                        nbCourbes = "-separate_mol -same_graph ";
1062                        this.nbGraph = 1;
1063                        this.nbCourbe =  this.nbMolecules;
1064                        if (this.nbCourbe > 8) {
1065                            alert("Too much molecules selected to draw one curve for each molecule selected");
1066                            return;
1067                        }
1068                        break;
1069                    case 'ci':
1070                        nbCourbes = "-separate_iso -same_graph ";
1071                        this.nbGraph = 1;
1072                        this.nbCourbe =  this.nbIsotopes;
1073                        if (this.nbCourbe > 8) {
1074                            alert("Too much isotopologues selected to draw one curve for each isotopologues selected");
1075                            return;
1076                        }
1077                        break;
1078                    case 'gm':
1079                        nbCourbes = "-separate_mol ";
1080                        this.nbGraph = this.nbMolecules;
1081                        if (this.nbGraph > 20) {
1082                            alert("Too much molecules selected to draw one graph for each molecules selected");
1083                            return;
1084                        }
1085                        break;
1086                    case 'gi':
1087                        nbCourbes = "-separate_iso ";
1088                        this.nbGraph = this.nbIsotopes;
1089                        if (this.nbGraph > 20) {
1090                            alert("Too much isotopologues selected to draw one graph for each isotopologues selected");
1091                            return;
1092                        }
1093                        break;
1094                    default:
1095                        nbCourbes = "";
1096                        this.nbGraph = 1;
1097                        break;
1098                }
1099
1100
1101                //Spectral range
1102                var rangeLower="-wavenb_min "+$("#rangeLower").val();
1103                var rangeUpper="-wavenb_max "+$("#rangeUpper").val();
1104
1105                //controle des valeurs entrées par l'utilisateur
1106
1107                switch (this.selectDatabase.getValue()) {
1108                    case 'GEISA2003':
1109                        //isNaN = n'est pas un nombre
1110                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0  || parseInt($("#rangeLower").val()) > 35877.030506)
1111                        {
1112                            alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506");
1113                            return;
1114                        }
1115
1116                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  || parseInt($("#rangeUpper").val()) > 35877.030506)
1117                        {
1118                            alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506");
1119                            return;
1120                        }
1121                        break;
1122                    case 'GEISA2011':
1123                        //isNaN = n'est pas un nombre
1124                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0  || parseInt($("#rangeLower").val()) > 35877.030506)
1125                        {
1126                            alert("Error: Invalid value for lower spectral range area. The value must be between 0 and 35877.030506");
1127                            return;
1128                        }
1129
1130                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  || parseInt($("#rangeUpper").val()) > 35877.030506)
1131                        {
1132                            alert("Error: Invalid value for upper spectral range area. The value must be between 0 and 35877.030506");
1133                            return;
1134                        }
1135                        break;
1136                    case 'GEISAIASI2003':
1137                        //isNaN = n'est pas un nombre
1138                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0 || parseInt($("#rangeLower").val()) < 599.000793 || parseInt($("#rangeLower").val()) > 3000.998767)
1139                        {
1140                            alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767");
1141                            return;
1142                        }
1143
1144                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  ||  parseInt($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767)
1145                        {
1146                            alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767");
1147                            return;
1148                        }
1149                        break;
1150                    case 'GEISAIASI2011':
1151                        //isNaN = n'est pas un nombre
1152                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0 || parseInt($("#rangeLower").val()) < 599.000793 || parseInt($("#rangeLower").val()) > 3000.998767)
1153                        {
1154                            alert("Error: Invalid value for lower spectral range area. The value must be between 599.000793 and 3000.998767");
1155                            return;
1156                        }
1157
1158                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  ||  parseInt($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767)
1159                        {
1160                            alert("Error: Invalid value for upper spectral range area. The value must be between 599.000793 and 3000.998767");
1161                            return;
1162                        }
1163                        break;
1164                }
1165
1166
1167                if ($("#rangeLower").val() == ""  )
1168                {
1169                    rangeLower="";
1170                }
1171
1172                if ($("#rangeUpper").val() == ""  )
1173                {
1174                    rangeUpper="";
1175                }
1176                if( parseInt($("#rangeLower").val())  > parseInt($("#rangeUpper").val()) )
1177                {
1178                    alert("Error: lower spectral range area is superior to upper spectral range area ");
1179                    return;
1180                }
1181
1182
1183
1184                //Sampling step
1185                if( $("#sampStep").val() > 0 )
1186                {
1187                    var samplingStep="-band "+$("#sampStep").val();
1188                    //calcul du nombre de graphs générés par l'option  Sampling step
1189                    this.nbGraphSamplingStep = (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) / parseFloat($("#sampStep").val());
1190                    //calcul du nombre de graphs total à tracer   (nbr de graph générés par "type of graph" * nbr de graph généré par "Sampling Step")
1191                       //test pour voir si    "nbGraphSamplingStep" est un entier
1192                       if ((this.nbGraphSamplingStep - parseInt(this.nbGraphSamplingStep)) == 0)
1193                       {
1194                        this.nbGraph=(this.nbGraph)*(this.nbGraphSamplingStep);
1195                       }
1196                       else
1197                       {
1198                        // si  "nbGraphSamplingStep" n'est pas un entier prendre le nbre entier suivant
1199                        this.nbGraph=this.nbGraph*(parseInt(this.nbGraphSamplingStep)+1);
1200                       }
1201                }
1202
1203                if(isNaN($("#sampStep").val()) == true ||   parseInt($("#sampStep").val()) < 0 )
1204                {
1205                    alert("Error: Invalid value for sampling step");
1206                    return;
1207                }
1208
1209                if( $("#sampStep").val() == 0 )
1210                {
1211                    var samplingStep="";
1212                }
1213
1214                //test sur le nombre de graphs générés
1215                if (this.nbGraph > 20)
1216                {
1217                    alert("Too many graphics will be drawn ("+this.nbGraph+"). Please change the value of the sampling step or change the value of the type of graph.");
1218                    return;
1219                }
1220
1221
1222
1223                //Transitions  to do
1224                //exemple de requete avec transition
1225                //./all -filein line_GEISA2009_bin -moleisot h2o:161 -wavenb_min 1 -wavenb_max 1000 -database_name "GEISA2011" -vib_ident_lower '[000]'
1226                //var TransitionUpper ="-vib_ident_upper '[ "+this.selectTransitionUpper.getValue()+" ]'";
1227                var transitionUpper=document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value;
1228                //Enlever les espaces blancs
1229               // TransitionUp= TransitionUp.replace(/ /g,"");
1230               //var TransitionUpper ="-vib_ident_upper ["+TransitionUp+"]";
1231                // var transitionUpper = "["+transitionUp+"]";
1232               // alert ("transitionUpper"+transitionUpper);
1233                //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés   (ex ch4 et C2HD)
1234                //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25
1235                var nb=0;
1236                nb=25-transitionUpper.length
1237                if (nb != 0)
1238                {
1239                    for (i = 1; i <= nb; i++) {
1240                       transitionUpper=transitionUpper+" ";
1241                    }
1242                }
1243
1244                //alert("transitionUpper.length"+transitionUpper.length);
1245                //transitionUpper=transitionUpper+" ";
1246                //alert("transitionUpper.length"+transitionUpper.length);
1247
1248                // var TransitionLower ="-vib_ident_lower '[ "+this.selectTransitionLower.getValue()+" ]'";
1249                  var transitionLower=document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value;
1250                //  TransitionLo= TransitionLo.replace(/ /g,"");
1251                 // var TransitionLower ="-vib_ident_lower ["+TransitionLo+"]";
1252                //var transitionLower ="["+transitionLo+"]";
1253
1254                //certaine transitions ont plusieurs espaces à droite qui ne sont pas conservés   (ex ch4 et C2HD)
1255                //si la longueur de la chaine de caracteres n'est pas 25 on rajoute le nobre d'espace nécessaire pour arriver à 25
1256                var nb=0;
1257                nb=25-transitionUpper.length
1258                if (nb != 0)
1259                {
1260                    for (i = 1; i <= nb; i++) {
1261                       transitionUpper=transitionUpper+" ";
1262                    }
1263                }
1264
1265                 //pas de transition sélectionnée
1266                // if (( this.selectTransitionUpper.getValue()== -1) ||  (this.selectTransitionUpper.getValue() == "transition" ))
1267                // {
1268                // TransitionUpper ="";
1269                // }
1270                // if (( this.selectTransitionLower.getValue()== -1) ||  (this.selectTransitionLower.getValue() == "transition" ))
1271                // {
1272                // TransitionLower ="";
1273                // }
1274                if (( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == -1) ||  (document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "transition" ))
1275                {
1276                    transitionUpper ="no";
1277                }
1278                if (( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == -1) ||  (document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "transition" ))
1279                {
1280                    transitionLower ="no";
1281                }
1282
1283                if ( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "")
1284                {
1285                    transitionUpper ="noValue";
1286                }
1287
1288                if ( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "")
1289                {
1290                    transitionLower ="noValue";
1291                }
1292
1293                 var sel = document.getElementById('transition1');
1294                 var idupper = sel.options[sel.selectedIndex].value;
1295                  //alert("idupper"+idupper);
1296
1297                //Intensity range
1298                var intensityLower="-int_min "+$("#intensityLo").val();
1299                var intensityUpper="-int_max "+$("#intensityUp").val();
1300
1301                //controle des valeurs entrées par l'utilisateur
1302                 if(isNaN($("#intensityLo").val()) == true ||   $("#intensityLo").val() < 0  )
1303                {
1304                    alert("Error: Invalid value for lower intensity range area. The value must be between 0 and 1E-16");
1305                    return;
1306                }
1307                if ($("#intensityLo").val() == ""  )
1308                {
1309                    intensityLower="";
1310                }
1311                if(isNaN($("#intensityUp").val()) == true ||   $("#intensityUp").val() < 0  )
1312                {
1313                    alert("Error: Invalid value for upper intensity range area. The value must be between 0 and 1E-16");
1314                    return;
1315                }
1316                if ($("#intensityUp").val() == ""  )
1317                {
1318                    intensityUpper="";
1319                }
1320
1321                //to do javascript ne sait comparer des exponenciels
1322              // if( $("#intensityLo").val()  > $("#intensityUp").val() )
1323
1324               // {
1325               //     alert("Error: lower intensity range area is superior to upper intensity range area ");
1326               //     return;
1327               // }
1328
1329
1330                //Valeur de mean value
1331                var meanValue = "-step "+$("#meanValue2").val();
1332                //controle des valeurs entrées par l'utilisateur
1333                //Si ce n'est pas un nombre ou si il est négatif  ou si mean value est supérieur ou égal à l'interval spectral
1334                if(isNaN($("#meanValue2").val()) == true ||   $("#meanValue2").val() < 0 ||   $("#meanValue2").val() >= (parseFloat($("#rangeUpper").val()) - parseFloat($("#rangeLower").val())) )
1335                {
1336                    alert("Error: Invalid value for Average calculation area");
1337                    return;
1338                }
1339                //si aucune valeur
1340                if ($("#meanValue2").val() == ""  )
1341                {
1342                    meanValue="";
1343                }
1344
1345                //sélection du premier choix pour l'axe des Y
1346                 var field="-field "+this.selectTraceAxeY1.getValue();
1347                //   var field="-field "+document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value;
1348
1349
1350
1351
1352                 //sélection du type d'échelle pour le parametre Y1 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée)
1353                if  (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false)
1354                {
1355                    var logScale = this.selectScaleY1.getValue();
1356                }
1357                else
1358                {
1359                    var logScale = ""
1360                }
1361               // if  (document.getElementById('selectScaleY1').options[document.getElementById('selectScaleY1').selectedIndex].value == '-log_scale' && document.getElementById("selectScaleY1" ).disabled == false)
1362               // {
1363               //     var logScale = document.getElementById('selectScaleY1').options[document.getElementById('selectScaleY1').selectedIndex].value;
1364                //}
1365                //else
1366               // {
1367               //     var logScale = ""
1368               // }
1369
1370
1371                //sélection du type de tracé pour Y1
1372                var lineType="-line_type "+this.selectTypeTraceY1.getValue();
1373                //var lineType="-line_type "+document.getElementById('selectTypePlotY1').options[document.getElementById('selectTypePlotY1').selectedIndex].value;
1374
1375
1376                //sélection ou non d'un 2eme choix pour l'axe des Y   (pas de valeur pour ce champ si choix none ou si l'option n'est pas activée)
1377                if  (this.selectTraceAxeY2.getValue() == 'no' ||  this.selectTraceAxeY2.isDisable == true)
1378                //if  (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no' ||  document.getElementById("selectAxeY2" ).disabled == true)
1379                {
1380                    var field2 = "";
1381                }
1382                else
1383                {
1384                    var field2 = "-field2 "+this.selectTraceAxeY2.getValue();
1385                    //var field2 = "-field2 "+document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value;
1386                }
1387
1388                //sélection du type d'échelle pour le parametre Y2 (il y a une valeur pour ce champ que si logaritmic est choisi et si l'option est activée)
1389                if  (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false)
1390               //  if  (document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value == '-log_scale2' && document.getElementById("selectScaleY2" ).disabled == false)
1391                {
1392                    var logScale2 =this.selectScaleY2.getValue();
1393                    //  var logScale2 = document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value;
1394                }
1395                else
1396                {
1397                    var logScale2 = "";
1398                }
1399
1400
1401                //sélection du type de tracé pour Y2  (pas de valeur  si l'option n'est pas activée)
1402                if  ( this.selectTypeTraceY2.isDisable == true)
1403               // if  ( document.getElementById("selectTypePlotY2" ).disabled == true)
1404                {
1405                    var lineType2 = "";
1406                }
1407                else
1408                {
1409                    var lineType2 = "-line_type2 "+this.selectTypeTraceY2.getValue();
1410                    // var lineType2 = "-line_type2 "+document.getElementById('selectTypePlotY2').options[document.getElementById('selectTypePlotY2').selectedIndex].value;
1411                }
1412
1413
1414                //ouverture de la div de l'image d'attente
1415                this.loadingGraphics.display();
1416
1417
1418
1419
1420                //construction de la requête Fortran
1421               // var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+TransitionUpper+" "+TransitionLower+" "+intensityLower+" "+intensityUpper+" "+
1422                                      // meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2;
1423
1424                var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+samplingStep+" "+intensityLower+" "+intensityUpper+" "+
1425                                       meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2;
1426
1427                 //alert ("parameters"+parameters);
1428
1429                //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée
1430                parameters=parameters.replace(/ /g,"kkk");
1431                transitionUpper=transitionUpper.replace(/ /g,"kkk");
1432                //le + est interprété comme un espace (plus sera retransformé en + dans le shell)
1433                transitionUpper=transitionUpper.replace(/\+/g,"plus");
1434                transitionLower=transitionLower.replace(/ /g,"kkk");
1435                transitionLower=transitionLower.replace(/\+/g,"plus");
1436
1437                this.nomFichier="GEISA2011";
1438                //envoie de la requête au controller
1439                //en cas de succes appel de la fonction "handleGeisa"
1440                $.ajax( {
1441                            //url: "project?methodName=createUserRequest&"+parameters+"&nbGraph="+ this.nbGraph,
1442                            //url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph,
1443                            url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph+"&nomFichier="+this.nomFichier,
1444                            success:jQuery.proxy( this.handleGeisa, this )
1445                        } );
1446            },
1447
1448
1449            //requête pour interrogation de la base de données des transitions
1450            requestTransition: function()
1451            {
1452
1453                var  nbMolecules=0;
1454
1455                //Récupération du spectral range
1456                var spectralRangeLower = $("#rangeLower").val();
1457                var spectralRangeUpper = $("#rangeUpper").val();
1458
1459                //Récupération des isotopes sélectionnés
1460                var inputs = document.getElementsByTagName( 'input' );
1461                var count = inputs.length;
1462                var isotopesSelectedNameArray = new Array();
1463                var i=0;
1464
1465                for( i = 0; i < count; i++ )
1466                {
1467                    var input = inputs.item( i );
1468                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1469                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1470                    {
1471                        var molN=input.value;
1472                        var molN1=molN.replace("_", ":");
1473                        //tous les isotopes sélectionnés sont placés dans un tableau
1474                        isotopesSelectedNameArray.push(molN1);
1475                    }
1476
1477                    //récupération du nombre de molécules sélectionnées
1478                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1479                    {
1480                       nbMolecules =  nbMolecules + 1;
1481                    }
1482
1483                }
1484                //alert ("nbMolecules"+nbMolecules);
1485                //si le nombre de molécule sélectionnées est supérieure Ã  1 les menus des transition sont inactifs
1486                if (nbMolecules > 1)
1487                {
1488
1489                    //this.selectTransitionLower.disable();
1490                    //this.selectTransitionUpper.disable();
1491                    //ajoute une classe à celle déjà existante de transitionUpper
1492                    $("#transitionUpper").addClass("notActiveText");
1493                    $("#transitionLower").addClass("notActiveText");
1494                }
1495                else
1496                {
1497                    //this.selectTransitionLower.enable();
1498                    //this.selectTransitionUpper.enable();
1499                    $("#transitionUpper").removeClass("notActiveText");
1500                    $("#transitionLower").removeClass("notActiveText");
1501                }
1502
1503
1504                //On ne fait appel à la BDD des transitions    et si au plus 1 molécule est sélectionnée
1505                if (nbMolecules == 1 )
1506                {
1507//                    $.ajax( {
1508//                                url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedName="+isotopesSelectedName+"&GeisaSelectedDatabase="+GeisaSelectedDatabase+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper,
1509//                                success:jQuery.proxy( this.handleRequestTransition, this )
1510//                            } );
1511
1512                    $.ajax( {
1513                                url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+this.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper,
1514                                success:jQuery.proxy( this.handleRequestTransition, this )
1515                            } );
1516
1517                }
1518                else
1519                {
1520                    //pour réinitialiser le menu déroulant si aucune ou plusieurs molécules sont sélectionnées
1521                    document.getElementById("transition2").length=0;
1522                    //this.selectTransitionUpper.clear();
1523                    document.getElementById("transition1").length=0;
1524
1525                    if (nbMolecules == 0 )
1526                    {
1527                        //this.selectTransitionLower.add('-1', "Select a molecule");
1528                        this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
1529                        //this.selectTransitionUpper.add('-1', "Select a molecule");
1530                        this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
1531                        //pour forcer à afficher le premier élément (et non le premier élément précédent)
1532                        //this.selectTransitionLower.selectFirst();
1533                        //this.selectTransitionUpper.selectFirst();
1534                    }
1535
1536                    if (nbMolecules > 1 )
1537                    {
1538                        //this.selectTransitionLower.add('-1', "Select a molecule");
1539                        this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} ));
1540                        //this.selectTransitionUpper.add('-1', "Select a molecule");
1541                        this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} ));
1542                        //pour forcer à afficher le premier élément (et non le premier élément précédent)
1543                        //this.selectTransitionLower.selectFirst();
1544                        //this.selectTransitionUpper.selectFirst();
1545                        //ajoute une classe à celle déjà existante de transitionUpper
1546                        $("#transitionUpper").addClass("notActiveText");
1547                        $("#transitionLower").addClass("notActiveText");
1548                    }
1549                }
1550            },
1551
1552
1553
1554
1555            //requête pour interrogation de la base de données des transitions en fonction d'une transition lower
1556            requestTransitionByTransitionLower: function()
1557            {
1558                var context  = this[0];
1559                //exemple transitionLower="                      000" : il y a 25 caractÚres dans chaque transition
1560                 context.transitionLower = this[1];
1561
1562                //Récupération de la Base Geisa sélectionnée
1563                var GeisaSelectedDatabase = context.selectDatabase.getValue();
1564
1565                //Récupération du spectral range
1566                var spectralRangeLower = $("#rangeLower").val();
1567                var spectralRangeUpper = $("#rangeUpper").val();
1568
1569                //Récupération des isotopes sélectionnés
1570                var inputs = document.getElementsByTagName( 'input' );
1571                var count = inputs.length;
1572                var isotopesSelectedNameArray = new Array();
1573                var i=0;
1574
1575                for( i = 0; i < count; i++ )
1576                {
1577                    var input = inputs.item( i );
1578                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1579                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1)
1580                    {
1581                        var molN=input.value;
1582                        var molN1=molN.replace("_", ":");
1583                        //tous les isotopes sélectionnés sont placés dans un tableau
1584                        isotopesSelectedNameArray.push(molN1);
1585                    }
1586
1587                }
1588
1589                 //le passage de javascript Ã  java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse
1590                 var transitionLowerReplaced = context.transitionLower.replace(/\+/g,"plus");
1591
1592                //Appel Ã  la BDD
1593
1594                $.ajax( {
1595                            url: "project?methodName=getTransitionByIsotopeNameByTransitionLower&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionLower="+transitionLowerReplaced,
1596                            success:jQuery.proxy( context.handleRequestTransitionByTransitionLower, context)
1597                        } );
1598
1599
1600
1601            },
1602
1603
1604            //requête pour interrogation de la base de données des transitions en fonction d'une transition upper
1605            requestTransitionByTransitionUpper: function()
1606            {
1607                var context  = this[0];
1608                //exemple transitionLower="                      000" : il y a 25 caractÚres dans chaque transition
1609                 context.transitionUpper = this[1];
1610
1611                //Récupération de la Base Geisa sélectionnée
1612                var GeisaSelectedDatabase = context.selectDatabase.getValue();
1613
1614                //Récupération du spectral range
1615                var spectralRangeLower = $("#rangeLower").val();
1616                var spectralRangeUpper = $("#rangeUpper").val();
1617
1618                //Récupération des isotopes sélectionnés
1619                var inputs = document.getElementsByTagName( 'input' );
1620                var count = inputs.length;
1621                var isotopesSelectedNameArray = new Array();
1622                var i=0;
1623
1624                for( i = 0; i < count; i++ )
1625                {
1626                    var input = inputs.item( i );
1627                    //ne prendre que les isotopes sélectionnés dans la base de données sélectionnée  (rechercher des id du type :  "chk-ch3cn-GEISA-11")
1628                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1)
1629                    {
1630                        var molN=input.value;
1631                        var molN1=molN.replace("_", ":");
1632                        //tous les isotopes sélectionnés sont placés dans un tableau
1633                        isotopesSelectedNameArray.push(molN1);
1634                    }
1635
1636                }
1637                //le passage de javascript Ã  java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse
1638                var transitionUpperReplaced = context.transitionUpper.replace(/\+/g,"plus");
1639
1640                //Appel Ã  la BDD
1641                $.ajax( {
1642                            url: "project?methodName=getTransitionByIsotopeNameByTransitionUpper&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionUpper="+transitionUpperReplaced,
1643                            success:jQuery.proxy( context.handleRequestTransitionByTransitionUpper, context)
1644                        } );
1645
1646
1647
1648            },
1649
1650
1651
1652//            requestTransition: function()
1653//            {
1654//                $.ajax( {
1655//                            url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(),
1656//                            success:jQuery.proxy( this.handleRequestTransition, this )
1657//                        } );
1658//            },
1659
1660            // HANDLES ******************************************************** = retours ajax
1661            //affichage sur l'interface
1662
1663            handleGeisa: function( result )
1664            {
1665
1666                 //numéro unique pour le nom du répertoire
1667                //this.nb = jQuery.parseJSON( result ).nb;
1668                this.NomRepFileOut = jQuery.parseJSON( result ).NomRepFileOut;
1669
1670                //chemin de l'image
1671//                this.pathImg = jQuery.parseJSON( result ).pathImg;
1672                this.pathImg = "<%=Controller.PATH_IMAGES%>"+this.NomRepFileOut;
1673
1674
1675                //Pour tracer le bon nombre de graphe et de bouton download
1676                var i=1;
1677                var content = '';
1678                for (i=1; i<this.nbGraph+1; i++) {
1679                    //content = content + '<img src=' + this.pathImg + "graph" + this.nb +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName='  + "graph" + this.nb+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>';
1680                    content = content + '<img src=' + this.pathImg + this.nomFichier +"-"+i+ ".png"+ ' /><a href="project?methodName=downloadFile&fileName=' +this.NomRepFileOut + this.nomFichier+"-"+i + ".png"+ '"><button class="dataProtocolDownloadButton">Download</button></a>';
1681
1682                }
1683
1684                this.displayWindow(content);
1685            },
1686
1687
1688//            handleRequestTransition: function( result )
1689//            {
1690//                alert("youpi");
1691//            },
1692
1693
1694            handleRequestTransition: function( result )
1695            {
1696
1697
1698//                var transitions = jQuery.parseJSON( result ).transitions;
1699                 var transitionsLower = jQuery.parseJSON( result ).transitionsLower;
1700                 var transitionsUpper = jQuery.parseJSON( result ).transitionsUpper;
1701
1702                 //pour vider les menus déroulant des transitions précédentes
1703                 // this.selectTransitionLower.clear();
1704                document.getElementById("transition2").length=0;
1705                //this.selectTransitionUpper.clear();
1706                document.getElementById("transition1").length=0;
1707                // this.selectTransitionLower.add('transition', "Choose a transition");
1708                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1709
1710                // this.selectTransitionUpper.add('transition', "Choose a transition");
1711                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1712
1713                 //pour forcer à afficher le premier élément (et non le premier élément précédent)
1714                // this.selectTransitionLower.selectFirst();
1715                // this.selectTransitionUpper.selectFirst();
1716
1717
1718                $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower )
1719                {
1720                   //  this.selectTransitionLower.add(transitionsLower, transitionsLower,jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
1721
1722
1723                    this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLower, text:transitionsLower} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ])));
1724
1725                }, this));
1726
1727                $.each(transitionsUpper, jQuery.proxy( function(index, transitionsUpper )
1728                {
1729                    //this.selectTransitionUpper.add(transitionsUpper, transitionsUpper,jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ]));
1730                    this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpper, text:transitionsUpper} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ])));
1731
1732                }, this));
1733
1734            },
1735
1736            handleRequestTransitionByTransitionLower : function( result )
1737            {
1738                //alert("transitionLower"+this.transitionLower);
1739                var transitionsUpperBis = jQuery.parseJSON( result ).transitionsUpperBis;
1740                //alert("transitionsUpper"+transitionsUpper);
1741
1742                //pour vider les menus déroulant des transitions précédentes
1743               // this.selectTransitionLower.clear();
1744                document.getElementById("transition2").length=0;
1745                //this.selectTransitionUpper.clear();
1746                document.getElementById("transition1").length=0;
1747               // while(0 < document.getElementById("transition1").length)
1748               // {
1749               //     document.getElementById("transition1").options[0] = null;
1750               // }
1751
1752
1753                //this.selectTransitionLower.add(this.transitionLower, this.transitionLower);
1754                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} ));
1755                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower,  selected:"selected"} ));
1756                //this.selectTransitionUpper.add('transition', "Choose a transition");
1757                //rajout du text "Choose a transition" selectionné en premier mais on ne peut pas cliquer dessus
1758                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1759
1760
1761                //pour forcer Ã  afficher le premier Ã©lément (et non le premier Ã©lément précédent)
1762                //this.selectTransitionLower.selectFirst();
1763                //this.selectTransitionUpper.selectFirst();
1764
1765
1766
1767                $.each(transitionsUpperBis, jQuery.proxy( function(index, transitionsUpperBis )
1768                {
1769                   // this.selectTransitionUpper.add(transitionsUpper, transitionsUpper);
1770                     this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpperBis, text:transitionsUpperBis} ));
1771
1772                }, this));
1773
1774            },
1775
1776
1777            handleRequestTransitionByTransitionUpper : function( result )
1778            {
1779               // alert("transitionUpper"+this.transitionUpper);
1780                var transitionsLowerBis = jQuery.parseJSON( result ).transitionsLowerBis;
1781                //alert("transitionsLower"+transitionsLower);
1782
1783                //pour vider les menus déroulant des transitions précédentes
1784               // this.selectTransitionLower.clear();
1785                document.getElementById("transition2").length=0;
1786                //this.selectTransitionUpper.clear();
1787                document.getElementById("transition1").length=0;
1788
1789               // this.selectTransitionLower.add('transition', "Choose a transition");
1790                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1791
1792               // this.selectTransitionUpper.add(this.transitionUpper, this.transitionUpper);
1793                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} ));
1794                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:this.transitionUpper, text:this.transitionUpper,  selected:"selected"} ));
1795
1796
1797                //pour forcer Ã  afficher le premier Ã©lément (et non le premier Ã©lément précédent)
1798                //this.selectTransitionLower.selectFirst();
1799                //this.selectTransitionUpper.selectFirst();
1800
1801
1802
1803                $.each(transitionsLowerBis, jQuery.proxy( function(index, transitionsLowerBis )
1804                {
1805                    //this.selectTransitionLower.add(transitionsLower, transitionsLower);
1806                    this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLowerBis, text:transitionsLowerBis} ));
1807                }, this));
1808
1809            },
1810            // EVENTS ********************************************************
1811            //
1812
1813
1814
1815
1816            //affichage de la valeur du spectral range et affichage du bloc des molecules en fonction de la base de donnees selectionnee
1817            onClickSelectDatabase: function(value)
1818            {
1819
1820                if  ('GEISA2011' == value)
1821                {
1822                    document.getElementById('spectralRangeTitre').innerHTML = "";
1823                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
1824                    //$("#rangeLower").val(0);
1825                    //$("#rangeUpper").val(35877.030506);
1826                    $("#rangeLower").val("");
1827                    $("#rangeUpper").val("");
1828
1829                    document.getElementById( "BDD-GEISA2011" ).style.display = "";
1830                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1831                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1832                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1833                }
1834
1835                if  ('GEISAIASI2011' == value)
1836                {
1837                    document.getElementById('spectralRangeTitre').innerHTML = "";
1838                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :";
1839                    //$("#rangeLower").val(599.000793);
1840                    //$("#rangeUpper").val(3000.998767);
1841                    $("#rangeLower").val("");
1842                    $("#rangeUpper").val("");
1843
1844                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1845                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "";
1846                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1847                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1848                }
1849
1850                if  ('GEISA2003' == value)
1851                {
1852                    document.getElementById('spectralRangeTitre').innerHTML = "";
1853                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
1854                    //$("#rangeLower").val(0);
1855                    //$("#rangeUpper").val(35877.030506);
1856                    $("#rangeLower").val("");
1857                    $("#rangeUpper").val("");
1858
1859                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1860                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1861                    document.getElementById( "BDD-GEISA2003" ).style.display = "";
1862                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1863                }
1864                if  ('GEISAIASI2003' == value)
1865                {
1866                    document.getElementById('spectralRangeTitre').innerHTML = "";
1867                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :";
1868                    //$("#rangeLower").val(599.000793);
1869                    // $("#rangeUpper").val(3000.998767);
1870                    $("#rangeLower").val("");
1871                    $("#rangeUpper").val("");
1872
1873                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1874                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1875                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1876                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "";
1877                }
1878
1879                //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
1880                this.requestTransition();
1881            },
1882
1883            //Pour sélectionner-desélectionner tous les isotopes
1884            selectAll: function()
1885            {
1886                var inputs = document.getElementsByTagName( 'input' );
1887                var count = inputs.length;
1888                var i=0;
1889
1890
1891                if( this.selectButton.getValue() == 'Select all isotopologues')
1892                {
1893                    for( i = 0; i < count; i++ )
1894                    {
1895                        var  input = inputs.item( i );
1896                        if( input.type == 'checkbox' )
1897                        {
1898                            input.checked = true;
1899                        }
1900                    }
1901                    this.selectButton.setValue("Unselect all isotopologues");
1902
1903                }
1904                else
1905                {
1906                    for( i = 0; i < count; i++ )
1907                    {
1908                        var  input = inputs.item( i );
1909                        if( input.type == 'checkbox' )
1910                        {
1911                            input.checked = false;
1912                        }
1913                    }
1914                    this.selectButton.setValue("Select all isotopologues");
1915                }
1916
1917              //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
1918                this.requestTransition();
1919
1920            },
1921
1922            //Pour montrer-cacher tous les isotopes
1923            viewAll: function()
1924            {
1925                var divs = document.getElementsByTagName( 'div' );
1926                var count = divs.length;
1927                var i = 0;
1928                if( this.showButton.getValue() == 'View all isotopologues')
1929                {
1930                    for( i = 0; i < count; i++ )
1931                    {
1932                        //ouvrir que les div dont l'id contient la chaine Cache
1933                        if (divs.item(i).id.indexOf("Cache") != -1) {
1934                            divs.item(i).style.display = "" ;
1935                        }
1936                    }
1937                    this.showButton.setValue("Hide all isotopologues");
1938                }
1939                else
1940                {
1941                    for( i = 0; i < count; i++ )
1942                    {
1943                        //fermer que les div dont l'id contient la chaine Cache
1944                        if (divs.item(i).id.indexOf("Cache") != -1) {
1945                            divs.item(i).style.display = "none" ;
1946                        }
1947                    }
1948                    this.showButton.setValue("View all isotopologues");
1949                }
1950            },
1951
1952            //Actions déclenchées quand on clique sur le nom d'une molécule
1953            cliquetout: function()
1954            {
1955                var context = this[0];
1956                // exemple :moleculeName = ch3ch
1957                var moleculeName = this[1];
1958                var bddVersion = this[2];
1959                var inputs = document.getElementsByTagName( 'input' );
1960                var count = inputs.length;
1961                var i=0;
1962                for( i = 0; i < count; i++ )
1963                {
1964                    var  input = inputs.item( i );
1965                    //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases
1966                    //if( input.type == 'checkbox' && ( input.id == ('chk-' + name + '-GEISA-11') || input.id == ('chk-' + name + '-GEISA-03') || input.id == ('chk-' + name + '-GEISA-IASI-11') || input.id == ('chk-' + name + '-GEISA-IASI-03')
1967                    // || input.id == (name + '-all-GEISA-03') || input.id == (name + '-all-GEISA-11') || input.id == (name + '-all-GEISA-IASI-03') || input.id == (name + '-all-GEISA-IASI-11')))
1968
1969                    if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 ))
1970
1971                    {
1972                        input.checked = document.getElementById( 'all-'+ moleculeName + '-' + bddVersion ).checked;
1973                    }
1974                }
1975                //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
1976                context.requestTransition();
1977            },
1978
1979            //actions déclenchées quand on clique sur un isotope
1980            cliqueIsotope: function()
1981            {
1982                var context = this[0];
1983                //exemple isotopeName = ch3cn_134
1984                var isotopeName = this[1];
1985                // exemple  moleculeName= ch3cn
1986                var moleculeName = this[2];
1987                var bddVersion = this[3];
1988                var inputs = document.getElementsByTagName( 'input' );
1989                var count = inputs.length;
1990                var i = 0;
1991                for( i = 0; i < count; i++ )
1992                {
1993                    input = inputs.item( i );
1994
1995                    //id=chk-ch3cn_234-GEISA2011
1996                    //cliquer ou decliquer le meme isotope dans toutes les bases
1997                    if( input.type == 'checkbox' &&  input.id.indexOf('chk-' + isotopeName) != -1)
1998                    {
1999                        input.checked = document.getElementById( 'chk-' + isotopeName + '-' + bddVersion ).checked;
2000
2001                    }
2002                     // id=all-ch3cn-GEISA2011
2003                    //pour décocher la case de la molecule quand on décoche un isotope
2004                   // if( input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName) != -1 && input.checked == true )
2005                    // {
2006                    //     input.checked = false;
2007                    // }
2008                }
2009
2010
2011                //pour cocher molecule quand on clique sur un isotope et décocher molécule quand tous les isotopes de la molécule sont décochés
2012                var nbIsotopeSelected=0;
2013                var input = "";
2014                var j=0;
2015                var k=0;
2016
2017                //tableau contenant toutes les valeurs du menu déroulant  "choosing Database"
2018                var databaseValues=context.selectDatabase.getValues();
2019                //taille du menu déroulant
2020                var nbdatabaseValues=context.selectDatabase.getSize();
2021
2022                //pour chaque base faire ...
2023                for( j = 0; j < nbdatabaseValues ; j++ )
2024                {
2025                    var nbIsotopeSelected=0;
2026                    //calcul du nombre d'isotopes sélectionnés pour une molécule précise  et une base de données
2027                    for( k = 0; k < count; k++ )
2028                    {
2029                        input = inputs.item( k );
2030                        if( input.type == 'checkbox' &&  input.id.indexOf('chk-'+moleculeName+'_') != -1  && input.id.indexOf(databaseValues[j]) != -1 && input.checked == true )
2031                        {
2032                            nbIsotopeSelected=nbIsotopeSelected+1;
2033                        }
2034
2035                    }
2036                    //si aucun isotope est sélectionné et que la molécule existe dans cette base alors on décoche la molécule
2037                    if ( nbIsotopeSelected == 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]))
2038                    {
2039                        document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=false;
2040                    }
2041                    //si au moins unisotope est sélectionné et que la molécule existe dans cette base alors on coche la molécule
2042                    if ( nbIsotopeSelected > 0 && document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]))
2043                    {
2044                        document.getElementById('all-'+ moleculeName+'-'+databaseValues[j]).checked=true;
2045                    }
2046                }
2047
2048
2049                //mettre a jour le menu déroulant des transitions en fonction des isotopes sélectionnés, de la longueur d'onde et de la base geisa
2050                context.requestTransition();
2051
2052            },
2053
2054
2055
2056            //pour cacher ou voir les isotopes d'une molecule
2057            visibilite: function(  )
2058            {
2059                var context = this[0];
2060                var thingId = this[1];
2061                var divs = document.getElementsByTagName( 'div' );
2062                var count = divs.length;
2063                var i = 0;
2064                for( i = 0; i < count; i++ )
2065                {
2066                    var div = divs.item( i );
2067
2068
2069                    if  (  div.id ==   thingId)
2070                    {
2071                        if( div.style.display == "none" )
2072                        {
2073                            div.style.display = "";
2074                        }
2075                        else
2076                        {
2077                            div.style.display = "none";
2078                        }
2079                    }
2080                }
2081            },
2082
2083             //Faire apparatre ou disparaitre le bloc "advanced options" quand on clique sur le lien "show advanced options"
2084             onClickShowAdvancedOptions: function()
2085            {
2086                //document.getElementById( "advancedOptions" ).style.display = "none";
2087                  if( document.getElementById( "advancedOptions" ).style.display == "none" )
2088                        {
2089                            document.getElementById( "advancedOptions" ).style.display = "";
2090                            document.getElementById( "aShowHide" ).innerHTML = "";
2091                            document.getElementById( "aShowHide" ).innerHTML = "Hide advanced options";
2092                        }
2093                        else
2094                        {
2095                            document.getElementById( "advancedOptions" ).style.display = "none";
2096                            document.getElementById( "aShowHide" ).innerHTML = "";
2097                            document.getElementById( "aShowHide" ).innerHTML = "Show advanced options";
2098                        }
2099            },
2100
2101            //si aucun transition n'a Ã©té trouvée
2102            OnclickVerifTransition : function()
2103            {
2104                //si il n'y a qu'un Ã©lément dans les menu déroulant transition upper et lower et que la valeur est "transition"
2105                if (document.getElementById('transition1').length==1 && document.getElementById('transition1').options[0].value=="transition" && document.getElementById('transition2').length==1 && document.getElementById('transition2').options[0].value=="transition")
2106                {
2107                 alert("Change isotopologues selection or spectral range values to obtain transition values");
2108                }
2109            },
2110
2111            onBlurInputMeanValue: function()
2112            {
2113                //si step est sup a 0,   ajout d'une ligne Z aux parametres Y1 et y2  si elle n'est pas déjà présente
2114                // !this.selectTraceAxeY1.content('Z') indique que "Z" n'exite pas dans le menu déroulant  selectTraceAxeY1
2115                if  ($("#meanValue2").val() > 0 && !this.selectTraceAxeY1.content('Z'))
2116               //  if  ($("#meanValue2").val() > 0 && document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != "Z")
2117                {
2118
2119                    this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
2120                    this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
2121                    //this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "Z" ])));
2122                    //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "Z" ])));
2123                }
2124                //si step = a 0     et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2
2125                if  ($("#meanValue2").val() == 0)
2126                {
2127                    this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
2128                    this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
2129                    //Selection par defaut du 1er element (pour que  "Number of lines"  ne soit plus selectionne par defaut si il n'existe plus)
2130                    this.selectTraceAxeY1.selectFirst();
2131                    this.selectTraceAxeY2.selectFirst();
2132                                     }
2133            },
2134
2135            onClickSelectNbCourbes: function(value)
2136            {
2137              var context  = this[0];
2138              var optionVal = this[1];
2139
2140               //si plusieurs courbes choisis pour les isotopes et ou molecules, les choix pour Y2 sont inactifs
2141                if  ('cm' == value || 'ci' == value)
2142                //if  ('cm' == optionVal || 'ci' == optionVal)
2143                {
2144                    //transformer le texte en gris
2145                    document.getElementById("axeY2Titre").className = "notActiveText";
2146                    document.getElementById("scaleY2Titre").className = "notActiveText";
2147                    document.getElementById("typePlotY2Titre").className = "notActiveText";
2148                    //pour rendre le menu déroulant inactif
2149                    this.selectTraceAxeY2.disable();
2150                    this.selectScaleY2.disable();
2151                    this.selectTypeTraceY2.disable();
2152                    //document.getElementById("selectAxeY2" ).disabled=true;
2153                    //document.getElementById("selectScaleY2" ).disabled=true;
2154                    //document.getElementById("selectTypePlotY2" ).disabled=true;
2155
2156                }
2157                //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs
2158                if  ('ca' == value || 'gm' == value || 'gi' == value)
2159                //if  ('ca' == optionVal || 'gm' == optionVal || 'gi' == optionVal)
2160                {
2161                    //remet le texte en couleur active
2162                    document.getElementById("axeY2Titre").className = "activeText";
2163                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
2164                    if (this.selectTraceAxeY2.getValue() == 'B')
2165                    {
2166                        document.getElementById("scaleY2Titre").className = "activeText";
2167                    }
2168                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
2169                    if (this.selectTraceAxeY2.getValue() != 'no')
2170                    {
2171                        document.getElementById("typePlotY2Titre").className = "activeText";
2172                    }
2173                    //pour rendre les menu déroulant actifs
2174                    this.selectTraceAxeY2.enable();
2175                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
2176                    if (this.selectTraceAxeY2.getValue() == 'B')
2177                    {
2178                        this.selectScaleY2.enable();
2179                    }
2180                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
2181                    if (this.selectTraceAxeY2.getValue() != 'no')
2182                    {
2183                        this.selectTypeTraceY2.enable();
2184                    }
2185
2186                    //remet le texte en couleur active
2187                   // document.getElementById("axeY2Titre").className = "activeText";
2188                    //pour rendre les menu déroulant actifs
2189                   // document.getElementById("selectAxeY2" ).disabled=false;
2190                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
2191                   // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B')
2192                   // {
2193                   //     document.getElementById("scaleY2Titre").className = "activeText";
2194                    //    document.getElementById("selectScaleY2" ).disabled=false;
2195                    //}
2196                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
2197                   // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no')
2198                    //{
2199                    //    document.getElementById("typePlotY2Titre").className = "activeText";
2200                    //    document.getElementById("selectTypePlotY2" ).disabled=false;
2201                    //}
2202                }
2203
2204
2205            },
2206
2207
2208            onClickSelectTraceAxeY1: function(value)
2209            {
2210                //si intensite n'est pas choisi pour Y1, le type d'échelle est inactif
2211                if  (this.selectTraceAxeY1.getValue() != 'B')
2212               // if  ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != 'B')
2213                {
2214                    //transformer le texte en gris
2215                    document.getElementById("scaleY1Titre").className = "notActiveText";
2216                    //pour rendre le menu déroulant inactif
2217                    this.selectScaleY1.disable();
2218                   //  document.getElementById("selectScaleY1" ).disabled=true;
2219                }
2220                //si intensite est  choisi pour Y1, le type d'échelle est actif
2221                if  (this.selectTraceAxeY1.getValue() == 'B')
2222                //if  ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value == 'B')
2223                {
2224                    //transformer le texte en gris
2225                    document.getElementById("scaleY1Titre").className = "activeText";
2226                    //pour rendre le menu déroulant inactif
2227                    this.selectScaleY1.enable();
2228                   // document.getElementById("selectScaleY1" ).disabled=false;
2229                }
2230            },
2231
2232            onClickSelectTraceAxeY2: function(value)
2233            {
2234                //si intensite n'est pas choisi pour Y2, le type d'échelle est inactif
2235                if  (this.selectTraceAxeY2.getValue() != 'B')
2236                 //if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'B')
2237                {
2238                    //transformer le texte en gris
2239                    document.getElementById("scaleY2Titre").className = "notActiveText";
2240                    //pour rendre le menu déroulant inactif
2241                    this.selectScaleY2.disable();
2242                    //document.getElementById("selectScaleY2" ).disabled=true;
2243                }
2244                //si intensite est  choisi pour Y2, le type d'échelle est actif
2245                if  (this.selectTraceAxeY2.getValue() == 'B')
2246               //if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B')
2247                {
2248                    //transformer le texte en foncé
2249                    document.getElementById("scaleY2Titre").className = "activeText";
2250                    //pour rendre le menu déroulant actif
2251                    this.selectScaleY2.enable();
2252                    //document.getElementById("selectScaleY2" ).disabled=false;
2253                }
2254                //si aucun parametre est  choisi pour Y2, le type de plot est inactif
2255                if  (this.selectTraceAxeY2.getValue() == 'no')
2256                //if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no')
2257                {
2258                    //transformer le texte en gris
2259                    document.getElementById("typePlotY2Titre").className = "notActiveText";
2260                    //pour rendre le menu déroulant inactif
2261                   this.selectTypeTraceY2.disable();
2262                    // document.getElementById("selectTypePlotY2" ).disabled=true;
2263                }
2264                //si un parametre est  choisi pour Y2, le type de plot est actif
2265               if  (this.selectTraceAxeY2.getValue() != 'no')
2266                // if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no')
2267                {
2268                    //transformer le texte en foncé
2269                    document.getElementById("typePlotY2Titre").className = "activeText";
2270                    //pour rendre le menu déroulant actif
2271                    this.selectTypeTraceY2.enable();
2272                   //document.getElementById("selectTypePlotY2" ).disabled=false;
2273                }
2274
2275            },
2276
2277            //bouton reset de toute la page  (rechargement de la page)
2278            resetPage: function()
2279            {
2280                //location.reload(); //pas appliquée car supprime la fenêtre graphique
2281
2282                //reset du choix de la base de données
2283                // selectFirst : affiche le premier élément de la liste
2284                //true : active la fonction associée au bouton
2285                this.selectDatabase.selectFirst( true );
2286
2287                //cacher tous les isotopes
2288                var divs = document.getElementsByTagName( 'div' );
2289                var count = divs.length;
2290                var i = 0;
2291
2292                for( i = 0; i < count; i++ )
2293                {
2294                    //fermer que les div dont l'id contient la chaine Cache
2295                    if (divs.item(i).id.indexOf("Cache") != -1) {
2296                        divs.item(i).style.display = "none" ;
2297                    }
2298                }
2299                this.showButton.setValue("View all isotopologues");
2300
2301                //déselectionner tous les isotopes
2302                var inputs = document.getElementsByTagName( 'input' );
2303                var count = inputs.length;
2304                var i=0;
2305
2306                for( i = 0; i < count; i++ )
2307                {
2308                    var  input = inputs.item( i );
2309                    if( input.type == 'checkbox' )
2310                    {
2311                        input.checked = false;
2312                    }
2313                }
2314                this.selectButton.setValue("Select all isotopologues");
2315
2316                //spectral range
2317                $("#rangeLower").val(0);
2318                $("#rangeUpper").val(35877.030506);
2319                $("#sampStep").val("");
2320
2321                //intensity range
2322                $("#intensityLo").val(0);
2323                $("#intensityUp").val(1e-16);
2324
2325                this.selectNbCourbes.selectFirst( true );
2326
2327                this.selectTraceAxeY1.selectFirst( true );
2328                this.selectScaleY1.selectFirst( true );
2329                this.selectTypeTraceY1.selectFirst( true );
2330
2331                document.getElementById("transition1").length=0;
2332                document.getElementById("transition2").length=0;
2333                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
2334                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
2335                $("#transitionUpper").removeClass("notActiveText");
2336                $("#transitionLower").removeClass("notActiveText");
2337
2338
2339                $("#meanValue2").val("");
2340
2341                this.selectTraceAxeY2.selectFirst( true );
2342                this.selectScaleY2.selectFirst( true );
2343                this.selectTypeTraceY2.selectFirst( true );
2344
2345            },
2346
2347            onClickSubmit: function()
2348            {
2349                this.requestGeisa();
2350            },
2351
2352            displayWindow: function(content)
2353            {
2354                //fermeture de la div de l'image d'attente
2355                this.loadingGraphics.hide();
2356
2357                // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>';
2358
2359                //alert(content);
2360                var $dialog = $( '<div></div>' )
2361
2362                        .html( content )
2363
2364                        .dialog( {
2365                            autoOpen: false,
2366                            title: "GEISA : spectroscopic database",
2367                            //buttons: { "Close": function() { $(this).dialog("close"); }, "Min": function() { $(this).dialog({ height: 20, width:350  }); },"Max": function() { $(this).dialog({ height: 560, width:700  }); }  },
2368                            buttons:{
2369                                "close":{
2370                                    id:'close',
2371                                    text:'Close',
2372                                    height:'30px',
2373                                    width:'47px',
2374                                    title :'to close the window',
2375                                    click: function() { $(this).dialog("close"); },
2376                                },
2377                                "min" :{
2378                                    id:'Min',
2379                                    text:'Min',
2380                                    height:'30px',
2381                                    width:'47px',
2382                                    title :'to reduce the window',
2383                                    click: function() { $(this).dialog({ height: 18, width:350  }); },
2384                                },
2385                                "max" :{
2386                                    id:'Max',
2387                                    text:'Max',
2388                                    height:'30px',
2389                                    width:'47px',
2390                                    title :'to enlarge the window ',
2391                                    click: function() { $(this).dialog({ height: 628, width:700  }); },
2392                                },
2393                            },
2394
2395                            //minHeight: 500,
2396                            // minWidth: 660,
2397                            height: 628,
2398                            width:700,
2399                            //Exemple de  valeurs possible pour position : "middle", "top",  [200, 100]
2400                            position: "middle"
2401                        } );
2402                $dialog.dialog( 'open' );
2403            },
2404
2405            // displayWindow: function(coordinate)
2406            //{
2407            //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>';
2408            // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>';
2409
2410            //alert(content);
2411            // var $dialog = $( '<div></div>' )
2412            // .html( content + content1 )
2413
2414            // .dialog( {
2415            //    autoOpen: false,
2416            //    title: "GEISA : spectroscopic database",
2417            //    minHeight: 500,
2418            //    minWidth: 660,
2419
2420            //coordonnee y y
2421            //   position:coordinate
2422
2423            // } );
2424            // $dialog.dialog( 'open' )
2425            //},
2426
2427
2428            onClickDownload: function()
2429            {
2430                document.location.href = "project?methodName=downloadFile&fileName=bib.txt";
2431            }
2432
2433
2434        } );
2435
2436
2437</script>
2438
2439
2440
Note: See TracBrowser for help on using the repository browser.