aboutsummaryrefslogtreecommitdiffstats
path: root/template-common/scripts.js
blob: a96775ce4edd25b68cde6aac3a08ef7022f2b9b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
function SelectAll( formulaire )
{
len = formulaire.elements.length;
var i=0;
for( i = 0; i < len; i++)
{
  if ( formulaire.elements[i].type=='checkbox'
	   && formulaire.elements[i].name != 'copie')
  {
	formulaire.elements[i].checked = true;
  }
}
}

function DeselectAll( formulaire )
{
len = formulaire.elements.length;
var i=0;
for( i = 0; i < len; i++)
{
  if ( formulaire.elements[i].type=='checkbox'
	   && formulaire.elements[i].name != 'copie')
  {
	formulaire.elements[i].checked = false;
  }
}
}

function Inverser( formulaire )
{
len = formulaire.elements.length;
var i=0;
for( i=0; i<len; i++)
{
  if ( formulaire.elements[i].type=='checkbox'
	   && formulaire.elements[i].name != 'copie')
  {
	formulaire.elements[i].checked = !formulaire.elements[i].checked;
  }
}
}

function verifieAndOpen()
{
  var ok=1;
  if (!img.complete)
  {
    // sometime the image loading is not complete
    // especially with KHTML and Opera 
    setTimeout("verifieAndOpen()",200)
  }
  else
  {
  /* give more space for scrollbars (10 for FF, 40 for IE) */
    width=img.width +40;
    height=img.height +40;
    window.open(owURL,owName,owFeatures  + ',width=' + width + ',height=' + height);
  }
}

function phpWGOpenWindow(theURL,winName,features)
{
  img = new Image()
  img.src = theURL;
  owURL=theURL;
  owName=winName;
  owFeatures=features;
  verifieAndOpen();
}

function popuphelp(url)
{
  window.open(
    url,
    'dc_popup',
    'alwaysRaised=yes,dependent=yes,toolbar=no,height=420,width=500,menubar=no,resizable=yes,scrollbars=yes,status=no'
  );
}