-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
740 lines (676 loc) · 43.2 KB
/
index.html
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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<HEAD>
<title>Law as Code</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="no" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta property="og:type" content="website"/>
<meta property="og:title" content="Law as Code"/>
<meta property="og:description" content="Adapted from @margarethagan's flowchart."/>
<meta property="og:image" content=""/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="apple-touch-icon" href="http://www.qnamarkup.org/images/QnA_300.png"/>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
</HEAD>
<BODY BGCOLOR="#ffffff" BACKGROUND="" MARGINWIDTH="0" MARGINHEIGHT="0" onLoad="startAT('1');"><style>
body {
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}
#rawmarkup{
display:none;
}
#QandA img{
width:100%;
}
div.main{
min-width:300px;
max-width:650px;
margin: 0 auto;
padding:0 5px 0 5px;
}
div.frame{
float:left;
width:100%;
margin:5px 0 5px 0;
}
div.full{
float:left;
width:100%;
}
.button{
padding:8px;
margin:8px 0 0px 0;
width:100%;
}
div.question_text{
float:left;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
color:#ffffff;
min-width:30px;
background:#5489eb;
border-radius: 15px;
padding:10px 15px 14px 15px;
margin-right:45px;
}
div.question_text a:link, div.question_text a:hover, div.question_text a:active, div.question_text a:visited{ color:#e3fbfc; }
div.question_arrow{
float:left;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 10px solid transparent;
border-top: 15px solid #5489eb;
margin:0 20px;
}
div.ans_text{
float:right;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
color:#000000;
min-width:30px;
background:#eeeeee;
border-radius: 15px;
padding:10px 15px 14px 15px;
margin-left:45px;
}
div.ans_arrow{
float:right;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 5px solid transparent;
border-top: 15px solid #eeeeee;
margin:0 20px;
}
div.choices{
float:left;
width:100%;
margin:15px 0 0 0;
}
div.credits{
float:left;
dispaly:none;
width:100%;
background:#eee;
margin:0px 0 15px 0;
}
div.credit_text{
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
padding:4px 15px 10px 15px;
}
li.error{
list-style-type: none;
background:#ffdddd;
margin: 10px 0 0 0;
padding: 5px;
}
.qpad {
float:left;
padding:0 15px;
}
a.qabutton {
float:left;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
width:100%;
background: #eee;
border-radius: 8px;
padding:10px 0px 12px 0;
margin: 0 0 8px 0;
border: solid 1px #888;
text-align:left;
color: #000000;
text-decoration: none;
}
a.qabutton:hover, a.qabutton:active {
float:left;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
width:100%;
background: #ddd;
border-radius: 8px;
padding:10px 0px 12px 0;
margin: 0 0 8px 0;
border: solid 1px #888;
text-align:left;
color: #000000;
text-decoration: underline;
}
div.xdiv {
float:left;
width:100%;
margin: 0 0 8px 0;
background: #eee;
border: solid 1px #888;
border-radius: 8px;
}
input.xinput {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
float:left;
width:100%;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
background: #fff;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
padding:10px 10px 12px 10px;
border: solid 0px #888;
border-bottom: solid 1px #888;
text-align:left;
color: #000000;
text-decoration: none;
}
a.xbutton {
float:left;
width:100%;
text-align:left;
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
line-height: 20px;
background: #eee;
border-radius: 8px;
padding:10px 0px 12px 0px;
color: #000000;
text-decoration: none;
}
a.xbutton:hover, a.xbutton:active {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
background: #ddd;
}
</style>
<FORM name="FORM" id="FORM"><div id="conversation" style="margin:15px auto 0 auto;padding:0 15px;max-width:500px"> <p><img src="LawAsCodeBot.jpg" style="width:100%;"></p>
<h2>DACA Intake Evaluation<sup>†</sup></h2>
<div id='QandA' class='QandA'><div style='padding:15px;background:#ddffdd;text-align:center;'>Loading QnA...</div></div><div id='Choices' class='choices'></div><div id='rawmarkup' style='display:none;'>Title: Law as Code
Description: Adapted from <a href="https://mobile.twitter.com/margarethagan">@margarethagan</a>'s <a href="http://www.openlawlab.com/2014/05/22/graphic-legal-intake-form/">flowchart</a>.
Before: <p><img src="LawAsCodeBot.jpg" style="width:100%;"></p>
<h2>DACA Intake Evaluation<sup>†</sup></h2>
After:<p><sup>†</sup>Adapted from <a href="https://mobile.twitter.com/margarethagan">@margarethagan</a>'s <a href="http://www.openlawlab.com/2014/05/22/graphic-legal-intake-form/">flowchart</a>. If you can codify a piece of your practice in a flowchart, you can build a bot. <a href="http://youtu.be/RVhzQ1JVi3s">Learn how (video)</a>. See also <a href="http://www.spacedrepetition.com/blog/how-a-law-student-used-legaltech-to-make-the-insanely-confusing-path-to-legal-immigration-insanely-simple-in-four-hours">How a Law Student Used #LegalTech to Make the "Insanely Confusing Path to Legal Immigration" Insanely Simple...in Four Hours</a>. <a href="https://www.mcsweeneys.net/articles/alright-fine-ill-add-a-disclaimer-to-my-emails">This is not legal advice.</a> </p>
Q(1): Were you born on or after June 16, 1981?
A: Yes
Q(1.1): Is this date before your 16th birthday?
A: Yes
Q(1.1.1): Is this date before June 15, 2007?
A: Yes
Q(1.1.1.1): Were you present in the US on June 15, 2012?
A: Yes
Q(1.1.1.1.1): Since first entering have you ever left the US?
A: Yes
Q(1.1.1.1.1.1): Did you leave multiple times?
A: Yes.
Q(1.1.1.1.1.1.1): How long?
X:time
Q(1.1.1.1.1.1.1.1):GOTO:3
A: No, I only left once.
Q(1.1.1.1.1.1.2):GOTO:3
A: No
Q(1.1.1.1.1.2):GOTO:3
A: No
Q(1.1.1.1.2):GOTO:2
A: No
Q(1.1.1.2):GOTO:2
A: No
Q(1.1.2):GOTO:2
A: No
Q(1.2):GOTO:2
Q(2): Not Eligible.
Q(3): If you left for only a short period of time, you may still be eligible for DACA. <b>Please speak to an intake volunteer of attorney for further evaluation.</b><BR><BR>On June 12, 2012, did you have a current Visa or a valid Green Card?
A: Yes
Q(3.1):GOTO:2
A: No
Q(3.2): Are you a current student or do you have a HS diploma or GED?
A: Yes
Q(3.2.1): Have you ever had any interaction at all with law enforcement?
A: Yes
Q(3.2.1.1): You may still be eligible for a DACA. <b>Please speak to an intake volunteer or attorney for further evaluation.</b>
A: No
Q(3.2.1.2): Have you ever had any interaction at all with Immigration and Customs Enforcement (ICE)?
A: Yes
Q(3.2.1.2.1):GOTO:3.2.1.1
A: No
Q(3.2.1.2.2): You are eligible for DACA. Please schedule an appointment to complete your application.
A: No
Q(3.2.2): You are not currently eligible, BUT you may be eligible if you enroll in a GED program.</div><div id="ondeck" name="ondeck"><div id="doc" name="doc" style="display:none;"></div><div id='Q-1' name='Q-1' style='display:none;'> Were you born on or after June 16, 1981?
</div><div id='Q-1.1' name='Q-1.1' style='display:none;'> Is this date before your 16th birthday?
</div><div id='Q-1.1.1' name='Q-1.1.1' style='display:none;'> Is this date before June 15, 2007?
</div><div id='Q-1.1.1.1' name='Q-1.1.1.1' style='display:none;'> Were you present in the US on June 15, 2012?
</div><div id='Q-1.1.1.1.1' name='Q-1.1.1.1.1' style='display:none;'> Since first entering have you ever left the US?
</div><div id='Q-1.1.1.1.1.1' name='Q-1.1.1.1.1.1' style='display:none;'> Did you leave multiple times?
</div><div id='Q-1.1.1.1.1.1.1' name='Q-1.1.1.1.1.1.1' style='display:none;'> How long?
</div><div id='Q-1.1.1.1.1.1.1.1' name='Q-1.1.1.1.1.1.1.1' style='display:none;'>GOTO:3
</div><div id='Q-1.1.1.1.1.1.2' name='Q-1.1.1.1.1.1.2' style='display:none;'>GOTO:3
</div><div id='Q-1.1.1.1.1.2' name='Q-1.1.1.1.1.2' style='display:none;'>GOTO:3
</div><div id='Q-1.1.1.1.2' name='Q-1.1.1.1.2' style='display:none;'>GOTO:2
</div><div id='Q-1.1.1.2' name='Q-1.1.1.2' style='display:none;'>GOTO:2
</div><div id='Q-1.1.2' name='Q-1.1.2' style='display:none;'>GOTO:2
</div><div id='Q-1.2' name='Q-1.2' style='display:none;'>GOTO:2
</div><div id='Q-2' name='Q-2' style='display:none;'> Not Eligible.
</div><div id='Q-3' name='Q-3' style='display:none;'> If you left for only a short period of time, you may still be eligible for DACA. <b>Please speak to an intake volunteer of attorney for further evaluation.</b><BR><BR>On June 12, 2012, did you have a current Visa or a valid Green Card?
</div><div id='Q-3.1' name='Q-3.1' style='display:none;'>GOTO:2
</div><div id='Q-3.2' name='Q-3.2' style='display:none;'> Are you a current student or do you have a HS diploma or GED?
</div><div id='Q-3.2.1' name='Q-3.2.1' style='display:none;'> Have you ever had any interaction at all with law enforcement?
</div><div id='Q-3.2.1.1' name='Q-3.2.1.1' style='display:none;'> You may still be eligible for a DACA. <b>Please speak to an intake volunteer or attorney for further evaluation.</b>
</div><div id='Q-3.2.1.2' name='Q-3.2.1.2' style='display:none;'> Have you ever had any interaction at all with Immigration and Customs Enforcement (ICE)?
</div><div id='Q-3.2.1.2.1' name='Q-3.2.1.2.1' style='display:none;'>GOTO:3.2.1.1
</div><div id='Q-3.2.1.2.2' name='Q-3.2.1.2.2' style='display:none;'> You are eligible for DACA. Please schedule an appointment to complete your application.
</div><div id='Q-3.2.2' name='Q-3.2.2' style='display:none;'> You are not currently eligible, BUT you may be eligible if you enroll in a GED program.</div><div id='A-1.1' name='A-1.1' style='display:none;'> Yes
</div><div id='A-href-1.1' name='A-href-1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1' name='A-target-1.1' style='display:none;'></div><div id='X-1.1' name='X-1.1' style='display:none;'></div><div id='A-1.1.1' name='A-1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1' name='A-href-1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1' name='A-target-1.1.1' style='display:none;'></div><div id='X-1.1.1' name='X-1.1.1' style='display:none;'></div><div id='A-1.1.1.1' name='A-1.1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1.1' name='A-href-1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1' name='A-target-1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1' name='X-1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1' name='A-1.1.1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1.1.1' name='A-href-1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1' name='A-target-1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1' name='X-1.1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1.1' name='A-1.1.1.1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1.1.1.1' name='A-href-1.1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1' name='A-target-1.1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1.1' name='X-1.1.1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1.1.1' name='A-1.1.1.1.1.1.1' style='display:none;'> Yes.
</div><div id='A-href-1.1.1.1.1.1.1' name='A-href-1.1.1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1.1' name='A-target-1.1.1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1.1.1' name='X-1.1.1.1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1.1.1.1' name='A-1.1.1.1.1.1.1.1' style='display:none;'><variable></div><div id='A-href-1.1.1.1.1.1.1.1' name='A-href-1.1.1.1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1.1.1' name='A-target-1.1.1.1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1.1.1.1' name='X-1.1.1.1.1.1.1.1' style='display:none;'>time</div><div id='A-1.1.1.1.1.1.2' name='A-1.1.1.1.1.1.2' style='display:none;'> No, I only left once.
</div><div id='A-href-1.1.1.1.1.1.2' name='A-href-1.1.1.1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1.2' name='A-target-1.1.1.1.1.1.2' style='display:none;'></div><div id='X-1.1.1.1.1.1.2' name='X-1.1.1.1.1.1.2' style='display:none;'></div><div id='A-1.1.1.1.1.2' name='A-1.1.1.1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.1.1.1.2' name='A-href-1.1.1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.2' name='A-target-1.1.1.1.1.2' style='display:none;'></div><div id='X-1.1.1.1.1.2' name='X-1.1.1.1.1.2' style='display:none;'></div><div id='A-1.1.1.1.2' name='A-1.1.1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.1.1.2' name='A-href-1.1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.2' name='A-target-1.1.1.1.2' style='display:none;'></div><div id='X-1.1.1.1.2' name='X-1.1.1.1.2' style='display:none;'></div><div id='A-1.1.1.2' name='A-1.1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.1.2' name='A-href-1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.2' name='A-target-1.1.1.2' style='display:none;'></div><div id='X-1.1.1.2' name='X-1.1.1.2' style='display:none;'></div><div id='A-1.1.2' name='A-1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.2' name='A-href-1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.2' name='A-target-1.1.2' style='display:none;'></div><div id='X-1.1.2' name='X-1.1.2' style='display:none;'></div><div id='A-1.2' name='A-1.2' style='display:none;'> No
</div><div id='A-href-1.2' name='A-href-1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.2' name='A-target-1.2' style='display:none;'></div><div id='X-1.2' name='X-1.2' style='display:none;'></div><div id='A-3.1' name='A-3.1' style='display:none;'> Yes
</div><div id='A-href-3.1' name='A-href-3.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.1' name='A-target-3.1' style='display:none;'></div><div id='X-3.1' name='X-3.1' style='display:none;'></div><div id='A-3.2' name='A-3.2' style='display:none;'> No
</div><div id='A-href-3.2' name='A-href-3.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2' name='A-target-3.2' style='display:none;'></div><div id='X-3.2' name='X-3.2' style='display:none;'></div><div id='A-3.2.1' name='A-3.2.1' style='display:none;'> Yes
</div><div id='A-href-3.2.1' name='A-href-3.2.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1' name='A-target-3.2.1' style='display:none;'></div><div id='X-3.2.1' name='X-3.2.1' style='display:none;'></div><div id='A-3.2.1.1' name='A-3.2.1.1' style='display:none;'> Yes
</div><div id='A-href-3.2.1.1' name='A-href-3.2.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.1' name='A-target-3.2.1.1' style='display:none;'></div><div id='X-3.2.1.1' name='X-3.2.1.1' style='display:none;'></div><div id='A-3.2.1.2' name='A-3.2.1.2' style='display:none;'> No
</div><div id='A-href-3.2.1.2' name='A-href-3.2.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.2' name='A-target-3.2.1.2' style='display:none;'></div><div id='X-3.2.1.2' name='X-3.2.1.2' style='display:none;'></div><div id='A-3.2.1.2.1' name='A-3.2.1.2.1' style='display:none;'> Yes
</div><div id='A-href-3.2.1.2.1' name='A-href-3.2.1.2.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.2.1' name='A-target-3.2.1.2.1' style='display:none;'></div><div id='X-3.2.1.2.1' name='X-3.2.1.2.1' style='display:none;'></div><div id='A-3.2.1.2.2' name='A-3.2.1.2.2' style='display:none;'> No
</div><div id='A-href-3.2.1.2.2' name='A-href-3.2.1.2.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.2.2' name='A-target-3.2.1.2.2' style='display:none;'></div><div id='X-3.2.1.2.2' name='X-3.2.1.2.2' style='display:none;'></div><div id='A-3.2.2' name='A-3.2.2' style='display:none;'> No
</div><div id='A-href-3.2.2' name='A-href-3.2.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.2' name='A-target-3.2.2' style='display:none;'></div><div id='X-3.2.2' name='X-3.2.2' style='display:none;'></div></div><textarea id="original" name="original" style="display:none;" disabled="disabled"><div id="doc" name="doc" style="display:none;"></div><div id='Q-1' name='Q-1' style='display:none;'> Were you born on or after June 16, 1981?
</div><div id='Q-1.1' name='Q-1.1' style='display:none;'> Is this date before your 16th birthday?
</div><div id='Q-1.1.1' name='Q-1.1.1' style='display:none;'> Is this date before June 15, 2007?
</div><div id='Q-1.1.1.1' name='Q-1.1.1.1' style='display:none;'> Were you present in the US on June 15, 2012?
</div><div id='Q-1.1.1.1.1' name='Q-1.1.1.1.1' style='display:none;'> Since first entering have you ever left the US?
</div><div id='Q-1.1.1.1.1.1' name='Q-1.1.1.1.1.1' style='display:none;'> Did you leave multiple times?
</div><div id='Q-1.1.1.1.1.1.1' name='Q-1.1.1.1.1.1.1' style='display:none;'> How long?
</div><div id='Q-1.1.1.1.1.1.1.1' name='Q-1.1.1.1.1.1.1.1' style='display:none;'>GOTO:3
</div><div id='Q-1.1.1.1.1.1.2' name='Q-1.1.1.1.1.1.2' style='display:none;'>GOTO:3
</div><div id='Q-1.1.1.1.1.2' name='Q-1.1.1.1.1.2' style='display:none;'>GOTO:3
</div><div id='Q-1.1.1.1.2' name='Q-1.1.1.1.2' style='display:none;'>GOTO:2
</div><div id='Q-1.1.1.2' name='Q-1.1.1.2' style='display:none;'>GOTO:2
</div><div id='Q-1.1.2' name='Q-1.1.2' style='display:none;'>GOTO:2
</div><div id='Q-1.2' name='Q-1.2' style='display:none;'>GOTO:2
</div><div id='Q-2' name='Q-2' style='display:none;'> Not Eligible.
</div><div id='Q-3' name='Q-3' style='display:none;'> If you left for only a short period of time, you may still be eligible for DACA. <b>Please speak to an intake volunteer of attorney for further evaluation.</b><BR><BR>On June 12, 2012, did you have a current Visa or a valid Green Card?
</div><div id='Q-3.1' name='Q-3.1' style='display:none;'>GOTO:2
</div><div id='Q-3.2' name='Q-3.2' style='display:none;'> Are you a current student or do you have a HS diploma or GED?
</div><div id='Q-3.2.1' name='Q-3.2.1' style='display:none;'> Have you ever had any interaction at all with law enforcement?
</div><div id='Q-3.2.1.1' name='Q-3.2.1.1' style='display:none;'> You may still be eligible for a DACA. <b>Please speak to an intake volunteer or attorney for further evaluation.</b>
</div><div id='Q-3.2.1.2' name='Q-3.2.1.2' style='display:none;'> Have you ever had any interaction at all with Immigration and Customs Enforcement (ICE)?
</div><div id='Q-3.2.1.2.1' name='Q-3.2.1.2.1' style='display:none;'>GOTO:3.2.1.1
</div><div id='Q-3.2.1.2.2' name='Q-3.2.1.2.2' style='display:none;'> You are eligible for DACA. Please schedule an appointment to complete your application.
</div><div id='Q-3.2.2' name='Q-3.2.2' style='display:none;'> You are not currently eligible, BUT you may be eligible if you enroll in a GED program.</div><div id='A-1.1' name='A-1.1' style='display:none;'> Yes
</div><div id='A-href-1.1' name='A-href-1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1' name='A-target-1.1' style='display:none;'></div><div id='X-1.1' name='X-1.1' style='display:none;'></div><div id='A-1.1.1' name='A-1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1' name='A-href-1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1' name='A-target-1.1.1' style='display:none;'></div><div id='X-1.1.1' name='X-1.1.1' style='display:none;'></div><div id='A-1.1.1.1' name='A-1.1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1.1' name='A-href-1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1' name='A-target-1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1' name='X-1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1' name='A-1.1.1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1.1.1' name='A-href-1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1' name='A-target-1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1' name='X-1.1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1.1' name='A-1.1.1.1.1.1' style='display:none;'> Yes
</div><div id='A-href-1.1.1.1.1.1' name='A-href-1.1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1' name='A-target-1.1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1.1' name='X-1.1.1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1.1.1' name='A-1.1.1.1.1.1.1' style='display:none;'> Yes.
</div><div id='A-href-1.1.1.1.1.1.1' name='A-href-1.1.1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1.1' name='A-target-1.1.1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1.1.1' name='X-1.1.1.1.1.1.1' style='display:none;'></div><div id='A-1.1.1.1.1.1.1.1' name='A-1.1.1.1.1.1.1.1' style='display:none;'><variable></div><div id='A-href-1.1.1.1.1.1.1.1' name='A-href-1.1.1.1.1.1.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1.1.1' name='A-target-1.1.1.1.1.1.1.1' style='display:none;'></div><div id='X-1.1.1.1.1.1.1.1' name='X-1.1.1.1.1.1.1.1' style='display:none;'>time</div><div id='A-1.1.1.1.1.1.2' name='A-1.1.1.1.1.1.2' style='display:none;'> No, I only left once.
</div><div id='A-href-1.1.1.1.1.1.2' name='A-href-1.1.1.1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.1.2' name='A-target-1.1.1.1.1.1.2' style='display:none;'></div><div id='X-1.1.1.1.1.1.2' name='X-1.1.1.1.1.1.2' style='display:none;'></div><div id='A-1.1.1.1.1.2' name='A-1.1.1.1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.1.1.1.2' name='A-href-1.1.1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.1.2' name='A-target-1.1.1.1.1.2' style='display:none;'></div><div id='X-1.1.1.1.1.2' name='X-1.1.1.1.1.2' style='display:none;'></div><div id='A-1.1.1.1.2' name='A-1.1.1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.1.1.2' name='A-href-1.1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.1.2' name='A-target-1.1.1.1.2' style='display:none;'></div><div id='X-1.1.1.1.2' name='X-1.1.1.1.2' style='display:none;'></div><div id='A-1.1.1.2' name='A-1.1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.1.2' name='A-href-1.1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.1.2' name='A-target-1.1.1.2' style='display:none;'></div><div id='X-1.1.1.2' name='X-1.1.1.2' style='display:none;'></div><div id='A-1.1.2' name='A-1.1.2' style='display:none;'> No
</div><div id='A-href-1.1.2' name='A-href-1.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.1.2' name='A-target-1.1.2' style='display:none;'></div><div id='X-1.1.2' name='X-1.1.2' style='display:none;'></div><div id='A-1.2' name='A-1.2' style='display:none;'> No
</div><div id='A-href-1.2' name='A-href-1.2' style='display:none;'>javascript:void('');</div><div id='A-target-1.2' name='A-target-1.2' style='display:none;'></div><div id='X-1.2' name='X-1.2' style='display:none;'></div><div id='A-3.1' name='A-3.1' style='display:none;'> Yes
</div><div id='A-href-3.1' name='A-href-3.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.1' name='A-target-3.1' style='display:none;'></div><div id='X-3.1' name='X-3.1' style='display:none;'></div><div id='A-3.2' name='A-3.2' style='display:none;'> No
</div><div id='A-href-3.2' name='A-href-3.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2' name='A-target-3.2' style='display:none;'></div><div id='X-3.2' name='X-3.2' style='display:none;'></div><div id='A-3.2.1' name='A-3.2.1' style='display:none;'> Yes
</div><div id='A-href-3.2.1' name='A-href-3.2.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1' name='A-target-3.2.1' style='display:none;'></div><div id='X-3.2.1' name='X-3.2.1' style='display:none;'></div><div id='A-3.2.1.1' name='A-3.2.1.1' style='display:none;'> Yes
</div><div id='A-href-3.2.1.1' name='A-href-3.2.1.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.1' name='A-target-3.2.1.1' style='display:none;'></div><div id='X-3.2.1.1' name='X-3.2.1.1' style='display:none;'></div><div id='A-3.2.1.2' name='A-3.2.1.2' style='display:none;'> No
</div><div id='A-href-3.2.1.2' name='A-href-3.2.1.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.2' name='A-target-3.2.1.2' style='display:none;'></div><div id='X-3.2.1.2' name='X-3.2.1.2' style='display:none;'></div><div id='A-3.2.1.2.1' name='A-3.2.1.2.1' style='display:none;'> Yes
</div><div id='A-href-3.2.1.2.1' name='A-href-3.2.1.2.1' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.2.1' name='A-target-3.2.1.2.1' style='display:none;'></div><div id='X-3.2.1.2.1' name='X-3.2.1.2.1' style='display:none;'></div><div id='A-3.2.1.2.2' name='A-3.2.1.2.2' style='display:none;'> No
</div><div id='A-href-3.2.1.2.2' name='A-href-3.2.1.2.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.1.2.2' name='A-target-3.2.1.2.2' style='display:none;'></div><div id='X-3.2.1.2.2' name='X-3.2.1.2.2' style='display:none;'></div><div id='A-3.2.2' name='A-3.2.2' style='display:none;'> No
</div><div id='A-href-3.2.2' name='A-href-3.2.2' style='display:none;'>javascript:void('');</div><div id='A-target-3.2.2' name='A-target-3.2.2' style='display:none;'></div><div id='X-3.2.2' name='X-3.2.2' style='display:none;'></div></textarea><textarea id="transcript" name="transcript" style="display:none;" disabled="disabled"></textarea><div style="float:left;width:100%;margin:15px 0 0px 0;border-top: solid 1px #ddd;"><div id=credits class=credits style="display:none;"><div class=credit_text><p><b> Law as Code</b></p><p> Adapted from <a href="https://mobile.twitter.com/margarethagan">@margarethagan</a>'s <a href="http://www.openlawlab.com/2014/05/22/graphic-legal-intake-form/">flowchart</a>.</p></div></div><p align=center><a href="javascript:void('');" onClick="shoh('credits');">credits</a> | <a href="http://www.qnamarkup.org/" target=_top>code your own</a></p></div></FORM><p><sup>†</sup>Adapted from <a href="https://mobile.twitter.com/margarethagan">@margarethagan</a>'s <a href="http://www.openlawlab.com/2014/05/22/graphic-legal-intake-form/">flowchart</a>. If you can codify a piece of your practice in a flowchart, you can build a bot. <a href="http://youtu.be/RVhzQ1JVi3s">Learn how (video)</a>. See also <a href="http://www.spacedrepetition.com/blog/how-a-law-student-used-legaltech-to-make-the-insanely-confusing-path-to-legal-immigration-insanely-simple-in-four-hours">How a Law Student Used #LegalTech to Make the "Insanely Confusing Path to Legal Immigration" Insanely Simple...in Four Hours</a>. <a href="https://www.mcsweeneys.net/articles/alright-fine-ill-add-a-disclaimer-to-my-emails">This is not legal advice.</a> </p>
</div></div>
<script type="text/javascript">
var QNum = 0;
var Qhtml = "";
var Dhtml = "";
var label = "";
var GOTOfired = 0;
$("#conversation input").on("keypress", 'form', function (e) {
var code = e.keyCode || e.which;
if (code == 13) {
e.preventDefault();
return false;
}
});
function answerQ(lb,restart) {
label = lb;
Dhtml = 'D-'+label;
Qhtml = 'Q-'+label;
var Ahtml = 'A-'+label;
var Jhtml = 'J-'+QNum;
var Xhtml = 'X-'+label;
var Xihtml = 'Xi-'+label;
var input_error = 0;
if (restart == undefined) {
var regexp = new RegExp("\<variable\>");
if (document.getElementById(Ahtml).innerHTML.match(regexp)) {
document.getElementById(Xihtml).value = document.getElementById(Xihtml).value.replace(/(^\s*|\s*$)/,"");
if (document.getElementById(Xihtml).value == "") {
input_error = "Your answer appears to be empty.";
} else {
document.getElementById(Xihtml).value = document.getElementById(Xihtml).value.replace(/</g,"<");
document.getElementById(Xihtml).value = document.getElementById(Xihtml).value.replace(/>/g,">");
}
}
}
if (input_error != 0) {
alert(input_error);
document.getElementById(Xihtml).focus();
} else {
if (restart == undefined) {
document.getElementById('QandA').innerHTML += "<div class='frame'><div class='full'><div class='ans_text'>"+document.getElementById(Ahtml).innerHTML+"</div></div><div class='ans_arrow'></div></div></div></div>";
// insert answer from button
if(document.getElementById(Ahtml).innerHTML != "") { document.getElementById('transcript').value += "USER: "+document.getElementById(Ahtml).innerHTML; }
if (document.getElementById('QandA').innerHTML.match(regexp)) {
var duplicatevars = new RegExp("id=\""+document.getElementById(Xhtml).innerHTML+"(.)*"+document.getElementById(Xhtml).innerHTML+"\"","g");
document.getElementById('QandA').innerHTML = document.getElementById('QandA').innerHTML.replace(duplicatevars, "");
document.getElementById('QandA').innerHTML = document.getElementById('QandA').innerHTML.replace(/\<variable\>(\<\/variable\>)?/, "<input type=hidden id=\""+document.getElementById(Xhtml).innerHTML+"\" name=\""+document.getElementById(Xhtml).innerHTML+"\" value=\""+document.getElementById(Xihtml).value+"\"/>"+document.getElementById(Xihtml).value);
document.getElementById('transcript').value = document.getElementById('transcript').value.replace(/\<variable\>(\<\/variable\>)?/, document.getElementById(Xihtml).value+"\n");
var thisvariable = new RegExp("<(X|x)>"+document.getElementById(Xhtml).innerHTML+"<\/(X|x)>","g");
document.getElementById('ondeck').innerHTML = document.getElementById('ondeck').innerHTML.replace(thisvariable, document.getElementById(document.getElementById(Xhtml).innerHTML).value);
document.getElementById('doc').innerHTML = document.getElementById('doc').innerHTML.replace(thisvariable, document.getElementById(document.getElementById(Xhtml).innerHTML).innerHTML);
console.log("thisvariable: "+thisvariable);
console.log("Variable name: "+document.getElementById(Xhtml).innerHTML);
console.log("Variable value: "+document.getElementById(document.getElementById(Xhtml).innerHTML).value);
}
document.getElementById('Choices').innerHTML = '';
setTimeout(function() {renderQnA(Qhtml,Jhtml,Dhtml,restart)}, 300);
} else {
document.getElementById('Choices').innerHTML = '';
renderQnA(Qhtml,Jhtml,Dhtml,restart);
}
}
}
function renderQnA(Qht,Jht,Dht,restar) {
Dhtml = Dht;
var GOTOfired = 0;
swapGOTO(Qht,Jht);
if (GOTOfired == 0) {
document.getElementById('QandA').innerHTML += "<div id="+Jht+" style=\"float:left;width:100%;height:1px;\"> </div>";
}
document.getElementById('QandA').innerHTML += "<div class='frame'><div class='full'><div class='question_text'>"+ document.getElementById(Qhtml).innerHTML+"</div></div><div class='question_arrow'></div></div>";
document.getElementById('QandA').innerHTML = document.getElementById('QandA').innerHTML.replace(/(\<br\>){2}/gi,"</div></div><div class='question_arrow'></div></div></div></div><div class='frame'><div class='full'><div class='question_text'>");
document.getElementById('QandA').innerHTML = document.getElementById('QandA').innerHTML.replace(/(\<br\> \<br\>)/gi,"<br><br>");
// add question
document.getElementById('transcript').value += "BOT: "+ document.getElementById(Qhtml).innerHTML;
document.getElementById('transcript').value = document.getElementById('transcript').value.replace(/(\<br\>){2}/gi,"\nBOT: ");
if (document.getElementById(Dhtml)) {
document.getElementById('doc').innerHTML += document.getElementById(Dhtml).innerHTML;
}
tmp = getElementsByIdRegExp("div", "A-"+label+"(\\.{1}\\d){1}$");
a_href = getElementsByIdRegExp("div", "A-href-"+label+"(\\.{1}\\d){1}$");
a_target = getElementsByIdRegExp("div", "A-target-"+label+"(\\.{1}\\d){1}$");
tmp_x = getElementsByIdRegExp("div", "X-"+label+"(\\.{1}\\d){1}$");
var Xishere = 0;
for ( var i = 0; i < tmp.length; i++ ) {
var nextlabel = tmp[i].id.substr(2);
var Xihtml = 'Xi-'+nextlabel;
var regexp = "\<variable\>";
var regexp_js = "^javascript:";
if (tmp[i].innerHTML.match(regexp)) {
document.getElementById('Choices').innerHTML += "<div class=\"xdiv\"><input type=\"text\" id=\""+Xihtml+"\" name=\""+Xihtml+"\" class=\"xinput\" onkeypress=\"{if (event.keyCode==13)answerQ('"+nextlabel+"')}\"/><a href=\"javascript:void('');\" class=\"xbutton\" onClick=\"answerQ('"+nextlabel+"');\"><span class=\"qpad\">Save above text as answer.</span></a></div>";
Xishere = Xihtml;
} else if (a_href[i].innerHTML.match(regexp_js) && a_href[i].innerHTML != "javascript:void('');") {
tmp[i].innerHTML = tmp[i].innerHTML.replace(/(\<br\>){2}/gi,"<br> <br>");
var script_call = a_href[i].innerHTML.replace(/^javascript:/gi,"");
document.getElementById('Choices').innerHTML += "<a href=\"javascript:void('');\" class=\"qabutton\" onClick=\"answerQ('"+nextlabel+"');"+script_call+"\" "+a_target[i].innerHTML+"><span class=\"qpad\">"+tmp[i].innerHTML+"</span></a>";
} else {
tmp[i].innerHTML = tmp[i].innerHTML.replace(/(\<br\>){2}/gi,"<br> <br>");
document.getElementById('Choices').innerHTML += "<a href=\""+a_href[i].innerHTML+"\" class=\"qabutton\" onClick=\"answerQ('"+nextlabel+"');\" "+a_target[i].innerHTML+"><span class=\"qpad\">"+tmp[i].innerHTML+"</span></a>";
}
}
if (restar == undefined) {
document.getElementById('Choices').innerHTML += "<a href=\"javascript:void('');\" class=\"qabutton\" onClick=\"startAT('1');\"><span class=\"qpad\">Start over.</span></a>";
}
if (QNum != 0) {
scroll2Q(Jht);
} else if (restar != undefined) {
window.scrollTo(0,0);
}
if (Xishere != 0 && window.self == window.top) {
console.log("Set focus for: "+Xishere);
document.getElementById(Xishere).focus();
}
console.log("Q#: "+QNum);
QNum++;
}
function swapGOTO(QH,JH) {
var regex = new RegExp("GOTO:(\d*)(\.\d+)*");
if (regex.test(document.getElementById(QH).innerHTML)) {
var Qtext = document.getElementById(QH).innerHTML.match(/(GOTO:(\d*)(.\s*\d+)*)/);
document.getElementById('QandA').innerHTML += "<div id="+JH+" style=\"float:left;width:100%;height:1px;\"> </div>";
// Add question
// note I added () around the < to avoid a < followed by a ? which causes problems in php
var Qtexttrans = document.getElementById(QH).innerHTML.replace(/(<)?GOTO:(\d*)(.\s*\d+)*>?/,"");
Qtexttrans = Qtexttrans.replace(/\s*$/,"");
if (Qtexttrans != "") {
document.getElementById('transcript').value += "BOT: "+Qtexttrans+"\n";
}
if (document.getElementById(QH).innerHTML.match(/^GOTO:(\d*)(.\s*\d+)*/)) {
document.getElementById('QandA').innerHTML += document.getElementById(QH).innerHTML.replace(/(<)?GOTO:(\d*)(.\s*\d+)*>?/,"<"+Qtext+">");
} else {
document.getElementById('QandA').innerHTML += "<div class='frame'><div class='full'><div class='question_text'>"+ document.getElementById(QH).innerHTML.replace(/(<)?GOTO:(\d*)(.\s*\d+)*>?/,"<"+Qtext+">")+"</div></div><div class='question_arrow'></div></div>";
}
// replace GOTO with text
label = Qtext[0].replace("GOTO:","");
Qhtml = 'Q-'+label;
if (document.getElementById(Dhtml)) {
document.getElementById('doc').innerHTML += document.getElementById(Dhtml).innerHTML;
}
Dhtml = 'D-'+label;
GOTOfired = 1;
swapGOTO(Qhtml,JH);
}
}
function scroll2Q(id) {
var top = document.getElementById(id).offsetTop; //Getting Y of target element
console.log("Jump to Y for ("+id+"): "+top);
//adapted from https://github.com/Yappli/smooth-scroll
var speed = 800;
var moving_frequency = 5; // Affects performance !
var hop_count = speed/moving_frequency
var getScrollTopDocumentAtBegin = document.documentElement.scrollTop + document.body.scrollTop;
var gap = (top - getScrollTopDocumentAtBegin) / hop_count;
for(var i = 1; i <= hop_count; i++)
{
(function()
{
var hop_top_position = gap*i;
setTimeout(function(){ window.scrollTo(0, hop_top_position + getScrollTopDocumentAtBegin); }, moving_frequency*i);
})();
}
}
function getElementsByIdIs(selectorTag, name) {
var items = [];
var myPosts = document.getElementsByTagName(selectorTag);
//omitting undefined null check for brevity
if (myPosts[0].id == name) {
items.push(myPosts[0]);
}
return items;
}
function getElementsByIdRegExp(selectorTag, expression) {
// note you need to escape \ in the expression with \, i.e., \\ = \
var regex = new RegExp(expression);
var items = [];
var myPosts = document.getElementsByTagName(selectorTag);
for (var i = 0; i < myPosts.length; i++) {
if (regex.test(myPosts[i].id)) {
items.push(myPosts[i]);
}
}
return items;
}
// startAT QnA
function startAT(id) {
document.getElementById('ondeck').innerHTML = document.getElementById('original').value;
document.getElementById('QandA').innerHTML = "";
document.getElementById('transcript').value = "";
QNum = 0;
answerQ(id,'1');
}
//show funtion
function show(id) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(id).style.display = 'block';
} else {
if (document.layers) {
document.id.display = 'block';
} else {
document.all.id.style.display = 'block';
}
}
}
//hide funtion
function hide(id) {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById(id).style.display = 'none';
} else {
if (document.layers) {
document.id.display = 'none';
} else {
document.all.id.style.display = 'none';
}
}
}
//show OR hide funtion depends on if element is shown or hidden
function shoh(id) {
if (document.getElementById) { // DOM3 = IE5, NS6
if (document.getElementById(id).style.display == "none"){
document.getElementById(id).style.display = 'block';
} else {
document.getElementById(id).style.display = 'none';
}
} else {
if (document.layers) {
if (document.id.display == "none"){
document.id.display = 'block';
} else {
document.id.display = 'none';
}
} else {
if (document.all.id.style.visibility == "none"){
document.all.id.style.display = 'block';
} else {
document.all.id.style.display = 'none';
}
}
}
}
function transcript(output) {
if (output == 1) {
return document.getElementById('transcript').value;
} else {
var output = document.getElementById('transcript').value.replace(/<[^>]*>/g,"");
return output;
}
}
function doc() {
return document.getElementById('doc').innerHTML;
}
function mail2(to,subject,body) {
to = encodeURIComponent(to);
subject = encodeURIComponent(subject);
body = encodeURIComponent(body);
window.location.href = "mailto:"+to+"?subject="+subject+"&body="+body;
}
function submit2(action,method,docAs,instructions,transcriptAs) {
document.FORM.action = action;
document.FORM.method = method;
if (docAs) {
var doctext = document.createElement("textarea");
doctext.style.display ='none';
doctext.name= docAs;
doctext.value= document.getElementById('doc').innerHTML;
document.getElementById('FORM').appendChild(doctext);
if (instructions) {
var instructtext = document.createElement("textarea");
instructtext.type='hidden';
instructtext.style.display ='none';
instructtext.name= 'i';
instructtext.value= instructions;
document.getElementById('FORM').appendChild(instructtext);
}
}
if (transcriptAs) {
var ttext = document.createElement("textarea");
ttext.type='hidden';
ttext.style.display ='none';
ttext.name= transcriptAs;
ttext.value= document.getElementById('transcript').value;
document.getElementById('FORM').appendChild(ttext);
}
document.getElementById('ondeck').innerHTML = "";
document.FORM.submit();
}
// h/t http://runnable.com/U5HC9xtufQpsu5aj/use-javascript-to-save-textarea-as-a-txt-file
function save2(filename,content)
{
// I'm using file system support as a proxy for support for this feature.
// Check based on one found at: http://blog.teamtreehouse.com/building-an-html5-text-editor-with-the-filesystem-apis
// Handle vendor prefixes.
window.requestFileSystem = window.requestFileSystem ||
window.webkitRequestFileSystem;
// Check for support.
if (window.requestFileSystem) {
// content = ID of textarea to save
// name = name to save file as, including file extension
// grab the content of the form field and place it into a variable
// var textToWrite = document.getElementById(content).value;
// create a new Blob (html5 magic) that conatins the data from your form feild
var textFileAsBlob = new Blob([content], {type:'text/plain'});
// Specify the name of the file to be saved
var fileNamecontentAs = filename;
// Optionally allow the user to choose a file name by providing
// an imput field in the HTML and using the collected data here
// var fileNamecontentAs = txtFileName.text;
// create a link for our script to 'click'
var downloadLink = document.createElement("a");
// supply the name of the file (from the var above).
// you could create the name here but using a var
// allows more flexability later.
downloadLink.download = fileNamecontentAs;
// provide text for the link. This will be hidden so you
// can actually use anything you want.
downloadLink.innerHTML = "My Hidden Link";
// allow our code to work in webkit & Gecko based browsers
// without the need for a if / else block.
window.URL = window.URL || window.webkitURL;
// Create the link Object.
downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
// when link is clicked call a function to remove it from
// the DOM in case user wants to save a second file.
downloadLink.onclick = destroyClickedElement;
// make sure the link is hidden.
downloadLink.style.display = "none";
// add the link to the DOM
document.body.appendChild(downloadLink);
// click the new link
downloadLink.click();
} else {
alert('This feature is not supported by your browser.');
}
}
function destroyClickedElement(event)
{
// remove the link from the DOM
document.body.removeChild(event.target);
}
// EOF
</script></BODY>
</HTML>