-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilterX.html
More file actions
772 lines (648 loc) · 29.7 KB
/
filterX.html
File metadata and controls
772 lines (648 loc) · 29.7 KB
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
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Series Spectral Analyzer</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
overflow: hidden;
}
.header {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
color: white;
padding: 30px;
text-align: center;
}
.header h1 {
font-size: 2.5rem;
margin-bottom: 10px;
font-weight: 700;
}
.header p {
font-size: 1.1rem;
opacity: 0.9;
}
.main-content {
padding: 40px;
}
.input-section {
background: #f8fafc;
border-radius: 15px;
padding: 30px;
margin-bottom: 30px;
border: 2px solid #e2e8f0;
}
.section-title {
font-size: 1.5rem;
color: #2d3748;
margin-bottom: 20px;
font-weight: 600;
}
.form-group {
margin-bottom: 25px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #4a5568;
}
textarea {
width: 100%;
height: 120px;
padding: 15px;
border: 2px solid #e2e8f0;
border-radius: 10px;
font-family: 'Courier New', monospace;
font-size: 14px;
resize: vertical;
transition: border-color 0.3s ease;
}
textarea:focus {
outline: none;
border-color: #4facfe;
box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}
input[type="number"], select {
width: 100%;
padding: 12px 15px;
border: 2px solid #e2e8f0;
border-radius: 10px;
font-size: 16px;
transition: border-color 0.3s ease;
}
input[type="number"]:focus, select:focus {
outline: none;
border-color: #4facfe;
box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}
.filter-controls {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 20px;
margin-top: 15px;
}
.button-group {
display: flex;
gap: 15px;
margin-top: 30px;
}
button {
padding: 15px 30px;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
flex: 1;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}
.btn-secondary {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white;
}
.btn-secondary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}
.btn-success {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
color: white;
}
.btn-success:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}
.results-section {
margin-top: 40px;
}
.chart-container {
background: white;
border-radius: 15px;
padding: 30px;
margin-bottom: 30px;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
border: 2px solid #e2e8f0;
}
.chart-title {
font-size: 1.3rem;
color: #2d3748;
margin-bottom: 20px;
font-weight: 600;
text-align: center;
}
.info-box {
background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
border-left: 5px solid #f6ad55;
}
.info-box h3 {
color: #744210;
margin-bottom: 10px;
}
.info-box p {
color: #744210;
line-height: 1.6;
}
.hidden {
display: none;
}
@media (max-width: 768px) {
.filter-controls {
grid-template-columns: 1fr;
}
.button-group {
flex-direction: column;
}
.header h1 {
font-size: 2rem;
}
.main-content {
padding: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>🔬 Time Series Spectral Analyzer</h1>
<p>Advanced filtering and spectral analysis for your time series data by Claudio Iturra</p>
</div>
<div class="main-content">
<div class="input-section">
<h2 class="section-title">📊 Data Input</h2>
<div class="form-group">
<label for="timeSeriesData">Time Series Data (one value per line):</label>
<textarea id="timeSeriesData" placeholder="Enter your time series data here, one value per line:
1.2
1.5
1.8
2.1
1.9
1.6
..."></textarea>
<button type="button" class="btn-secondary" onclick="loadSampleData()" style="margin-top: 10px; width: auto; padding: 8px 16px;">📊 Load Sample 30-Day Data</button>
</div>
<div class="form-group">
<label for="samplingRate">Sampling Resolution (hours):</label>
<input type="number" id="samplingRate" value="1" min="0.1" step="0.1">
</div>
<div class="form-group">
<label for="filterType">Filter Type:</label>
<select id="filterType">
<option value="none">No Filter</option>
<option value="lowpass">Low Pass</option>
<option value="highpass">High Pass</option>
<option value="bandpass">Band Pass</option>
</select>
<div class="filter-controls">
<div>
<label for="lowCutoff">Low Cutoff (hours):</label>
<input type="number" id="lowCutoff" value="10" min="0.1" step="0.1">
</div>
<div>
<label for="highCutoff">High Cutoff (hours):</label>
<input type="number" id="highCutoff" value="24" min="0.1" step="0.1">
</div>
<div>
<label for="filterOrder">Filter Order:</label>
<input type="number" id="filterOrder" value="4" min="1" max="10">
</div>
</div>
</div>
<div class="button-group">
<button class="btn-primary" onclick="processTimeSeries()">🔄 Process & Filter</button>
<button class="btn-secondary" onclick="generateSpectrum()">📈 Generate Spectrum</button>
<button class="btn-success" onclick="downloadResults()">💾 Download Results</button>
</div>
</div>
<div class="info-box">
<h3>💡 How to Use:</h3>
<p>1. Paste your time series data (one value per line) • 2. Set your sampling resolution in hours • 3. Choose a filter type and parameters • 4. Click "Process & Filter" to see filtered data • 5. Click "Generate Spectrum" for frequency analysis • 6. Download your results as CSV files</p>
</div>
<div id="resultsSection" class="results-section hidden">
<div class="chart-container">
<h3 class="chart-title">📊 Original vs Filtered Time Series</h3>
<canvas id="timeSeriesChart"></canvas>
</div>
<div class="chart-container">
<h3 class="chart-title">🌊 Power Spectral Density</h3>
<canvas id="spectrumChart"></canvas>
</div>
</div>
</div>
</div>
<script>
let originalData = [];
let filteredData = [];
let frequencies = [];
let powerSpectrum = [];
let timeSeriesChart = null;
let spectrumChart = null;
function parseTimeSeriesData() {
const input = document.getElementById('timeSeriesData').value.trim();
if (!input) {
alert('Please enter time series data');
return false;
}
const lines = input.split('\n');
originalData = [];
for (let line of lines) {
const value = parseFloat(line.trim());
if (!isNaN(value)) {
originalData.push(value);
}
}
if (originalData.length < 4) {
alert('Please provide at least 4 data points');
return false;
}
return true;
}
function applyFilter(data, filterType, samplingRate, lowCutoff, highCutoff, order) {
if (filterType === 'none') {
return [...data];
}
let filtered = [...data];
if (filterType === 'lowpass') {
// Low-pass filter: keep frequencies with periods longer than highCutoff hours
// Window size should be proportional to the cutoff period
const windowSize = Math.max(3, Math.round(highCutoff / samplingRate));
filtered = applyMovingAverage(data, windowSize);
// Apply multiple passes for higher order (each pass increases attenuation)
for (let pass = 1; pass < order; pass++) {
filtered = applyMovingAverage(filtered, windowSize);
}
} else if (filterType === 'highpass') {
// High-pass filter: remove frequencies with periods longer than lowCutoff hours
// Window size should be proportional to the cutoff period
const windowSize = Math.max(5, Math.round(lowCutoff / samplingRate));
let smoothed = applyMovingAverage(data, windowSize);
// Apply multiple passes for smoother low-frequency component removal
for (let pass = 1; pass < order; pass++) {
smoothed = applyMovingAverage(smoothed, windowSize);
}
// Subtract the low-frequency component to get high-frequency component
filtered = data.map((val, i) => val - smoothed[i]);
} else if (filterType === 'bandpass') {
// Band-pass: keep frequencies with periods between lowCutoff and highCutoff hours
// First apply high-pass to remove long periods (> lowCutoff)
const highPassWindowSize = Math.max(5, Math.round(lowCutoff / samplingRate));
let smoothedLow = applyMovingAverage(data, highPassWindowSize);
for (let pass = 1; pass < order; pass++) {
smoothedLow = applyMovingAverage(smoothedLow, highPassWindowSize);
}
let highPassed = data.map((val, i) => val - smoothedLow[i]);
// Then apply low-pass to remove short periods (< highCutoff)
const lowPassWindowSize = Math.max(3, Math.round(highCutoff / samplingRate));
filtered = applyMovingAverage(highPassed, lowPassWindowSize);
for (let pass = 1; pass < order; pass++) {
filtered = applyMovingAverage(filtered, lowPassWindowSize);
}
}
return filtered;
}
function applyMovingAverage(data, windowSize) {
const result = [];
for (let i = 0; i < data.length; i++) {
let sum = 0;
let count = 0;
for (let j = Math.max(0, i - Math.floor(windowSize/2));
j <= Math.min(data.length - 1, i + Math.floor(windowSize/2)); j++) {
sum += data[j];
count++;
}
result.push(sum / count);
}
return result;
}
function computeFFT(data, samplingRate) {
// Remove DC component (mean)
const mean = data.reduce((sum, val) => sum + val, 0) / data.length;
const centeredData = data.map(val => val - mean);
// Apply window function (Hanning window)
const windowedData = centeredData.map((val, i) => {
const window = 0.5 * (1 - Math.cos(2 * Math.PI * i / (data.length - 1)));
return val * window;
});
// Pad data to next power of 2 for efficient FFT
const n = Math.pow(2, Math.ceil(Math.log2(windowedData.length)));
const paddedData = [...windowedData];
while (paddedData.length < n) {
paddedData.push(0);
}
// Simple DFT implementation (since FFT.js might not be available)
const power = [];
const frequencies = [];
for (let k = 0; k < Math.floor(n/2); k++) {
let realSum = 0;
let imagSum = 0;
for (let j = 0; j < paddedData.length; j++) {
const angle = -2 * Math.PI * k * j / n;
realSum += paddedData[j] * Math.cos(angle);
imagSum += paddedData[j] * Math.sin(angle);
}
// Power spectral density
const magnitude = Math.sqrt(realSum * realSum + imagSum * imagSum);
power.push(magnitude * magnitude / n);
// Frequency in cycles per hour
frequencies.push(k / (n * samplingRate));
}
return { power, frequencies };
}
function processTimeSeries() {
if (!parseTimeSeriesData()) return;
const filterType = document.getElementById('filterType').value;
const samplingRate = parseFloat(document.getElementById('samplingRate').value);
const lowCutoff = parseFloat(document.getElementById('lowCutoff').value);
const highCutoff = parseFloat(document.getElementById('highCutoff').value);
const filterOrder = parseInt(document.getElementById('filterOrder').value);
// Apply filter
filteredData = applyFilter(originalData, filterType, samplingRate, lowCutoff, highCutoff, filterOrder);
// Show results
document.getElementById('resultsSection').classList.remove('hidden');
// Create time series chart
createTimeSeriesChart();
}
function generateSpectrum() {
if (originalData.length === 0) {
alert('Please load time series data first');
return;
}
const samplingRate = parseFloat(document.getElementById('samplingRate').value);
// Compute FFT for original data
const originalResult = computeFFT(originalData, samplingRate);
// Compute FFT for filtered data (if available)
let filteredResult = null;
if (filteredData.length > 0) {
filteredResult = computeFFT(filteredData, samplingRate);
}
// Store results
powerSpectrum = originalResult.power;
frequencies = originalResult.frequencies;
// Create spectrum chart with both datasets
createSpectrumChart(originalResult, filteredResult);
}
function createTimeSeriesChart() {
const ctx = document.getElementById('timeSeriesChart').getContext('2d');
if (timeSeriesChart) {
timeSeriesChart.destroy();
}
const samplingRate = parseFloat(document.getElementById('samplingRate').value);
const timePoints = originalData.map((_, i) => i * samplingRate);
timeSeriesChart = new Chart(ctx, {
type: 'line',
data: {
labels: timePoints,
datasets: [{
label: 'Original Data',
data: originalData,
borderColor: '#667eea',
backgroundColor: 'rgba(102, 126, 234, 0.1)',
borderWidth: 2,
fill: false,
tension: 0.1
}, {
label: 'Filtered Data',
data: filteredData,
borderColor: '#f093fb',
backgroundColor: 'rgba(240, 147, 251, 0.1)',
borderWidth: 2,
fill: false,
tension: 0.1
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
}
},
scales: {
x: {
display: true,
title: {
display: true,
text: 'Time (hours)'
}
},
y: {
display: true,
title: {
display: true,
text: 'Amplitude'
}
}
}
}
});
}
function createSpectrumChart(originalResult, filteredResult) {
const ctx = document.getElementById('spectrumChart').getContext('2d');
if (spectrumChart) {
spectrumChart.destroy();
}
// Prepare datasets array
const datasets = [];
// Original data spectrum
const originalFreqs = originalResult.frequencies.slice(1).filter(f => f > 0);
const originalPower = originalResult.power.slice(1, originalFreqs.length + 1);
const originalPeriods = originalFreqs.map(f => 1/f);
const originalChartData = originalPeriods.map((period, i) => ({
x: period,
y: originalPower[i]
})).filter(point => point.y > 0 && point.x > 0);
datasets.push({
label: 'Original Data Spectrum',
data: originalChartData,
borderColor: '#667eea',
backgroundColor: 'rgba(102, 126, 234, 0.6)',
borderWidth: 2,
pointRadius: 1.5,
showLine: true,
tension: 0.1
});
// Filtered data spectrum (if available)
if (filteredResult) {
const filteredFreqs = filteredResult.frequencies.slice(1).filter(f => f > 0);
const filteredPower = filteredResult.power.slice(1, filteredFreqs.length + 1);
const filteredPeriods = filteredFreqs.map(f => 1/f);
const filteredChartData = filteredPeriods.map((period, i) => ({
x: period,
y: filteredPower[i]
})).filter(point => point.y > 0 && point.x > 0);
datasets.push({
label: 'Filtered Data Spectrum',
data: filteredChartData,
borderColor: '#f093fb',
backgroundColor: 'rgba(240, 147, 251, 0.6)',
borderWidth: 2,
pointRadius: 1.5,
showLine: true,
tension: 0.1
});
}
// Find min/max for axes
const allPeriods = originalPeriods.concat(filteredResult ? filteredResult.frequencies.slice(1).filter(f => f > 0).map(f => 1/f) : []);
const allPowers = originalPower.concat(filteredResult ? filteredResult.power.slice(1, filteredResult.frequencies.length) : []);
spectrumChart = new Chart(ctx, {
type: 'scatter',
data: {
datasets: datasets
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
}
},
scales: {
x: {
type: 'logarithmic',
display: true,
title: {
display: true,
text: 'Period (hours)'
},
min: Math.max(1, Math.min(...allPeriods.filter(p => p > 0))),
max: Math.max(...allPeriods.filter(p => p > 0))
},
y: {
type: 'logarithmic',
display: true,
title: {
display: true,
text: 'Power'
},
min: Math.min(...allPowers.filter(p => p > 0)) * 0.1
}
}
}
});
}
function downloadResults() {
if (originalData.length === 0) {
alert('No data to download. Please process time series first.');
return;
}
// Download filtered time series
let csvContent = "Time (hours),Original Data,Filtered Data\n";
const samplingRate = parseFloat(document.getElementById('samplingRate').value);
for (let i = 0; i < originalData.length; i++) {
const time = i * samplingRate;
const filtered = filteredData[i] || '';
csvContent += `${time},${originalData[i]},${filtered}\n`;
}
downloadCSV(csvContent, 'filtered_time_series.csv');
// Download spectrum if available
if (powerSpectrum.length > 0) {
// Download original spectrum
let originalSpectrumCSV = "Frequency (1/hours),Period (hours),Original_Power\n";
for (let i = 1; i < frequencies.length; i++) {
const freq = frequencies[i];
const period = freq > 0 ? 1/freq : 0;
originalSpectrumCSV += `${freq},${period},${powerSpectrum[i]}\n`;
}
downloadCSV(originalSpectrumCSV, 'original_spectrum.csv');
// Download filtered spectrum if available
if (filteredData.length > 0) {
const samplingRate = parseFloat(document.getElementById('samplingRate').value);
const filteredResult = computeFFT(filteredData, samplingRate);
let filteredSpectrumCSV = "Frequency (1/hours),Period (hours),Filtered_Power\n";
for (let i = 1; i < filteredResult.frequencies.length; i++) {
const freq = filteredResult.frequencies[i];
const period = freq > 0 ? 1/freq : 0;
filteredSpectrumCSV += `${freq},${period},${filteredResult.power[i]}\n`;
}
downloadCSV(filteredSpectrumCSV, 'filtered_spectrum.csv');
}
}
}
function downloadCSV(content, filename) {
const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' });
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.setAttribute('href', url);
link.setAttribute('download', filename);
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
// Update filter controls based on filter type
document.getElementById('filterType').addEventListener('change', function() {
const filterType = this.value;
const controls = document.querySelectorAll('.filter-controls input');
controls.forEach(control => {
control.disabled = filterType === 'none';
});
if (filterType === 'lowpass') {
document.getElementById('lowCutoff').disabled = true;
} else if (filterType === 'highpass') {
document.getElementById('highCutoff').disabled = true;
}
});
function loadSampleData() {
// Generate 30 days of hourly data (720 points)
const hours = 30 * 24; // 720 hours
let sampleData = [];
for (let i = 0; i < hours; i++) {
// Create a signal with STRONG 12-hour and 24-hour frequency components:
// 1. STRONG Daily cycle (24-hour period) - Primary component
const dailyCycle = 5 * Math.sin(2 * Math.PI * i / 24 + Math.PI/4);
// 2. STRONG Semi-daily cycle (12-hour period) - Secondary component
const semiDaily = 4 * Math.sin(2 * Math.PI * i / 12);
// 3. Weak weekly cycle (168-hour period) - Background
const weeklyCycle = 0.5 * Math.sin(2 * Math.PI * i / 168);
// 4. Small trend component
const trend = 0.005 * i;
// 5. Reduced random noise to make frequencies more visible
const noise = 0.3 * (Math.random() - 0.5);
// 6. Small higher frequency components (6-hour and 8-hour cycles)
const highFreq = 0.2 * Math.sin(2 * Math.PI * i / 6) + 0.15 * Math.sin(2 * Math.PI * i / 8);
// Combine all components with emphasis on 12h and 24h cycles
const value = 15 + dailyCycle + semiDaily + weeklyCycle + trend + noise + highFreq;
sampleData.push(value.toFixed(3));
}
// Load into textarea
document.getElementById('timeSeriesData').value = sampleData.join('\n');
// Set appropriate sampling rate
document.getElementById('samplingRate').value = '1';
alert('Sample 30-day hourly time series loaded! This data has STRONG 12-hour and 24-hour frequency components for clear spectral analysis.');
}
// Initialize
document.getElementById('filterType').dispatchEvent(new Event('change'));
</script>
<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'971a775a010188b2',t:'MTc1NTYxNTA1Ny4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>
</html>