source: geisa/web/initGeisa_script.jsp @ 568

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

Bouton pour agrandir et réduire la fenêtre dialog

File size: 114.6 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
488
489                this.createMolecules($('#BDD-GEISA2011'), this.arrayGeisa2011, "GEISA2011");
490                this.createMolecules($('#BDD-GEISA2003'), this.arrayGeisa2003, "GEISA2003");
491                this.createMolecules($('#BDD-GEISAIASI2011'), this.arrayGeisaIasi2011, "GEISAIASI2011");
492                this.createMolecules($('#BDD-GEISAIASI2003'), this.arrayGeisaIasi2003, "GEISAIASI2003");
493
494
495                //Zone texte  SpectralRange
496                //Titre général (qui changera en fonction de la base geisa choisie)
497                document.getElementById('spectralRangeTitre').innerHTML = "";
498                document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
499
500                //Titre
501                //var titleSpectralRangeLower = document.createTextNode("Upper Bound :");
502               // document.getElementById("spectralRangeLower").appendChild(titleSpectralRangeLower);
503                document.getElementById("spectralRangeLower").innerHTML = "Lower value, cm<sup>-1</sup> : ";
504                //var titleSpectralRangeUpper = document.createTextNode("Upper Bound :");
505               // document.getElementById("spectralRangeUpper").appendChild(titleSpectralRangeUpper);
506                document.getElementById("spectralRangeUpper").innerHTML = "Upper value, cm<sup>-1</sup> : ";
507                //zone texte  SpectralRangeLower
508                var inputSpectralRangeLower = $( document.createElement( "input" ) );
509                inputSpectralRangeLower.attr( {id:"rangeLower", class:"styleInputs"} );
510                inputSpectralRangeLower.val(0);
511                //pour mettre à jour le menu déroulant des transitions
512                inputSpectralRangeLower.bind( 'blur', this, jQuery.proxy( this.requestTransition, this ));
513                this.containerFormSpectralRangeLower.append( inputSpectralRangeLower );
514                //zone texte   SpectralRangeUpper
515                var inputSpectralRangeUpper = $( document.createElement( "input" ) );
516                inputSpectralRangeUpper.attr( {id:"rangeUpper"} );
517                inputSpectralRangeUpper.val(35877.030506);
518                //pour mettre à jour le menu déroulant des transitions lorsque l'on change la valeur du spectral range
519                inputSpectralRangeUpper.bind( 'blur', this, jQuery.proxy( this.requestTransition, this ));
520                this.containerFormSpectralRangeUpper.append( inputSpectralRangeUpper );
521
522
523                 //Zone texte Intensity
524                //Titre
525                //var titleIntensityLower = document.createTextNode("Lower Bound :");
526                //document.getElementById("intensityLower").appendChild(titleIntensityLower);
527                //var titleIntensityUpper = document.createTextNode("Upper Bound :");
528                //document.getElementById("intensityUpper").appendChild(titleIntensityUpper);
529                  document.getElementById("intensityLower").innerHTML = "Lower value, cm/mol. : "
530                  document.getElementById("intensityUpper").innerHTML = "Upper value, cm/mol. : "
531
532                //zone texte    IntensityLower
533                var inputIntensityLower = $( document.createElement( "input" ) );
534                inputIntensityLower.attr( {id:"intensityLo", class:"styleInputs"} );
535                inputIntensityLower.val(0);
536                this.containerFormIntensityLower.append( inputIntensityLower );
537                //zone texte    IntensityUpper
538                var inputIntensityUpper = $( document.createElement( "input" ) );
539                inputIntensityUpper.attr( {id:"intensityUp"} );
540                inputIntensityUpper.val(1e-16);
541                this.containerFormIntensityUpper.append( inputIntensityUpper );
542
543
544                // Create menu deroulant  1er choix axe des y
545                //Titre
546                var titleAxeY1 = document.createTextNode("Select parameter (left Y-axis)");
547                document.getElementById("axeY1").appendChild(titleAxeY1);
548                var spaceBr = document.createElement ("br");
549                document.getElementById("axeY1").appendChild(spaceBr);
550                //menu déroulant
551                var paramSelectAxeY1 = new Object();
552                paramSelectAxeY1.id = "selectAxeY1";
553                paramSelectAxeY1.parent = $("#axeY1");
554                this.selectTraceAxeY1 = new Select( paramSelectAxeY1 );
555                this.selectTraceAxeY1.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY1, this ));
556                this.selectTraceAxeY1.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
557                this.selectTraceAxeY1.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
558                this.selectTraceAxeY1.add( 'F', "Temperature dependence coefficient n of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
559                this.selectTraceAxeY1.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
560                this.selectTraceAxeY1.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
561                this.selectTraceAxeY1.add( 'R', "Temperature dependence coefficient of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
562                this.selectTraceAxeY1.selectFirst( false );
563               //  this.selectTraceAxeY1 = $( document.createElement( "select" ) );
564               // this.selectTraceAxeY1.attr( {id:"selectAxeY1" } );
565                //this.selectTraceAxeY1.css("width", "100px");
566               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"B", text:"Intensity"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "B" ])));
567               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"C", text:"Air broadening pressure halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "C" ])));
568               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"D", text:"Energy of the lower transition level"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "D" ])));
569               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"F", text:"Temperature of the air broadening halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "F" ])));
570               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"N", text:"Self broadening pressure halfwidth (HWHM)"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "N" ])));
571               // 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" ])));
572               // this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"R", text:"Temperature of the air pressure shift"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "R" ])));
573               // $("#axeY1").append(this.selectTraceAxeY1);
574
575
576
577                // Create menu deroulant  type de graphe
578                 //Titre
579                var titleTypeTrace = document.createTextNode("Type of graph");
580                document.getElementById("nbCourbes").appendChild(titleTypeTrace);
581                var spaceBr = document.createElement ("br");
582                document.getElementById("nbCourbes").appendChild(spaceBr);
583                //menu déroulant
584                var paramNbCourbes = new Object();
585                paramNbCourbes.id = "selectNbCourbes";
586                paramNbCourbes.parent = $("#nbCourbes");
587                this.selectNbCourbes = new Select( paramNbCourbes );
588                this.selectNbCourbes.add( 'ca', "One curve for all selection", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
589                this.selectNbCourbes.add( 'cm', "One curve for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
590                this.selectNbCourbes.add( 'ci', "One curve for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
591                this.selectNbCourbes.add( 'gm', "One graph for each molecule selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
592                this.selectNbCourbes.add( 'gi', "One graph for each isotopologue selected", jQuery.proxy(this.onClickSelectNbCourbes, this ) );
593                this.selectNbCourbes.selectFirst( false );
594                // this.selectNbCourbes = $( document.createElement( "select" ) );
595                //this.selectNbCourbes.attr( {id:"selectNbCourbes"} );
596               // this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"ca", text:"One curve for all selection"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "ca" ])));
597                //this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"cm", text:"One curve for each molecule selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "cm" ])));
598                //this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"ci", text:"One curve for each isotopologue selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "ci" ])));
599               // this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"gm", text:"One graph for each molecule selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "gm" ])));
600                //this.selectNbCourbes.append($( document.createElement( "option" ) ).attr( {value:"gi", text:"One graph for each isotopologue selected"} ).bind( 'click', jQuery.proxy(this.onClickSelectNbCourbes, [this, "gi" ])));
601                //$("#nbCourbes").append(this.selectNbCourbes);
602
603
604                // Create menu deroulant  type d'échelle linéaire ou logarithmique  pour le choix y1
605                //Titre
606                var titleScaleY1 = document.createTextNode("Select the type of Scale (if intensity is choosen)");
607                document.getElementById("scaleY1Titre").appendChild(titleScaleY1);
608                //menu déroulant
609                var paramSelectScaleY1 = new Object();
610                paramSelectScaleY1.id = "selectScaleY1";
611                paramSelectScaleY1.parent = $("#scaleY1");
612                this.selectScaleY1 = new Select( paramSelectScaleY1 );
613                this.selectScaleY1.add( 'l', "Linear" );
614                this.selectScaleY1.add( '-log_scale', "Logarithmic" );
615                this.selectScaleY1.selectFirst( false );
616                //this.selectScaleY1 = $( document.createElement( "select" ) );
617               // this.selectScaleY1.attr( {id:"selectScaleY1"} );
618               // var optSelectScaleY1 = $( document.createElement( "option" ) );
619               // optSelectScaleY1.attr( {value:"l", text:"Linear"} );
620               // this.selectScaleY1.append(optSelectScaleY1);
621               // var optSelectScaleY1 = $( document.createElement( "option" ) );
622                //optSelectScaleY1.attr( {value:"-log_scale", text:"Logarithmic"} );
623               // this.selectScaleY1.append(optSelectScaleY1);
624               // $("#scaleY1").append(this.selectScaleY1);
625
626
627                // Create menu deroulant  style de tracer   Y1
628                //Titre
629                var titleTypeTrace = document.createTextNode("Select the type of plot");
630                document.getElementById("typePlotY1").appendChild(titleTypeTrace);
631                var spaceBr = document.createElement ("br");
632                document.getElementById("typePlotY1").appendChild(spaceBr);
633                //menu déroulant
634                var paramSelectTypeTraceY1 = new Object();
635                paramSelectTypeTraceY1.id = "selectTypePlotY1";
636                paramSelectTypeTraceY1.parent = $("#typePlotY1");
637                this.selectTypeTraceY1 = new Select( paramSelectTypeTraceY1 );
638                this.selectTypeTraceY1.add( 'l', "Lines" );
639                this.selectTypeTraceY1.add( 'p', "Dots" );
640                this.selectTypeTraceY1.add( 'i', "Peaks" );
641                this.selectTypeTraceY1.add( 'lp', "Lines and Dots" );
642                this.selectTypeTraceY1.selectFirst( false );
643                //this.selectTypeTraceY1 = $( document.createElement( "select" ) );
644                //this.selectTypeTraceY1.attr( {id:"selectTypePlotY1"} );
645                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"l", text:"Lines"} ));
646                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"p", text:"Dots"} ));
647                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"i", text:"Peaks"} ));
648                //this.selectTypeTraceY1.append($( document.createElement( "option" ) ).attr( {value:"lp", text:"Lines and Dots"} ));
649                //$("#typePlotY1").append(this.selectTypeTraceY1);
650
651
652
653
654                //lien pour montrer ou cacher le bloc "advanced options"
655                var showHide = $(document.createElement("a"));
656                showHide.html("Show advanced options");
657                showHide.attr( {id:"aShowHide", class:"fieldsetGeneralTitle"} );
658                showHide.bind( 'click', this, jQuery.proxy( this.onClickShowAdvancedOptions));
659                $("#showAdvancedOptions").append(showHide);
660
661
662                //titre  menu deroulant  transition upper
663                var titleTransitionUpper = document.createTextNode("Upper state : ");
664                document.getElementById("transitionUpper").appendChild(titleTransitionUpper);
665
666
667                // Create menu deroulant  transition upper
668//                var paramSelectTransitionUpper = new Object();
669//                paramSelectTransitionUpper.id = "transition1";
670//                paramSelectTransitionUpper.parent = $("#transitionUpper");
671//                this.selectTransitionUpper = new Select( paramSelectTransitionUpper );
672//                this.selectTransitionUpper.add( '-1', "Select a molecule" );
673//                this.selectTransitionUpper.selectFirst( false );
674
675                this.selectTransitionUpper = $( document.createElement( "select" ) );
676                this.selectTransitionUpper.attr( {id:"transition1"} );
677                var optTransitionUpper = $( document.createElement( "option" ) );
678                optTransitionUpper.attr( {value:"-1", text:"Select a molecule"} );
679                //var  transitionsLower ="000";
680                // opt2.bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
681                this.selectTransitionUpper.append(optTransitionUpper);
682                $("#transitionUpper").append(this.selectTransitionUpper);
683
684
685                //titre  menu deroulant  transition lower
686                var titleTransitionLower = document.createTextNode("Lower state : ");
687                document.getElementById("transitionLower").appendChild(titleTransitionLower);
688
689                // Create menu deroulant  transition lower
690//                var paramSelectTransitionLower = new Object();
691//                paramSelectTransitionLower.id = "transition2";
692//                paramSelectTransitionLower.parent = $("#transitionLower");
693//                this.selectTransitionLower = new Select( paramSelectTransitionLower );
694//                this.selectTransitionLower.add( '-1', "Select a molecule");
695//                this.selectTransitionLower.selectFirst( false );
696                this.selectTransitionLower = $( document.createElement( "select" ) );
697                this.selectTransitionLower.attr( {id:"transition2"} );
698                var optTransitionLower = $( document.createElement( "option" ) );
699                optTransitionLower.attr( {value:"-1", text:"Select a molecule"} );
700                this.selectTransitionLower.append(optTransitionLower);
701                $("#transitionLower").append(this.selectTransitionLower);
702
703                //bouton reset pour les transition
704                var resetButton = new Button( {value:"Reset", parent:$( "#transitionReset" ), id:"buttonReset", className: "gray_button", onClick:jQuery.proxy( this.requestTransition, this )} );
705
706
707//                //menu déroulant  js   en javascript    sans passer par le modele
708//                var select = document.createElement('select');
709//                select.id = "transiEssai";
710//                select.name ="transiEssai";
711//
712//                var opt = document.createElement('option');
713//                opt.setAttribute('value','id1');
714//                var theText = document.createTextNode("id1");
715//                opt.appendChild(theText);
716//                select.appendChild(opt);
717//
718//                var opt = document.createElement('option');
719//                opt.setAttribute('value','id2');
720//                var theText = document.createTextNode("id2");
721//                opt.appendChild(theText);
722//
723//                //opt.onclick=jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]);
724//                    select.appendChild(opt);
725//                    document.getElementById("transitionLower").appendChild(select);
726
727
728                //menu déroulant en jquery    sans passer par le modele
729//                this.select2 = $( document.createElement( "select" ) );
730//                this.select2.attr( {id:"transiEssai2", name:"transiEssai2"} );
731//                var opt2 = $( document.createElement( "option" ) );
732//                opt2.attr( {value:"id3", text:"zzz"} );
733//                //var  transitionsLower ="000";
734//                // opt2.bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
735//                this.select2.append(opt2);
736//                $("#transitionLower").append(this.select2);
737
738
739
740
741                //Zone text Mean Value
742                //Titre
743                var titleMeanValue = document.createTextNode("Step : ");
744                document.getElementById("meanValue1").appendChild(titleMeanValue);
745                //champ input
746                var inputMeanValue = $( document.createElement( "input" ) );
747                inputMeanValue.attr( {id:"meanValue2"} );
748                inputMeanValue.val(0);
749                this.containerFormMeanValue1.append( inputMeanValue );
750                inputMeanValue.bind( 'blur', this, jQuery.proxy( this.onBlurInputMeanValue, this ));
751
752
753                // Create menu deroulant  2eme choix axe des y
754                //Titre
755                var titleAxeY2 = document.createTextNode("Select secondary parameter (right Y-axis)");
756                document.getElementById("axeY2Titre").appendChild(titleAxeY2);
757                //menu déroulant
758                var paramSelectAxeY2 = new Object();
759                paramSelectAxeY2.id = "selectAxeY2";
760                paramSelectAxeY2.parent = $("#axeY2");
761                this.selectTraceAxeY2 = new Select( paramSelectAxeY2 );
762                this.selectTraceAxeY2.add( 'no', "None", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
763                this.selectTraceAxeY2.add( 'B', "Intensity", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
764                this.selectTraceAxeY2.add( 'C', "Air broadening pressure halfwidth", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
765                this.selectTraceAxeY2.add( 'D', "Energy of the lower transition level", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
766                this.selectTraceAxeY2.add( 'F', "Temperature dependence coefficient n of the air broadening halfwidth ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
767                this.selectTraceAxeY2.add( 'N', "Self broadening pressure halfwidth (HWHM)", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
768                this.selectTraceAxeY2.add( 'O', "Air pressure shift of the line transition", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
769                this.selectTraceAxeY2.add( 'R', "Temperature dependence coefficient of the air pressure shift ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
770                this.selectTraceAxeY2.selectFirst( false );
771                //this.selectTraceAxeY2 = $( document.createElement( "select" ) );
772                //this.selectTraceAxeY2.attr( {id:"selectAxeY2"} );
773                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"no", text:"None"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "no" ])));
774                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"B", text:"Intensity"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "B" ])));
775                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"C", text:"Air broadening pressure halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "C" ])));
776                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"D", text:"Energy of the lower transition level"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "D" ])));
777                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"F", text:"Temperature of the air broadening halfwidth"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "F" ])));
778                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"N", text:"Self broadening pressure halfwidth (HWHM)"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "N" ])));
779                //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" ])));
780                //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"R", text:"Temperature of the air pressure shift"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "R" ])));
781                //$("#axeY2").append(this.selectTraceAxeY2);
782
783
784                // Create menu deroulant  type d'échelle linéaire ou logarithmique  pour le choix y2
785                //Titre
786                var titleScaleY2 = document.createTextNode("Select the type of Scale (if intensity is choosen)");
787                document.getElementById("scaleY2Titre").appendChild(titleScaleY2);
788                //menu déroulant
789                var paramSelectScaleY2 = new Object();
790                paramSelectScaleY2.id = "SelectScaleY2";
791                paramSelectScaleY2.parent = $("#scaleY2");
792                this.selectScaleY2 = new Select( paramSelectScaleY2 );
793                this.selectScaleY2.add( 'l', "Linear" );
794                this.selectScaleY2.add( '-log_scale2', "Logarithmic" );
795                this.selectScaleY2.selectFirst( false );
796                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
797                document.getElementById("scaleY2Titre").className = "notActiveText";
798                this.selectScaleY2.disable();
799
800
801                //this.selectScaleY2 = $( document.createElement( "select" ) );
802                //this.selectScaleY2.attr( {id:"selectScaleY2"} );
803                //var optSelectScaleY2 = $( document.createElement( "option" ) );
804                //optSelectScaleY2.attr( {value:"l", text:"Linear"} );
805               // this.selectScaleY2.append(optSelectScaleY2);
806               // var optSelectScaleY2 = $( document.createElement( "option" ) );
807               // optSelectScaleY2.attr( {value:"-log_scale2", text:"Logarithmic"} );
808                //this.selectScaleY2.append(optSelectScaleY2);
809                //$("#scaleY2").append(this.selectScaleY2);
810                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
811                //document.getElementById("scaleY2Titre").className = "notActiveText";
812                //document.getElementById("selectScaleY2" ).disabled=true;
813
814
815                // Create menu deroulant  style de tracer       Y2
816                //Titre
817                var titleTypeTrace = document.createTextNode("Select the type of plot");
818                document.getElementById("typePlotY2Titre").appendChild(titleTypeTrace);
819                //menu déroulant
820                var paramSelectTypeTraceY2 = new Object();
821                paramSelectTypeTraceY2.id = "selectTypePlotY2";
822                paramSelectTypeTraceY2.parent = $("#typePlotY2");
823                this.selectTypeTraceY2 = new Select( paramSelectTypeTraceY2 );
824                this.selectTypeTraceY2.add( 'l', "Lines" );
825                this.selectTypeTraceY2.add( 'p', "Dots" );
826                this.selectTypeTraceY2.add( 'i', "Peaks" );
827                this.selectTypeTraceY2.add( 'lp', "Lines and Dots" );
828                this.selectTypeTraceY2.selectFirst( false );
829                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
830                document.getElementById("typePlotY2Titre").className = "notActiveText";
831                this.selectTypeTraceY2.disable();
832                //this.selectTypeTraceY2 = $( document.createElement( "select" ) );
833                //this.selectTypeTraceY2.attr( {id:"selectTypePlotY2"} );
834                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"l", text:"Lines"} ));
835                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"p", text:"Dots"} ));
836                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"i", text:"Peaks"} ));
837                //this.selectTypeTraceY2.append($( document.createElement( "option" ) ).attr( {value:"lp", text:"Lines and Dots"} ));
838                //$("#typePlotY2").append(this.selectTypeTraceY2);
839                //est inactif par defaut car selectTraceAxeY2 est positionne a none par defaut
840               // document.getElementById("typePlotY2Titre").className = "notActiveText";
841               // document.getElementById("selectTypePlotY2" ).disabled=true;
842
843
844
845                //création de l'image d'attente
846                var param = new Object();
847               param.id = "loadingForGraphics";
848               param.parent = this.containerLoading;
849               this.loadingGraphics = new Loading( param );
850              // this.loadingGraphics.display();
851               //this.loadingGraphics.hide();
852
853
854                // 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 )} );
855                var submitButton = new Button( {value:"Submit", parent:$( "#boutonSubmit" ), id:"button_submit_3", className: "positive", onClick:jQuery.proxy( this.onClickSubmit, this )} );
856            },
857
858
859
860
861            /**
862             * This method creates the case to check for the moles
863             * create cases à cocher pour les molécules
864             * @param container
865             * @param moleculesArray
866             */
867                //createMolecules: function(container, moleculesArray)
868            createMolecules: function(container, moleculesArray, BddVersion)
869            {
870                var table = $(document.createElement("table"));
871                container.append(table);
872                // var tr = $(document.createElement("tr"));
873                // tr.attr({valign: "top"});
874                // table.append(tr);
875                var i=0;
876                //nombre de molecules par ligne
877                var l=11;
878                //taille du tableau
879                //alert("l" +moleculesArray.length);
880                // parseInt : partie entiÚre
881                // var res =  parseInt(8/3);
882                //alert("res="+res);
883
884                $.each(moleculesArray, jQuery.proxy( function(index, moleculeElement )
885                {
886
887
888                    //this.tr et non var tr pour que tr existe encore à la sortie du if
889                    if ( index == (i*l))
890                    {
891                        //alert(index);
892                        this.tr = $(document.createElement("tr"));
893                        this.tr.attr({valign: "top"});
894                        table.append(this.tr);
895                        i=i+1;
896
897                    }
898                    var td = $(document.createElement("td"));
899                    this.tr.append(td);
900
901                    var span= $(document.createElement("span"));
902                    span.addClass("molecule");
903                    td.append(span);
904
905                    var input = $(document.createElement("input"));
906                    input.attr({type:"checkbox", id:"all-"+moleculeElement.id+"-"+BddVersion});
907                    input.bind( 'click', this, jQuery.proxy( this.cliquetout, [this, moleculeElement.id, BddVersion ] ));
908                    span.append(input);
909
910                    var a = $(document.createElement("a"));
911                    a.html("<b>"+moleculeElement.name+"</b>");
912
913                    a.bind( 'click', this, jQuery.proxy( this.visibilite, [this,"Cache-"+ moleculeElement.id] ));
914                    span.append(a);
915
916                    var div= $(document.createElement("div"));
917                    div.addClass("divViolet");
918                    div.attr({id:"Cache-"+moleculeElement.id, style: "display:none"});
919                    td.append(div);
920
921                    var spanIsotopes= $(document.createElement("span"));
922                    spanIsotopes.addClass("isotope");
923                    spanIsotopes.attr({id:moleculeElement.id+"Isotope"+BddVersion});
924                    div.append(spanIsotopes);
925
926
927                    this.createIsotopes($("#"+moleculeElement.id+"Isotope"+BddVersion), moleculeElement.isotopesArray, moleculeElement.id, BddVersion);
928
929
930                }, this) );
931
932
933            },
934
935            createIsotopes: function(container, isotopesArray, moleculeElement, BddVersion )
936            {
937
938
939                $.each(isotopesArray, jQuery.proxy( function( index, isotopeElement )
940                {
941                    container.append("&nbsp;&nbsp;&nbsp;");
942                    var inputIsotopes = $(document.createElement("input"));
943                    inputIsotopes.attr({type:"checkbox", id:"chk-"+moleculeElement+"_"+isotopeElement+"-"+BddVersion, name:"moles", value:moleculeElement+"_"+isotopeElement});
944                    inputIsotopes.bind( 'click', this, jQuery.proxy( this.cliqueIsotope, [this, moleculeElement+"_"+isotopeElement, moleculeElement, BddVersion ] ));
945                    container.append(inputIsotopes);
946                    container.append(isotopeElement);
947                    var br = $(document.createElement("br"));
948                    container.append(br);
949
950                }, this) );
951            },
952
953            // <table><tr><td>
954            // <span class="molecule"><input type=checkbox id=all-ch3cn-GEISA2011 onclick="cliquetout('this, ch3cn, GEISA2011');">
955            //          <a href="javascript:visibilite('this, Cache-ch3cn');"><B>CH<sub>3</sub>CN</a></B>
956            // </span>
957            // <div class="divViolet" id="Cache-ch3cn" style="display:none;">
958            //          <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>
959            // </div>
960            // </td></tr></table>
961
962// REQUESTS ********************************************************
963            //récupération de toutes les valeurs choisies par l'utilisateur et transformation de ces valeurs pour les inclure dans la requête fortran
964            requestGeisa: function()
965            {
966
967                //on va chercher les chemin déclaré dans le controller
968                this.pathProcess = "<%=Controller.PATH_PROCESS%>";
969                this.LongPathImages = "<%=Controller.LONG_PATH_IMAGES%>";
970
971
972
973                 //sélection du fichier binaire de la base geisa sélectionnée
974                var paramBase = "";
975                switch (this.selectDatabase.getValue()) {
976                    case 'GEISA2003':
977                        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";
978                        break;
979                    case 'GEISA2011':
980                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISA2009_bin -database_name GEISA2011 -database_type gs08";
981                        break;
982                    case 'GEISAIASI2003':
983                        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";
984                        break;
985                    case 'GEISAIASI2011':
986                        paramBase = " -dirin "+this.pathProcess+" -dirout "+this.LongPathImages+" -filein "+this.pathProcess+"line_GEISAIASI2011_bin_gsi08_v1.0 -database_name GEISAIASI2011 -database_type gsi08";
987                        break;
988                }
989
990
991                //molécules
992                //récupération des molécules sélectionnées
993                var inputs = document.getElementsByTagName( 'input' );
994                var count = inputs.length;
995                var isotopesSelectedName ="";
996              //  alert(this.selectDatabase.getValue());
997                var i=0;
998                this.nbIsotopes = 0;
999                this.nbMolecules = 0;
1000                this.nbGraph = 0;
1001                for( i = 0; i < count; i++ )
1002                {
1003                    var input = inputs.item( i );
1004                    //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")
1005                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1006                    {
1007                        //nombre d'isotopes sélectionnés
1008                        this.nbIsotopes =  this.nbIsotopes + 1;
1009
1010                        var molN=input.value;
1011                        var molN1=molN.replace("_", ":");
1012                        // exemple : -moleisot h2o:161 -moleisot h2o:162 -moleisot co2:626 -moleisot co2:627 -moleisot o3:666 -moleisot o3:668
1013                        isotopesSelectedName = isotopesSelectedName+"-moleisot "+molN1+" ";
1014                    }
1015                    //récupération du nombre de molécules sélectionnées
1016                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1017                    {
1018                        //nombre d'isotopes sélectionnés
1019                        this.nbMolecules =  this.nbMolecules + 1;
1020                    }
1021                }
1022
1023
1024                //averti l'utilisateur qu'il faut au moins sélectionner un isotope
1025                if (this.nbIsotopes ==  0) {
1026                    alert("Error : no molecule or isotopoloque was selected");
1027                    return;
1028                }
1029
1030
1031
1032                //sélection du nombre de courbes ou de graphs
1033
1034                var nbCourbes = "";
1035
1036                switch (this.selectNbCourbes.getValue()) {
1037                //sswitch (document.getElementById('selectNbCourbes').options[document.getElementById('selectNbCourbes').selectedIndex].value) {
1038                    case 'cm':
1039                        nbCourbes = "-separate_mol -same_graph ";
1040                        this.nbGraph = 1;
1041                        this.nbCourbe =  this.nbMolecules;
1042                        if (this.nbCourbe > 8) {
1043                            alert("Too much molecules selected to draw one curve for each molecule selected");
1044                            return;
1045                        }
1046                        break;
1047                    case 'ci':
1048                        nbCourbes = "-separate_iso -same_graph ";
1049                        this.nbGraph = 1;
1050                        this.nbCourbe =  this.nbIsotopes;
1051                        if (this.nbCourbe > 8) {
1052                            alert("Too much isotopologues selected to draw one curve for each isotopologues selected");
1053                            return;
1054                        }
1055                        break;
1056                    case 'gm':
1057                        nbCourbes = "-separate_mol ";
1058                        this.nbGraph = this.nbMolecules;
1059                        if (this.nbGraph > 20) {
1060                            alert("Too much molecules selected to draw one graph for each molecules selected");
1061                            return;
1062                        }
1063                        break;
1064                    case 'gi':
1065                        nbCourbes = "-separate_iso ";
1066                        this.nbGraph = this.nbIsotopes;
1067                        if (this.nbGraph > 20) {
1068                            alert("Too much isotopologues selected to draw one graph for each isotopologues selected");
1069                            return;
1070                        }
1071                        break;
1072                    default:
1073                        nbCourbes = "";
1074                        this.nbGraph = 1;
1075                        break;
1076                }
1077
1078
1079                //Spectral range
1080                var rangeLower="-wavenb_min "+$("#rangeLower").val();
1081                var rangeUpper="-wavenb_max "+$("#rangeUpper").val();
1082
1083                //controle des valeurs entrées par l'utilisateur
1084
1085                switch (this.selectDatabase.getValue()) {
1086                    case 'GEISA2003':
1087                        //isNaN = n'est pas un nombre
1088                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0  || parseInt($("#rangeLower").val()) > 35877.030506)
1089                        {
1090                            alert("Error: Invalid value for lower spectral range area");
1091                            return;
1092                        }
1093
1094                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  || parseInt($("#rangeUpper").val()) > 35877.030506)
1095                        {
1096                            alert("Error: Invalid value for upper spectral range area");
1097                            return;
1098                        }
1099                        break;
1100                    case 'GEISA2011':
1101                        //isNaN = n'est pas un nombre
1102                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0  || parseInt($("#rangeLower").val()) > 35877.030506)
1103                        {
1104                            alert("Error: Invalid value for lower spectral range area");
1105                            return;
1106                        }
1107
1108                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  || parseInt($("#rangeUpper").val()) > 35877.030506)
1109                        {
1110                            alert("Error: Invalid value for upper spectral range area");
1111                            return;
1112                        }
1113                        break;
1114                    case 'GEISAIASI2003':
1115                        //isNaN = n'est pas un nombre
1116                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0 || parseInt($("#rangeLower").val()) < 599.000793 || parseInt($("#rangeLower").val()) > 3000.998767)
1117                        {
1118                            alert("Error: Invalid value for lower spectral range area");
1119                            return;
1120                        }
1121
1122                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  ||  parseInt($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767)
1123                        {
1124                            alert("Error: Invalid value for upper spectral range area");
1125                            return;
1126                        }
1127                        break;
1128                    case 'GEISAIASI2011':
1129                        //isNaN = n'est pas un nombre
1130                        if(isNaN($("#rangeLower").val()) == true ||   parseInt($("#rangeLower").val()) < 0 || parseInt($("#rangeLower").val()) < 599.000793 || parseInt($("#rangeLower").val()) > 3000.998767)
1131                        {
1132                            alert("Error: Invalid value for lower spectral range area");
1133                            return;
1134                        }
1135
1136                        if(isNaN($("#rangeUpper").val()) == true ||   parseInt( $("#rangeUpper").val()) == 0 || parseInt( $("#rangeUpper").val()) < 0  ||  parseInt($("#rangeUpper").val()) < 599.000793 || parseInt($("#rangeUpper").val()) > 3000.998767)
1137                        {
1138                            alert("Error: Invalid value for upper spectral range area");
1139                            return;
1140                        }
1141                        break;
1142                }
1143
1144
1145                if ($("#rangeLower").val() == ""  )
1146                {
1147                    rangeLower="";
1148                }
1149
1150                if ($("#rangeUpper").val() == ""  )
1151                {
1152                    rangeUpper="";
1153                }
1154                if( parseInt($("#rangeLower").val())  > parseInt($("#rangeUpper").val()) )
1155                {
1156                    alert("Error: lower spectral range area is superior to upper spectral range area ");
1157                    return;
1158                }
1159
1160
1161                //Transitions  to do
1162                //exemple de requete avec transition
1163                //./all -filein line_GEISA2009_bin -moleisot h2o:161 -wavenb_min 1 -wavenb_max 1000 -database_name "GEISA2011" -vib_ident_lower '[000]'
1164                //var TransitionUpper ="-vib_ident_upper '[ "+this.selectTransitionUpper.getValue()+" ]'";
1165                var transitionUpper=document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value;
1166                //Enlever les espaces blancs
1167               // TransitionUp= TransitionUp.replace(/ /g,"");
1168               //var TransitionUpper ="-vib_ident_upper ["+TransitionUp+"]";
1169                // var transitionUpper = "["+transitionUp+"]";
1170               // alert ("transitionUpper"+transitionUpper);
1171
1172                // var TransitionLower ="-vib_ident_lower '[ "+this.selectTransitionLower.getValue()+" ]'";
1173                  var transitionLower=document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value;
1174                //  TransitionLo= TransitionLo.replace(/ /g,"");
1175                 // var TransitionLower ="-vib_ident_lower ["+TransitionLo+"]";
1176                //var transitionLower ="["+transitionLo+"]";
1177
1178                 //pas de transition sélectionnée
1179                // if (( this.selectTransitionUpper.getValue()== -1) ||  (this.selectTransitionUpper.getValue() == "transition" ))
1180                // {
1181                // TransitionUpper ="";
1182                // }
1183                // if (( this.selectTransitionLower.getValue()== -1) ||  (this.selectTransitionLower.getValue() == "transition" ))
1184                // {
1185                // TransitionLower ="";
1186                // }
1187                if (( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == -1) ||  (document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "transition" ))
1188                {
1189                    transitionUpper ="no";
1190                }
1191                if (( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == -1) ||  (document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "transition" ))
1192                {
1193                    transitionLower ="no";
1194                }
1195
1196                if ( document.getElementById('transition1').options[document.getElementById('transition1').selectedIndex].value == "")
1197                {
1198                    transitionUpper ="noValue";
1199                }
1200
1201                if ( document.getElementById('transition2').options[document.getElementById('transition2').selectedIndex].value == "")
1202                {
1203                    transitionLower ="noValue";
1204                }
1205
1206                 var sel = document.getElementById('transition1');
1207                 var idupper = sel.options[sel.selectedIndex].value;
1208                  //alert("idupper"+idupper);
1209
1210                //Intensity range
1211                var intensityLower="-int_min "+$("#intensityLo").val();
1212                var intensityUpper="-int_max "+$("#intensityUp").val();
1213
1214                //controle des valeurs entrées par l'utilisateur
1215                 if(isNaN($("#intensityLo").val()) == true ||   $("#intensityLo").val() < 0  )
1216                {
1217                    alert("Error: Invalid value for lower intensity range area");
1218                    return;
1219                }
1220                if ($("#intensityLo").val() == ""  )
1221                {
1222                    intensityLower="";
1223                }
1224                if(isNaN($("#intensityUp").val()) == true ||   $("#intensityUp").val() < 0  )
1225                {
1226                    alert("Error: Invalid value for upper intensity range area");
1227                    return;
1228                }
1229                if ($("#intensityUp").val() == ""  )
1230                {
1231                    intensityUpper="";
1232                }
1233
1234                //to do javascript ne sait comparer des exponenciels
1235              // if( $("#intensityLo").val()  > $("#intensityUp").val() )
1236
1237               // {
1238               //     alert("Error: lower intensity range area is superior to upper intensity range area ");
1239               //     return;
1240               // }
1241
1242
1243                //Valeur de mean value
1244                var meanValue = "-step "+$("#meanValue2").val();
1245                //controle des valeurs entrées par l'utilisateur
1246                //Si ce n'est pas un nombre ou si il est négatif
1247                if(isNaN($("#meanValue2").val()) == true ||   $("#meanValue2").val() < 0  )
1248                {
1249                    alert("Error: Invalid value for Average calculation area");
1250                    return;
1251                }
1252                //si aucune valeur
1253                if ($("#meanValue2").val() == ""  )
1254                {
1255                    meanValue="";
1256                }
1257
1258                //sélection du premier choix pour l'axe des Y
1259                 var field="-field "+this.selectTraceAxeY1.getValue();
1260                //   var field="-field "+document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value;
1261
1262
1263
1264
1265                 //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)
1266                if  (this.selectScaleY1.getValue() == '-log_scale' && this.selectScaleY1.isDisable == false)
1267                {
1268                    var logScale = this.selectScaleY1.getValue();
1269                }
1270                else
1271                {
1272                    var logScale = ""
1273                }
1274               // if  (document.getElementById('selectScaleY1').options[document.getElementById('selectScaleY1').selectedIndex].value == '-log_scale' && document.getElementById("selectScaleY1" ).disabled == false)
1275               // {
1276               //     var logScale = document.getElementById('selectScaleY1').options[document.getElementById('selectScaleY1').selectedIndex].value;
1277                //}
1278                //else
1279               // {
1280               //     var logScale = ""
1281               // }
1282
1283
1284                //sélection du type de tracé pour Y1
1285                var lineType="-line_type "+this.selectTypeTraceY1.getValue();
1286                //var lineType="-line_type "+document.getElementById('selectTypePlotY1').options[document.getElementById('selectTypePlotY1').selectedIndex].value;
1287
1288
1289                //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)
1290                if  (this.selectTraceAxeY2.getValue() == 'no' ||  this.selectTraceAxeY2.isDisable == true)
1291                //if  (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no' ||  document.getElementById("selectAxeY2" ).disabled == true)
1292                {
1293                    var field2 = "";
1294                }
1295                else
1296                {
1297                    var field2 = "-field2 "+this.selectTraceAxeY2.getValue();
1298                    //var field2 = "-field2 "+document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value;
1299                }
1300
1301                //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)
1302                if  (this.selectScaleY2.getValue() == '-log_scale2' && this.selectScaleY2.isDisable == false)
1303               //  if  (document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value == '-log_scale2' && document.getElementById("selectScaleY2" ).disabled == false)
1304                {
1305                    var logScale2 =this.selectScaleY2.getValue();
1306                    //  var logScale2 = document.getElementById('selectScaleY2').options[document.getElementById('selectScaleY2').selectedIndex].value;
1307                }
1308                else
1309                {
1310                    var logScale2 = "";
1311                }
1312
1313
1314                //sélection du type de tracé pour Y2  (pas de valeur  si l'option n'est pas activée)
1315                if  ( this.selectTypeTraceY2.isDisable == true)
1316               // if  ( document.getElementById("selectTypePlotY2" ).disabled == true)
1317                {
1318                    var lineType2 = "";
1319                }
1320                else
1321                {
1322                    var lineType2 = "-line_type2 "+this.selectTypeTraceY2.getValue();
1323                    // var lineType2 = "-line_type2 "+document.getElementById('selectTypePlotY2').options[document.getElementById('selectTypePlotY2').selectedIndex].value;
1324                }
1325
1326
1327                //ouverture de la div de l'image d'attente
1328                this.loadingGraphics.display();
1329
1330
1331
1332
1333                //construction de la requête Fortran
1334               // var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+TransitionUpper+" "+TransitionLower+" "+intensityLower+" "+intensityUpper+" "+
1335                                      // meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2;
1336
1337                var parameters = "&fortranRequest="+paramBase+" "+isotopesSelectedName+" "+rangeLower+" "+rangeUpper+" "+intensityLower+" "+intensityUpper+" "+
1338                                       meanValue+" "+nbCourbes+" "+field+" "+logScale+" "+lineType+" "+field2+" "+logScale2+" "+lineType2;
1339
1340                 alert ("parameters"+parameters);
1341
1342                //remplacement de espace par "EEE" pour que le shell script ne voit qu'un seul argument en entrée
1343                parameters=parameters.replace(/ /g,"EEE");
1344                transitionUpper=transitionUpper.replace(/ /g,"EEE");
1345                //le + est interprété comme un espace (plus sera retransformé en + dans le shell)
1346                transitionUpper=transitionUpper.replace(/\+/g,"plus");
1347                transitionLower=transitionLower.replace(/ /g,"EEE");
1348                transitionLower=transitionLower.replace(/\+/g,"plus");
1349
1350
1351                //envoie de la requête au controller
1352                //en cas de succes appel de la fonction "handleGeisa"
1353                $.ajax( {
1354                            //url: "project?methodName=createUserRequest&"+parameters+"&nbGraph="+ this.nbGraph,
1355                            url: "project?methodName=createUserRequest&"+parameters+"&transitionUpper="+ transitionUpper+"&transitionLower="+ transitionLower+"&nbGraph="+ this.nbGraph,
1356                            success:jQuery.proxy( this.handleGeisa, this )
1357                        } );
1358            },
1359
1360
1361            //requête pour interrogation de la base de données des transitions
1362            requestTransition: function()
1363            {
1364
1365                var  nbMolecules=0;
1366
1367                //Récupération du spectral range
1368                var spectralRangeLower = $("#rangeLower").val();
1369                var spectralRangeUpper = $("#rangeUpper").val();
1370
1371                //Récupération des isotopes sélectionnés
1372                var inputs = document.getElementsByTagName( 'input' );
1373                var count = inputs.length;
1374                var isotopesSelectedNameArray = new Array();
1375                var i=0;
1376
1377                for( i = 0; i < count; i++ )
1378                {
1379                    var input = inputs.item( i );
1380                    //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")
1381                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1382                    {
1383                        var molN=input.value;
1384                        var molN1=molN.replace("_", ":");
1385                        //tous les isotopes sélectionnés sont placés dans un tableau
1386                        isotopesSelectedNameArray.push(molN1);
1387                    }
1388
1389                    //récupération du nombre de molécules sélectionnées
1390                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("all-")!= -1 && input.id.indexOf(this.selectDatabase.getValue())!= -1)
1391                    {
1392                       nbMolecules =  nbMolecules + 1;
1393                    }
1394
1395                }
1396                //alert ("nbMolecules"+nbMolecules);
1397                //si le nombre de molécule sélectionnées est supérieure Ã  1 les menus des transition sont inactifs
1398                if (nbMolecules > 1)
1399                {
1400
1401                    //this.selectTransitionLower.disable();
1402                    //this.selectTransitionUpper.disable();
1403                    //ajoute une classe à celle déjà existante de transitionUpperTitle
1404                    $("#transitionUpperTitle").addClass("notActiveText");
1405                    $("#transitionLowerTitle").addClass("notActiveText");
1406                }
1407                else
1408                {
1409                    //this.selectTransitionLower.enable();
1410                    //this.selectTransitionUpper.enable();
1411                    $("#transitionUpperTitle").removeClass("notActiveText");
1412                    $("#transitionLowerTitle").removeClass("notActiveText");
1413                }
1414
1415
1416                //On ne fait appel à la BDD des transitions    et si au plus 1 molécule est sélectionnée
1417                if (nbMolecules == 1 )
1418                {
1419//                    $.ajax( {
1420//                                url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedName="+isotopesSelectedName+"&GeisaSelectedDatabase="+GeisaSelectedDatabase+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper,
1421//                                success:jQuery.proxy( this.handleRequestTransition, this )
1422//                            } );
1423
1424                    $.ajax( {
1425                                url: "project?methodName=getTransitionByIsotopeName&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+this.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper,
1426                                success:jQuery.proxy( this.handleRequestTransition, this )
1427                            } );
1428
1429                }
1430                else
1431                {
1432                    //pour réinitialiser le menu déroulant si aucune ou plusieurs molécules sont sélectionnées
1433                    document.getElementById("transition2").length=0;
1434                    //this.selectTransitionUpper.clear();
1435                    document.getElementById("transition1").length=0;
1436
1437                    if (nbMolecules == 0 )
1438                    {
1439                        //this.selectTransitionLower.add('-1', "Select a molecule");
1440                        this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
1441                        //this.selectTransitionUpper.add('-1', "Select a molecule");
1442                        this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"Select a molecule", selected:"selected"} ));
1443                        //pour forcer à afficher le premier élément (et non le premier élément précédent)
1444                        //this.selectTransitionLower.selectFirst();
1445                        //this.selectTransitionUpper.selectFirst();
1446                    }
1447
1448                    if (nbMolecules > 1 )
1449                    {
1450                        //this.selectTransitionLower.add('-1', "Select a molecule");
1451                        this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} ));
1452                        //this.selectTransitionUpper.add('-1', "Select a molecule");
1453                        this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"-1", text:"", selected:"selected", disabled:"disabled"} ));
1454                        //pour forcer à afficher le premier élément (et non le premier élément précédent)
1455                        //this.selectTransitionLower.selectFirst();
1456                        //this.selectTransitionUpper.selectFirst();
1457                    }
1458                }
1459            },
1460
1461
1462
1463
1464            //requête pour interrogation de la base de données des transitions en fonction d'une transition lower
1465            requestTransitionByTransitionLower: function()
1466            {
1467                var context  = this[0];
1468                //exemple transitionLower="                      000" : il y a 25 caractÚres dans chaque transition
1469                 context.transitionLower = this[1];
1470
1471                //Récupération de la Base Geisa sélectionnée
1472                var GeisaSelectedDatabase = context.selectDatabase.getValue();
1473
1474                //Récupération du spectral range
1475                var spectralRangeLower = $("#rangeLower").val();
1476                var spectralRangeUpper = $("#rangeUpper").val();
1477
1478                //Récupération des isotopes sélectionnés
1479                var inputs = document.getElementsByTagName( 'input' );
1480                var count = inputs.length;
1481                var isotopesSelectedNameArray = new Array();
1482                var i=0;
1483
1484                for( i = 0; i < count; i++ )
1485                {
1486                    var input = inputs.item( i );
1487                    //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")
1488                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1)
1489                    {
1490                        var molN=input.value;
1491                        var molN1=molN.replace("_", ":");
1492                        //tous les isotopes sélectionnés sont placés dans un tableau
1493                        isotopesSelectedNameArray.push(molN1);
1494                    }
1495
1496                }
1497
1498                 //le passage de javascript Ã  java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse
1499                 var transitionLowerReplaced = context.transitionLower.replace(/\+/g,"plus");
1500
1501                //Appel Ã  la BDD
1502
1503                $.ajax( {
1504                            url: "project?methodName=getTransitionByIsotopeNameByTransitionLower&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionLower="+transitionLowerReplaced,
1505                            success:jQuery.proxy( context.handleRequestTransitionByTransitionLower, context)
1506                        } );
1507
1508
1509
1510            },
1511
1512
1513            //requête pour interrogation de la base de données des transitions en fonction d'une transition upper
1514            requestTransitionByTransitionUpper: function()
1515            {
1516                var context  = this[0];
1517                //exemple transitionLower="                      000" : il y a 25 caractÚres dans chaque transition
1518                 context.transitionUpper = this[1];
1519
1520                //Récupération de la Base Geisa sélectionnée
1521                var GeisaSelectedDatabase = context.selectDatabase.getValue();
1522
1523                //Récupération du spectral range
1524                var spectralRangeLower = $("#rangeLower").val();
1525                var spectralRangeUpper = $("#rangeUpper").val();
1526
1527                //Récupération des isotopes sélectionnés
1528                var inputs = document.getElementsByTagName( 'input' );
1529                var count = inputs.length;
1530                var isotopesSelectedNameArray = new Array();
1531                var i=0;
1532
1533                for( i = 0; i < count; i++ )
1534                {
1535                    var input = inputs.item( i );
1536                    //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")
1537                    if( input.type == 'checkbox' && input.checked == true && input.id.indexOf("chk-")!= -1 && input.id.indexOf(context.selectDatabase.getValue())!= -1)
1538                    {
1539                        var molN=input.value;
1540                        var molN1=molN.replace("_", ":");
1541                        //tous les isotopes sélectionnés sont placés dans un tableau
1542                        isotopesSelectedNameArray.push(molN1);
1543                    }
1544
1545                }
1546                //le passage de javascript Ã  java par ajax transforme les + en espace donc transformation des + en plus et dans le controller on fait l'inverse
1547                var transitionUpperReplaced = context.transitionUpper.replace(/\+/g,"plus");
1548
1549                //Appel Ã  la BDD
1550                $.ajax( {
1551                            url: "project?methodName=getTransitionByIsotopeNameByTransitionUpper&isotopesSelectedNameArray="+isotopesSelectedNameArray+"&geisaSelectedDatabase="+context.selectDatabase.getValue2()+"&spectralRangeLower="+spectralRangeLower+"&spectralRangeUpper="+spectralRangeUpper+"&transitionUpper="+transitionUpperReplaced,
1552                            success:jQuery.proxy( context.handleRequestTransitionByTransitionUpper, context)
1553                        } );
1554
1555
1556
1557            },
1558
1559
1560
1561//            requestTransition: function()
1562//            {
1563//                $.ajax( {
1564//                            url: "project?methodName=transition&transitionValue="+ this.selectTransitionUpper.getValue(),
1565//                            success:jQuery.proxy( this.handleRequestTransition, this )
1566//                        } );
1567//            },
1568
1569            // HANDLES ******************************************************** = retours ajax
1570            //affichage sur l'interface
1571
1572            handleGeisa: function( result )
1573            {
1574
1575
1576                //chemin de l'image
1577//                this.pathImg = jQuery.parseJSON( result ).pathImg;
1578                this.pathImg = "<%=Controller.PATH_IMAGES%>";
1579                //numéro unique pour le nom du graph
1580                this.nb = jQuery.parseJSON( result ).nb;
1581                //Pour tracer le bon nombre de graphe et de bouton download
1582                var i=1;
1583                var content = '';
1584                for (i=1; i<this.nbGraph+1; i++) {
1585                    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>';
1586                }
1587
1588                this.displayWindow(content);
1589            },
1590
1591
1592//            handleRequestTransition: function( result )
1593//            {
1594//                alert("youpi");
1595//            },
1596
1597
1598            handleRequestTransition: function( result )
1599            {
1600
1601
1602//                var transitions = jQuery.parseJSON( result ).transitions;
1603                 var transitionsLower = jQuery.parseJSON( result ).transitionsLower;
1604                 var transitionsUpper = jQuery.parseJSON( result ).transitionsUpper;
1605
1606                 //pour vider les menus déroulant des transitions précédentes
1607                 // this.selectTransitionLower.clear();
1608                document.getElementById("transition2").length=0;
1609                //this.selectTransitionUpper.clear();
1610                document.getElementById("transition1").length=0;
1611                // this.selectTransitionLower.add('transition', "Choose a transition");
1612                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1613
1614                // this.selectTransitionUpper.add('transition', "Choose a transition");
1615                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1616
1617                 //pour forcer à afficher le premier élément (et non le premier élément précédent)
1618                // this.selectTransitionLower.selectFirst();
1619                // this.selectTransitionUpper.selectFirst();
1620
1621                // alert ("transitionsUpper"+transitionsUpper);
1622                $.each(transitionsLower, jQuery.proxy( function(index, transitionsLower )
1623                {
1624                   //  this.selectTransitionLower.add(transitionsLower, transitionsLower,jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ]));
1625
1626
1627                    this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLower, text:transitionsLower} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionLower, [this, transitionsLower ])));
1628
1629                }, this));
1630
1631                $.each(transitionsUpper, jQuery.proxy( function(index, transitionsUpper )
1632                {
1633                    //this.selectTransitionUpper.add(transitionsUpper, transitionsUpper,jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ]));
1634                    this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpper, text:transitionsUpper} ).bind( 'click', jQuery.proxy(this.requestTransitionByTransitionUpper, [this, transitionsUpper ])));
1635
1636                }, this));
1637
1638            },
1639
1640            handleRequestTransitionByTransitionLower : function( result )
1641            {
1642                //alert("transitionLower"+this.transitionLower);
1643                var transitionsUpperBis = jQuery.parseJSON( result ).transitionsUpperBis;
1644                //alert("transitionsUpper"+transitionsUpper);
1645
1646                //pour vider les menus déroulant des transitions précédentes
1647               // this.selectTransitionLower.clear();
1648                document.getElementById("transition2").length=0;
1649                //this.selectTransitionUpper.clear();
1650                document.getElementById("transition1").length=0;
1651               // while(0 < document.getElementById("transition1").length)
1652               // {
1653               //     document.getElementById("transition1").options[0] = null;
1654               // }
1655
1656
1657                //this.selectTransitionLower.add(this.transitionLower, this.transitionLower);
1658                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} ));
1659                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:this.transitionLower, text:this.transitionLower,  selected:"selected"} ));
1660                //this.selectTransitionUpper.add('transition', "Choose a transition");
1661                //rajout du text "Choose a transition" selectionné en premier mais on ne peut pa cliquer dessus
1662                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1663
1664
1665                //pour forcer Ã  afficher le premier Ã©lément (et non le premier Ã©lément précédent)
1666                //this.selectTransitionLower.selectFirst();
1667                //this.selectTransitionUpper.selectFirst();
1668
1669
1670
1671                $.each(transitionsUpperBis, jQuery.proxy( function(index, transitionsUpperBis )
1672                {
1673                   // this.selectTransitionUpper.add(transitionsUpper, transitionsUpper);
1674                     this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:transitionsUpperBis, text:transitionsUpperBis} ));
1675
1676                }, this));
1677
1678            },
1679
1680
1681            handleRequestTransitionByTransitionUpper : function( result )
1682            {
1683               // alert("transitionUpper"+this.transitionUpper);
1684                var transitionsLowerBis = jQuery.parseJSON( result ).transitionsLowerBis;
1685                //alert("transitionsLower"+transitionsLower);
1686
1687                //pour vider les menus déroulant des transitions précédentes
1688               // this.selectTransitionLower.clear();
1689                document.getElementById("transition2").length=0;
1690                //this.selectTransitionUpper.clear();
1691                document.getElementById("transition1").length=0;
1692
1693               // this.selectTransitionLower.add('transition', "Choose a transition");
1694                this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled", selected:"selected"} ));
1695
1696               // this.selectTransitionUpper.add(this.transitionUpper, this.transitionUpper);
1697                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:"transition", text:"Choose a transition", disabled:"disabled"} ));
1698                this.selectTransitionUpper.append($( document.createElement( "option" ) ).attr( {value:this.transitionUpper, text:this.transitionUpper,  selected:"selected"} ));
1699
1700
1701                //pour forcer Ã  afficher le premier Ã©lément (et non le premier Ã©lément précédent)
1702                //this.selectTransitionLower.selectFirst();
1703                //this.selectTransitionUpper.selectFirst();
1704
1705
1706
1707                $.each(transitionsLowerBis, jQuery.proxy( function(index, transitionsLowerBis )
1708                {
1709                    //this.selectTransitionLower.add(transitionsLower, transitionsLower);
1710                    this.selectTransitionLower.append($( document.createElement( "option" ) ).attr( {value:transitionsLowerBis, text:transitionsLowerBis} ));
1711                }, this));
1712
1713            },
1714            // EVENTS ********************************************************
1715            //
1716
1717
1718
1719
1720            //affichage de la valeur du spectral range et affichage du bloc des molecules en fonction de la base de donnees selectionnee
1721            onClickSelectDatabase: function(value)
1722            {
1723
1724                if  ('GEISA2011' == value)
1725                {
1726                    document.getElementById('spectralRangeTitre').innerHTML = "";
1727                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
1728                    $("#rangeLower").val(0);
1729                    $("#rangeUpper").val(35877.030506);
1730
1731                    document.getElementById( "BDD-GEISA2011" ).style.display = "";
1732                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1733                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1734                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1735                }
1736
1737                if  ('GEISAIASI2011' == value)
1738                {
1739                    document.getElementById('spectralRangeTitre').innerHTML = "";
1740                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :";
1741                    $("#rangeLower").val(599.000793);
1742                    $("#rangeUpper").val(3000.998767);
1743
1744                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1745                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "";
1746                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1747                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1748                }
1749
1750                if  ('GEISA2003' == value)
1751                {
1752                    document.getElementById('spectralRangeTitre').innerHTML = "";
1753                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing the spectral range from 0 to 35877.030506 cm<sup>-1</sup> :";
1754                    $("#rangeLower").val(0);
1755                    $("#rangeUpper").val(35877.030506);
1756
1757                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1758                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1759                    document.getElementById( "BDD-GEISA2003" ).style.display = "";
1760                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "none";
1761                }
1762                if  ('GEISAIASI2003' == value)
1763                {
1764                    document.getElementById('spectralRangeTitre').innerHTML = "";
1765                    document.getElementById('spectralRangeTitre').innerHTML = "Choosing spectral range (599.000793 to 3000.998767 cm<sup>-1</sup>) :";
1766                    $("#rangeLower").val(599.000793);
1767                    $("#rangeUpper").val(3000.998767);
1768
1769                    document.getElementById( "BDD-GEISA2011" ).style.display = "none";
1770                    document.getElementById( "BDD-GEISAIASI2011" ).style.display = "none";
1771                    document.getElementById( "BDD-GEISA2003" ).style.display = "none";
1772                    document.getElementById( "BDD-GEISAIASI2003" ).style.display = "";
1773                }
1774
1775                //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
1776                this.requestTransition();
1777            },
1778
1779
1780
1781            //Actions déclenchées quand on clique sur le nom d'une molécule
1782            cliquetout: function()
1783            {
1784                var context = this[0];
1785                // exemple :moleculeName = ch3ch
1786                var moleculeName = this[1];
1787                var bddVersion = this[2];
1788                var inputs = document.getElementsByTagName( 'input' );
1789                var count = inputs.length;
1790                for( i = 0; i < count; i++ )
1791                {
1792                    var  input = inputs.item( i );
1793                    //cliquer toutes les molécules et isotopes du meme nom dans toutes les bases
1794                    //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')
1795                    // || 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')))
1796
1797                    if( input.type == 'checkbox' && ( input.id.indexOf('chk-' + moleculeName + '_') != -1 || input.id.indexOf('all-'+moleculeName+'-')!= -1 ))
1798
1799                    {
1800                        input.checked = document.getElementById( 'all-'+ moleculeName + '-' + bddVersion ).checked;
1801                    }
1802                }
1803                //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
1804                context.requestTransition();
1805            },
1806
1807            //actions déclenchées quand on clique sur un isotope
1808            cliqueIsotope: function()
1809            {
1810                var context = this[0];
1811                //exemple isotopeName = ch3cn_134
1812                var isotopeName = this[1];
1813                // exemple  moleculeName= ch3cn
1814                var moleculeName = this[2];
1815                var bddVersion = this[3];
1816                var inputs = document.getElementsByTagName( 'input' );
1817                var count = inputs.length;
1818                var i = 0;
1819                for( i = 0; i < count; i++ )
1820                {
1821                    input = inputs.item( i );
1822
1823                    //id=chk-ch3cn_234-GEISA2011
1824                    //cliquer ou decliquer le meme isotope dans toutes les bases
1825                    if( input.type == 'checkbox' &&  input.id.indexOf('chk-' + isotopeName) != -1)
1826                    {
1827                        input.checked = document.getElementById( 'chk-' + isotopeName + '-' + bddVersion ).checked;
1828
1829                    }
1830                     // id=all-ch3cn-GEISA2011
1831                    //pour décocher la case de la molecule quand on décoche un isotope
1832                   // if( input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName) != -1 && input.checked == true )
1833                    // {
1834                    //     input.checked = false;
1835                    // }
1836                }
1837
1838
1839                //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
1840                var nbIsotopeSelected=0;
1841
1842                for( i = 0; i < count; i++ )
1843                {
1844                    input = inputs.item( i );
1845                    if( input.type == 'checkbox' &&  input.id.indexOf('chk-'+moleculeName+'_') != -1  && input.id.indexOf(bddVersion) != -1 && input.checked == true )
1846                    {
1847                     nbIsotopeSelected=nbIsotopeSelected+1;
1848                    }
1849
1850                }
1851
1852
1853                for( i = 0; i < count; i++ )
1854                {
1855                    input = inputs.item( i );
1856                    if (input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName+'-') != -1 && nbIsotopeSelected == 0)
1857                    {
1858                        input.checked = false;
1859                    }
1860
1861                     if (input.type == 'checkbox' && input.id.indexOf('all-'+ moleculeName+'-') != -1 && nbIsotopeSelected > 0)
1862                    {
1863                        input.checked = true;
1864                    }
1865
1866                }
1867
1868                // alert("database"+context.selectDatabase.getSize());
1869
1870                //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
1871                context.requestTransition();
1872
1873            },
1874
1875
1876
1877            //pour cacher ou voir les isotopes d'une molecule
1878            visibilite: function(  )
1879            {
1880                var context = this[0];
1881                var thingId = this[1];
1882                var divs = document.getElementsByTagName( 'div' );
1883                var count = divs.length;
1884                var i = 0;
1885                for( i = 0; i < count; i++ )
1886                {
1887                    var div = divs.item( i );
1888
1889
1890                    if  (  div.id ==   thingId)
1891                    {
1892                        if( div.style.display == "none" )
1893                        {
1894                            div.style.display = "";
1895                        }
1896                        else
1897                        {
1898                            div.style.display = "none";
1899                        }
1900                    }
1901                }
1902            },
1903
1904             //Faire apparatre ou disparaitre le bloc "advanced options" quand on clique sur le lien "show advanced options"
1905             onClickShowAdvancedOptions: function()
1906            {
1907                //document.getElementById( "advancedOptions" ).style.display = "none";
1908                  if( document.getElementById( "advancedOptions" ).style.display == "none" )
1909                        {
1910                            document.getElementById( "advancedOptions" ).style.display = "";
1911                            document.getElementById( "aShowHide" ).innerHTML = "";
1912                            document.getElementById( "aShowHide" ).innerHTML = "Hide advanced options";
1913                        }
1914                        else
1915                        {
1916                            document.getElementById( "advancedOptions" ).style.display = "none";
1917                            document.getElementById( "aShowHide" ).innerHTML = "";
1918                            document.getElementById( "aShowHide" ).innerHTML = "Show advanced options";
1919                        }
1920            },
1921
1922
1923
1924            onBlurInputMeanValue: function()
1925            {
1926                //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
1927                // !this.selectTraceAxeY1.content('Z') indique que "Z" n'exite pas dans le menu déroulant  selectTraceAxeY1
1928                if  ($("#meanValue2").val() > 0 && !this.selectTraceAxeY1.content('Z'))
1929               //  if  ($("#meanValue2").val() > 0 && document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != "Z")
1930                {
1931
1932                    this.selectTraceAxeY1.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
1933                    this.selectTraceAxeY2.add( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
1934                    //this.selectTraceAxeY1.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY1, [this, "Z" ])));
1935                    //this.selectTraceAxeY2.append($( document.createElement( "option" ) ).attr( {value:"Z", text:"Number of lines"} ).bind( 'click', jQuery.proxy(this.onClickSelectTraceAxeY2, [this, "Z" ])));
1936                }
1937                //si step = a 0     et autres valeurs (a faire) , retrait de la ligne Z aux parametres Y1 et y2
1938                if  ($("#meanValue2").val() == 0)
1939                {
1940                    this.selectTraceAxeY1.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY1, this ) );
1941                    this.selectTraceAxeY2.remove( 'Z', "Number of lines ", jQuery.proxy(this.onClickSelectTraceAxeY2, this ) );
1942                    //Selection par defaut du 1er element (pour que  "Number of lines"  ne soit plus selectionne par defaut si il n'existe plus)
1943                    this.selectTraceAxeY1.selectFirst();
1944                    this.selectTraceAxeY2.selectFirst();
1945                                     }
1946            },
1947
1948            onClickSelectNbCourbes: function(value)
1949            {
1950              var context  = this[0];
1951              var optionVal = this[1];
1952
1953               //si plusieurs courbes choisis pour les isotopes et ou molecules, les choix pour Y2 sont inactifs
1954                if  ('cm' == value || 'ci' == value)
1955                //if  ('cm' == optionVal || 'ci' == optionVal)
1956                {
1957                    //transformer le texte en gris
1958                    document.getElementById("axeY2Titre").className = "notActiveText";
1959                    document.getElementById("scaleY2Titre").className = "notActiveText";
1960                    document.getElementById("typePlotY2Titre").className = "notActiveText";
1961                    //pour rendre le menu déroulant inactif
1962                    this.selectTraceAxeY2.disable();
1963                    this.selectScaleY2.disable();
1964                    this.selectTypeTraceY2.disable();
1965                    //document.getElementById("selectAxeY2" ).disabled=true;
1966                    //document.getElementById("selectScaleY2" ).disabled=true;
1967                    //document.getElementById("selectTypePlotY2" ).disabled=true;
1968
1969                }
1970                //si une seule courbe choisie pour les isotopes et ou molecules, les choix pour Y2 sont actifs
1971                if  ('ca' == value || 'gm' == value || 'gi' == value)
1972                //if  ('ca' == optionVal || 'gm' == optionVal || 'gi' == optionVal)
1973                {
1974                    //remet le texte en couleur active
1975                    document.getElementById("axeY2Titre").className = "activeText";
1976                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
1977                    if (this.selectTraceAxeY2.getValue() == 'B')
1978                    {
1979                        document.getElementById("scaleY2Titre").className = "activeText";
1980                    }
1981                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
1982                    if (this.selectTraceAxeY2.getValue() != 'no')
1983                    {
1984                        document.getElementById("typePlotY2Titre").className = "activeText";
1985                    }
1986                    //pour rendre les menu déroulant actifs
1987                    this.selectTraceAxeY2.enable();
1988                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
1989                    if (this.selectTraceAxeY2.getValue() == 'B')
1990                    {
1991                        this.selectScaleY2.enable();
1992                    }
1993                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
1994                    if (this.selectTraceAxeY2.getValue() != 'no')
1995                    {
1996                        this.selectTypeTraceY2.enable();
1997                    }
1998
1999                    //remet le texte en couleur active
2000                   // document.getElementById("axeY2Titre").className = "activeText";
2001                    //pour rendre les menu déroulant actifs
2002                   // document.getElementById("selectAxeY2" ).disabled=false;
2003                    //rendre actif l'echelle que si l'intensite est choisie dans les parametres
2004                   // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B')
2005                   // {
2006                   //     document.getElementById("scaleY2Titre").className = "activeText";
2007                    //    document.getElementById("selectScaleY2" ).disabled=false;
2008                    //}
2009                    //rendre actif le type de plot si ce n'est pas la valeur none qui est choisie
2010                   // if (document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no')
2011                    //{
2012                    //    document.getElementById("typePlotY2Titre").className = "activeText";
2013                    //    document.getElementById("selectTypePlotY2" ).disabled=false;
2014                    //}
2015                }
2016
2017
2018            },
2019
2020
2021            onClickSelectTraceAxeY1: function(value)
2022            {
2023                //si intensite n'est pas choisi pour Y1, le type d'échelle est inactif
2024                if  (this.selectTraceAxeY1.getValue() != 'B')
2025               // if  ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value != 'B')
2026                {
2027                    //transformer le texte en gris
2028                    document.getElementById("scaleY1Titre").className = "notActiveText";
2029                    //pour rendre le menu déroulant inactif
2030                    this.selectScaleY1.disable();
2031                   //  document.getElementById("selectScaleY1" ).disabled=true;
2032                }
2033                //si intensite est  choisi pour Y1, le type d'échelle est actif
2034                if  (this.selectTraceAxeY1.getValue() == 'B')
2035                //if  ( document.getElementById('selectAxeY1').options[document.getElementById('selectAxeY1').selectedIndex].value == 'B')
2036                {
2037                    //transformer le texte en gris
2038                    document.getElementById("scaleY1Titre").className = "activeText";
2039                    //pour rendre le menu déroulant inactif
2040                    this.selectScaleY1.enable();
2041                   // document.getElementById("selectScaleY1" ).disabled=false;
2042                }
2043            },
2044
2045            onClickSelectTraceAxeY2: function(value)
2046            {
2047                //si intensite n'est pas choisi pour Y2, le type d'échelle est inactif
2048                if  (this.selectTraceAxeY2.getValue() != 'B')
2049                 //if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'B')
2050                {
2051                    //transformer le texte en gris
2052                    document.getElementById("scaleY2Titre").className = "notActiveText";
2053                    //pour rendre le menu déroulant inactif
2054                    this.selectScaleY2.disable();
2055                    //document.getElementById("selectScaleY2" ).disabled=true;
2056                }
2057                //si intensite est  choisi pour Y2, le type d'échelle est actif
2058                if  (this.selectTraceAxeY2.getValue() == 'B')
2059               //if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'B')
2060                {
2061                    //transformer le texte en foncé
2062                    document.getElementById("scaleY2Titre").className = "activeText";
2063                    //pour rendre le menu déroulant actif
2064                    this.selectScaleY2.enable();
2065                    //document.getElementById("selectScaleY2" ).disabled=false;
2066                }
2067                //si aucun parametre est  choisi pour Y2, le type de plot est inactif
2068                if  (this.selectTraceAxeY2.getValue() == 'no')
2069                //if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value == 'no')
2070                {
2071                    //transformer le texte en gris
2072                    document.getElementById("typePlotY2Titre").className = "notActiveText";
2073                    //pour rendre le menu déroulant inactif
2074                   this.selectTypeTraceY2.disable();
2075                    // document.getElementById("selectTypePlotY2" ).disabled=true;
2076                }
2077                //si un parametre est  choisi pour Y2, le type de plot est actif
2078               if  (this.selectTraceAxeY2.getValue() != 'no')
2079                // if  ( document.getElementById('selectAxeY2').options[document.getElementById('selectAxeY2').selectedIndex].value != 'no')
2080                {
2081                    //transformer le texte en foncé
2082                    document.getElementById("typePlotY2Titre").className = "activeText";
2083                    //pour rendre le menu déroulant actif
2084                    this.selectTypeTraceY2.enable();
2085                   //document.getElementById("selectTypePlotY2" ).disabled=false;
2086                }
2087
2088            },
2089
2090            onClickSubmit: function()
2091            {
2092                this.requestGeisa();
2093            },
2094
2095            displayWindow: function(content)
2096            {
2097                //fermeture de la div de l'image d'attente
2098                this.loadingGraphics.hide();
2099
2100                // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>';
2101
2102                //alert(content);
2103                var $dialog = $( '<div></div>' )
2104
2105                        .html( content )
2106
2107                        .dialog( {
2108                            autoOpen: false,
2109                            title: "GEISA : spectroscopic database",
2110                            //buttons: { "Close": function() { $(this).dialog("close"); }, "Min": function() { $(this).dialog({ height: 20, width:350  }); },"Max": function() { $(this).dialog({ height: 560, width:700  }); }  },
2111                            buttons:{
2112                                "close":{
2113                                    id:'close',
2114                                    text:'Close',
2115                                    height:'30px',
2116                                    width:'45px',
2117                                    title :'to close the window',
2118                                    click: function() { $(this).dialog("close"); },
2119                                },
2120                                "min" :{
2121                                    id:'Min',
2122                                    text:'Min',
2123                                    height:'30px',
2124                                    width:'45px',
2125                                    title :'to reduce the window',
2126                                    click: function() { $(this).dialog({ height: 18, width:350  }); },
2127                                },
2128                                "max" :{
2129                                    id:'Max',
2130                                    text:'Max',
2131                                    height:'30px',
2132                                    width:'45px',
2133                                    title :'to enlarge the window ',
2134                                    click: function() { $(this).dialog({ height: 628, width:700  }); },
2135                                },
2136                            },
2137
2138                            //minHeight: 500,
2139                            // minWidth: 660,
2140                            height: 628,
2141                            width:700,
2142                            //Exemple de  valeurs possible pour position : "middle", "top",  [200, 100]
2143                            position: "middle"
2144                        } );
2145                $dialog.dialog( 'open' );
2146            },
2147
2148            // displayWindow: function(coordinate)
2149            //{
2150            //var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName=bib.txt"><button class="dataProtocolDownloadButton">Download</button></a>';
2151            // var content = '<img src=' + this.pathImg + ' /><a href="project?methodName=downloadFile&fileName='  + this.nameImg + '"><button class="dataProtocolDownloadButton">Download</button></a>';
2152
2153            //alert(content);
2154            // var $dialog = $( '<div></div>' )
2155            // .html( content + content1 )
2156
2157            // .dialog( {
2158            //    autoOpen: false,
2159            //    title: "GEISA : spectroscopic database",
2160            //    minHeight: 500,
2161            //    minWidth: 660,
2162
2163            //coordonnee y y
2164            //   position:coordinate
2165
2166            // } );
2167            // $dialog.dialog( 'open' )
2168            //},
2169
2170
2171            onClickDownload: function()
2172            {
2173                document.location.href = "project?methodName=downloadFile&fileName=bib.txt";
2174            }
2175
2176
2177        } );
2178
2179
2180</script>
2181
2182
2183
Note: See TracBrowser for help on using the repository browser.