Welcome to The American Presidency var myDomain = ".grolier.com";//****************************************************************// Cookies -- Yum!//****************************************************************function Cookie() { this.getCookieVal = function(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) { endstr = document.cookie.length; } return unescape(document.cookie.substring(offset, endstr)); } this.FixCookieDate = function(date) { var base = new Date(0); var skew = base.getTime(); // dawn of (Unix) time - should be 0 if (skew > 0) // Except on the Mac - ahead of its time date.setTime (date.getTime() - skew); } this.GetCookie = function(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { return this.getCookieVal (j); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } this.SetCookie = function(name,value,expires,path,domain,secure) { document.cookie = name + "=" + escape (value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } this.SetCookieNoEscape = function(name,value,expires,path,domain,secure) { document.cookie = name + "=" + value + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } this.DeleteCookie = function(name,path,domain) { if (this.GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } this.isBorderlessUser = function() { var BLU = this.GetCookie("bless"); var isBU = (BLU != "" && BLU != null); //alert("is a borderless user (article):" + BLU + "\nresult = " + isBU); return isBU; } }theCookie = new Cookie();//This is needed to allow the go atlas display the close or back link.theCookie.SetCookie("clhref", window.location.href, null, "/", ".grolier.com", null);function Popup() { // object variables this._gBlurbWindow; // object methods // set the focus after checking if the browser supports it this._setFocus = function() { //alert(navigator.userAgent); //MSIE 4.0(1) in particular doesn't like the focus call. if (navigator.userAgent.indexOf("MSIE 4.0") != -1) { return; } if (navigator.userAgent.indexOf("MSIE 4.01") != -1) { return; } this._gBlurbWindow.focus(); } this.loadWindow = function(newLocation) { window.location.href = newLocation; } this.loadParent = function(newLocation) { window.opener.location = newLocation; window.opener.window.focus(); } this.loadGrandParent = function(newLocation) { parent.window.opener.window.opener.location = newLocation; parent.window.opener.window.opener.window.focus(); } this.loadGrandParentAndClose = function(newLocation) { parent.window.opener.window.opener.location = newLocation; parent.window.close(); parent.window.opener.window.opener.window.focus(); } this.loadParentWindowAndClose = function(newLocation) { window.opener.location = newLocation; window.close(); window.opener.window.focus(); } //this function just figures out of a particular option is on or off. this._isAffirmative = function(option) { if (option == "yes" || option == "on" || option == "true" || option == 1 || option == "1" || option == 'yes' || option == 'on' || option == 'true' || option == '1') { return 1; } else { return 0; } } this._newWindow = function(inContentURL, inWidth, inHeight, inWindowName, inResize, inStatusbars, inScrollbars, inMenubar) { options = "height=" + inHeight + ",width=" + inWidth; //configure resizing option if (this._isAffirmative(inResize) == 1) { options = options + ",resizable=yes"; } else { options = options + ",resizable=no"; } //configure menubar option if (this._isAffirmative(inMenubar) == 1) { options = options + ",menubar=yes"; } else { options = options + ",menubar=no"; } //configure status bar option if (this._isAffirmative(inStatusbars) == 1) { options = options + ",status=yes"; } else { options = options + ",status=no"; } //configure scrollbars option if (this._isAffirmative(inScrollbars) == 1) { options = options + ",scrollbars=yes"; } else { options = options + ",scrollbars=no"; } //alert(options); this._gBlurbWindow = window.open(inContentURL, inWindowName, options); this._gBlurbWindow.opener = window; this._setFocus(); } // this method opens a Blurb Window this.blurbWindow = function(inContentURL, inWidth, inHeight, inWindowName, inResize) { //order of parameters: URL, width, height, windowname, resize, statusbars, scrollbars, menubar this._newWindow(inContentURL, inWidth, inHeight, inWindowName, inResize, "yes", "yes", 'yes'); } // This window doesn't have location or menu bars */ this.boxWindow = function(inContentURL, inWidth, inHeight, inWindowName, inResize) { //alert("in boxWindow"); //order of parameters: URL, width, height, windowname, resize, statusbars, scrollbars, menubar this._newWindow(inContentURL, inWidth, inHeight, inWindowName, inResize, "yes", "yes", "no"); } // This window doesn't have location or menu bars or status bars this.boxWindowNoStatus = function(inContentURL, inWidth, inHeight, inWindowName, inResize) { alert("in boxWindowNostatus"); //order of parameters: URL, width, height, windowname, resize, statusbars, scrollbars, menubar this._newWindow(inContentURL, inWidth, inHeight, inWindowName, inResize, "no", "yes", "no"); }}var thePopup = new Popup();
//I'm going to break the rule here and leave this functionality out of the objectification of all javascript.
DOM = (document.getElementById) ? true : false;
NS4 = (document.layers) ? true : false;
IE = (document.all) ? true : false;
IE4 = IE && !DOM;
Mac = (navigator.appVersion.indexOf("Mac") != -1);
IE4M = IE4 && Mac;
Opera = (navigator.userAgent.indexOf("Opera")!=-1);
Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);
IsMenu = !Opera && !Konqueror && !IE4M && (DOM || NS4 || IE4);
BrowserString = NS4 ? "NS4" : DOM ? "DOM" : "IE4";
//This code was previously in nsdd623_70.js. I figured this is the perfect place to let this code live on.
var ddnav = navigator.userAgent;
//alert(navigator.userAgent);
//Netscape 6.2.x and Netscape 7.0 have problems loading goatlas
//information in the main frame, so I am going to set the document.domain
//to grolier.com so these browsers can exchange information without causing
//potential security flaws.
if (ddnav.indexOf("Netscape6/6.2") != -1 || ddnav.indexOf("Netscape/7.0") != -1) {
document.domain = "grolier.com";
}
function setWordLookup(event) { // is this a new version of gecko or safari? if (window.getSelection) { var str = window.getSelection(); // is this an older version of gecko? } else if (document.getSelection) { var str = document.getSelection(); // is this ie? } else if (document.selection && document.selection.createRange) { var range = document.selection.createRange(); var str = range.text; } else { return; } // cast the text object to a string str = str.toString(); // did the user select anything? if (str.length > 0) { // Escape the string so we can match the Spanish characters easier. str = escape(str); /* //Array of character entities to replace. var pattern = new Array("%E1", "%E9", "%ED", "%F1", "%F3", "%FA", "%FC", "%C1", "%C9", "%CD", "%D1", "%D3", "%DA", "%DC"); // Array of replacement characters. var replace = new Array("a", "e", "i", "i", "n", "o", "u", "u", "A", "E", "I", "N", "0", "U", "U"); // Loop through and replace all Spanish characters. for (var i = 0; i < pattern.length; i++) { str = str.replace(pattern[i], replace[i]); } // Get the first word of the selection. var re = new RegExp('^\\s?\\w+', "g"); str = re.exec(str); */ // Set the cookie. theCookie.SetCookie("wordlookup", str, null , "/", myDomain); } if (document.layers) { document.routeEvent(event); } } if (window.Event) { document.captureEvents(Event.MOUSEUP); } document.onmouseup = setWordLookup; var Feature = "";if(window.event + "" == "undefined") event = null;function HM_f_PopUp(){return false};function HM_f_PopDown(){return false};popUp = HM_f_PopUp;popDown = HM_f_PopDown; [Content provided by the Related articles:Carter, James Earl, Jr. (1924- ) |
|