2
* Copyright (c) 2012, Intel Corporation.
4
* This program is licensed under the terms and conditions of the
5
* Apache License, version 2.0. The full text of the Apache License is at
6
* http://www.apache.org/licenses/LICENSE-2.0
10
function license_init(id, hpageid)
12
var lbtn = document.getElementById(id+"btnl");
13
var qbtn = document.getElementById(id+"btnq");
14
var lpage = document.getElementById(id+"page");
15
var hpage = document.getElementById(hpageid);
16
var ltext = document.getElementById(id+"text");
17
var lscroll = document.getElementById(id+"scroll");
19
var priorHpageDisplay = hpage.style.display;
21
lbtn.onclick = function() {
22
priorHpageDisplay=hpage.style.display;
24
/* initialize scroll rate */
29
/* set the scroller to the top position */
30
lscroll.style.top = "0px";
32
/* display the license page */
33
hpage.style.display="none";
34
lpage.style.display="block";
36
/* calculate the scroll length when the window is shown */
37
var maxY = lscroll.clientHeight - ltext.clientHeight;
39
/* start the autoscroll interval */
40
timer = setInterval(function() {
41
/* get the actual interval, in case performance slows us down */
42
var t1 = (new Date()).getTime();
43
var dT = (t0 == 0)?20:(t1-t0);
46
/* delay specific number of milliseconds */
51
/* calculate the new top position using dY and dT */
52
var newY = Math.abs(parseInt(lscroll.style.top)) + ((dT/40)*dY);
54
lscroll.style.top = (-1 * newY) + "px";
56
lscroll.style.top = "0px";
58
/* if the lscroll has hit the limit, delay and swing */
60
if((newY >= maxY)&&(dY > 0))
65
else if((newY <= 0)&&(dY < 0))
73
qbtn.onclick = function() {
74
hpage.style.display=priorHpageDisplay;
75
lpage.style.display="none";