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
|
// fullwin1.js
// CONSTRUCTOR FUNCTION TO CREATE FULLWIN OBJECT
function _fullWin_object ( win_url, win_name, win_ref, win_features )
{
this.win_url = win_url;
this.win_name = win_name;
this.win_ref = win_ref;
this.win_features = win_features;
}
// DECLARE SCRIPTS ARRAY
var _fullWin = new Array;
function _fullWindow(winURL) {
var winName = replaceBadCharacters(winURL);
var linkID = "";
if (_fullWindow.arguments.length > 1 && _fullWindow.arguments[1].length > 0) {
linkID = _fullWindow.arguments[1];
winName += linkID;
}
// MAKE ROBUST FUNCTION - TEST ARGUMENTS FIRST
if (_fullWindow.arguments.length < 1) {
alert ( "\nPage Scripting Error!\nInvalid number of arguments passed to 'full_window' function.\n" );
return(false);
} else if ( typeof ( winName ) != "string" || winName.length < 2) {
alert ( "\nPage Scripting Error!\nInvalid 'targetName' string passed to 'full_window' function.\n" );
return (false);
}
var win_num = _fullWin.length;
var found = false;
for (var num=0; num<_fullWin.length; num++) {
if ( winURL==_fullWin[num].win_url && winName==_fullWin[num].win_name) {
win_num = num;
found = true;
break;
}
}
if (!found) {
_fullWin[win_num] = new _fullWin_object (
winURL,
winName,
null,
"" );
}
var fw = _fullWin[win_num];
// IF FULL WINDOW IS ALREADY OPEN
if (remoteWindowOpen(fw.win_ref)) {
// BRING EXISTING WINDOW TO TOP
fw.win_ref.focus ();
return(remoteWindowOpen(fw.win_ref));
}
fw.win_features = full_window_features ();
var win_ref = window.open(fw.win_url,fw.win_name,fw.win_features);
fw.win_ref = win_ref;
if (remoteWindowOpen(fw.win_ref)) {
fw.win_ref.focus ();
}
var retCode = remoteWindowOpen(fw.win_ref);
// alert(retCode);
return(retCode);
}
function replaceBadCharacters(string) {
// CONVERT STRING TO UPPER CASE
string = string.toUpperCase();
// REMOVE COMMON EXTENSION FROM END OF FILENAME
string = string.replace(/.htm|.html$|.shtml|.asp/i,"");
// REMOVE PROTOCOL FROM BEGINNING OF URL
// string = string.replace(/^http:\/\/www.|http:\/\//i,"");
// REMOVE ALL BAD CHARACTERS FROM REMAINING STRING
string = string.replace(/\/|:|\+|-|\.|_| |=|#|%|\?|\&|,/ig,"");
// REDUCE LENGTH OF STRING TO 12
string = string.substr(string.length-12,12);
return(string);
}
function full_window_features ()
{
var featuresList = "directories=yes";
if ( navigator.userAgent.indexOf ( "Opera" ) > -1 ) {
featuresList += ",top=0"; // doesn't WORK
featuresList += ",left=0"; // doesn't WORK
featuresList += ",height=" + screen.availHeight;
featuresList += ",width=" + screen.availWidth;
} else if ( navigator.userAgent.indexOf ( "Gecko" ) > -1 ) {
featuresList += ",top=" + screen.availTop;
featuresList += ",left=" + screen.availLeft;
featuresList += ",height=" + ( screen.availHeight - 144 );
featuresList += ",width=" + ( screen.availWidth - 7 );
} else if ( document.all ) {
featuresList += ",top=" + parseInt(screen.availTop,10);
featuresList += ",left=" + parseInt(screen.availLeft,10);
featuresList += ",height=" + screen.availHeight;
featuresList += ",width=" + screen.availWidth;
} else if ( document.layers ) {
featuresList += ",top=" + screen.availTop;
featuresList += ",left=" + screen.availLeft;
featuresList += ",height=" + ( screen.availHeight - 157 );
featuresList += ",width=" + ( screen.availWidth - 11 );
} else if ( navigator.javaEnabled () ) {
var toolkit = java.awt.Toolkit.getDefaultToolkit ();
var screen_size = toolkit.getScreenSize ();
featuresList += ",width=" + ( screen_size.width - 13 );
featuresList += ",height=" + ( screen_size.height - 194 );
} else if ( typeof ( screen ) == "object" ) {
featuresList += ",top=" + screen.availTop;
featuresList += ",left=" + screen.availLeft;
featuresList += ",height=" + screen.availHeight;
featuresList += ",width=" + screen.availWidth;
}
featuresList += ",location=1";
featuresList += ",menubar=1";
featuresList += ",scrollbars=1";
featuresList += ",status=1";
featuresList += ",toolbar=1";
featuresList += ",resizable=1";
featuresList += ",fullscreen=0";
return(featuresList);
}
// CROSS PLATFORM, BOOLEAN, ERROR FREE TEST TO CHECK IF REMOTE WINDOW IS OPEN
function remoteWindowOpen(window_reference) {
if (window_reference !== null && window_reference.closed === false) {
return(true);
}
return(false);
}
//=================================================================================
function getMe() {
var prot = '\x6D' + '\x61\x69\x6C' + '\x74\x6F';
var addr = "\x48\x61d\x6Cey\x47\x40\x77eb\x2D\x77\x69se\x2D\x77\x69zard\x2E\x63\x6F\x6D";
var htmstr = '<div> </div><div class="mailLink">';
htmstr += 'E\x6D\x61il: <a href="' + prot + '\x3A' + addr + '">' + addr + '</a></div>';
document.write(htmstr);
}
//=================================================================================
// themes.js
//=================================================================================
var pathName = location.pathname.replace(/\\/g,"/");
var siteIndex = false;
if (pathName == "/" || pathName.match(/\/www\/index.html$/i)) {
siteIndex = true;
} else if (pathName == "/~webwisew/") {
siteIndex = true;
} else if (pathName == "/webmaste/www/") {
siteIndex = true;
}
var imgObj = new Array();
var imgArr = new Array();
var imgArray = new Array (
"line-horz-1.gif",
"line-horz-2.gif",
"line-horz-3.gif",
"line-horz-4.gif",
"theme-back.jpg",
"deadlink-back.gif",
"hoverlink-back.gif" );
function preloadThemeImages(skinNo) {
if (skinNo < 1 || skinNo > 6) {
return;
}
var skinStr = "0" + skinNo;
var preFix = (siteIndex) ? "" : "../";
var imgPath = preFix + "images/skin-" + skinStr + "/";
for (var count=0; count<imgArray.length; count++) {
imgObj[count] = new Image();
imgObj[count].src = imgPath + imgArray[count];
}
}
var maxTheme = 6;
var _startTheme = _endTheme = 0;
function preloadOtherImages() {
var skinStr, imgPath, arrayNum = -1;
for (var skin=1; skin<7; skin++) {
if (skin == _startTheme) {
continue;
}
skinStr = "0" + skin;
var preFix = (siteIndex) ? "" : "../";
imgPath = preFix + "images/skin-" + skinStr + "/";
if (siteIndex) {
imgPath = imgPath.replace(/^..\//,"");
}
arrayNum ++;
imgArr[arrayNum] = new Array();
for (var count=0; count<imgArray.length; count++) {
imgArr[arrayNum][count] = new Image();
imgArr[arrayNum][count].src = imgPath + imgArray[count];
}
}
}
// window.onload=preloadOtherImages
//=================================================================================
var ssCookieName = "colorSelected";
var ssCookieDays = 10;
var ssCookieValue = 1;
function setInitialStyles() {
if (retroBrowser()) {
return;
}
ssCookieValue = readCookie(ssCookieName);
ssCookieValue = (ssCookieValue<1 || ssCookieValue>maxTheme) ? 1 : ssCookieValue;
_startTheme = _endTheme = ssCookieValue;
if (navigator.appName.match(/^Microsoft/i)) {
preloadThemeImages(ssCookieValue);
switchStyleSheetMicrosoft(ssCookieValue);
} else if (navigator.appName.match(/^Netscape/i)) {
preloadThemeImages(ssCookieValue);
switchStyleSheetGecko(ssCookieValue);
}
}
function changeScheme(toNum) {
if (retroBrowser()) {
return;
}
if (navigator.appName.match(/^Microsoft/i)) {
preloadThemeImages(toNum);
switchStyleSheetMicrosoft(toNum);
} else if (navigator.appName.match(/^Netscape/i)) {
preloadThemeImages(toNum);
switchStyleSheetGecko(toNum);
}
ssCookieValue = toNum;
createCookie(ssCookieName,ssCookieValue,ssCookieDays);
_endTheme = toNum;
}
function retroBrowser () {
if (document.layers) {
return(true);
} else if (navigator.userAgent.match(/Opera/ig)) {
return(true);
} else if (navigator.userAgent.match(/Safari/ig)) {
return(true);
}
return(false);
}
function switchStyleSheetMicrosoft(toNum) {
var preFix = (siteIndex) ? "" : "../";
if (document.styleSheets[0].href !== null) {
document.styleSheets[0].href = preFix + "css/www-theme-" + toNum + ".css";
}
}
function switchStyleSheetGecko(toNum) {
var linkTag, linkTitle = "skin" + toNum;
var linksArray = document.getElementsByTagName("link");
for(var linkNum=0; linkNum<linksArray.length; linkNum++) {
linkTag = linksArray[linkNum];
if(linkTag.getAttribute("rel").match(/^sty|^alt/i)) {
if (linkTag.getAttribute("title") == linkTitle) {
linkTag.disabled = false;
} else if (linkTag.getAttribute("title")) {
linkTag.disabled = true;
}
}
}
}
function checkRadioButton() {
var form;
if (document.getElementById) {
form = document.getElementById('colorSelect');
form.colorScheme[(ssCookieValue-1)].checked = true;
} else {
colorSelect.colorScheme[(ssCookieValue-1)].checked = true;
}
}
setInitialStyles();
//=================================================================================
function displayThemesMenu() {
if (retroBrowser()) {
return;
}
var htmstr = '<div class="themesMenu">';
htmstr += '\n<div class="divHeader">CSS Switch Themes</div>';
htmstr += '\n<div><table width="177" border="0" cellpadding="0" cellspacing="1">';
htmstr += '\n<div><form id="colorSelect" action="#" onSubmit="return false">';
htmstr += '\n<tr class="bg1">';
htmstr += '\n<td>';
htmstr += '\n<div><label for="www1">-1-</label></div>';
htmstr += '\n<div><input id="www1" name="colorScheme" type="radio" onClick="changeScheme(1)"></div>';
htmstr += '\n</td>';
htmstr += '\n<td>';
htmstr += '\n<div><label for="www2">-2-</label></div>';
htmstr += '\n<div><input id="www2" name="colorScheme" type="radio" onClick="changeScheme(2)"></div>';
htmstr += '\n</td>';
htmstr += '\n<td>';
htmstr += '\n<div><label for="www3">-3-</label></div>';
htmstr += '\n<div><input id="www3" name="colorScheme" type="radio" onClick="changeScheme(3)"></div>';
htmstr += '\n</td>';
htmstr += '\n<td>';
htmstr += '\n<div><label for="www4">-4-</label></div>';
htmstr += '\n<div><input id="www4" name="colorScheme" type="radio" onClick="changeScheme(4)"></div>';
htmstr += '\n</td>';
htmstr += '\n<td>';
htmstr += '\n<div><label for="www5">-5-</label></div>';
htmstr += '\n<div><input id="www5" name="colorScheme" type="radio" onClick="changeScheme(5)"></div>';
htmstr += '\n</td>';
htmstr += '\n<td>';
htmstr += '\n<div><label for="www6">-6-</label></div>';
htmstr += '\n<div><input id="www6" name="colorScheme" type="radio" onClick="changeScheme(6)"></div>';
htmstr += '\n</td>';
htmstr += '\n</tr>';
htmstr += '\n</form></div>';
htmstr += '\n</table></div>';
htmstr += '\n<div class="divData">';
htmstr += '\n<div><a href="../site-goodies/site-development-bible.html#Theme_Switching">About Theme Switching</a></div>';
htmstr += '\n<div><a href="../css-style-sheets/switch-style-sheets-dynamically.html">CSS Switch Styles Tutorial</a></div>';
htmstr += '\n</div>';
htmstr += '\n</div>';
document.write(htmstr);
if(typeof(checkRadioButton)=="function") {
checkRadioButton();
}
}
//=================================================================================
function createCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires=" + date.toGMTString();
}
document.cookie = name + "=" + value + expires + "; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') {
c = c.substring(1,c.length);
}
if (c.indexOf(nameEQ) === 0) {
return (c.substring(nameEQ.length,c.length));
}
}
return (null);
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
//================================================================================
var namePath = location.pathname.replace(/\\/g,"/");
var indexFile = false;
if (namePath == "/" || namePath.match(/\/www\/index.html$/i)) {
indexFile = true;
} else if (namePath == "/~webwisew/") {
indexFile = true;
}
var preFix = (indexFile) ? "" : "../";
var ExchangeLinks = new Image(392,72);
ExchangeLinks.src = preFix + "images/exchange-links-now.gif";
var SwapLinks = new Image(392,72);
SwapLinks.src = preFix + "images/swap-links-with-us.gif";
function swapLinksBanner() {
var htmstr = '<p>';
htmstr += '<a href="http://webmaster.web-wise-wizard.com/" onClick="return(checkLocal(this))" onMouseOver="linksMouseover()" onMouseOut="linksMouseout()">';
htmstr += '<img id="exchangeBanner" name="exchangeBanner" src="' + preFix + 'images/exchange-links-now.gif" width="392" height="72" class="alignCenter">';
htmstr += '</a>';
htmstr += '</p>';
document.write(htmstr);
}
function linksMouseover() {
if (document.getElementById) {
document.getElementById("exchangeBanner").src = SwapLinks.src;
} else if (document.all || document.layers) {
document.exchangeBanner.src = SwapLinks.src;
}
}
function linksMouseout() {
if (document.getElementById) {
document.getElementById("exchangeBanner").src = ExchangeLinks.src;
} else if (document.all || document.layers) {
document.exchangeBanner.src = ExchangeLinks.src;
}
}
//=================================================================================
function footerLinks(doctype,css,jsTested,icra) {
var pathName = location.pathname.replace(/\\/g,"/");
var siteIndex = false;
if (pathName == "/" || pathName.match(/\/www\/index.html$/i)) {
siteIndex = true;
} else if (pathName == "/~webwisew/") {
siteIndex = true;
}
var preFix = (siteIndex) ? "" : "../";
var htmstr = '<div class="footerText">';
htmstr += '<a href="' + preFix + 'site-goodies/online-privacy-policy.html" onClick="this.blur()">Online Privacy Policy</a>';
htmstr += '</div>';
htmstr += '<div class="footerText">';
htmstr += '<a href="' + preFix + 'site-goodies/contact-us.html" onClick="this.blur()">Contact Us</a>';
htmstr += '</div>';
htmstr += '<div class="alignCenter">';
htmstr += '<img src="' + preFix + 'images/pixClear.gif" alt="" width="1" height="22" class="displayBlock">';
htmstr += '</div>';
htmstr += '<div class="footerText"> ';
if (doctype == "xhtml10") {
htmstr += '<a href="http://validator.w3.org/check?uri=referer">';
htmstr += '<img src="' + preFix + 'images/w3c-xhtml-1.0.gif"';
htmstr += ' alt="Valid XHTML 1.0" width="88" height="31"></a>';
} else if (doctype == "xhtml11") {
htmstr += '<a href="http://validator.w3.org/check?uri=referer">';
htmstr += '<img src="' + preFix + 'images/w3c-xhtml-1.1.gif"';
htmstr += ' alt="Valid XHTML 1.1" width="88" height="31"></a>';
} else {
htmstr += '<a href="http://validator.w3.org/check/referer">';
htmstr += '<img src="' + preFix + 'images/valid-html401.gif"';
htmstr += ' alt="Valid HTML 4.01!" width="88" height="31"></a>';
}
htmstr += '<a href="http://jigsaw.w3.org/css-validator/check/referer">';
htmstr += '<img src="' + preFix + 'images/valid-css.gif" alt="Valid CSS!" width="88" height="31"></a>';
if (jsTested =="js") {
htmstr += '<a href="http://www.web-wise-wizard.com/">';
htmstr += '<img src="' + preFix + 'images/javascript-tested.gif" alt="JavaScript Tested" width="88" height="31"></a>';
}
htmstr += '<a href="http://www.icra.org/sitelabel/">';
htmstr += '<img src="' + preFix + 'images/icra_sw.gif" alt="Internet Content Rating Association';
htmstr += ' - This site is ICRA labelled" width="88" height="31"></a>';
htmstr += pageCheckerLogo(preFix);
htmstr += '</div>';
document.write(htmstr);
}
//=================================================================================
function pageCheckerLogo (preFix) {
var htmstr, docDomain = (typeof(document.domain)=="unknown") ? "" : document.domain;
if (docDomain.match(/web-wise-wizard.com$/i)) {
htmstr = ' <a href="http://www.prchecker.info/" onClick="return(fullWindow(this))">';
htmstr += '<img src="http://www.prchecker.info/PR2_img.gif" alt="Check Page Rank" border="0" width="88" height="31">';
htmstr += '</a>';
} else {
htmstr = ' <img src="' + preFix + 'images/page-rank-hash.gif" alt="Page Checker Hash" border="0" width="88" height="31">';
}
return("");
}
//=================================================================================
|