accueil: correction d'un lien (pour Gustavo)
[aidenligne_francais_universite.git] / js / outilsJS.js
1 <!--
2 window.onload=function(){
3 montre();
4 montre_verticale();
5 }
6 function montre(id) {
7 var d = document.getElementById(id);
8 for (var i = 1; i<=10; i++) {
9 if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
10 }
11 if (d) {
12 d.style.display='block';
13 d.style.visibility ='visible';
14 }
15 }
16 //-->
17 function montre_verticale(id) {
18 var d = document.getElementById(id);
19 for (var i = 1; i<=10; i++) {
20 if (document.getElementById('hmenu'+i)) {
21 document.getElementById('hmenu'+i).style.visibility ='hidden';
22 }
23 }
24
25 if (d) {
26 d.style.visibility ='visible';
27 }
28 }
29 function opacity(id, opacStart, opacEnd, millisec) {
30 //speed for each frame
31 var speed = Math.round(millisec / 100);
32 var timer = 0;
33
34 //determine the direction for the blending, if start and end are the same nothing happens
35 if(opacStart > opacEnd) {
36 for(i = opacStart; i >= opacEnd; i--) {
37 setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
38 timer++;
39 }
40 } else if(opacStart < opacEnd) {
41 for(i = opacStart; i <= opacEnd; i++)
42 {
43 setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
44 timer++;
45 }
46 }
47 }
48 //change the opacity for different browsers
49 function changeOpac(opacity, id) {
50 var object = document.getElementById(id).style;
51 object.opacity = (opacity / 100);
52 object.MozOpacity = (opacity / 100);
53 object.KhtmlOpacity = (opacity / 100);
54 object.filter = "alpha(opacity=" + opacity + ")";
55 }
56 function currentOpac(id, opacEnd, millisec) {
57 //standard opacity is 100
58 var currentOpac = 100;
59
60 //if the element has an opacity set, get it
61 if(document.getElementById(id).style.opacity < 100) {
62 currentOpac = document.getElementById(id).style.opacity * 100;
63 }
64
65 //call for the function that changes the opacity
66 opacity(id, currentOpac, opacEnd, millisec)
67 }
68 //-->