-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeyboard.htm
555 lines (542 loc) · 26.2 KB
/
keyboard.htm
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
var ua = navigator.userAgent.toLowerCase();
var isIE = "0";
if(ua.indexOf("ie") != -1){
isIE = "1";
}
window.onload=
function()
{
password1=null;
initCalc();
}
var password1;
var CapsLockValue=0;
var checkSoftKey;
function setVariables() {
tablewidth=630;
tableheight=20;
if (navigator.appName == "Netscape") {
horz=".left";
vert=".top";
docStyle="document.";
styleDoc="";
innerW="window.innerWidth";
innerH="window.innerHeight";
offsetX="window.pageXOffset";
offsetY="window.pageYOffset";
}
else {
horz=".pixelLeft";
vert=".pixelTop";
docStyle="";
styleDoc=".style";
innerW="document.body.clientWidth";
innerH="document.body.clientHeight";
offsetX="document.body.scrollLeft";
offsetY="document.body.scrollTop";
}
}
function checkLocation() {
if (checkSoftKey) {
objectXY="softkeyboard";
var availableX=eval(innerW);
var availableY=eval(innerH);
var currentX=eval(offsetX);
var currentY=eval(offsetY);
x=availableX-tablewidth+currentX;
y=currentY;
evalMove();
}
setTimeout("checkLocation()",0);
}
function evalMove() {
eval(docStyle + objectXY + styleDoc + vert + "=" + y);
}
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
function heartBeat() {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.softkeyboard.style.pixelTop += percent;
if(NS) document.softkeyboard.top += percent;
lastScrollY = lastScrollY + percent;}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.softkeyboard.style.pixelLeft += percent;
if(NS) document.softkeyboard.left += percent;
lastScrollX = lastScrollX + percent; } }
function checkFocus(x,y) {
stalkerx = document.softkeyboard.pageX;
stalkery = document.softkeyboard.pageY;
stalkerwidth = document.softkeyboard.clip.width;
stalkerheight = document.softkeyboard.clip.height;
if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
else return false;}
function grabIt(e) {
checkSoftKey = false;
if(IE) {
whichIt = event.srcElement;
while (whichIt.id!=null&&whichIt.id.indexOf("softkeyboard") == -1) {
whichIt = whichIt.parentElement;
if (whichIt == null) { return true; } }
if(whichIt.style!=null){
whichIt.style.pixelLeft = whichIt.offsetLeft;
whichIt.style.pixelTop = whichIt.offsetTop;
}
currentX = (event.clientX + document.body.scrollLeft);
currentY = (event.clientY + document.body.scrollTop);
} else {
window.captureEvents(Event.MOUSEMOVE);
if(checkFocus (e.pageX,e.pageY)) {
whichIt = document.softkeyboard;
StalkerTouchedX = e.pageX-document.softkeyboard.pageX;
StalkerTouchedY = e.pageY-document.softkeyboard.pageY;} }
return true; }
function moveIt(e) {
if (whichIt == null) { return false; }
if(IE) {
if(whichIt.style!=null){
newX = (event.clientX + document.body.scrollLeft);
newY = (event.clientY + document.body.scrollTop);
distanceX = (newX - currentX); distanceY = (newY - currentY);
currentX = newX; currentY = newY;
whichIt.style.pixelLeft += distanceX;
whichIt.style.pixelTop += distanceY;
if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue = false;
}
} else {
whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
return false;}
return false; }
function dropIt() {whichIt = null;
if(NS) window.releaseEvents (Event.MOUSEMOVE);
return true; }
if(NS) {window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
window.onmousedown = grabIt;
window.onmousemove = moveIt;
window.onmouseup = dropIt; }
if(IE) {
document.onmousedown = grabIt;
document.onmousemove = moveIt;
document.onmouseup = dropIt; }
var style1="<style>";
style1+=".btn_letter {BORDER-RIGHT: 1px solid; PADDING-RIGHT: 1px; BORDER-TOP: 1px solid; PADDING-LEFT: 2px;FONT-SIZE: 14px; BORDER-LEFT: 1px solid; CURSOR: hand;PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; width:25px; height:20px;}";
style1+=".btn_num {width:25px;BORDER-RIGHT:1px solid; PADDING-RIGHT: 1px; BORDER-TOP: 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; BORDER-LEFT: 1px solid; CURSOR: hand; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid;height:20px;}";
style1+=".table_title {FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#B2DEF7, EndColorStr=#7AB7DA); height:26px;padding-top: 3px;}";
style1+=".btn_input {BORDER-RIGHT: #2C59AA 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #2C59AA 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5); BORDER-LEFT: #2C59AA 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #2C59AA 1px solid}";
style1+="</style>";
document.write(style1);
//document.write("<DIV align=center id=\"softkeyboard\" name=\"softkeyboard\" style=\"position:absolute; left:0px; top:0px; width:400px; z-index:180;display:none\"><table id=\"CalcTable\" width=\"\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"\"><FORM id=Calc name=Calc action=\"\" method=post autocomplete=\"off\"><tr><td class=\"table_title\" title=\"���0�8�0�6�0�7�0�8�0�2�0�7�0�1�0�3��0�5�0�2�0�2�0�9�0�9�0�9���0�5�0�0��0�1�0�3�0�7�0�3�0�5�0�3�0�6����0�5�0�6�0�0,�0�5���0�6���0�8�0�1�0�7�0�1�0�1�0�5�0�0�0�5�0�8�0�1�0�6�0�5�0�4�0�8�0�1�0�6�0�5�0�1�0�5�0�0�0�5!\" align=\"right\" valign=\"middle\" bgcolor=\"\" style=\"cursor: default;height:30\"><INPUT type=hidden value=\"\" name=password><INPUT type=hidden value=ok name=action2> <font style=\"font-weight:bold; font-size:13px; color:#075BC3\"> �0�1�0�5�0�0�0�5�0�8�0�1�0�6�0�5�0�4��</font>                 <INPUT id=useKey class=\"btn_input\" type=button value=\"�0�8�0�1�0�7�0�1�0�4���0�3�0�0�0�8�0�1�0�6�0�5\" bgtype=\"1\" onclick=\"password1.readOnly=0;password1.focus();closekeyboard();password1.value='';\"><span style=\"width:2px;\"></span></td></tr><tr align=\"center\"><td class=\"table_title\" align=\"center\" ><table align=\"center\" width=\"%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n<tr align=\"left\" valign=\"middle\"> \n<td class=\"table_title\"> <input type=button value=\" ~ \"></td>\n<td> <input type=button value=\" ! \"></td>\n<td> <input type=button value=\" @ \"></td>\n<td> <input type=button value=\" # \"></td>\n<td> <input type=button value=\" $ \"></td>\n<td><input type=button value=\" % \"></td>\n<td><input type=button value=\" ^ \"></td>\n<td> <input type=button value=\" & \"></td>\n<td><input type=button value=\" * \"></td>\n<td class=\"table_title\"><input type=button value=\" ( \"></td>\n<td><input type=button value=\" ) \"></td>\n<td><input type=button value=\" _ \"></td>\n<td> <input type=button value=\" + \"></td>\n<td><input type=button value=\" | \"></td>\n<td colspan=\"1\" rowspan=\"2\"> <input name=\"button10\" type=button value=\" �0�1�0�9�0�0�0�9\" onclick=\"setpassvalue();\" onDblClick=\"setpassvalue();\" style=\"width:100px;height:40px\"> \n</td>\n</tr>\n<tr align=\"left\" valign=\"middle\"> \n<td><input type=button value=\" ` \"></td>\n<td><input type=button bgtype=\"2\" name=\"button_number1\" value=\" 1 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number2\" value=\" 2 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number3\" value=\" 3 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number4\" value=\" 4 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number5\" value=\" 5 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number6\" value=\" 6 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number7\" value=\" 7 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number8\" value=\" 8 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number9\" value=\" 9 \"></td>\n<td> <input bgtype=\"2\" name=\"button_number0\" type=button value=\" 0 \"></td>\n<td> <input type=button value=\" - \"></td>\n<td> <input type=button value=\" = \"></td>\n<td> <input type=button value=\" \\ \"></td>\n<td> </td>\n</tr>\n<tr align=\"left\" valign=\"middle\"> \n<td> <input type=button value=\" q \"></td>\n<td> <input type=button value=\" w \"></td>\n<td> <input type=button value=\" e \"></td>\n<td> <input type=button value=\" r \"></td>\n<td> <input type=button value=\" t \"></td>\n<td> <input type=button value=\" y \"></td>\n<td> <input type=button value=\" u \"></td>\n<td> <input type=button value=\" i \"></td>\n<td> <input type=button value=\" o \"></td>\n<td> <input name=\"button8\" type=button value=\" p \"></td>\n<td> <Input name=\"button9\" type=button value=\" { \"></td>\n<td> <input type=button value=\" } \"></td>\n<td> <input type=button value=\" [ \"></td>\n<td> <input type=button value=\" ] \"></td>\n<td><input name=\"button9\" type=button onClick=\"capsLockText();setCapsLock();\" onDblClick=\"capsLockText();setCapsLock();\" value=\"�0�5�0�4�0�3�0�3�0�7��/�0�4�0�3�0�4�0�7\" style=\"width:100px;\"></td>\n</tr>\n<tr align=\"left\" valign=\"middle\"> \n<td> <input type=button value=\" a \"></td>\n<td> <input type=button value=\" s \"></td>\n<td> <input type=button value=\" d \"></td>\n<td> <input type=button value=\" f \"></td>\n<td> <input type=button value=\" g \"></td>\n<td> <input type=button value=\" h \"></td>\n<td> <input type=button value=\" j \"></td>\n<td> <input name=\"button3\" type=button value=\" k \"></td>\n<td> <input name=\"button4\" type=button value=\" l \"></td>\n<td> <input name=\"button5\" type=button value=\" : \"></td>\n<td> <input name=\"button7\" type=button value=\" " \"></td>\n<td> <input type=button value=\" ; \"></td>\n<td> <input type=button value=\" ' \"></td>\n<td rowspan=\"2\" colspan=\"2\"> <input name=\"button12\" type=button onclick=\"OverInput();\" value=\" �0�6���0�9�� \" style=\"width:126px;height:42px;\"></td>\n</tr>\n<tr align=\"left\" valign=\"middle\"> \n<td><input name=\"button2\" type=button value=\" z \"></td>\n<td> <input type=button value=\" x \"></td>\n<td> <input type=button value=\" c \"></td>\n<td> <input type=button value=\" v \"></td>\n<td> <input type=button value=\" b \"></td>\n<td> <input type=button value=\" n \"></td>\n<td> <input type=button value=\" m \"></td>\n<td> <input type=button value=\" < \"></td>\n<td> <input type=button value=\" > \"></td>\n<td> <input type=button value=\" ? \"></td>\n<td> <input type=button value=\" , \"></td>\n <td> <input type=button value=\" . \"></td>\n <td> <input type=button value=\" / \"></td>\n</tr>\n</table></td></FORM></tr></table></DIV>");
if(isIE == "1"){
document.write("<DIV align=center id=\"softkeyboard\" name=\"softkeyboard\" style=\"position:absolute; left:0px; top:0px; width:400px; z-index:180;display:none\"><table id=\"CalcTable\" width=\"\" border=\"0\" align=\"center\" height='70' cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"\"><FORM id=Calc name=Calc action=\"\" method=post autocomplete=\"off\"><tr><td class=\"table_title\" title=\"text1\" align=\"right\" valign=\"middle\" bgcolor=\"\" style=\"cursor: default;height:30\"><INPUT type=hidden value=\"\" name=password><INPUT type=hidden value=ok name=action2> <font style=\"font-weight:bold; font-size:13px; color:#075BC3\"> \u5bc6\u7801\u8f93\u5165\u5668</font>                 <INPUT id=useKey class=\"btn_input\" type=button value=\"\u4f7f\u7528\u952e\u76d8\u8f93\u5165\" bgtype=\"1\" onclick=\"clearKeyborad();\"><span style=\"width:2px;\"></span></td></tr><tr align=\"center\"><td align=\"center\" class=\"table_title\"><table align=\"center\" width=\"%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n<tr align=\"left\" valign=\"middle\"> \n<td><input type=button bgtype=\"2\" name=\"button_number1\" value=\" 1 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number2\" value=\" 2 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number3\" value=\" 3 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number4\" value=\" 4 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number5\" value=\" 5 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number6\" value=\" 6 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number7\" value=\" 7 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number8\" value=\" 8 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number9\" value=\" 9 \"></td>\n<td> <input bgtype=\"2\" name=\"button_number0\" type=button value=\" 0 \"></td>\n<td colspan=\"1\" rowspan=\"2\"> <input name=\"button10\" class=\"btn_input\" align=\"middle\" type=button value=\"\u9000\u683c\" onclick=\"setpassvalue();\" onDblClick=\"setpassvalue();\" style=\"width:40px;height:20px\"> \n<td rowspan=\"2\" colspan=\"2\"> <input name=\"button12\" type=button onclick=\"OverInput();\" value=\"\u786e\u5b9a\" style=\"width:40px;height:20px;\"></td>\n</tr></table></td></FORM></tr></table></DIV>");
}else{
document.write("<DIV align=center id=\"softkeyboard\" name=\"softkeyboard\" style=\"position:absolute; left:0px; top:0px; width:400px; z-index:180;display:none\"><table id=\"CalcTable\" width=\"\" border=\"0\" align=\"center\" height='70' cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"\"><FORM id=Calc name=Calc action=\"\" method=post autocomplete=\"off\"><tr><td class=\"table_title\" title=\"text1\" align=\"right\" valign=\"middle\" bgcolor=\"\" style=\"cursor: default;height:30\"><INPUT type=hidden value=\"\" name=password><INPUT type=hidden value=ok name=action2> <font style=\"font-weight:bold; font-size:13px; color:#075BC3\"> \u5bc6\u7801\u8f93\u5165\u5668</font>                 <INPUT id=useKey class=\"btn_input\" type=button value=\"\u4f7f\u7528\u952e\u76d8\u8f93\u5165\" bgtype=\"1\" onclick=\"clearKeyborad();\"><span style=\"width:2px;\"></span></td></tr><tr align=\"center\"><td align=\"center\" class=\"table_title\"><table align=\"center\" width=\"%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n<tr align=\"left\" valign=\"middle\"> \n<td><input type=button bgtype=\"2\" name=\"button_number1\" value=\" 1 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number2\" value=\" 2 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number3\" value=\" 3 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number4\" value=\" 4 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number5\" value=\" 5 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number6\" value=\" 6 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number7\" value=\" 7 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number8\" value=\" 8 \"></td>\n<td> <input type=button bgtype=\"2\" name=\"button_number9\" value=\" 9 \"></td>\n<td> <input bgtype=\"2\" name=\"button_number0\" type=button value=\" 0 \"></td>\n<td colspan=\"1\" rowspan=\"2\"> <input name=\"button10\" class=\"btn_input\" align=\"middle\" type=button value=\"\u9000\u683c\" onclick=\"setpassvalue();\" style=\"width:40px;height:20px\"> \n<td rowspan=\"2\" colspan=\"2\"> <input name=\"button12\" type=button onclick=\"OverInput();\" value=\"\u786e\u5b9a\" style=\"width:40px;height:20px;\"></td>\n</tr></table></td></FORM></tr></table></DIV>");
}
function addValue_old(newValue)
{
if (CapsLockValue==0)
{
var str=document.Calc.password.value;
if(str.length<password1.maxLength)
{
document.Calc.password.value += newValue;
}
if(str.length<=password1.maxLength)
{
password1.value=document.Calc.password.value;
}
}
else
{
var str=document.Calc.password.value;
if(str.length<password1.maxLength)
{
//Calc.password.value += newValue.toUpperCase();
document.Calc.password.value += newValue;
}
if(str.length<=password1.maxLength)
{
password1.value=Calc.password.value;
}
}
}
function clearKeyborad(){
var pwdActiveX;
if(isIE == "0" ){
pwdActiveX = document.getElementById("loginActiveX");
}else{
pwdActiveX = document.getElementById("DCsswebLogin1");
}
if(pwdActiveX == null){ //text input clear
password1.readOnly=0;
password1.focus();
password1.value='';
}else{ //ActiveX input clear
try{
pwdActiveX.SetPswNum(11);
}catch(e){}
}
closekeyboard();
}
function setpassvalue()
{
if(jsSSL == "true" ){//is ssl
if(isIE == "0" ){//except IE,others
var embed2 = document.getElementById('loginActiveX');
embed2.SetPswNum(parseInt(10));
}else{
var pwdActiveX = document.getElementById("DCsswebLogin1");
if(pwdActiveX == null){ //text input backspace
var longnum=document.Calc.password.value.length;
var num
num=document.Calc.password.value.substr(0,longnum-1);
document.Calc.password.value=num;
var str=document.Calc.password.value;
password1.value=document.Calc.password.value;
}else{ //ActiveX input backspace
try{
pwdActiveX.SetPswNum(10);
}catch(e){}
}
}
}else{//not ssl
var Calc = document.getElementById('Calc');
var longnum=Calc.password.value.length;
var num
num=Calc.password.value.substr(0,longnum-1);
Calc.password.value=num;
var str=Calc.password.value;
password1.value=Calc.password.value;
}
}
function OverInput()
{
var str=document.Calc.password.value;
password1.value=document.Calc.password.value;
closekeyboard();
document.Calc.password.value="";
password1.readOnly=0;
}
function closekeyboard(theForm)
{
document.getElementById("softkeyboard").style.display="none";
if(null!=unhideSelect){
unhideSelect();
}
}
function showkeyboard_old()
{
randomNumberButton();
var th = password1;
var ttop = th.offsetTop;
var thei = th.clientHeight;
var tleft = th.offsetLeft;
var ttyp = th.type;
while (th = th.offsetParent){ttop+=th.offsetTop; tleft+=th.offsetLeft;}
softkeyboard.style.top = ttop+thei+16;
softkeyboard.style.left = tleft-100;
softkeyboard.style.display="block";
password1.readOnly=1;
password1.blur();
document.getElementById("useKey").focus();
//if(null!=hideSelect){
//hideSelect();
//}
}
function setCapsLock()
{
if (CapsLockValue==0)
{
CapsLockValue=1
}
else
{
CapsLockValue=0
}
}
function setCalcborder_old()
{
CalcTable.style.border="1px solid #B5ADF1"
}
function setHead_old()
{
CalcTable.cells[0].style.backgroundColor="#B5ADF1"
}
function setCalcButtonBg_old()
{
for(var i=0;i<document.Calc.elements.length;i++)
{
if(document.Calc.elements[i].type=="button"&&document.Calc.elements[i].bgtype!="1")
{
if(document.Calc.elements[i].bgtype=="2"){
document.Calc.elements[i].className="btn_num";
}else{
document.Calc.elements[i].className="btn_letter";
}
var str1=document.Calc.elements[i].value;
str1=str1.trim();
if(str1.length==1)
{
}
var thisButtonValue=document.Calc.elements[i].value;
thisButtonValue=thisButtonValue.trim();
if(thisButtonValue.length==1)
{
document.Calc.elements[i].onclick=
function ()
{
var thisButtonValue=this.value;
thisButtonValue=thisButtonValue.trim();
thisButtonValue=jiamiMimaKey(thisButtonValue);
addValue(thisButtonValue);
}
document.Calc.elements[i].ondblclick = function (){
if(isIE == "1"){
var thisButtonValue=this.value;
thisButtonValue=thisButtonValue.trim();
thisButtonValue=jiamiMimaKey(thisButtonValue);
addValue(thisButtonValue);
}else{
}
}
}
}
}
}
function initCalc()
{
setCalcborder();
setHead();
setCalcButtonBg();
}
String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
var capsLockFlag;
capsLockFlag=true;
function capsLockText()
{
if(capsLockFlag)
{
for(var i=0;i<document.Calc.elements.length;i++)
{
var char=document.Calc.elements[i].value;
var char=char.trim()
if(document.Calc.elements[i].type=="button"&&char>="a"&&char<="z"&&char.length==1)
{
document.Calc.elements[i].value=" "+String.fromCharCode(char.charCodeAt(0)-32)+" "
}
}
}
else
{
for(var i=0;i<document.Calc.elements.length;i++)
{
var char=document.Calc.elements[i].value;
var char=char.trim()
if(document.Calc.elements[i].type=="button"&&char>="A"&&char<="Z"&&char.length==1)
{
document.Calc.elements[i].value=" "+String.fromCharCode(char.charCodeAt(0)+32)+" "
}
}
}
capsLockFlag=!capsLockFlag;
}
function randomNumberButton(){
var a = new Array(10);
a[0]=0;a[1]=1;a[2]=2;a[3]=3;a[4]=4;a[5]=5;a[6]=6;a[7]=7;a[8]=8;a[9]=9;
var randomNum;
var times=10;
for(var i=0;i<10;i++){
randomNum = parseInt(Math.random()*10);
var tmp=a[0];
a[0]=a[randomNum];
a[randomNum]=tmp;
}
document.Calc.button_number0.value=" "+a[0]+" ";
document.Calc.button_number1.value=" "+a[1]+" ";
document.Calc.button_number2.value=" "+a[2]+" ";
document.Calc.button_number3.value=" "+a[3]+" ";
document.Calc.button_number4.value=" "+a[4]+" ";
document.Calc.button_number5.value=" "+a[5]+" ";
document.Calc.button_number6.value=" "+a[6]+" ";
document.Calc.button_number7.value=" "+a[7]+" ";
document.Calc.button_number8.value=" "+a[8]+" ";
document.Calc.button_number9.value=" "+a[9]+" ";
}
function hideSelect(){
var i=0;
while(i<document.getElementsByTagName("select").length){
document.getElementsByTagName("select")[i].style.visibility = "hidden";
i=i+1;
}
}
function unhideSelect(){
var i=0;
while(i<document.getElementsByTagName("select").length){
document.getElementsByTagName("select")[i].style.visibility = "visible";
i=i+1;
}
}
function jiamiMimaKey(newValue) {
if (typeof(b) == "undefined" || typeof(ifUseYinshe) == "undefined" || ifUseYinshe == 0) {return newValue;}
var everyone = '';
var afterPass = '';
for (var i=0;i<newValue.length;i++ ) {
everyone = newValue.charAt(i);
for (var j =0;j<((b.length)/2);j++) {
if (everyone == b[2*j]) {
afterPass = afterPass + b[2*j+1];
break;
}
}
}
newValue= afterPass;
jiami = 1;
return afterPass;
}
//------------------------add by zhangsq
function addValue(newValue)
{
var Calc = document.getElementById('Calc');
if (CapsLockValue==1)
{
var str=Calc.password.value;
if(str.length<password1.size)
{
Calc.password.value += newValue;
}
if(str.length<=password1.size)
{
password1.value=Calc.password.value;
}
}
else
{
if(jsSSL == "true"){
if(isIE == "0" ){//
var embed2 = document.getElementById('loginActiveX');
embed2.SetPswNum(parseInt(newValue));
}else{
var pwdActiveX = document.getElementById("DCsswebLogin1");
if(pwdActiveX == null){ //text input
var str=Calc.password.value;
if(str.length<password1.maxLength)
{
Calc.password.value += newValue;
}
if(str.length<=password1.maxLength)
{
password1.value=Calc.password.value;
}
}else{
try{
pwdActiveX.SetPswNum(newValue);
}catch(e){
}
}
}
}else{
var str=Calc.password.value;
if(str.length<password1.maxLength)
{
//Calc.password.value += newValue.toUpperCase();
Calc.password.value += newValue;
}
if(str.length<=password1.maxLength)
{
password1.value=Calc.password.value;
}
}
}
}
function showkeyboard()
{
randomNumberButton();
var th ;
if(jsSSL == "true"){
if(isIE == "0" ){//
th = document.getElementById('loginActiveX');
}else{
th = document.getElementById("DCsswebLogin1");
}
}else{
th = password1;
}
var ttop = th.offsetTop;
var thei = th.clientHeight;
var tleft = th.offsetLeft;
var ttyp = th.type;
while (th = th.offsetParent){ttop+=th.offsetTop; tleft+=th.offsetLeft;}
document.getElementById("softkeyboard").style.display="block";
document.getElementById("softkeyboard").style.top = (ttop+thei)+"px";
document.getElementById("softkeyboard").style.left = (tleft-100)+"px";
//password1.readOnly=1;
//password1.blur();
//document.getElementById("useKey").focus();
//if(null!=hideSelect){
//hideSelect();
//}
}
function setCalcborder()
{
document.getElementById("CalcTable").style.border="1px solid #B5ADF1";
}
function setHead()
{
document.getElementById("CalcTable").rows[0].cells[0].style.backgroundColor="#B5ADF1";
document.getElementById("CalcTable").rows[1].cells[0].style.backgroundColor="#B2DEF7";
}
function setCalcButtonBg()
{
for(var i=0;i<document.Calc.elements.length;i++)
{
if(document.Calc.elements[i].type=="button"&&document.Calc.elements[i].bgtype!="1")
{
if(document.Calc.elements[i].id=="useKey"){
}else{
document.Calc.elements[i].className="btn_num";
}
var thisButtonValue=document.Calc.elements[i].value;
thisButtonValue=thisButtonValue.trim();
if(thisButtonValue.length==1)
{
document.Calc.elements[i].onclick=
function ()
{
var thisButtonValue=this.value;
thisButtonValue=thisButtonValue.trim();
thisButtonValue=jiamiMimaKey(thisButtonValue);
addValue(thisButtonValue);
}
document.Calc.elements[i].ondblclick= function (){
if(isIE == "1"){
var thisButtonValue=this.value;
thisButtonValue=thisButtonValue.trim();
thisButtonValue=jiamiMimaKey(thisButtonValue);
addValue(thisButtonValue);
}else{}
}
}
}
}
}