accueil: correction d'un lien (pour Gustavo)
[aidenligne_francais_universite.git] / js / fonctionsJS.js
1 /*
2 FONCTIONS JS POUR LE SITE
3 */
4
5 /*------------------------------------------------------------
6 Document Text Sizer- Copyright 2003 - Taewook Kang. All rights reserved.
7 Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
8 Web Site: http://txkang.com
9 Script featured on Dynamic Drive (http://www.dynamicdrive.com)
10
11 Please retain this copyright notice in the script.
12 License is granted to user to reuse this code on
13 their own website if, and only if,
14 this entire copyright notice is included.
15
16 Modifi� le 15 juin 2006, ajout de lineHeight , Adoflo de Paz
17 --------------------------------------------------------------*/
18
19 //Specify affected tags. Add or remove from list:
20 var tags = new Array('h3','h2','h1','p','ul','li');
21
22 //Specify spectrum of different font sizes:
23 var sizes = new Array( 'xx-small','x-small','small','medium','large','x-large');
24 var txtLineHeight = new Array('12px','16px','18px','20px','24px','28px');
25
26 var tailleDebut = 2;
27
28 function zoom( element,indice) {
29 if (!document.getElementById( element )) return
30 var doc = document,cEl = null,size = tailleDebut,i,j,cTags;
31
32 size += indice;
33 if ( size < 0 ) size = 0;
34 if ( size > 5 ) size = 5;
35 tailleDebut = size;
36
37 if ( !( cEl = doc.getElementById( element ) ) ) cEl = doc.getElementsByTagName( element )[ 0 ];
38
39 cEl.style.fontSize = sizes[ size ];
40 for ( i = 0 ; i < tags.length ; i++ ) {
41 cTags = cEl.getElementsByTagName( tags[ i ] );
42 if(tags[ i ] =='h1'){
43 for ( j = 0 ; j < cTags.length ; j++ ) {
44 cTags[ j ].style.lineHeight = txtLineHeight[ size+2 ];
45 cTags[ j ].style.fontSize = sizes[ size+1];
46 }
47
48 }else{
49 for ( j = 0 ; j < cTags.length ; j++ ) {
50 cTags[ j ].style.lineHeight = txtLineHeight[ size ];
51 cTags[ j ].style.fontSize = sizes[ size ];
52 }
53 }
54 }
55 }
56 /*
57 Fonction nous permettant d'ouvrir une fen�tre Java Script
58 */
59 function OuvrirFenetre(page){
60 window.open(page,'','width=600,height=500,status=no,resizable=yes,top=100,left=100,dependent=yes,alwaysRaised=yes,scrollbars=yes,menubar=no');
61
62 }
63
64 function popupShadow(nom) {
65 var cbShadow = document.getElementById(nom);
66 var layerId = "divLayer1";
67 var dShadow = document.getElementById("divShadow");
68 var activeLayer = document.getElementById(layerId);
69 if(dShadow.style.visibility=='visible'){
70 dShadow.style.visibility = "hidden";
71 }else{
72 dShadow.style.left = (parseInt(activeLayer.offsetLeft)+5)+"px";
73 dShadow.style.top = (parseInt(activeLayer.offsetTop)+5)+"px";
74 dShadow.style.left = (parseInt(activeLayer.offsetLeft)+5)+"px";
75 dShadow.style.top = (parseInt(activeLayer.offsetTop)+5)+"px";
76 dShadow.style.width = parseInt(activeLayer.offsetWidth)+"px";
77 dShadow.style.height = parseInt(activeLayer.offsetHeight)+"px";
78 dShadow.style.visibility = "visible";
79 dShadow.style.filter = "Alpha(opacity="+50+")";
80 dShadow.style.opacity = 50/100;
81 }
82 }
83 function popupWindow(nom) {
84 var activeLayer = document.getElementById(nom);
85 popupShadow(nom);
86 if(activeLayer.style.visibility=='visible'){
87 activeLayer.style.visibility = "hidden";
88 }else{
89 if(nom != ""){
90 // On affiche le calque actif
91 activeLayer.style.visibility = "visible";
92 /*activeLayer.style.filter = "Alpha(opacity="+90+")";
93 activeLayer.style.opacity = 90/100;*/
94 }
95 }
96 }
97 function closePopupwindow(){
98 }
99