PageSourceSearch

https://harriettubmanbiography.com/scripts/popup.js

js harriettubmanbiography.com collected 2026-10-02 10:35:22 UTC 3,953 bytes, 106 lines download raw bytes

1/** function openpopup 
2* @description Open a popup window at specified positions with specified dimensions.
3* @param Window hwndPopup is a global paramter that will refer the new popup window instance that
4*        will be opened.
5*
6*   var popupWidth    = 300;
7*   var popupHeight   = 300;
8*   var popupTop      = 300;
9*   var popupLeft     = 300;
10*   var isFullScreen  = false;
11*   var isAutoCenter  = false;
12*   var popupTarget   = "popupwin";
13*   var popupParams   = "toolbar=0, scrollbars=0, menubar=0, status=0, resizable=1";
14*/
15
16function openpopup(/*Window*/ hwndPopup, /*String*/ url, /*int*/ popupWidth, /*int*/ popupHeight, /*int*/popupTop,
17                   /*int*/ popupLeft, /*boolean*/ isFullScreen, /*boolean*/ isAutoCenter,
18                   /*String*/ popupTarget, /*String*/ popupParams) {
19
20	if (typeof(popupWidth) == "string") {
21		popupWidth = parseInt(window.screen.width * (parseInt(popupWidth)/100));
22	}
23	if (typeof(popupHeight) == "string") {
24		popupHeight = parseInt(window.screen.height * (parseInt(popupHeight)/100));
25	}
26	if (typeof(popupLeft) == "string") {
27		popupLeft = parseInt(window.screen.width * (parseInt(popupLeft)/100));
28	}
29	if (typeof(popupTop) == "string") {
30		popupTop = parseInt(window.screen.height * (parseInt(popupTop)/100));
31	}
32  
33
34  if (isFullScreen) {
35		popupParams += ", fullscreen=1";
36		popupTop = 0; popupLeft = 0;
37		popupHeight = window.screen.height;
38		popupWidth = window.screen.width;
39  } else if (isAutoCenter) {
40    popupTop  = parseInt((window.screen.height - popupHeight)/2);
41    popupLeft = parseInt((window.screen.width - popupWidth)/2);
42  }
43
44  var ua = window.navigator.userAgent;
45  var isOpera = (ua.indexOf("Opera") > -1);
46  var operaVersion;
47  var isMac = (ua.indexOf("Mac") > -1);
48
49  if (isMac && url.indexOf("http") != 0) {
50    url = location.href.substring(0,location.href.lastIndexOf('\/')) + "/" + url;
51  }
52
53  if (isOpera) {
54    var i = ua.indexOf("Opera");
55    operaVersion = parseFloat(ua.substring(i + 6, ua.indexOf(" ", i + 8)));
56    if (operaVersion > 7.00) {
57      var isAccessible = false;
58      eval("try { isAccessible = ( (hwndPopup != null) && !hwndPopup.closed ); } catch(exc) { } ");
59      if (!isAccessible) {
60        hwndPopup = null;
61      }
62    }
63  }
64
65  if ( (hwndPopup == null) || hwndPopup.closed ) {    
66    if (isOpera && (operaVersion < 7)) {
67      if (url.indexOf("http") != 0) {			 
68        hwndPopup = window.open(url,popupTarget,popupParams + ((!isFullScreen && (popupWidth > 0 && popupHeight > 0)) ? ", width=" + popupWidth +", height=" + popupHeight : ""));
69        if (!isFullScreen) {
70          hwndPopup.moveTo(popupLeft, popupTop);
71        }
72        hwndPopup.focus();
73        return;
74      }
75    }
76    if (!(window.navigator.appName == "Netscape" && !document.getElementById)) {
77      //not ns4
78      popupParams += ((popupWidth > 0 && popupHeight > 0) ? (", width=" + popupWidth +", height=" + popupHeight) : "") + ", left=" + popupLeft + ", top=" + popupTop;
79    } else {
80      popupParams += ", left=" + popupLeft + ", top=" + popupTop;
81    }
82    //alert(popupParams);
83    hwndPopup = window.open("",popupTarget,popupParams);
84    if (!isFullScreen) {
85      if (popupWidth > 0 && popupHeight > 0)
86			hwndPopup.resizeTo(popupWidth, popupHeight);
87      hwndPopup.moveTo(popupLeft, popupTop);
88    }
89    hwndPopup.focus();
90    with (hwndPopup.document) {
91      open();
92      write("<ht"+"ml><he"+"ad></he"+"ad><bo"+"dy onLoad=\"window.location.href='" + url + "'\"></bo"+"dy></ht"+"ml>");
93      close();
94    }
95  } else {
96    if (isOpera && (operaVersion > 7.00)) {
97      eval("try { hwndPopup.focus(); hwndPopup.location.href = url; } catch(exc) { hwndPopup = window.open(\""+ url +"\",\"" + popupTarget +"\",\""+ popupParams +
98			((popupWidth > 0 && popupHeight > 0) ? (", width=" + popupWidth +", height=" + popupHeight) : "") +
99			"\"); } ");
100    } else {
101      hwndPopup.focus();
102      hwndPopup.location.href = url;
103    } 
104  }
105}// end function
106

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.