initial import from onelab svn codebase
[plewww.git] / planetlab / includes / plc_script.js
1
2 function addLoadEvent(func) {
3   if (!document.getElementById | !document.getElementsByTagName) return
4         var oldonload=window.onload
5         if (typeof window.onload != 'function') { window.onload=func }
6         else {
7                 window.onload=function() { oldonload(); func() }
8         }
9 }
10
11 // ----------------------------------------------------------------------------- //
12
13 function show(id){
14         if (!document.getElementsByTagName) return
15         if (document.getElementById(id).style.display=='block'){
16                 document.getElementById(id).style.display='none'
17         }
18         else{
19                 document.getElementById(id).style.display='block'
20         }
21         //  focus is moved by the href of the link to the start of the help
22 }
23
24
25 function hide(id){
26         if (document.getElementById) {document.getElementById(id).style.display='none'}
27 }
28
29 function copyValue (id1,id2) {
30   if (document.getElementById) {document.getElementById(id2).value=document.getElementById(id1).value}
31 }
32
33
34 // ----------------------------------------------------------------------------- //
35