

/* utilities Starts */

//! ################################################################
//! This file contains both original and merged/adapted code.
//! Except where indicated, all code is

//! All Rights Reserved.

if (window.goN2LibMon) {
goN2LibMon._beginUtilities = new Date().getTime();
}
if (typeof goN2Initializer != 'undefined') {
window.oTheDoc = document;
window.oTheBody = oTheDoc.body;
window.oTheHead = document.getElementsByTagName('head').item(0);
window.gaTD = {};
goN2Initializer.aEventsRun = [];
goN2Initializer.bCoreLoaded = false;
goN2Initializer.runThisWhen = function (sWhen, fFn, sComment) {
;
;
if ( (typeof fFn != 'function') || fFn == null) return false;
sWhen = sWhen.toLowerCase();
if ( (sWhen =='inbody' && document.body) || this.aEventsRun[sWhen] ){
fFn();
} else {
this.aHandlers[this.aHandlers.length] = { sWhen: sWhen, fFn: fFn, sComment: sComment };
}
return true
};
goN2Initializer.initializeThis = goN2Initializer.runThisWhen;
goN2Initializer.run = function (sWhen) {
sWhen = (typeof sWhen == 'undefined') ? null : sWhen;
sWhen = sWhen.toLowerCase();
this.aEventsRun[sWhen] = true;
;//goN2Debug.info("N2Initializer called with " + (sWhen ? "'"+sWhen+"'" : "null"));
var aH = this.aHandlers;
var len = aH.length;
for (var i=0;i<len;i++) {
var oTmp = aH[i];
if ((oTmp.bCalled != true) &&
(oTmp.fFn) &&
( (sWhen == null) || (oTmp.sWhen && (oTmp.sWhen == sWhen)))
) {
;
if (oTmp.fFn) {
oTmp.fFn();
}
oTmp.bCalled = true;
}
}
}
function n2RunEvent(sWhen) {
goN2Initializer.run(sWhen);
}
function n2RunThisWhen(sWhen, fFn, sComment) {
goN2Initializer.runThisWhen(sWhen, fFn, sComment);
}
function n2RunIfLoaded(sLibID, fFn, sComment) {
goN2Initializer.runThisWhen(sLibID+'loaded', fFn, 'sequenced init of '+ sComment);
}
goN2LibMon.bJSLoaded = false;
goN2LibMon.bCSSLoaded = false;
goN2LibMon.nREQUESTLOAD = -2;
goN2LibMon.nBEGINLOAD = -3;
goN2LibMon.beginLoad = function (sLibID, sFeatureID, beginTime) {
;
var oTmp = this.aLibs[sLibID];
if (oTmp) {
oTmp.sFeature = sFeatureID;
oTmp.nBegin = (beginTime ? beginTime : new Date().getTime());
oTmp.nDuration= this.nBEGINLOAD;
}
};
goN2LibMon.endLoad = function (sLibID, nStatus, endTime) {
;
var oTmp = this.aLibs[sLibID];
if (oTmp) {
if (typeof endTime == 'undefined')
endTime = new Date().getTime();
oTmp.nDuration = endTime - oTmp.nBegin;
oTmp.bLoaded=true;
}
var bALL=this.allLibsLoaded();
goN2Initializer.run(sLibID+'loaded');
if (bALL) {
this.bJSLoaded = true;
goN2Initializer.run('lastlibraryloaded');
}
};
goN2LibMon.allLibsLoaded = function () {
var bAllLoaded=true;
for (var key in this.aLibs) {
if (this.aLibs[key] && this.aLibs[key].nDuration <0) { bAllLoaded=false; }
}
return bAllLoaded;
};
goN2LibMon.confirmJSLoaded = goN2LibMon.isJSLoaded = function() { return this.bJSLoaded; };
goN2LibMon.confirmCSSLoaded = goN2LibMon.isCSSLoaded = function() { return true; };
function n2LibraryIsLoaded (sLibID) {
var oTmp = goN2LibMon.aLibs[sLibID];
if (oTmp)
return oTmp.bLoaded;
return false;
}
goN2Initializer.isReady = function() {return true;}
if (goN2LibMon._beginDtk)
goN2LibMon.beginLoad('dtk', 'n2CoreLibs', goN2LibMon._beginDtk);
if (goN2LibMon._endDtk)
goN2LibMon.endLoad('dtk', 'n2CoreLibs', goN2LibMon._endDtk);
goN2LibMon.beginLoad('utilities', 'n2CoreLibs', goN2LibMon._beginUtilities);
n2RunEvent('n2Loader:safetyNet:loaded');
}
function N2Utilities() {
this.className = 'N2Utilities';
this.version = '1.0.1';
this.revision= '$Revision: #7 $';
this.initialized = false;
this.bIsCSS;
this.bIsW3C;
this.bIsIE4;
this.bIsNN4;
this.bIsIE6CSS;
this.bIsIE;
this.bIsSafari;
this.browser_version;
//! * **********************************************************************
//! The following section of this file code was mainly adapted from:
//! "Dynamic HTML:The Definitive Reference"
//! 2nd Edition
//! by Danny Goodman
//! Published by O'Reilly & Associates  ISBN 1-56592-494-0
//! http://www.oreilly.com
//!
//! Copyright 2002 Danny Goodman.  All Rights Reserved.
//! Some minor changes and additions have been made to suit the
//! current application requirements and to enhance functionality.
//! ************************************************************************
this.initDHTMLAPI = function () {
if (document.images) {
this.bIsCSS = (document.body && document.body.style) ? true : false;
this.bIsW3C = (this.bIsCSS && document.getElementById) ? true : false;
this.bIsIE4 = (this.bIsCSS && document.all) ? true : false;
this.bIsNN4 = (document.layers) ? true : false;
this.bIsIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
this.bIsSafari = (navigator.userAgent.indexOf("AppleWebKit") > -1) ? true : false;
}
}
this.seekLayer = function (oDoc, sName) {
var elem;
for (var i = 0; i < oDoc.layers.length; i++) {
if (oDoc.layers[i].name == sName) {
elem = oDoc.layers[i];
break;
}
if (oDoc.layers[i].document.layers.length > 0) {
elem = this.seekLayer(document.layers[i].document, sName);
}
}
return elem;
}
this.getRawObject = function (obj) {
;
}
this._getRawObject = function (obj, bFailureOK) {
var elem;
;
if (!obj) {
return null;
}
if (typeof obj == "string") {
if (this.bIsW3C) {
elem = document.getElementById(obj);
} else if (this.bIsIE4) {
elem = document.all(obj);
} else if (this.bIsNN4) {
elem = this.seekLayer(document, obj);
}
if ( this.isUndefOrNull(elem) && !bFailureOK ) {
;
}
} else {
elem = obj;
}
return elem;
}
this.getObject = function (obj) {
var elem = this.getElement(obj);
if (elem && this.bIsCSS) {
elem = elem.style;
}
return elem;
}
this.shiftTo = function (obj, x, y) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if (this.bIsCSS) {
var units = (typeof oStyle.left == "string") ? "px" : 0;
oStyle.left = x + units;
oStyle.top = y + units;
} else if (this.bIsNN4) {
oStyle.moveTo(x,y)
}
}
}
this.shiftBy = function (obj, deltaX, deltaY) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if (this.bIsCSS) {
var units = (typeof oStyle.left == "string") ? "px" : 0;
oStyle.left = this.getElementLeft(obj) + deltaX + units;
oStyle.top = this.getElementTop(obj) + deltaY + units;
} else if (this.bIsNN4) {
oStyle.moveBy(deltaX, deltaY);
}
}
}
this.setZIndex = function (obj, zOrder) {
var oStyle = this.getElementStyle(obj);
if (oStyle) { oStyle.zIndex = zOrder; }
}
this.setBGColor = function (obj, color) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if (this.bIsNN4) {
oStyle.bgColor = color;
} else if (this.bIsCSS) {
oStyle.backgroundColor = color;
}
}
}
this.show = function (obj) {
var oStyle = this.getElementStyle(obj);
if (oStyle) { oStyle.visibility = "visible"; }
}
this.hide = function (obj) {
var oStyle = this.getElementStyle(obj);
if (oStyle) { oStyle.visibility = "hidden"; }
}
this.MOZALPHAMAX = 255./256.;
this.getAlphaLevel = function (elem) {
var oElem = this.getElement(elem);
var ret;
if (oElem) {
var style = oElem.style;
if (oElem.filters && oElem.filters.alpha) {
ret = oElem.filters.alpha.opacity;
} else if (style) {
if (this.isDefined(style.MozOpacity)) {
var strOpacity = style.MozOpacity;
if (strOpacity.length > 0) {
ret = parseFloat(style.MozOpacity);
if (ret >= this.MOZALPHAMAX && this.isDefined(style.azdMozOpacity)) {
var saved = parseFloat(style.azdMozOpacity);
if (saved >= this.MOZALPHAMAX) {
ret = saved;
}
}
ret = ret * 100;
}
} else if (this.isDefined(style.opacity)) {
ret = (style.opacity.length==0 ? 1 : parseFloat(style.opacity)) * 100;
} else if (this.isDefined(style.KhtmlOpacity)) {
ret = (style.KhtmlOpacity.length==0 ? 1 : parseFloat(style.KhtmlOpacity)) * 100;
}
}
}
if (this.isUndefined(ret)) {
ret = 100; // presume that no set opacity means opaque
;
}
return ret;
}
this.setAlphaLevel = function (elem, level) {
level = (level <= 0 ? 0 : (level >= 100 ? 100 : level));
var oElem = this.getElement(elem);
;
if (oElem) {
var style = oElem.style
if (oElem.filters) {
var filters = oElem.filters;
if (!filters.alpha) {
;
this.addClass(oElem, "n2Fadable");
filters = oElem.filters; // object changed by adding a filter
;
}
if (filters.alpha) {
filters.alpha.opacity = level;
} else {
;
}
} else  if (style && this.isDefined(style.MozOpacity)) {
var reqLevel = level * 0.01;
var mozLevel = (reqLevel > this.MOZALPHAMAX ? this.MOZALPHAMAX : reqLevel);
if (mozLevel != reqLevel) {
;
}
style.MozOpacity = mozLevel;
style.azdMozOpacity = "" + reqLevel; // store as string (just as MozOpacity is) to get same rounding
} else if (style && this.isDefined(style.opacity)) {
var reqLevel = "" + (level * 0.01);
style.opacity = reqLevel;
} else if (style && this.isDefined(style.KhtmlOpacity)) {
var reqLevel = "" + (level * 0.01);
ret = (style.KhtmlOpacity.length==0 ? 1 : parseFloat(style.KhtmlOpacity)) * 100;
} else {
;
}
}
}
this.getElementLeft = function (obj)  {
var oElem = this.getElement(obj);
var result = 0;
if (oElem) {
var cssDecl, defaultView = document.defaultView;
if (  defaultView &&
(typeof defaultView.getComputedStyle == 'function') &&
(cssDecl=defaultView.getComputedStyle(oElem, null))
) {
result = cssDecl.getPropertyValue("left");
} else if (oElem.currentStyle) {
result = oElem.currentStyle.left;
} else if (oElem.style) {
result = oElem.style.left;
} else if (this.bIsNN4) {
result = oElem.left;
}
result = parseInt(result);
if (isNaN(result)) {
result = this.getPageElementLeft(oElem);
}
}
return result;
}
this.getElementTop = function (obj)  {
var oElem = this.getElement(obj);
var result = 0;
if (oElem) {
var cssDecl, defaultView = document.defaultView;
if (defaultView &&
(typeof defaultView.getComputedStyle == 'function') &&
(cssDecl=defaultView.getComputedStyle(oElem, null))
) {
result = cssDecl.getPropertyValue("top");
} else if (oElem.currentStyle) {
result = oElem.currentStyle.top;
} else if (oElem.style) {
result = oElem.style.top;
} else if (this.bIsNN4) {
result = oElem.top;
}
}
result = parseInt(result);
if (isNaN(result)) {
result = this.getPageElementTop(oElem);
}
return result;
}
this.getElementWidth = function (obj)  {
var oElem = this.getElement(obj);
var result = 0;
if (oElem) {
var width = oElem.width;
if (width && this.isMozilla5() && (typeof width != 'string' || width.match(/^[0-9]+$/) !== null)) {
result = width;
} else if (oElem.offsetWidth) {
result = oElem.offsetWidth;
} else if (oElem.clip && oElem.clip.width) {
result = oElem.clip.width;
} else if (oElem.style && oElem.style.pixelWidth) {
result = oElem.style.pixelWidth;
}
}
return parseInt(result);
}
this.getElementHeight = function (obj)  {
var oElem = this.getElement(obj);
var result = 0;
if (oElem) {
var height = oElem.height;
if (height && this.isMozilla5() && (typeof height != 'string' || height.match(/^[0-9]+$/) !== null)) {
result = height;
} else if (oElem.offsetHeight) {
result = oElem.offsetHeight;
} else if (oElem.clip && oElem.clip.height) {
result = oElem.clip.height;
} else if (oElem.style && oElem.style.pixelHeight) {
result = oElem.style.pixelHeight;
}
}
return parseInt(result);
}
this.getInsideWindowWidth = function () {
if (window.innerWidth) {
return window.innerWidth;
} else if (document.body && document.body.clientWidth) {
return document.body.clientWidth;
}
;
return 0;
}
this.getInsideWindowHeight = function () {
if (window.innerHeight) {
return window.innerHeight;
} else if (document.body && document.body.clientHeight) {
return document.body.clientHeight;
}
;
return 0;
}
//! ************************************************************
//!     END CODE derived from "Dynamic HTML:The Definitive Reference"
//!     2nd Edition
//!     by Danny Goodman
//!     Published by O'Reilly & Associates  ISBN 1-56592-494-0
//!     http://www.oreilly.com
//!     Copyright 2002 Danny Goodman.  All Rights Reserved.
//! ################################################################
//! All the code that follows is Copyright 2003 Amazon.com.
//! All Rights Reserved.
//! ************************************************************
//! Copyright (c) Amazon.com 2003, 2004.  All Rights Reserved.
//! Not to be reused without permission
//! ################################################################
this.initialize = function () {
this.initDHTMLAPI();
var agid = navigator.userAgent.toLowerCase();
this.bIsIE = (agid.indexOf("msie") != -1);
this.bIsGecko = (agid.indexOf("gecko") != -1);
this.bIsFirefox = (agid.indexOf("firefox") != -1);
this.browser_version = parseInt(navigator.appVersion);
this.getRawObject = this._getRawObject;   // rest to use the correct fn.
this.getElement = this._getRawObject;
this.getElementStyle = this.getObject;
this.getObjectWidth  = this.getElementWidth;
this.getObjectHeight = this.getElementHeight;
this.getObjectLeft   = this.getElementLeft;
this.getObjectTop    = this.getElementTop;
this.initAnimationAPI();
this.workaroundIE6CachingBug();
this.initialized = true;
;
}
this.isIE = function () { return this.bIsIE; }
this.isW3C = function () { return this.bIsW3C; }
this.isMozilla5 = function () { return this.bIsGecko && this.browser_version>=5 && !this.bIsSafari; }
this.isFirefox = function () { return this.bIsFirefox && this.browser_version>=5; }
this.isSafari = function () { return this.bIsSafari; }
this.exists = function(obj) {
return ( !this.isUndefOrNull(this.getElement(obj)) );
}
this.display = function (obj, type) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if(this.bIsIE || this.isMozilla5())
oStyle.display = this.isDefined(type) ? type : "block";
else {
oStyle.display = "block";
}
}
}
this.undisplay = function (obj) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
oStyle.display = 'none';
}
}
this.isDisplayed = function(obj) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
return oStyle.display != 'none';
}
return true;
}
this.toggleDisplay = function (obj, type) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if (oStyle.display == 'none')
this.display (obj, type);
else
this.undisplay(obj);
}
}
this.toggleDualDisplay = function (obj1, obj2) {
this.toggleDisplay(obj1);
this.toggleDisplay(obj2);
}
this.getScrollLeft = function() {
if (document.documentElement.scrollLeft) {
return  document.documentElement.scrollLeft;
} else {
return  document.body.scrollLeft;
}
}
this.getScrollTop = function() {
if (document.documentElement.scrollTop) {
return document.documentElement.scrollTop;
} else {
return document.body.scrollTop;
}
}
this.setScrollLeft = function(n) {
if (document.documentElement.scrollLeft) {
document.documentElement.scrollLeft = n;
} else {
document.body.scrollLeft = n;
}
}
this.setScrollTop = function(n) {
if (document.documentElement.scrollTop) {
document.documentElement.scrollTop=n;
} else {
document.body.scrollTop=n;
}
}
this.animateScrollTo = function(nTo, nStep, nDelay, nStepInc) {
var nTop = goN2U.getScrollTop();
nStepInc = this.isDefined(nStepInc) ? nStepInc : 20;
nStep = nStep ? nStep+=nStepInc : 20;
nDelay = nDelay ? nDelay : 25;
if (nTop > nTo) {
if (nTop > nTo+(nStep*1.5)) {
goN2U.setScrollTop(nTop-nStep);
setTimeout(function() { goN2U.animateScrollTo(nTo, nStep, nDelay, nStepInc); }, nDelay);
} else {
goN2U.setScrollTop(nTo);
}
} else {
if (nTop < nTo-(nStep*1.5)) {
goN2U.setScrollTop(nTop+nStep);
setTimeout(function() { goN2U.animateScrollTo(nTo, nStep, nDelay, nStepInc); }, nDelay);
} else {
goN2U.setScrollTop(nTo);
}
}
}
this.removeElementById = function(sID) {
var oElem = document.getElementById(sID);
if (oElem && oElem.parentNode && oElem.parentNode.removeChild) {
try {
oElem.parentNode.removeChild(oElem);
;
} catch (e) {
;
}
} else {
;
}
}
this.adjustBy = function (obj, deltaX, deltaY, deltaW, deltaH) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if (this.bIsCSS) {
var units = (typeof oStyle.left == "string") ? "px" : 0;
oStyle.left = this.getElementLeft(obj) + deltaX + units;
oStyle.top = this.getElementTop(obj) + deltaY + units;
oStyle.width = this.getElementWidth(obj) + deltaW; // + units;
oStyle.height = this.getElementHeight(obj) + deltaH; // + units;
} else if (this.bIsNN4) {
oStyle.moveBy(deltaX, deltaY);
}
}
}
this.displayAt = function (obj, newX, newY, newW, newH) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if (this.bIsCSS) {
var units = (typeof oStyle.left == "string") ? "px" : 0;
oStyle.left = newX + units;
oStyle.top = newY + units;
oStyle.width = newW + units;
oStyle.height = newH + units;
} else if (this.bIsNN4) {
oStyle.shiftTo(newX, newY);
}
}
}
this.clip = function (obj, nTop, nRight, nBottom, nLeft) {
var oStyle = this.getElementStyle(obj);
oStyle.clip = "rect("+nTop+"px, " + nRight + "px, "+nBottom+"px, "+nLeft+"px)";
}
this.setContent = function (sID, sHtml, sClass) {
var relem = this.getElement(sID);
if (relem) relem.innerHTML = sHtml;
if (sClass) this.setClass(sID, sClass);
}
this.setWidth = function (obj, n) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if ((typeof oStyle.width == "string") && (typeof n == "number")) {
oStyle.width=n+"px";
} else {
oStyle.width = n;
}
}
}
this.setHeight = function (obj, n) {
var oStyle = this.getElementStyle(obj);
if (oStyle) {
if ((typeof oStyle.height == "string") && (typeof n == "number")) {
oStyle.height=n+"px";
} else {
oStyle.height = n;
}
}
}
this.getScrolledElementTop = function (elem) {
var top = this.getPageElementTop(elem);
if (elem) {
var bod = document.body;
var docParent = this.getParentElement(elem);
while (docParent !== null && docParent !== bod) {
top -= docParent.scrollTop;
docParent = this.getParentElement(docParent);
}
}
return top;
}
this.getScrolledElementLeft = function (elem) {
var left = this.getPageElementLeft(elem);
if (elem) {
var bod = document.body;
var docParent = this.getParentElement(elem);
while (docParent !== null && docParent !== bod) {
left -= docParent.scrollLeft;
docParent = this.getParentElement(docParent);
}
}
return left;
}
this.getPageElementTop = function (elem) {
var top=0;
if (elem) {
top = elem.offsetTop;
var parentObj = elem.offsetParent;
while (parentObj != null) {
if(this.bIsIE) {
if( (parentObj.tagName != "TABLE") && (parentObj.tagName != "BODY") )
top += parentObj.clientTop;
}
else {
if(parentObj.tagName == "TABLE") {
var nParBorder = parseInt(parentObj.border);
if(isNaN(nParBorder)) {
var nParFrame = parentObj.getAttribute('frame');
if(nParFrame != null)
top += 1;
} else if(nParBorder > 0) {
top += nParBorder;
}
}
}
top += parentObj.offsetTop;
parentObj = parentObj.offsetParent;
}
}
return top;
}
this.getPageElementLeft = function (elem) {
var left=0;
if (elem) {
left = elem.offsetLeft;
var parentObj = elem.offsetParent;
while (parentObj != null) {
if (this.bIsIE) {
if( (parentObj.tagName != "TABLE") && (parentObj.tagName != "BODY") )
left += parentObj.clientLeft;
}
else {
if (parentObj.tagName == "TABLE") {
var nParBorder = parseInt(parentObj.border);
if(isNaN(nParBorder)) {
var nParFrame = parentObj.getAttribute('frame');
if(nParFrame != null)
left += 1;
} else if (nParBorder > 0) {
left += nParBorder;
}
}
}
left += parentObj.offsetLeft;
parentObj = parentObj.offsetParent;
}
}
return left;
}
this.getParentElement = function (elem) {
if (elem) {
if (this.bIsIE) return elem.parentElement;
return elem.parentNode;
}
return null;
}
this.elementIsContainedBy = function(elem, elemParent) {
if (this.isUndefOrNull(elem) || this.isUndefOrNull(elemParent)) {
return false;
}
while (true) {
if (elem === elemParent) {
return true;
}
var parent = this.getParentElement(elem);
if (parent === null) {
return false;
}
elem = parent;
}
}
this.classfixup;
if (document.all) this.classfixup = "className";
else this.classfixup = "class";
this.setClass = function (obj, style) {
var obj = this.getElement (obj);
;
if (obj) obj.setAttribute(this.classfixup, style,0);
}
this.getClassX = function (obj) {
var obj = this.getElement (obj);
if (obj) return obj.getAttribute(this.classfixup, 0);
return null;
}
this.addComma = function addComma(sNum) {
if (typeof sNum != "string") sNum = sNum.toString();
var aV = sNum.split('.');
sNum = aV[0];
var p0, p1, len, x=3;
if (sNum.length >x) {
for (x=3;(len=sNum.length)>x;x+=4 ) {
p0 = sNum.substring(0, len-x);
p1 = sNum.substring(len-x);
sNum = p0 +',' + p1;
}
}
if (aV[1]>=0) sNum += '.' + aV[1];
return sNum;
}
this.preloadImages = new Array();
this.preloadImage = function (sImage, id) {
if (!id) id=this.preloadImages.length;
if (!this.preloadImages[id]) {
this.preloadImages[id]=new Image();
this.preloadImages[id].src=sImage;
;
}
}
this.getLinkNameInfo = function (sLinkID, sNameOverride) {
var oLNI = new N2LinkNameInfo(sLinkID, sNameOverride);
return (oLNI.getLinkID() ? oLNI : null);
}
this.getIFrameDocument = function (id) {
var oIFrame = this.getElement(id);
if (oIFrame) {
if (oIFrame.contentDocument) {
return oIFrame.contentDocument;
} else if (oIFrame.contentWindow) {
return oIFrame.contentWindow.document;
} else if (oIFrame.document) {
return oIFrame.document;
}
;
return null;
}
;
return null;
}
this.getIFrameWindow = function (id) {
var oIFrame = this.getElement(id);
if (oIFrame) {
if (oIFrame.contentWindow) {
return oIFrame.contentWindow;
}
;
return null;
}
;
return null;
}
this.n2FlashElement = function (id, styleOn, styleOff, count) {
n2DoFlashElement (id, styleOn, styleOff, count*2);
}
this.n2DoFlashElement = function (id, styleOn, styleOrig, count) {
count--;
if (count % 2)
setClass(id, styleOn);
else
setClass(id, styleOrig);
if (count) {
setTimeout("n2DoFlashElement('" + id +"','" + styleOn + "','" + styleOrig + "'," + count +")", 500);
}
}
this.animateBox = function (sl, st, sw, sh, fl, ft, fw, fh, nSteps, fnDone, style) {
var nHInc = parseInt( ((fl-sl)<<8)/nSteps);
var nVInc = parseInt( ((ft-st)<<8)/nSteps);
var nWdInc = parseInt( ((fw-sw)<<8)/nSteps);
var nHtInc = parseInt( ((fh-sh)<<8)/nSteps);
var o = goN2U.getElement(this.sAnimationDivID);
if (o && !this.bAnimateBoxRunning) {
this.bAnimateBoxRunning = true;
if (style) goN2U.setClass(this.sAnimationDivID, style);
goN2U.shiftTo(o, sl, st);
goN2U.show(o);
goN2U.setWidth(o, sw);
goN2U.setHeight(o, sh);
var fn = function() { goN2U._animateBox(goN2U.sAnimationDivID, parseInt(sl*256), parseInt(st*256), parseInt(sw*256), parseInt(sh*256),
nHInc, nVInc, nWdInc, nHtInc, nSteps, nSteps, fnDone); };
setTimeout(fn, 25);
} else if (fnDone) {
fnDone();
}
}
this._animateBox = function (sID, sl, st, sw, sh, nHInc, nVInc, nWdInc, nHtInc, totalSteps, nSteps, fnDone) {
var currStep = totalSteps - nSteps + 1;
goN2U.displayAt(sID, (sl+currStep*nHInc)>>8, (st+currStep*nVInc)>>8,
(sw+currStep*nWdInc)>>8, (sh+currStep*nHtInc)>>8);
if (--nSteps >0) {
var fn = function() { goN2U._animateBox(sID, sl, st, sw, sh, nHInc, nVInc, nWdInc, nHtInc, totalSteps, nSteps, fnDone); };
setTimeout(fn, 25);
} else {
goN2U.hide(sID);
if (fnDone) fnDone();
this.bAnimateBoxRunning = false;
}
}
this.initAnimationAPI = function () {
this.sAnimationDivID = 'goN2UAnimatedBox'; //WARNING: events.js uses goN2U.sAnimationDivID
this.bAnimateBoxRunning = false;
var b = document.body;
if (!b) {
throw(new Error('Page has no body tag.  JSF unsupported.'));
}
var o = document.createElement("div");
if (o) {
var sID = this.sAnimationDivID;
b.insertBefore(o, b.firstChild);
o.setAttribute("id", sID, 0);
this.setClass(o, 'animatedBox');
} else {
;
}
}
this.expDivProcessing = false;
this.expDivSize = 30;
this.stepDone = true;
this.toggleDivHeight = function (theDiv, hidableElem, delay, fnDone, displayableElem){
var oParent = this.getElement(theDiv).parentNode;
if (oParent.style.display != "none")
this.collapseDivDual('h', theDiv, hidableElem, delay, fnDone, displayableElem);
else
this.expandDivDual('h', theDiv, hidableElem, delay, fnDone, displayableElem);
}
this.toggleDivWidth = function (theDiv, hidableElem, delay, fnDone, displayableElem){
var oParent = this.getElement(theDiv).parentNode;
if (oParent.style.display != "none")
this.collapseDivDual('w', theDiv, hidableElem, delay, fnDone, displayableElem);
else
this.expandDivDual('w', theDiv, hidableElem, delay, fnDone, displayableElem);
}
this.expandDivWidth = function (theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate){
this.expandDivDual('w', theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate);
}
this.expandDivHeight = function (theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate){
this.expandDivDual('h', theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate);
}
this.collapseDivWidth = function (theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate){
this.collapseDivDual('w', theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate);
}
this.collapseDivHeight = function (theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate){
this.collapseDivDual('h', theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate);
}
this.collapseExpandDivsWidth = function (divA, divB, delay){
this.collapseExpandDivsDual ('w', divA, divB, delay);
}
this.collapseExpandDivsHeight = function (divA, divB, delay){
this.collapseExpandDivsDual ('h', divA, divB, delay);
}
this.expandCalcStep = function (h) {
if (h <40) return h/2;
if (h <225) return 20;  //15
if (h <900) return parseInt(h/10); // h/15
return 100;  // 60
}
this.expandDivDual = function (mode, theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate){
if (this.expDivProcessing) return;
this.expDivProcessing = true;
var theDivObj = this.getElement(theDiv);
var parentDiv = theDivObj.parentNode;
if (!parentDiv.id) { parentDiv.id = 'outer_' + theDivObj.id; }
this.expDivSize=0;
var maxSize;
if (mode == 'w' ) {
this.setWidth(parentDiv, this.expDivSize);
this.display(parentDiv);
maxSize = this.getElementWidth(theDivObj);
} else {
this.setHeight(parentDiv, this.expDivSize);
this.display(parentDiv);
maxSize = this.getElementHeight(theDivObj);
}
if (hidableElem) this.undisplay(hidableElem);
if (displayableElem) { this.display(displayableElem); }
if (bImmediate) {
this._expandDualFinal(mode, parentDiv, fnDone);
} else {
if (!delay || delay<20) { delay = 20; }
var step = 4;
this._expandDual(mode, parentDiv.id, maxSize, delay, step, fnDone, displayableElem);
}
}
this._expandDual = function (mode, parentDiv, maxSize, delay, step, fnDone, displayableElem){
if(this.expDivSize<maxSize) {
var nS = this.expDivSize;
if(nS>20){ step = this.expandCalcStep(maxSize); }
else if(nS>8) { step = 10; }
this.expDivSize = Math.min(this.expDivSize+=step, maxSize);
mode == 'w' ? this.setWidth(parentDiv, this.expDivSize) : this.setHeight(parentDiv, this.expDivSize);
setTimeout("goN2U._expandDual('"+mode+"','"+parentDiv+"',"+maxSize+","+delay+","+step+","+fnDone+",'"+displayableElem+"');",delay );
} else{
this._expandDualFinal(mode, parentDiv, fnDone);
}
}
this._expandDualFinal = function (mode, parentDiv, fnDone){
mode == 'w' ? this.setWidth(parentDiv, "auto") : this.setHeight(parentDiv, "auto");
this.expDivSize = 20;
this.expDivProcessing = false;
if(fnDone) fnDone();
}
this.collapseDivDual = function (mode, theDiv, hidableElem, delay, fnDone, displayableElem, bImmediate){
if (this.expDivProcessing) return;
this.expDivProcessing = true;
var theDivObj = this.getElement(theDiv);
var parentDiv = theDivObj.parentNode;
if (!parentDiv.id) { parentDiv.id = 'outer_' + theDivObj.id; }
if (!delay || delay<20) { delay = 20; }
this.expDivSize=0;
var size = (mode == 'w' ? this.getElementWidth(parentDiv) : this.getElementHeight(parentDiv));
var step = this.expandCalcStep(size);
if (hidableElem) this.undisplay(hidableElem);
var end = 0;
if(displayableElem) {
this.display(displayableElem,"inline");
end = (mode == 'w' ? this.getElementWidth(displayableElem) : this.getElementHeight(displayableElem));
this.undisplay(displayableElem);
}
if (bImmediate) {
this._collapseDualFinal(mode, parentDiv, hidableElem, fnDone, displayableElem);
} else {
this._collapseDual(mode, parentDiv.id, hidableElem, delay, step, fnDone, displayableElem, end)
}
}
this._collapseDual = function (mode, parentDiv, hidableElem, delay, step, fnDone, displayableElem, end){
this.expDivSize = (mode == 'w' ? this.getElementWidth(parentDiv) : this.getElementHeight(parentDiv));
var nRem = this.expDivSize-end;
if(nRem>0){
if(nRem<6){ step = 2; }
else if(nRem<11){ step = 4; }
else if(nRem<60){ step = 10; }
this.expDivSize -= step;
if (this.expDivSize <end) {
this.expDivSize = end;
}
mode == 'w' ? this.setWidth(parentDiv, this.expDivSize) : this.setHeight(parentDiv, this.expDivSize);
if (this.expDivSize>end) {
setTimeout("goN2U._collapseDual('"+mode+"','"+parentDiv+"','"+hidableElem+"',"+delay+","+step+","+fnDone+",'"+displayableElem+"',"+end+");",delay );
} else {
this._collapseDualFinal(mode, parentDiv, hidableElem, fnDone, displayableElem);
}
} else {
this._collapseDualFinal(mode, parentDiv, hidableElem, fnDone, displayableElem);
}
}
this._collapseDualFinal = function (mode, parentDiv, hidableElem, fnDone, displayableElem){
this.undisplay(parentDiv);
this.expDivProcessing = false;
if(displayableElem) this.display(displayableElem,"inline");
if(fnDone) fnDone();
}
this.getConfigurationObject = function(sID) {
var sClassName = 'go' + sID + 'Properties';
var obj;
if((typeof window[sClassName] != 'undefined') &&  (typeof window[sClassName] == 'object')) {
obj = window[sClassName];
} else {
obj = new Object;
}
obj.getValue = this._defaultConfigObjectGetValue;
obj.__sJSFID = sClassName;
return obj;
}
this._defaultConfigObjectGetValue = function(sID, sDefault) {
if (typeof this[sID] != 'undefined') {
return this[sID];
}
return sDefault;
}
this.collapseExpandDivsDual = function (mode, divA, divB, delay){
if (this.expDivProcessing) return;
this.expDivProcessing = true;
var divAObj = this.getElement(divA);
var divBObj = this.getElement(divB);
var divAParent = divAObj.parentNode;
var divBParent = divBObj.parentNode;
if (!divAParent.id) { divAParent.id = 'outer_' + divAObj.id; }
if (!divBParent.id) { divBParent.id = 'outer_' + divBObj.id; }
if (!delay || delay<20) { delay = 20; }
var size = (mode == 'w' ? this.getElementWidth(divAParent) : this.getElementHeight(divAParent));
var step = this.expandCalcStep(size);
this._comboCollapseDual(mode, divAParent.id, divBParent.id, delay, step);
}
this._comboCollapseDual = function (mode, divAParent, divBParent, delay, step){
this.expDivSize = (mode == 'w' ? this.getElementWidth(divAParent) : this.getElementHeight(divAParent));
if(this.expDivSize>step){
this.expDivSize-=step;
mode == 'w' ? this.setWidth(divAParent, this.expDivSize) :this.setHeight(divAParent, this.expDivSize);
setTimeout("goN2U._comboCollapseDual('"+mode+"','"+divAParent+"','"+divBParent+"',"+delay+","+step+");", delay );
} else {
this.undisplay(divAParent);
this.display(divBParent);
this.setWidth(divBParent,"auto");
mode == 'w' ?  this.setWidth(divBParent,"auto") :this.setHeight(divBParent,"auto");
var maxSize = (mode == 'w' ? this.getElementWidth(divBParent) : this.getElementHeight(divBParent));
this.expDivSize = step;
mode == 'w' ?  this.setWidth(divBParent,this.expDivSize) :this.setHeight(divBParent,this.expDivSize);
setTimeout("goN2U._comboExpandDual('"+mode+"','"+divBParent+"',"+maxSize+","+delay+","+step+");",delay );
}
}
this._comboExpandDual = function (mode,divBParent, maxSize, delay, step){
this.expDivSize =  (mode == 'w' ? this.getElementWidth(divBParent) : this.getElementHeight(divBParent));
if((this.expDivSize<maxSize) && (maxSize <1000)){
this.expDivSize+=step;
mode == 'w' ? this.setWidth(divBParent,this.expDivSize) : this.setHeight(divBParent,this.expDivSize);
setTimeout("goN2U._comboExpandDual('"+mode+"','"+divBParent+"',"+maxSize+","+delay+","+step+");",delay );
} else{
mode == 'w' ? this.setWidth(divBParent,maxSize) : this.setHeight(divBParent,maxSize);
this.show (divBParent);
this.expDivSize = 20;
this.expDivProcessing = false;
}
}
this.animateAlpha = function (sID, alphaStart, alphaFinal, nSteps, fnDone, style) {
var o = goN2U.getElement(sID);
if (!o) {
;
return;
}
alphaStart = (alphaStart <= 0 ? 0 : (alphaStart >= 100 ? 100 : alphaStart));
alphaFinal = (alphaFinal <= 0 ? 0 : (alphaFinal >= 100 ? 100 : alphaFinal));
if (this.isUndefined(o.azdAnimAlpha)) {
o.azdAnimAlpha = new Object();
o.azdAnimAlpha.bRunning = false;
}
var anim = o.azdAnimAlpha;
if (anim.bRunning) {
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
anim.bRunning = false;
}
var alphaDelta = alphaFinal-alphaStart;
var alphaStep = alphaDelta * 1.0 / nSteps; // force floating-point so alphaStep is non-zero
if (nSteps > 1 && Math.abs(alphaStep) > 0.0001) {
anim.alphaStep = alphaStep;
anim.alphaFinal = alphaFinal;
anim.fnDone = fnDone;
var alphaCur = this.getAlphaLevel(o);
anim.nDir = (alphaFinal-alphaCur) > 0 ? 1 : -1;
if (anim.nDir * alphaStep < 0) {
anim.alphaStep = -alphaStep;
}
if (alphaCur >= this.MOZALPHAMAX*100) {
this.setAlphaLevel(o, this.MOZALPHAMAX*100);
}
anim.bRunning = true;
var fn = new Function ("goN2U._animateAlpha('"+sID+"');");
anim.intervalID = setInterval(fn, 25);
} else {
this.setAlphaLevel(o, alphaFinal);
if (fnDone) {
fnDone();
}
}
}
this._animateAlpha = function (sID) {
var o = goN2U.getElement(sID);
if (!o) {
;
return;
}
var anim = o.azdAnimAlpha;
if (!anim.bRunning) {
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
return;
}
var alphaNext = this.getAlphaLevel(o) + anim.alphaStep;
if ((anim.alphaFinal-alphaNext) * anim.nDir > 0) {
this.setAlphaLevel(o, alphaNext);
} else {
this.setAlphaLevel(o, anim.alphaFinal);
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
anim.bRunning = false;
if (anim.fnDone) {
anim.fnDone();
}
}
}
this.animateAlphaCancel = function(sID) {
var o = goN2U.getElement(sID);
if (!o) {
;
return;
}
var anim = o.azdAnimAlpha;
clearInterval(anim.intervalID);
;
anim.intervalID = undefined;
anim.bRunning = false;
}
this.isUndefined = function (a) { return (typeof a == 'undefined'); }
this.isDefined   = function (a) { return typeof a != 'undefined'; }
this.isFunction  = function (a) { return typeof a == 'function'; }
this.isNull      = function (a) { return typeof a == 'object' && !a; }
this.isNumber    = function (a) { return typeof a == 'number' && isFinite(a); }
this.isObject    = function (a) { return (a && typeof a == 'object') || this.isFunction(a); }
this.isString    = function (a) { return typeof a == 'string'; }
this.isArray     = function (a) { return this.isObject(a) && a.constructor == Array; }
this.isList      = function (a) { return this.isObject(a) && this.isDefined(a.item) && this.isDefined(a.length)}; // tested for NodeList
this.isUndefOrNull = function (a) { return (typeof a == 'undefined') || (typeof a == 'object' && !a) }
this.objIsInstanceOf = function(obj, classObj) {
while (obj.__proto__) {
if (obj.__proto__ === classObj) {
return true;
}
obj = obj.__proto__;
}
return false;
}
this.templatize = function(oData, sTemplate)
{
var sHTML = '';
if (sTemplate.length > 0)
{
if (this.bIsSafari) {
var sHTML = sTemplate;
for (var i in oData) {
if (typeof(oData[i]) == "string") {
oData[i] = oData[i].replace(new RegExp("\\$", "g"), "&#36;");
}
sHTML = sHTML.replace(new RegExp("{" + i + "}", "g"), oData[i]);
}
sHTML = sHTML.replace(/{([^}]+)}/g, '');
} else {
sHTML = sTemplate.replace(/{([^}]+)}/g, function($0, $1) {
var sV = oData[$1];
if ( typeof sV != 'undefined'  ) {
return sV;
}
return '';
});
}
}
return sHTML;
}
this.extractMultipartValues = function(sVal, cSeparator, aPropertyNames, oProperties, sName) {
if (!sVal || sVal.length == 0) {
return oProperties;
}
var aResult = sVal.split(cSeparator);
var nExpected = aPropertyNames.length;
if (aResult.length) {
if (aResult.length > nExpected) {
aResult[nExpected-1] = aResult.slice(nExpected-1).join('_');
}
if (goN2U.isUndefOrNull(oProperties)) {
oProperties = {};
}
if (!oProperties.aRawValues) {
oProperties.aRawValues=[];
}
oProperties.aRawValues[oProperties.aRawValues.length] = sVal;
var i;
for (i=0;i<aPropertyNames.length;i++) {
var sPropName = aPropertyNames[i];
var c = sPropName.charAt(0);
var val = aResult[i];
if (goN2U.isDefined(val)) {
switch (c) {
case 'a': val = val.split('|');
break;
case 'b': val = val ? true : false;
break;
case 'n': val = parseInt(val);
break;
}
oProperties[sPropName] = val;
} else {
;
}
}
}
return oProperties;
}
this.handleEvent = function (evt)
{
if (!evt && window.event) evt = window.event;
var elTarget = evt.srcElement || evt.target;
if (evt.stopPropagation) evt.stopPropagation();
evt.cancelBubble = true;
return true;
}
this.addHandler = function (el, evt, fn)
{
if (el.attachEvent)
return el.attachEvent("on"+evt, fn);
else if (el.addEventListener)
return (el.addEventListener(evt, fn, false), true);
else
return (el["on"+evt] = fn, true);
return false;
}
this.removeHandler = function (el, evt, fn)
{
if (el.detachEvent)
return el.detachEvent("on"+evt, fn);
else if (el.removeEventListener)
return (el.removeEventListener(evt, fn, false), true);
else
return (el["on"+evt] = null, true);
return false;
}
this.hasClass = function (el, sClass)
{
el = this.getElement(el);
if (el)
{
return new RegExp("\\b"+sClass+"\\b").test(el.className);
}
return false;
}
this.addClass = function (el, sClass)
{
el = this.getElement(el);
if (el)
{
if (!new RegExp("\\b"+sClass+"\\b").test(el.className)) {
el.className += ((el.className.length > 0) ? " " : '')+ sClass;
}
return true;
}
return false;
}
this.removeClass = function (el, sClass)
{
el = this.getElement(el);
if (el)
{
el.className = el.className.replace(new RegExp('\\b'+sClass+"\\b",'g'), '');
return true;
}
return false;
}
this.insertAdjacentHTML = function(oElm, sWhere, sHTML)
{
if (oElm.insertAdjacentHTML && goN2U.isIE())
{
oElm.insertAdjacentHTML(sWhere, sHTML);
return;
} else if (oElm.ownerDocument && oElm.ownerDocument.createRange)
{
var oRange = oElm.ownerDocument.createRange();
oRange.setStartBefore(oElm);
var oFrag = oRange.createContextualFragment(sHTML);
switch (sWhere)
{
case 'beforeBegin':
oElm.parentNode.insertBefore(oFrag,oElm)
break;
case 'afterBegin':
oElm.insertBefore(oFrag,oElm.firstChild);
break;
case 'beforeEnd':
oElm.appendChild(oFrag);
break;
case 'afterEnd':
if (oElm.nextSibling)
{
oElm.parentNode.insertBefore(oFrag,oElm.nextSibling);
} else {
oElm.parentNode.appendChild(oFrag);
}
break;
default:
;
break;
}
} else
{
;
}
}
this.addStyles = function(aStyles) {
var i, s, aS;
if (document.styleSheets.length == 0) {
var newcss = document.createElement("style");
newcss.type="text/css";
newcss.media="all";
document.getElementsByTagName("head")[0].appendChild(newcss);
if (document.styleSheets.length == 0) {
;
return;
}
}
var css = document.styleSheets[document.styleSheets.length-1];
for (i=0; i< aStyles.length; i++) {
s = aStyles[i];
if (css.insertRule) {
css.insertRule(s, 0);
} else if (css.addRule) {
if (aS = s.match(/^([^\{]*)\{([^\}]*)\}/))
css.addRule(aS[1], aS[2]);
}
}
}
this.workaroundIE6CachingBug = function()
{
var userAgent = navigator.userAgent;
if (this.bIsIE && userAgent.search(/msie 6\./i) >= 0 && userAgent.search(/windows/i) >= 0)
{
try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}
}
}
} // END of goN2Utilities Class
goN2Locale = new Object();
goN2Locale.getString = function(id, sFallback)
{
var oCfg = goN2U.getConfigurationObject('JSFStringTable');
var str;
if (id && oCfg)
{
str = oCfg.getValue(id);
}
if (!str)
{
;//goN2Debug.error('Untranslated string '+id+' ("'+sFallback+'") used (or string table not available)');
return sFallback;
}
return str;
}
goN2Locale.getStrings = function(idsAndFallbacks)
{
var oCfg = goN2U.getConfigurationObject('JSFStringTable');
var trans = {};
if (oCfg)
{
var str;
for (id in idsAndFallbacks)
{
str = oCfg.getValue(id);
if (str)
{
trans[id] = str;
}
else
{
;
trans[id] = idsAndFallbacks[id];
}
}
}
else
{
;
}
return trans;
}
goN2Locale.getImageURL = function(id, sFallback)
{
var oCfg = goN2U.getConfigurationObject('JSFImageURL');
var str = '';
if (oCfg)
{
if (oCfg.getValue(id))
{
return oCfg.getValue(id);
}
else if (goN2U.isDefined(sFallback))
{
var fullPathFallback = window.gsN2ImageHost + sFallback;
;
return fullPathFallback;
}
else
{
;
}
}
else
{
;//goN2Debug.error("JSF image table not available)");
}
return str;
}
goN2Locale.getImageURLs = function(idsAndFallbacks)
{
var oCfg = goN2U.getConfigurationObject('JSFImageURL');
var trans = {};
if (oCfg)
{
var url;
for (id in idsAndFallbacks)
{
url = oCfg.getValue(id);
if (url)
{
trans[id] = url;
}
else
{
var fullPathFallback = window.gsN2ImageHost + idsAndFallbacks[id];
;//goN2Debug.error("Couldn't find image tag \"" + id + '"; falling back to ' + fullPathFallback + ')');
trans[id] = fullPathFallback;
}
}
}
else
{
;
}
return trans;
}
if (typeof(HTMLElement) != 'undefined')
{
HTMLElement.prototype.insertAdjacentHTML = function(sWhere, sHTML)
{
goN2U.insertAdjacentHTML(this, sWhere, sHTML);
}
}
window.N2TextSizer=function(spanID) {
var spanEl = document.createElement("span");
if (spanEl) {
spanEl.setAttribute("id",spanID, 0);
document.body.appendChild(spanEl);
goN2U.hide(spanID);
this.span=spanEl;   // expects goN2Utility class to have been initialized
this.sID = spanID;
this.style=null;
}
this.getStringWidth = function (txt, len) {
;
if (len) this.span.innerText = txt.substring(0, len);
else this.span.innerText = txt;
return goN2U.getElementWidth(this.sID);
}
this.setStyle = function (style) {
if (style != this.style) {
goN2U.setClass (this.span, style);
this.style = style;
}
}
this.truncateToWidth = function (txt, width) {
var len = txt.length;
var txtwidth = this.getStringWidth(txt);
if (txtwidth >width) {
var reqlen = Math.floor(width/txtwidth*len) - 3;
var temptxt = txt.substring(0, reqlen);
temptxt += '...';
return temptxt;
} else {
return txt;
}
}
this.setContent = function (cont) {
this.span.innerHTML=cont;
return goN2U.getElementWidth(this.span);
}
this.getWidth = function () {
return goN2U.getElementWidth(this.span);
}
this.getHeight = function () {
return goN2U.getElementHeight(this.span);
}
}
window.N2FifoQueue=function(n) {
var current = 0;
var next = 0;
var size = n ? n : 20;
var q = new Array(n);
this.add = function (item) {
q[next] = item;
next++;
if (next == size) next = 0;
q[next] = null;  // to ensure we don't have current go past
}
this.current = function () {
return q[current];
}
this.next = function () {
var val = null;
if (q[current]) current++;  // don't advance past stop fence
if (current == size) current = 0;
val = q[current];
return val;
}
this.nextExists = function () {
var val = null;
var temp = current;
if (q[temp]) temp++;   // don't advance past stop fence
if (temp == size) temp = 0;
return q[temp] != null;
}
this.toString = function () {
var txt = "Current: " + current + "\n";
txt += "Next: " + next + "\n";
for (i=0;i<size;i++) {
txt += "["+i+"] = " + q[i];
if (i == current) txt += " <-Current ";
if (i == next) txt += " <-Next";
txt +="\n";
}
return txt
}
}
window.N2BrowseStack=function(n) {
var current = -1;
var size = n ? n : 20;
var q = new Array(n);
this.add = function (item) {
current++;
q[current] = item;
q[current+1] = null;   // once we add a new item any past it are toast
}
this.reset = function () {
current = -1;
q[0] = null;
q[1] = null;
}
this.previous = function (item) {
if (current >0) return q[current-1];
return null;
}
this.current = function () {
return q[current];
}
this.next = function () {
return q[current+1];
}
this.goBack = function () { if (current >0) current--; }
this.goForward = function () { if (q[current+1]) current++; }
this.toString = function () {
var txt = "Current: " + current + "\n";
for (i=0;i<=current;i++) {
txt += "["+i+"] = " + q[i].id;
if (i == current) txt += " <-Current ";
txt +="\n";
}
return txt
}
}
window.N2LinkNameInfo=function(sLinkID, sNameOverride) {
if (sLinkID) {
var oLink = goN2U.getElement(sLinkID);
var sName = "";
if (oLink) {
sName = oLink.name;
;
}
if (sNameOverride) {
sName = sNameOverride;
;
}
if (sName) {
var tmpArray = sName.split("|");
if (tmpArray.length >1) {
this.sLinkID = sLinkID;
this.sName = sName;
this.sFeature  = tmpArray[0];
this.sType = tmpArray[1];
this.sID = tmpArray[2];
this.sParams = tmpArray[3];
for (var i = 4; !goN2U.isUndefined(tmpArray[i]); i++) {
this.sParams = this.sParams + "|" + tmpArray[i];
}
}
}
} else {
;
}
this.getLinkID  = function () { return this.sLinkID; }
this.getLinkName= function () { return this.sName; }
this.getFeature = function () { return this.sFeature; }
this.getType    = function () { return this.sType; }
this.getID      = function () { return this.sID; }
this.getParams  = function () { return this.sParams; }
}
var gaN2HandlerChains = new Array();
var gaN2HandlerRunFns = new Array();
window.N2ChainEventHandler=function(sHandlerName, fFn, sComment) {
sHandlerName = sHandlerName.toLowerCase();
sComment = sComment ? sComment : 'unknown';
;
;
if ( (typeof fFn != 'function') || fFn == null) return false;
var aChain;
if (!gaN2HandlerChains[sHandlerName]) {
aChain = gaN2HandlerChains[sHandlerName] = new Array();
} else {
aChain =  gaN2HandlerChains[sHandlerName];
}
var oE = window;
if (sHandlerName != 'onload' && sHandlerName != 'onresize' && sHandlerName != 'onerror') {
oE = document.getElementsByTagName("body")[0];
if (oE == null) {
;
return;
}
}
if  (oE[sHandlerName])  {
if (oE[sHandlerName] != gaN2HandlerRunFns[sHandlerName]) {
aChain[0] = oE[sHandlerName];
var fn = new Function ("evt", "evt = evt ? evt : window.event; _N2RunHandlers(evt, '"+sHandlerName+"');");
gaN2HandlerRunFns[sHandlerName] = fn;
oE[sHandlerName] = fn;
}
var len = aChain.length;
;
aChain[len] = fFn;
} else {
;
oE[sHandlerName] = fFn;
}
return true;
}
function _N2RunHandlers( evt, sHandlerName ) {
var aH = gaN2HandlerChains[sHandlerName];
var len = aH.length;
for (var i=0;i<len;i++) {
aH[i](evt);
}
}
N2ChainEventHandler('onload',
function(){
n2RunEvent('onload');
n2RunEvent(goN2LibMon.isJSLoaded() ? 'onloadsuccess' : 'onloaderror');
},
'run onload events' );
window.goN2Drag = {
obj : null,
normalizeEvent : function (evt) {
evt = (evt) ? evt : ((window.event) ? window.event : null);
if (evt) {
if(!evt.target) {
evt.target = evt.srcElement;
}
} else {
;
}
return evt;
},
mouseDown : function(evt) {
evt = goN2Drag.normalizeEvent(evt);
if (evt) {
var oE = goN2Drag.obj = evt.target;
if (oE._n2bDraggable) {
oE._n2SavedMouseMove = document.onmousemove;
oE._n2SavedMouseUp = document.onmouseup;
document.onmousemove = goN2Drag.mouseMove;
document.onmouseup = goN2Drag.mouseUp;
if (document.body && document.body.setCapture) {
document.body.setCapture();
;
}
var mouseDownX = (evt.clientX)? evt.clientX : evt.pageX;
var mouseDownY = (evt.clientY)? evt.clientY : evt.pageY;
oE.dragOffsetX = mouseDownX - ((oE.offsetLeft) ? oE.offsetLeft : oE.left);
oE.dragOffsetY = mouseDownY - ((oE.offsetTop) ? oE.offsetTop : oE.top);
oE.buttonIsDown = true;
if (oE._oN2 && oE._oN2.mouseDown) {
oE._oN2.onMouseDown(evt)
}
}
}
},
mouseMove : function(evt) {
evt = goN2Drag.normalizeEvent(evt);
if (evt) {
var oE = goN2Drag.obj;
if (oE.buttonIsDown) {
var nX = (evt.clientX)? evt.clientX : evt.pageX;
nX -= oE.dragOffsetX;
var nY = (evt.clientY)? evt.clientY : evt.pageY;
nY -= oE.dragOffsetY;
nX = Math.max(oE._n2nMinLeft, nX);
nX = Math.min(oE._n2nMaxLeft, nX);
nY = Math.max(oE._n2nMinTop, nY);
nY = Math.min(oE._n2nMaxTop, nY);
var bDoShift = true;
if (oE._oN2 && oE._oN2.onMoved) {
bDoShift = oE._oN2.onMoved(nX, nY);
}
if (bDoShift) {
goN2U.shiftTo(oE, nX, nY);
}
}
}
},
mouseUp : function(evt) {
;
evt = goN2Drag.normalizeEvent(evt);
if (evt) {
var oE = goN2Drag.obj;
if (oE.buttonIsDown) {
if (document.body && document.body.releaseCapture) {
document.body.releaseCapture();
;
}
oE.buttonIsDown = false;
if (oE._oN2 && oE._oN2.onMouseUp) {
oE._oN2.onMouseUp();
}
}
document.onmousemove = oE._n2SavedMouseMove;
document.onmouseup   = oE._n2SavedMouseUp;
}
},
makeDraggable : function (sID, nMinLeft, nMaxLeft, nMinTop, nMaxTop) {
var oE = goN2U.getElement(sID);
if (oE) {
oE["onmousedown"] = goN2Drag.mouseDown;
oE._n2bDraggable = true;
oE._n2nMinLeft = goN2U.isDefined(nMinLeft) ? nMinLeft : 0;
oE._n2nMaxLeft = goN2U.isDefined(nMaxLeft) ? nMaxLeft : 10000;
oE._n2nMinTop = goN2U.isDefined(nMinTop) ? nMinTop : 0;
oE._n2nMaxTop = goN2U.isDefined(nMaxTop) ? nMaxTop : 10000;
;
} else {
;
}
return oE;
}
}
var goN2U = new N2Utilities();
goN2U.initialize();
if (window.goN2LibMon) goN2LibMon.endLoad('utilities');

/* utilities Ends */



/* events Starts */

//! ################################################################
//! Copyright (c) 2004-2007 Amazon.com, Inc., and its Affiliates.
//! All rights reserved.
//! Not to be reused without permission
//! $DateTime: 2007/09/03 08:14:26 $
//! ################################################################
function n2EventsInitLibrary() { // Begin library code wrapper. Goes all the way to the bottom of the file
if (window.goN2LibMon) goN2LibMon.beginLoad('events', 'n2CoreLibs');
window.N2Instance = function(oFeature) {
this.className = 'N2Instance';
this.version = '1.1.0';
this.oFeature = oFeature;
this._timers = new Object(); // HASH of timerids for this object, indexed by timer name.
this.nSTATEDORMANT = 0;
this.nSTATEPREOPEN = 1;
this.nSTATEOPENING = 2;
this.nSTATEVISIBLE = 3;
this.nSTATECLOSING = 4;
this.activeState = this.nSTATEDORMANT;
this.instanceName = null;
this.oRegFeatureOpened = null;
}
new N2Instance();
window.N2Instance.prototype.getFeature = function() {
return this.oFeature;
}
window.N2Instance.prototype.getFeatureID = function() {
return (this.oRegFeatureOpened ? this.oRegFeatureOpened.getFeatureID() : "");
}
window.N2Instance.prototype.setRegFeatureOpened = function(oRegFeatureOpened) {
this.oRegFeatureOpened = oRegFeatureOpened;
}
window.N2Instance.prototype.getRegFeatureOpened = function() {
return this.oRegFeatureOpened;
}
window.N2Instance.prototype.getInstanceName = function() {
return this.instanceName;
}
window.N2Instance.prototype.getInstanceNameFromLinkInfo = function(oLNI) {
;
return null;
}
window.N2Instance.prototype._setInstanceName = function(oLNI) {
;
var instanceName = this.getInstanceNameFromLinkInfo(oLNI);
if (instanceName != this.instanceName) {
this.clearAllTimers();
this.instanceName = instanceName;
}
}
window.N2Instance.prototype.isDormant = function() {
return (this.activeState <= this.nSTATEDORMANT);
}
window.N2Instance.prototype.isPreOpen = function() {
return (this.nSTATEDORMANT < this.activeState && this.activeState <= this.nSTATEPREOPEN);
}
window.N2Instance.prototype.isOpening = function() {
return (this.nSTATEPREOPEN < this.activeState && this.activeState <= this.nSTATEOPENING);
}
window.N2Instance.prototype.isVisible = function() {
return (this.nSTATEOPENING < this.activeState && this.activeState <= this.nSTATEVISIBLE);
}
window.N2Instance.prototype.isClosing = function() {
return (this.nSTATEVISIBLE < this.activeState);
}
window.N2Instance.prototype.isActive = function() {
return this.isVisible();
};
window.N2Instance.prototype.setTimer = function(timerName, nMSDelay, eventData) {
this.clearTimer(timerName);
var timerObject = new Object();
this._timers[timerName] = timerObject;
;//goN2Debug.info("N2Instance setting timer feature " + this.getFeatureID() + ", instance " + this.getInstanceName() + ", timer " + timerName + ", eventData " + eventData);
timerObject.eventData = eventData;
timerObject.timerid = setTimeout(
"N2Instance._timerFired('" +
this.getFeatureID() + "', '" +
this.getInstanceName() + "', '" +
timerName+"')",
nMSDelay);
}
window.N2Instance.prototype.clearTimer = function(timerName) {
var timerObject = this._timers[timerName];
if (timerObject) {
;
clearTimeout(timerObject.timerid);
this._timers[timerName] = 0;
}
}
window.N2Instance.prototype.clearAllTimers = function() {
;
for (var timerName in this._timers) {
this.clearTimer(timerName);
}
}
window.N2Instance._timerFired = function(featureID, instanceName, timerName) {
;
var oFeature = goN2Events.lookupFeature(featureID);
;
if (!oFeature) {
return;
}
var oInstance = oFeature.getInstance(featureID, instanceName);
;
if (!oInstance) {
return;
}
var timerObject = oInstance._timers[timerName];
oInstance._timers[timerName] = 0;
;
oInstance[timerName](timerObject.eventData);
}
window.N2FInstance = function(oFeature) {
N2FInstance.parentClass.call(this, oFeature);
this.className = 'N2FInstance';
this.version = '1.1.0';
this.bPreOpenDuringClose = false;
this.bMouseIsIn = false;
}
window.N2FInstance.prototype = new N2Instance();
window.N2FInstance.parentClass = N2Instance;
window.N2FInstance.prototype.getRawObject = function() {
;
return null;
}
window.N2FInstance.prototype.getInstanceNameFromLinkInfo = function(oLNI) {
var name = N2FInstance.getInstanceNameFromLinkInfo(oLNI);
return name;
}
window.N2FInstance.getInstanceNameFromLinkInfo = function(oLNI) {
;
var name = (oLNI.getID() ? N2Feature.prefixFInstanceNames + oLNI.getID() : null);
return name;
}
window.N2FInstance.prototype.isStatic = function() {
return false;
}
window.N2FInstance.prototype.assignInstance = function(oLNI) {
if (!this.isDormant()) {
;
return false;
}
this._setInstanceName(oLNI);
return true;
}
window.N2FInstance.prototype.overlayClosed = function() {
return;
}
window.N2FInstance.prototype.notifyFInstanceHasMouse = function(bMouseIsInInstance) {
var bMouseWasIn = this.bMouseIsIn;
this.bMouseIsIn = bMouseIsInInstance;
if (this.oFeature.isDisabled()) {
return;
}
if (this.isStatic()) {
return;
}
if (bMouseWasIn && !bMouseIsInInstance) {
;
this._scheduleClose(this.getRegFeatureOpened().getDelayCloseAfter());
} else if (!bMouseWasIn && bMouseIsInInstance) {
;
this._cancelClose();
}
}
window.N2FInstance.prototype.setMouseIn = function(bMouseIsInInstance) {
this.bMouseIsIn = bMouseIsInInstance;
}
window.N2FInstance.prototype.mouseOverHotspotTrack = function(oLNI) {
;//goN2Debug.info("feature instance mouseOverHotspotTrack; feature " + oLNI.getFeature() + ", feature instance '" + this.getInstanceName() + "'");
var oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
;
if (this.oFeature.isDisabled()) {
return;
}
this._cancelClose();
}
window.N2FInstance.prototype.mouseOverHotspotOpen = function(oLNI, nFeatureFlags) {
;//goN2Debug.info("feature instance mouseOverHotspotOpen; feature " + oLNI.getFeature() + ", feature instance '" + this.getInstanceName() + "'");
var oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
;
if (this.oFeature.isDisabled()) {
return;
}
if (this.activeState<=this.nSTATEPREOPEN || this.isClosing()) {
this._scheduleOpen(oLNI, nFeatureFlags, oRegFeature.getDelayShowAfter());
} else {
;
this._cancelClose();
}
}
window.N2FInstance.prototype.mouseOutHotspotClose = function(oLNI) {
;//goN2Debug.info("feature instance mouseOutHotspotClose; feature " + this.getFeatureID() + ", feature instance '" + this.getInstanceName() + "'");
var oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
;
if (this.activeState <= this.nSTATEDORMANT) {
} else if (this.activeState <= this.nSTATEPREOPEN) {
this._cancelOpen();
} else if (this.activeState <= this.nSTATEVISIBLE) {
this._scheduleClose(oRegFeature.getDelayReachWithin());
} else {
}
}
window.N2FInstance.prototype.clickHotspotOpen = function(oLNI, nFeatureFlags) {
;//goN2Debug.info("feature instance clickHotspotOpen; feature " + this.getFeatureID() + ", feature instance '" + this.getInstanceName() + "'");
var oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
;
this.openNow(oLNI, nFeatureFlags);
}
window.N2FInstance.prototype.mouseOver = function() {
;//goN2Debug.info("feature instance mouseOver; feature " + this.getFeatureID() + ", feature instance '" + this.getInstanceName() + "'");
this.notifyFInstanceHasMouse(true);
}
window.N2FInstance.prototype.mouseOut = function() {
;//goN2Debug.info("feature instance mouseOut; feature " + this.getFeatureID() + ", feature instance '" + this.getInstanceName() + "'");
this.notifyFInstanceHasMouse(false);
}
window.N2FInstance.prototype._scheduleOpen = function(oLNI, nFeatureFlags, nMSDelay) {
this.setRegFeatureOpened(goN2Events.lookupRegFeature(oLNI.getFeature()));
;
var eventData = new Object();
eventData.oLNI = oLNI;
eventData.nFeatureFlags = nFeatureFlags;
this.setTimer("_timedOpen", nMSDelay, eventData);
if (this.isClosing()) {
this.bPreOpenDuringClose = true;
} else {
this.activeState = this.nSTATEPREOPEN;
}
}
window.N2FInstance.prototype._timedOpen = function(eventData) {
if (this.oFeature.isDisabled()) {
return;
}
this.openNow(eventData.oLNI, eventData.nFeatureFlags);
}
window.N2FInstance.prototype._cancelOpen = function() {
;
this.clearTimer("_timedOpen");
}
window.N2FInstance.prototype._scheduleClose = function(nMSDelay) {
;
if (this.isStatic()) {
return;
}
this.setTimer("_timedClose", nMSDelay, null);
}
window.N2FInstance.prototype._timedClose = function(eventData) {
this.closeNow();
}
window.N2FInstance.prototype._cancelClose = function() {
;
this.clearTimer("_timedClose");
}
window.N2FInstance.prototype.openNow = function(oLNI, nFeatureFlags) {
;
}
window.N2FInstance.prototype.closeNow = function(bImmediate) {
;
}
window.N2FInstanceWrapper = function(oWrapperFeature) {
N2FInstanceWrapper.parentClass.call(this, oWrapperFeature); // Call the base class constructor function.
this.className = 'N2FInstanceWrapper';
this.version = '1.1.0';
this.oWrappedFeature = null; // must be null except when Active.
}
window.N2FInstanceWrapper.prototype = new N2FInstance();
window.N2FInstanceWrapper.parentClass = N2FInstance;
window.N2FInstanceWrapper.prototype.isStatic = function() {
return ((this.oWrappedFeature && this.oWrappedFeature.isStatic) ? this.oWrappedFeature.isStatic() : false);
}
window.N2FInstanceWrapper.prototype.getRawObject = function() {
;
return this.oWrappedFeature.getObject();
}
window.N2FInstanceWrapper.prototype.openNow = function(oLNI, nFeatureFlags) {
;//goN2Debug.info("feature instance wrapper openNow; feature " + oLNI.getFeature() + ", feature instance '" + this.getInstanceNameFromLinkInfo(oLNI) + "'");
;
if (this.oFeature.isDisabled()) {
return;
}
var oFInstanceActive = this.oFeature.getActiveWrappedFInstance();
if (oFInstanceActive) {
oFInstanceActive.closeNow(true);
}
this.oWrappedFeature = this.oFeature.getWrappedFeatureObj();
this.oFeature.setActiveWrappedFInstance(this);
if (!this.oWrappedFeature.isVisible())
{
;
this._cancelOpen();
this.setRegFeatureOpened(goN2Events.lookupRegFeature(oLNI.getFeature()));
var oHotspot = this._createHotspotObj(oLNI, nFeatureFlags);
this.oWrappedFeature.show(oHotspot);
if (this.oWrappedFeature.isVisible()) {
goN2Events.toggleObjects("hide", this.oFeature.getWrappedFeatureActiveElement().id);
this._setStateFromWrappedFeature(this.nSTATEVISIBLE);
} else {
this.oWrappedFeature = null;
this.oFeature.setActiveWrappedFInstance(null);
this._setStateFromWrappedFeature(this.nSTATEDORMANT);
}
} else {
;
this._setStateFromWrappedFeature(this.nSTATEVISIBLE);
}
}
window.N2FInstance.prototype.overlayClosed = function() {
if (this.oWrappedFeature) {
this.oWrappedFeature = null;
this.oFeature.setActiveWrappedFInstance(null);
}
this._setStateFromWrappedFeature(this.nSTATEDORMANT);
}
window.N2FInstanceWrapper.prototype._setStateFromWrappedFeature = function(activeStateExpected) {
if (this.oWrappedFeature && this.oWrappedFeature.isVisible()) {
this.activeState = this.nSTATEVISIBLE;
} else {
this.activeState = this.nSTATEDORMANT;
}
;
if (this.activeState != activeStateExpected) {
;
}
}
window.N2FInstanceWrapper.prototype.closeNow = function(bImmediate) {
;//goN2Debug.info("feature instance wrapper closeNow; feature " + this.getFeatureID() + ", feature instance '" + this.getInstanceName() + "'");
if (this.isStatic()) {
return;
}
var oWrappedFeature = this.oWrappedFeature;
if (oWrappedFeature && oWrappedFeature.isVisible()) {
this._cancelClose();
var nAnimateCloseSaved;
if (bImmediate) {
nAnimateCloseSaved = this._smashNAnimateClose(oWrappedFeature, 0);
}
try {
;
oWrappedFeature.hide();
} catch (e) {
if (bImmediate) {
this._smashNAnimateClose(oWrappedFeature, nAnimateCloseSaved);
}
throw(e);
}
if (bImmediate) {
this._smashNAnimateClose(oWrappedFeature, nAnimateCloseSaved);
}
;
if (this.oWrappedFeature) {
this.oWrappedFeature = null;
this.oFeature.setActiveWrappedFInstance(null);
}
goN2Events.toggleObjects("show");
} else {
;
}
this._setStateFromWrappedFeature(this.nSTATEDORMANT);
this.setRegFeatureOpened(null);
}
window.N2FInstanceWrapper.prototype._smashNAnimateClose = function(oWrappedFeature, newValue) {
var oldValue = oWrappedFeature.nAnimateClose;
oWrappedFeature.nAnimateClose = newValue;
return oldValue;
}
window.N2FInstanceWrapper.prototype._createHotspotObj = function(oLNI, nFeatureFlags) {
if (goN2U.isUndefOrNull(nFeatureFlags)) {
nFeatureFlags = 0;
}
var oHotspot = new Object();
oHotspot.id = "";
oHotspot.objectname = "";
oHotspot.abstop = "";           // abs y within the document
oHotspot.absleft = "";          // abs x within the document
oHotspot.top = "";              // abs y within the window [relative to the document]
oHotspot.left = "";             // abs x within the window [relative to the document]
oHotspot.bottom = "";
oHotspot.right = "";
oHotspot.availAbove = 0;
oHotspot.availUnder = 0;
oHotspot.availLeft = 0;
oHotspot.availRight = 0;
oHotspot.scrollLeft = 0;
oHotspot.scrollTop = 0;
oHotspot.clientHeight = 0;
oHotspot.clientWidth = 0;
oHotspot.staticFlag = 0;
var sFeatureID = oLNI.getFeature();
;
var sLinkID = oLNI.getLinkID();
var oLink = goN2U.getRawObject(sLinkID);
oHotspot.oLink = oLink;
var sName = oLNI.getLinkName();
if (sName != oLink.id) {
oHotspot.sNameOverride = sName;
}
;
oHotspot.featureID = sFeatureID;
;
oHotspot.relatedFeatureObj = this.oWrappedFeature;
oHotspot.staticFlag = nFeatureFlags;
oHotspot.scrollLeft = goN2U.getScrollLeft();
oHotspot.scrollTop = goN2U.getScrollTop();
oHotspot.clientHeight = goN2U.getInsideWindowHeight();
oHotspot.clientWidth = goN2U.getInsideWindowWidth();
;
;
oHotspot.href = oLink.href;
var sTmp;
var re = /([\r\n])/gi;
sTmp = oLink.innerHTML;
oHotspot.linkHTML = sTmp.replace(re, " ");
sTmp = goN2U.isUndefOrNull(oLink.innerText) ? oLink.innerHTML : oLink.innerText;
oHotspot.linkText = sTmp.replace(re, " ");
;
;
;
;
oHotspot.absleft = goN2U.getScrolledElementLeft(oLink);
oHotspot.abstop = goN2U.getScrolledElementTop(oLink);
oHotspot.left = goN2U.getObjectLeft(oLink) - oHotspot.scrollLeft;
oHotspot.top = goN2U.getObjectTop(oLink) - oHotspot.scrollTop;
oHotspot.width = goN2U.getObjectWidth(oLink);
oHotspot.height = goN2U.getObjectHeight(oLink);
var elChild = oLink.firstChild;
if ( (oHotspot.width == 0) && elChild ){
oHotspot.width = goN2U.getObjectWidth(elChild);
oHotspot.height = goN2U.getObjectHeight(elChild);
} else if ( goN2U.isMozilla5() ) {
var aChildren = oLink.childNodes
var nChildren = aChildren.length;
for (var i=0;i<nChildren;i++) {
elChild = aChildren[i];
if ((elChild.nodeType == 1) && (elChild.tagName == 'IMG')) {
oHotspot.bottom = oHotspot.top + goN2U.getObjectHeight(oLink);
oHotspot.height = goN2U.getObjectHeight(elChild);
var oldTop = oHotspot.top;
oHotspot.top = oHotspot.bottom - oHotspot.height;
oHotspot.abstop = oHotspot.abstop + (oHotspot.top-oldTop);
break;
}
}
}
oHotspot.right = oHotspot.left + oHotspot.width;
oHotspot.bottom = oHotspot.top + oHotspot.height;
oHotspot.sLinkID = sLinkID;
; //oLink set earlier
oHotspot.availAbove = oHotspot.abstop - oHotspot.scrollTop - 1;
oHotspot.availUnder = oHotspot.clientHeight - (oHotspot.abstop + oHotspot.height - oHotspot.scrollTop);
oHotspot.availLeft = oHotspot.absleft - oHotspot.scrollLeft - 1;
oHotspot.availRight = oHotspot.clientWidth - (oHotspot.absleft + oHotspot.width - oHotspot.scrollLeft);
return oHotspot;
}
window.N2HInstance = function(oFeature) {
N2HInstance.parentClass.call(this, oFeature); // Call the base class constructor function.
this.className = 'N2HInstance';
this.version = '1.1.0';
}
window.N2HInstance.prototype = new N2Instance();
window.N2HInstance.parentClass = N2Instance;
window.N2HInstance.prototype.getInstanceNameFromLinkInfo = function(oLNI) {
return N2HInstance.getInstanceNameFromLinkInfo(oLNI);
}
window.N2HInstance.getInstanceNameFromLinkInfo = function(oLNI) {
;
;
return N2Feature.prefixHInstanceNames + oLNI.getLinkID();
}
window.N2HInstance.prototype.getLinkInfoFromInstanceName = function(sInstanceName) {
return N2HInstance.getInstanceNameFromLinkInfo(sInstanceName);
}
window.N2HInstance.getLinkInfoFromInstanceName = function(sInstanceName) {
;
var prefixLength = N2Feature.prefixHInstanceNames.length;
;
var sLinkID = sInstanceName.substr(prefixLength, sInstanceName.length-prefixLength);
return goN2U.getLinkNameInfo(sLinkID);
}
window.N2HInstance.prototype.mouseOverTrack = function(oLNI) {
if (this.oFeature.isDisabled()) {
return;
}
;//goN2Debug.info("hotspot mouseOverTrack; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());
var oFInstance = this.oFeature.getFeatureInstance(oLNI);
if (oFInstance) {
oFInstance.mouseOverHotspotTrack(oLNI);
}
}
window.N2HInstance.prototype.mouseOverOpen = function(oLNI, nFeatureFlags) {
if (this.oFeature.isDisabled()) {
return;
}
;//goN2Debug.info("hotspot mouseOverOpen; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());
var oFInstance = this.oFeature.getFeatureInstance(oLNI);
if (!oFInstance) {
oFInstance = this.oFeature.createFeatureInstance(oLNI);
}
if (oFInstance) {
oFInstance.mouseOverHotspotOpen(oLNI, nFeatureFlags);
} else {
;
}
}
window.N2HInstance.prototype.mouseClickOpen = function(oLNI, nFeatureFlags) {
;//goN2Debug.info("hotspot mouseClickOpen; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());
if (this.oFeature.isDisabled()) {
return;
}
var oFInstance = this.oFeature.getFeatureInstance(oLNI);
if (!oFInstance) {
oFInstance = this.oFeature.createFeatureInstance(oLNI);
}
if (oFInstance) {
oFInstance.clickHotspotOpen(oLNI, nFeatureFlags);
} else {
;
}
}
window.N2HInstance.prototype.mouseOutClose = function(oLNI) {
;//goN2Debug.info("hotspot mouseOutClose; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());
if (this.oFeature.isDisabled()) {
return;
}
var oFInstance = this.oFeature.getFeatureInstance(oLNI);
if (oFInstance) {
oFInstance.mouseOutHotspotClose(oLNI);
}
}
window.N2RegFeature = function(oFeature, sFeatureID, mouseOverFn, mouseOutFn, clickFn) {
this.className = 'N2RegFeature';
this.version = '1.1.0';
if (!oFeature) {
return;
}
if (!mouseOverFn) {
mouseOverFn = n2MouseOverHotspotNop;
}
if (!mouseOutFn) {
mouseOutFn = n2MouseOutHotspotNop;
}
this._sFeatureID = sFeatureID;
this._oFeature = oFeature;
this._timerDelays = new Object();
this._timerDelays.showAfter  = 400;
this._timerDelays.reachWithin = 600;
this._timerDelays.closeAfter = 400;
this._eventsRegistry = new Object();
this._registeredFunctions = new Object();
this._preProcessEventFunction('onmouseover', mouseOverFn);
this._preProcessEventFunction('onmouseout', mouseOutFn);
this._preProcessEventFunction('onclick', clickFn);
}
new N2RegFeature();
window.N2RegFeature.prototype.getFeatureID = function() { return this._sFeatureID; }
window.N2RegFeature.prototype.getFeature = function() { return this._oFeature; }
window.N2RegFeature.prototype.getEventHelperFunction = function(event) {
return this._registeredFunctions[event];
}
window.N2RegFeature.prototype._preProcessEventFunction = function(event, fname)
{
try {
;
var code = eval(fname)
this._eventsRegistry[event] = fname;
this._registeredFunctions[event] = code;
;
}
catch (e) {
;
}
}
window.N2RegFeature.prototype.attachEventsToLink = function(elem) {
for (var event in this._eventsRegistry) {
if (this._eventsRegistry[event]) {
;
elem[event] = this._registeredFunctions[event];
}
}
}
window.N2RegFeature.prototype.setDelays = function(nShowAfter, nReachWithin, nCloseAfter) {
var a, b, c;
a = this._timerDelays.showAfter   = goN2U.isUndefOrNull(nShowAfter)   ? this._timerDelays.showAfter   : nShowAfter;
b = this._timerDelays.reachWithin = goN2U.isUndefOrNull(nReachWithin) ? this._timerDelays.reachWithin : nReachWithin;
c = this._timerDelays.closeAfter  = goN2U.isUndefOrNull(nCloseAfter)  ? this._timerDelays.closeAfter  : nCloseAfter;
;
}
window.N2RegFeature.prototype.getDelayShowAfter = function() {
return this._timerDelays.showAfter;
}
window.N2RegFeature.prototype.getDelayReachWithin = function() {
return this._timerDelays.reachWithin;
}
window.N2RegFeature.prototype.getDelayCloseAfter = function() {
return this._timerDelays.closeAfter;
}
window.N2Feature = function() {
this.className = 'N2Feature';
this.version = '1.1.0';
this._timeDisabledUntil = null;
this._nDefaultDisableMs = 5000;
this._oHInstance = new N2HInstance(this);
}
new N2Feature();
window.N2Feature.prefixHInstanceNames = "HS_";
window.N2Feature.prefixFInstanceNames = "FI_";
window.N2Feature.prototype.closeAllInstances = function(bImmediate) {
;
}
window.N2Feature.prototype.notifyMouseOwner = function(oRegFeatureMouseOwner, sInstanceNameMouseOwner) {
;
}
window.N2Feature.prototype.disableFeature = function(nMSDelay) {
if (!nMSDelay) {
nMSDelay = this._nDefaultDisableMs;
}
this.clossAll(false);
var date = new Date();
var now = date.getTime();
this._timeDisabledUntil = now + nMSDelay;
}
window.N2Feature.prototype.isDisabled = function() {
var bDisabled = false;
if (this._timeDisabledUntil) {
var date = new Date();
var now = date.getTime();
if (now < this._timeDisabledUntil) {
bDisabled = true;
} else {
this._timeDisabledUntil = null;
}
}
return bDisabled;
}
window.N2Feature.prototype.getFeatureInstance = function(oLNI_or_featureID, sInstanceName) {
;
return null;
}
window.N2Feature.prototype.createFeatureInstance = function(oLNI) {
;
return null;
}
window.N2Feature.prototype.getFeatureInstanceName = function(oLNI) {
return N2FInstance.getInstanceNameFromLinkInfo(oLNI);
}
window.N2Feature.prototype.getHotspotInstance = function(oLNI_or_featureID, sInstanceName) {
return this._oHInstance;
}
window.N2Feature.prototype.getHotspotInstanceName = function(oLNI) {
return N2HInstance.getInstanceNameFromLinkInfo(oLNI);
}
window.N2Feature.prototype.getLinkInfoFromHotspotInstanceName = function(sInstanceName) {
return N2HInstance.getLinkInfoFromInstanceName(sInstanceName);
}
window.N2Feature.prototype.isHotspotInstanceName = function(sInstanceName) {
;
if (sInstanceName) {
return (sInstanceName.substr(0,N2Feature.prefixHInstanceNames.length) == N2Feature.prefixHInstanceNames);
}
return false;
}
window.N2Feature.prototype.getInstance = function(featureID, sInstanceName) {
;
if (sInstanceName.substr(0,N2Feature.prefixHInstanceNames.length) == N2Feature.prefixHInstanceNames) {
return this.getHotspotInstance(featureID, sInstanceName);
} else if (sInstanceName.substr(0,N2Feature.prefixFInstanceNames.length) == N2Feature.prefixFInstanceNames) {
return this.getFeatureInstance(featureID, sInstanceName);
}
;
return null;
}
window.N2FeatureWrapper = function(sFeatureID, oWrappedFeature, wrappedFeatureObjectName) {
N2FeatureWrapper.parentClass.call(this);  // THIS line MUST come first -- executes parent constructor
this.className = 'N2FeatureWrapper';
this.version = '1.1.0';
this._oWrappedFeature = oWrappedFeature; // JSF 1.0 Feature object
this._wrappedFeatureObjectName = wrappedFeatureObjectName;
this._oActiveFInstance = null; // the active feature instance, if any.
this._featureInstances = new Object();
}
window.N2FeatureWrapper.prototype = new N2Feature();
window.N2FeatureWrapper.parentClass = N2Feature;
window.N2FeatureWrapper.prototype.getWrappedFeatureObjectName = function() { return this._wrappedFeatureObjectName; }
window.N2FeatureWrapper.prototype.getWrappedFeatureObj = function() { return this._oWrappedFeature; }
window.N2FeatureWrapper.prototype.getActiveWrappedFInstance = function() { return this._oActiveFInstance; }
window.N2FeatureWrapper.prototype.setActiveWrappedFInstance = function(oWrappingInstance) {
;
this._oActiveFInstance = oWrappingInstance;
}
window.N2FeatureWrapper.prototype.getWrappedFeatureActiveElement = function() {
return (this._oWrappedFeature.isActive() ? this._oWrappedFeature.getObject() : null);
}
window.N2FeatureWrapper.prototype.getWrappedMouseOutCallback = function() {
return this._oWrappedFeature.myMouseOutCallback;
}
window.N2FeatureWrapper.prototype.getFeatureInstance = function(oLNI_or_featureID, sInstanceName) {
var featureID;
if (typeof oLNI_or_featureID == "string") {
featureID = oLNI_or_featureID;
} else {
var oLNI = oLNI_or_featureID;
featureID = oLNI.getFeature();
sInstanceName = N2FInstance.getInstanceNameFromLinkInfo(oLNI);
}
for (var id in this._featureInstances) {
if (id == featureID + "|" + sInstanceName) {
return this._featureInstances[id];
}
}
return null;
}
window.N2FeatureWrapper.prototype.notifyMouseOwner = function(oRegFeatureMouseOwner, sInstanceNameMouseOwner) {
var oFeatureMouseOwner = (oRegFeatureMouseOwner ? oRegFeatureMouseOwner.getFeature() : null);
var featureIDMouseOwner = (oRegFeatureMouseOwner ? oRegFeatureMouseOwner.getFeatureID() : "");
for (var id in this._featureInstances) {
var idArray = id.split("|");
var featureID = idArray[0];
var oFInstance = this._featureInstances[id];
oFInstance.notifyFInstanceHasMouse(
this == oFeatureMouseOwner &&                           // needed because featureIDs might be null
oFInstance.getFeatureID() == featureIDMouseOwner &&
oFInstance.getInstanceName() == sInstanceNameMouseOwner );
}
if (oFeatureMouseOwner==this && this.isHotspotInstanceName(sInstanceNameMouseOwner)) {
var oLNI = this.getLinkInfoFromHotspotInstanceName(sInstanceNameMouseOwner);
if (oLNI) {
var hotspotElem = goN2U.getRawObject(oLNI.getLinkID());
var helperFunction = oRegFeatureMouseOwner.getEventHelperFunction("onmouseover");
if (hotspotElem && helperFunction) {
helperFunction.call(hotspotElem);
}
}
}
}
window.N2FeatureWrapper.prototype.closeAllInstances = function(bImmediate) {
; // gets the wrapped feature, not the instance!  But uncalled, so it's OK.
var oFInstance = this.getWrappedFeatureActiveElement();
if (oFInstance) {
oFInstance.closeNow(bImmediate);
}
}
window.N2FeatureWrapper.prototype.createFeatureInstance = function(oLNI) {
var oWrappingInstance = new N2FInstanceWrapper(this);
oWrappingInstance.assignInstance(oLNI);
var id = oLNI.getFeature() + "|" + oWrappingInstance.getInstanceNameFromLinkInfo(oLNI);
;
this._featureInstances[id] = oWrappingInstance;
return oWrappingInstance;
}
window.N2Events = function() {
this.className = 'N2Events';
this.version = '1.1.0';
this._nextAvailId = 0;
this._oFeatureMouseOwner = null;    // the instance's feature
this._sInstanceNameMouseOwner = ""; // the instance name
this._nParentSeeks=3;
this._bAnalyzeHREFs=false;
this._sAutoFeatureID='autoexp';
this._featureChangedTimer = null;
this._featureRegistry = new Object();
this.fSEMISTATIC = N2Events.fSEMISTATIC;
this.fSTATICWITHCLOSE = N2Events.fSTATICWITHCLOSE;
this.initialize = function()
{
if (!this._initialized) {
; // safety net failed
this._initialized = true;
N2ChainEventHandler('onmousemove',
function(evt) {
evt = (evt) ? evt : window.event;
if (typeof goN2Events == "object") {
goN2Events._mouseMoved(evt);
}
},
'N2EventsMouse');
;
} else {
;
}
}
this.registerFeature = function(sFeatureID, featureObjectOrObjectName, mouseOverFn, mouseOutFn, clickFn) {
;
;
var oFeature;
if (typeof featureObjectOrObjectName == "object") {
oFeature = featureObjectOrObjectName;
} else {
var oWrappedFeature = this._evalWrappedFeatureObjectName(featureObjectOrObjectName);
if (oWrappedFeature == null) {
;
return;
}
oFeature = this._getFeatureFromWrappedFeature(oWrappedFeature);
if (!oFeature) {
oFeature = new N2FeatureWrapper(sFeatureID, oWrappedFeature, featureObjectOrObjectName);
}
}
var oRegFeature = new N2RegFeature(oFeature, sFeatureID, mouseOverFn, mouseOutFn, clickFn);
this._featureRegistry[sFeatureID] = oRegFeature;
}
this._evalWrappedFeatureObjectName = function(wrappedFeatureObjectName) {
var oWrappedFeature = null;
try {
oWrappedFeature = eval(wrappedFeatureObjectName);
}
catch (e) {
}
return oWrappedFeature;
}
this.lookupRegFeature = function(sFeatureID) {
return this._featureRegistry[sFeatureID];
}
this.lookupFeature = function(sFeatureID) {
var oRegFeature = this._featureRegistry[sFeatureID];
return (oRegFeature ? oRegFeature.getFeature() : null);
}
this._getFeatureFromWrappedFeature = function(oWrappedFeature) {
for (var sFeatureID in this._featureRegistry) {
var oRegFeature = this._featureRegistry[sFeatureID];
var oFeature = oRegFeature.getFeature();
if (oFeature.getWrappedFeatureObj &&
oFeature.getWrappedFeatureObj() === oWrappedFeature
) {
return oFeature;
}
}
}
this._searchForActiveFeature = function(elementMouse) {
var oFeatureActive = null;
for (var sFeatureID in this._featureRegistry) {
var oFeature = this._featureRegistry[sFeatureID].getFeature();
var oWrappedFeature = oFeature.getWrappedFeatureObj();
if (oWrappedFeature.isStatic() || !oWrappedFeature.isActive()) {
continue;
}
var bMouseIn = false;
if (goN2U.isDefined(oWrappedFeature.isElementContained)) {
bMouseIn = oWrappedFeature.isElementContained(elementMouse);
} else {
var elementFeature = oFeature.getWrappedFeatureActiveElement();
bMouseIn = goN2U.elementIsContainedBy(elementMouse, elementFeature);
}
if (bMouseIn) {
if (oFeatureActive && oFeatureActive!==oFeature) {
;
}
oFeatureActive = oFeature;
}
}
return oFeatureActive;
}
this.setFeatureDelays = function(sFeatureID, nShowAfter, nReachWithin, nCloseAfter) {
var oRegFeature = this._featureRegistry[sFeatureID];
if (!oRegFeature) {
;
return;
}
oRegFeature.setDelays(nShowAfter, nReachWithin, nCloseAfter);
}
this.analyzeHREFS = function(b) { this._bAnalyzeHREFs = b; }
this.setAutoFeatureID = function(s) { this._sAutoFeatureID=s; }
this.broadcastMouseOwner = function(oRegFeatureMouseOwner, sInstanceNameMouseOwner) {
var oFeatureMouseOwner = (oRegFeatureMouseOwner ? oRegFeatureMouseOwner.getFeature() : null);
if (oFeatureMouseOwner!==this._oFeatureMouseOwner || sInstanceNameMouseOwner!=this._sInstanceNameMouseOwner ) {
this._oFeatureMouseOwner = oFeatureMouseOwner;
this._sInstanceNameMouseOwner = sInstanceNameMouseOwner;
for (var sFeatureID in this._featureRegistry) {
var oFeature = this._featureRegistry[sFeatureID].getFeature();
oFeature.notifyMouseOwner(oRegFeatureMouseOwner, sInstanceNameMouseOwner);
}
}
}
this.validateState = function() {
var oRegFeatureMouseOwner = null;
if (this._oFeatureMouseOwner != null){
var oWrappedPopoverFeature = this._oFeatureMouseOwner.getWrappedFeatureObj();
oRegFeatureMouseOwner = this.lookupRegFeature(oWrappedPopoverFeature.getRegFeatureID());
}
for (var sFeatureID in this._featureRegistry) {
var oFeature = this._featureRegistry[sFeatureID].getFeature();
oFeature.notifyMouseOwner(oRegFeatureMouseOwner, this._sInstanceNameMouseOwner);
}
}
this.instanceIsNotMouseOwner = function(oRegFeature, sInstanceName) {
var oFeature = oRegFeature.getFeature();
if (oFeature===this._oFeatureMouseOwner && sInstanceName==this._sInstanceNameMouseOwner ) {
this._oFeatureMouseOwner = null;
this._sInstanceNameMouseOwner = "";
}
}
this._attachEventsToLink = function(elem, name) {
var modified = false;
var nameArray = name.split("|");
if (nameArray.length < N2Events.nMINHOTSPOTNAMECOMPONENTS) {
return false;
}
var sFeatureID = nameArray[0];
var oRegFeature = this.lookupRegFeature(sFeatureID);
if (sFeatureID && oRegFeature) {
;
if (!elem.id) {
elem.setAttribute("id","lnx"+this._nextAvailId);
;
this._nextAvailId++;
}
oRegFeature.attachEventsToLink(elem);
modified = true;
}
return modified;
}
this._mouseMoved = function(evt)
{
;
var name;
var elem;
if (goN2U.bIsIE)
elem = evt.srcElement;
else
elem = evt.target;
var elemBase = elem; // save the element on which the event was generated
if (elem) {
if (!elem.name && this._bAnalyzeHREFs) {
var sHref = elem.href;
if (elem.tagName == 'IMG') {
var i = 2; //this._nParentSeeks;
var parentElem = goN2U.getParentElement(elem);
while ( parentElem && i ) {
if (parentElem.href) {
sHref = parentElem.href;
break;
}
parentElem = goN2U.getParentElement(parentElem);
i--;
}
}
if (sHref) {
var aRE = new Array();
aRE[0] = /\/exec\/obidos\/ASIN\/([^\/]*)\//;
aRE[1] = /\/exec\/obidos\/am\/[^=]+=ASIN\/([^\/]+)/;
aRE[2] = /\/exec\/obidos\/tg\/detail\/-\/([^\/]*)\//;
aRE[3] = /\/exec\/obidos\/am\/[^\/]+\/detail\/-\/([^\/]*)\//;
sHref = unescape(sHref);
for (var i=0;i<aRE.length;i++) {
var aResults = sHref.match(aRE[i]);
if (aResults) {
var sASIN = aResults[1];
var sNameVal = this._sAutoFeatureID + '|a|' + sASIN;
;
elem.name = sNameVal;
break;
}
}
}
} // END bAnalyzeHREFs
if (!elem.name || (typeof elem.name != 'string')) {
var i = this._nParentSeeks;
var parentElem = goN2U.getParentElement(elem);
while ( parentElem && i ) {
if (parentElem.name && (typeof parentElem.name == 'string')) {
elem = parentElem;
break;
}
parentElem = goN2U.getParentElement(parentElem);
i--;
}
}
name = elem.name;
if (name && (typeof name == 'string') && goN2U.isUndefOrNull(elem.onmouseout)) {
if (this._attachEventsToLink(elem, name)) {
;
if (goN2U.bIsIE && elem.getAttribute("onmouseover")){
;
elem.onmouseover();
} else if (elem['onmouseover']){   // Mozillla
;
elem['onmouseover']();
} else {
;
}
}
}
} else {
;
}
var bIsInInstance = false;
var oRegFeature = null;     // non-null if bIsInInstance
var sInstanceName = null;   // non-null if bIsInInstance
if (elem) {
var oFeature = this._searchForActiveFeature(elem); // see fixme comment on _searchForActiveFeature
if (oFeature) {
var oInstance = oFeature.getActiveWrappedFInstance();
;
bIsInInstance = true;
if (oInstance) {
oRegFeature = oInstance.getRegFeatureOpened();
sInstanceName = oInstance.getInstanceName();
}
}
}
if (!bIsInInstance && elem && elem.name && (typeof elem.name == 'string')) {
var nameArray = elem.name.split("|");
if (nameArray.length >= N2Events.nMINHOTSPOTNAMECOMPONENTS) {
var oLNI = goN2U.getLinkNameInfo(elem.id);
if (oLNI) {
var sFeatureID = oLNI.getFeature();
oRegFeature = this.lookupRegFeature(sFeatureID);
if (oRegFeature) {
var oFeature = oRegFeature.getFeature();
bIsInInstance = true;
sInstanceName = oFeature.getHotspotInstanceName(oLNI);
}
}
}
}
this.broadcastMouseOwner(oRegFeature, sInstanceName);
}
this.addEventHandler = function(eventID, fn) {
var r;
if (window.addEventListener) {
window.addEventListener(eventID, fn, false);
r = true;
} else if (window.attachEvent) {
r = document.attachEvent("on"+eventID, fn);
} else {
;
r = false;
}
;
return r;
}
this.removeEventHandler = function(eventID, fn) {
var r;
if (window.removeEventListener) {
window.removeEventListener(eventID, fn, false);
r = true;
} else if (window.detachEvent) {
r = document.detachEvent("on"+eventID, fn);
} else {
;
r = false;
}
;
return r;
}
this._toggleControlElements = {}; // look up by element id to get 'alwaysHide', etc.
this.hideUnderPopovers = function(sId, action)
{
this._toggleControlElements[sId] = action;
}
this.toggleObjects = function(etype, element)
{
var thisLeft;
var thisTop;
var thisRight;
var thisBottom;
if (etype != "hide")
{
;
}
else
{
var oElement = goN2U.getRawObject(element);
if (!oElement)
{
;
return;
}
;
thisLeft = goN2U.getObjectLeft(oElement);
thisTop = goN2U.getObjectTop(oElement);
thisRight = thisLeft + goN2U.getObjectWidth(oElement);
thisBottom = thisTop + goN2U.getObjectHeight(oElement);
}
this._toggleAlwaysHideObjects(etype, thisLeft, thisTop, thisRight, thisBottom);
if (goN2U.bIsIE)
this._checkPopOverObjects("select", etype, thisLeft, thisTop, thisRight, thisBottom);
}
this._toggleAlwaysHideObjects = function(etype, thisLeft, thisTop, thisRight, thisBottom)
{
for (var sId in this._toggleControlElements)
{
if (this._toggleControlElements[sId] != "alwaysHide")
continue;
var oElem = goN2U.getElement(sId, true);
if (!oElem)
continue;
this._toggleOneElement(etype, oElem, thisLeft, thisTop, thisRight, thisBottom);
}
}
this._checkPopOverObjects = function(tagName, etype, thisLeft, thisTop, thisRight, thisBottom)
{
var myObjs = document.getElementsByTagName(tagName);
var i;
for (i=0; i<myObjs.length; i++) {
var oElem = myObjs[i];
if ((oElem.id && oElem.id.substring(0,4) == '_po_' ) ||
(oElem.name && oElem.name.substring(0,4) == '_po_') ) {
continue;
}
var bSkip = false;
for (var sId in this._toggleControlElements)
{
var oElemControl = goN2U.getElement(sId, true); // returns null if no such element
if (goN2U.elementIsContainedBy(oElem, oElemControl))
{
bSkip = true;
break;
}
}
if (bSkip)
continue;
this._toggleOneElement(etype, oElem, thisLeft, thisTop, thisRight, thisBottom);
}
}
this._toggleOneElement = function(etype, oElem, thisLeft, thisTop, thisRight, thisBottom)
{
if (oElem.tagName.toLowerCase() == 'iframe')
{
try
{
oElem = goN2U.getIFrameDocument(oElem).body;
}
catch(e)
{
;
}
}
if (etype != "hide")
{
oElem.style.visibility = "visible";
}
else
{
oElem.style.visibility = this._isFInstanceOverElement(thisLeft, thisTop, thisRight, thisBottom, oElem) ? "hidden" : "visible";
}
}
this._isFInstanceOverElement = function(thisLeft, thisTop, thisRight, thisBottom, menuObj)
{
var mL = goN2U.getObjectLeft(menuObj);
var mT = goN2U.getObjectTop(menuObj);
var mR = mL + goN2U.getObjectWidth(menuObj);
var mB = mT + goN2U.getObjectHeight(menuObj);
var pL = thisLeft;
var pT = thisTop;
var pR = thisRight;
var pB = thisBottom;
;
if ( (mL >= pL) && (mL <= pR) && (mT >= pT) && (mT <= pB) )  return true;
if ( (mL >= pL) && (mL <= pR) && (mB >= pT) && (mB <= pB) )  return true;
if ( (mR >= pL) && (mR <= pR) && (mT >= pT) && (mT <= pB) )  return true;
if ( (mR >= pL) && (mR <= pR) && (mB >= pT) && (mB <= pB) )  return true;
if ( (mL >= pL) && (mL <= pR) && (mT <= pT) && (mB >= pB) )  return true;
if ( (pL >= mL) && (pL <= mR) && (pT >= mT) && (pT <= mB) )  return true;
if ( (pL >= mL) && (pL <= mR) && (pB >= mT) && (pB <= mB) )  return true;
if ( (pR >= mL) && (pR <= mR) && (pT >= mT) && (pT <= mB) )  return true;
if ( (pR >= mL) && (pR <= mR) && (pB >= mT) && (pB <= mB) )  return true;
;
return false;
}
this.disableFeature = function(featureID, delay) {
var oFeature = this.lookupFeature(featureID);
;
if (oFeature) {
oFeature.disableFeature(nMSDelay);
}
}
this.featureIsDisabled = function(featureID) {
var bDisabled = false;
var oFeature = this.lookupFeature(featureID);
;
if (oFeature) {
bDisabled = oFeature.isDisabled();
}
return bDisabled;
}
this.qaAddIDsToNamedLinks = function() {
var mylinks = document.getElementsByTagName("a");
for (var i=0; i<mylinks.length; i++) {
var name = mylinks[i].getAttribute("name");
if (name && (typeof name == 'string')) {
var nameArray = name.split("|");
if ( nameArray.length>=N2Events.nMINHOTSPOTNAMECOMPONENTS && !mylinks[i].id ) {
mylinks[i].setAttribute("id","lnx"+this._nextAvailId);
;
this._nextAvailId++;
}
}
}
}
this.invokeFeature = function(linkID, bShow, sNameOverride, nFeatureFlags) {
var elem = goN2U.getRawObject(linkID);
if (elem == null) {
;
return;
}
nFeatureFlags |= this.fSTATICWITHCLOSE;
var oLNI = goN2U.getLinkNameInfo(linkID, sNameOverride);
if (!oLNI) {
;
return;
}
var oFeature = this.lookupFeature(oLNI.getFeature());
var oFInstance = oFeature.getFeatureInstance(oLNI);
if (!oFInstance && bShow) {
oFInstance = oFeature.createFeatureInstance(oLNI);
}
if (!oFInstance) {
;
return;
}
if (bShow) {
;
oFInstance.openNow(oLNI, nFeatureFlags);
} else {
;
oFInstance.closeNow();
}
}
this.qaTestFeature = function(sLinkID, bShow, sNameOverride, sFlags){
;
this.invokeFeature(sLinkID, bShow, sNameOverride, sFlags)
}
this.mouseOverHotspotOpen = function(hotspotElement, nFeatureFlags) {
;
var oRegFeature = null;
var oFeature = null;
var sInstanceName;
var oHInstance = null;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
sInstanceName = oFeature.getHotspotInstanceName(oLNI);
oHInstance = oFeature.getHotspotInstance(oLNI);
}
this.broadcastMouseOwner(oRegFeature, sInstanceName);
if (oHInstance) {
oHInstance.mouseOverOpen(oLNI, nFeatureFlags);
} else {
;
}
}
this.mouseOverHotspotTrack = function(hotspotElement) {
;
var oRegFeature = null;
var oFeature = null;
var oHInstance = null;
var sInstanceName;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
sInstanceName = oFeature.getHotspotInstanceName(oLNI);
oHInstance = oFeature.getHotspotInstance(oLNI);
}
this.broadcastMouseOwner(oRegFeature, sInstanceName);
if (oHInstance) {
oHInstance.mouseOverTrack(oLNI);
} else {
;
}
}
this.mouseClickHotspotOpen = function(hotspotElement, nFeatureFlags) {
;
var oRegFeature = null;
var oFeature = null;
var oHInstance = null;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
oHInstance = oFeature.getHotspotInstance(oLNI);
}
this.broadcastMouseOwner(oRegFeature, oFeature.getHotspotInstanceName(oLNI));
if (oHInstance) {
oHInstance.mouseClickOpen(oLNI, nFeatureFlags);
} else {
;//goN2Debug.warning("N2Events mouseClickHotspotOpen -- unknown hotspot '" + (oFeature ? oFeature.getHotspotInstanceName(oLNI) : "") + "'");
}
return false;
}
this.mouseOutHotspotClose = function(hotspotElement) {
;
var oRegFeature = null;
var oFeature = null;
var oHInstance = null;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
oFeature = oRegFeature.getFeature();
oHInstance = oFeature.getHotspotInstance(oLNI);
}
if (oHInstance) {
oHInstance.mouseOutClose(oLNI);
} else {
;//goN2Debug.warning("N2HEvents mouseOutHotspotClose -- unknown hotspot '" +  (oFeature ? oFeature.getHotspotInstanceName(oLNI) : "") + "'");
}
if (oRegFeature) {
this.instanceIsNotMouseOwner(oRegFeature, oFeature.getHotspotInstanceName(oLNI));
}
}
this.mouseOutHotspotTrack = function(hotspotElement) {
;
var oLNI = goN2U.getLinkNameInfo(hotspotElement.id);
if (oLNI) {
var oRegFeature = goN2Events.lookupRegFeature(oLNI.getFeature());
if (oRegFeature) {
this.instanceIsNotMouseOwner(oRegFeature, oRegFeature.getFeature().getHotspotInstanceName(oLNI));
}
}
}
this._getFInstanceFromCallbackArg = function(oFInstanceOrWrappedFeature) {
var oFInstance;
if (!goN2U.objIsInstanceOf(oFInstanceOrWrappedFeature, N2FInstance)) {
var oFeature = this._getFeatureFromWrappedFeature(oFInstanceOrWrappedFeature);
;
oFInstance = oFeature.getActiveWrappedFInstance();
} else {
oFInstance = oFInstanceOrWrappedFeature;
;
}
return oFInstance;
}
this.mouseOverFeature = function(oFInstanceOrWrappedFeature) {
;
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
if (oFInstance) {
this.broadcastMouseOwner(oFInstance.getRegFeatureOpened(), oFInstance.getInstanceName());
oFInstance.mouseOver();
}
}
this.mouseOutFeature = function(oFInstanceOrWrappedFeature) {
;
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
if (oFInstance) {
this.instanceIsNotMouseOwner(oFInstance.getRegFeatureOpened(), oFInstance.getInstanceName());
oFInstance.mouseOut();
}
}
this.overlayClosed = function(oFInstanceOrWrappedFeature) {
;
if (!oFInstanceOrWrappedFeature) {
;
return;
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
if (oFInstance)
oFInstance.overlayClosed();
this.toggleObjects("show");
;
}
this.overlayChanged = function(oFInstanceOrWrappedFeature) {
;
if (!oFInstanceOrWrappedFeature) {
;
return;
}
if (this._featureChangedTimer) {
clearTimeout(this._featureChangedTimer);
}
var oFInstance = this._getFInstanceFromCallbackArg(oFInstanceOrWrappedFeature);
var oElem = oFInstance.getRawObject();
;
if (oElem) {
this._featureChangedTimer = setTimeout("goN2Events._overlayChangedTimerAction('"+oElem.id+"')", 200);
}
}
this._overlayChangedTimerAction = function(sElementID) {
;
this.toggleObjects("show", sElementID);
this.toggleObjects("hide", sElementID);
this._featureChangedTimer = null;
}
}
window.N2Events.fNONSTATIC = 0;
window.N2Events.fSEMISTATIC = 1;
window.N2Events.fSTATICWITHCLOSE = 3;
window.N2Events.nMINHOTSPOTNAMECOMPONENTS = 2; // name="feature|type|key..." must have at least feature and type
window.goN2Events = new N2Events();
goN2Events.initialize();
window.n2InitEvents = function() {
;
}
window.qaAddIDsToNamedLinks = function() { goN2Events.qaAddIDsToNamedLinks(); };
window.n2MouseOverFeature = function(oFInstanceOrWrappedFeature) { goN2Events.mouseOverFeature(oFInstanceOrWrappedFeature); }
window.n2MouseOutFeature = function(oFInstanceOrWrappedFeature) { goN2Events.mouseOutFeature(oFInstanceOrWrappedFeature); }
window.n2OverlayClosed = function(oFInstanceOrWrappedFeature) { goN2Events.overlayClosed(oFInstanceOrWrappedFeature); }
window.n2OverlayChanged = function(oFInstanceOrWrappedFeature) { goN2Events.overlayChanged(oFInstanceOrWrappedFeature); }
window.n2MouseOverHotspotNop = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotTrack(this);
}
}
window.n2MouseOverHotspot = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotOpen(this, N2Events.fNONSTATIC);
}
}
window.n2MouseOverHotspotStatic = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotOpen(this, N2Events.fSTATICWITHCLOSE);
}
}
window.n2MouseOverHotspotSemiStatic = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseOverHotspotOpen(this, N2Events.fSEMISTATIC);
}
}
window.n2HotspotClick = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseClickHotspotOpen(this, N2Events.fNONSTATIC);
}
}
window.n2HotspotClickStatic = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseClickHotspotOpen(this, N2Events.fSTATICWITHCLOSE);
}
}
window.n2HotspotClickSemiStatic = function() {
if (typeof goN2Events == "object") {
return goN2Events.mouseClickHotspotOpen(this, N2Events.fSEMISTATIC);
}
}
window.n2MouseOutHotspotNop = function() {
if (typeof goN2Events == "object") {
goN2Events.mouseOutHotspotTrack(this);
}
}
window.n2MouseOutHotspot = function() {
if (typeof goN2Events == "object") {
if (window.event && event.toElement) {
var grabberId = (goN2U.isDefined(N2SimplePopover) ? N2SimplePopover.sClickGrabberID : goN2U.sAnimationDivID);
if (event.toElement.id == goN2U.sAnimationDivID || event.toElement.id == grabberId) {
;
return;
}
}
goN2Events.mouseOutHotspotClose(this);
}
}
window.n2HotspotDisableFeature = function(nMs, oFInstanceOrWrappedFeature) {
if (typeof goN2Events != "object") {
return;
}
if (!oFInstanceOrWrappedFeature) {
;
return;
}
;
var oFeature;
if (_n2ObjectIsFInstance(oFInstanceOrWrappedFeature)) {
var oFInstance = oFInstanceOrWrappedFeature;
oFeature = oFInstance.getFeature();
} else {
oFeature = goN2Events._getFeatureFromWrappedFeature(oFInstanceOrWrappedFeature);
;
}
oFeature.disableFeature(nMS);
return true;
}
if (window.goN2LibMon) goN2LibMon.endLoad('events');
} // END library code wrapper
n2RunIfLoaded("utilities", n2EventsInitLibrary, "events");

/* events Ends */



/* simplePopover Starts */

//! ################################################################
//! Copyright (c) 2004-2007 Amazon.com, Inc., and its Affiliates.
//! All rights reserved.
//! Not to be reused without permission
//! $DateTime: 2008/04/11 22:20:43 $
//! ################################################################
function n2SimplePopoverInitLibrary() {  // Begin library code wrapper. Goes all the way to the bottom of the file
if (window.goN2LibMon) { goN2LibMon.beginLoad('simplePopover', 'n2CoreLibs'); }
window.N2SimplePopover=function() {
var oCfg = goN2U.getConfigurationObject('N2SimplePopover');
this.nEdgePad = oCfg.getValue('this.nEdgePad', 6);  // padding from screen edge to popup (when applicable)
this.nHotPad = oCfg.getValue('this.nHotPad', 2);
this.className = 'N2SimplePopover';
this.version = '1.0.2';
this.myMouseOverCallback=n2MouseOverFeature;    // put here not in initialization
this.myMouseOutCallback=n2MouseOutFeature;      // put here not in initialization
this.myOnCloseCallback=n2OverlayClosed;         // put here not in initialization
this.myFeatureChangedCallback=n2OverlayChanged; // put here not in initialization
this.myCustomCallbacks = [];
this.myID=null;
this.popObj=null;
this.bIsVisible = false;
this.cursorCanLeavePopover = false;
this.staticTimer = null;
this.content = null;
this.nHAdjust=0;
this.nVAdjust=0;
this.nAnimateOpen=5;
this.nAnimateClose=4;
this.sAnimateOpenStyle = 'animatedBox';
this.sAnimateCloseStyle = 'animatedBoxHollow';
this.sBorderStyle = null;
this.bIsTabTitled = false;
this.oBorderImg = {
t:  goN2Locale.getImageURL('JSF-popover-border-t','gno/popover-border-t'),
b:  goN2Locale.getImageURL('JSF-popover-border-b','gno/popover-border-b'),
l:  goN2Locale.getImageURL('JSF-popover-border-l','gno/popover-border-l'),
r:  goN2Locale.getImageURL('JSF-popover-border-r','gno/popover-border-r'),
tl: goN2Locale.getImageURL('JSF-popover-border-tl','gno/popover-border-tl'),
tr: goN2Locale.getImageURL('JSF-popover-border-tr','gno/popover-border-tr'),
bl: goN2Locale.getImageURL('JSF-popover-border-bl','gno/popover-border-bl'),
br: goN2Locale.getImageURL('JSF-popover-border-br','gno/popover-border-br'),
ct: goN2Locale.getImageURL('JSF-popover-border-t','gno/popover-border-t'),
cb: goN2Locale.getImageURL('JSF-popover-border-b','gno/popover-border-b'),
cl: goN2Locale.getImageURL('JSF-popover-border-l','gno/popover-border-l'),
cr: goN2Locale.getImageURL('JSF-popover-border-r','gno/popover-border-r'),
ctl:goN2Locale.getImageURL('JSF-popover-border-ctl','gno/popover-border-ctl'),
ctr:goN2Locale.getImageURL('JSF-popover-border-ctr','gno/popover-border-ctr'),
cbl:goN2Locale.getImageURL('JSF-popover-border-cbl','gno/popover-border-cbl'),
cbr:goN2Locale.getImageURL('JSF-popover-border-cbr','gno/popover-border-cbr')
};
this.sTransImg = goN2Locale.getImageURL('JSF-popover-trans', 'gno/popover-trans');
this.oCurHotspot = null;
this.oCurTabTitle = null;
this.connID = null;
this.nPopLevel = null;
this.childPopFeatureID = null;
this.parentPopFeatureID = null;
this.regFeatureID;
this.bLADSupported = true;
this.nLADTimeoutMs = 16000; // ms to wait
this.nLADRetryMs = 250;     // ms delay between checks
this.sLADKey = null;        // gaTD[key] exists
this.sLADField = null;      // gaTD[<sID>].field or gaTD[key].field exists
var imagePath = goN2Locale.getImageURL('JSF-loading-bar', 'nav2/images/loading-bar');
this.sLADLoadingMessage = goN2Locale.getString('loading_13548', 'Loading...') + '<im'+'g s'+'rc="' + imagePath + '" height="9" align="absmiddle">';
this.sLADTimeoutMessage = goN2Locale.getString('unable_to_get_info_36020', "Unable to obtain necessary information. Please try again later");
this.bMoveHEContent = true;
}
new N2SimplePopover();
N2SimplePopover.sClickGrabberID = 'n2SPopClickGrab'; //WARNING: events.js uses N2SimplePopover.sClickGrabberID
N2SimplePopover.prototype.initialize = function (id, objectName, dataArrayName, populateMethod, sLocateMethodID, nHAdjust, nVAdjust, sBorderStyle) {
;
this.myID=id;               // ID of HTML layer element
this.objectName=objectName; // JS Object name
if(dataArrayName) {
try {
this.aDataArray = eval(dataArrayName);
}
catch(e) {
;
}
}
this.sDataArrayName = dataArrayName;  // JS Object name
;
this.sBorderStyle = sBorderStyle;
this.createPopHTML(id, objectName, this.content);
this._createHotspotClickGrabber();
this.popObj = goN2U.getRawObject(this.myID);
this.popObjStyle = goN2U.getObject(this.myID);
;
;
this._presetLocate(sLocateMethodID, nHAdjust, nVAdjust);
};
N2SimplePopover.prototype.destructor = function() {
this.popObj = null;
this.popObjStyle = null;
}
N2SimplePopover.prototype.getObject = function () { return this.popObj; };
N2SimplePopover.prototype.simplePopoverInitialize = N2SimplePopover.prototype.initialize;
N2SimplePopover.prototype.setMouseOverCallback = function (fn) { this.myMouseOverCallback = fn; };
N2SimplePopover.prototype.setMouseOutCallback = function (fn) { this.myMouseOutCallback = fn; };
N2SimplePopover.prototype.setPopoverChangedCallback = function (fn) { this.myFeatureChangedCallback = fn; };
N2SimplePopover.prototype.setOnCloseCallback = function (fn) { this.myOnCloseCallback = fn; };
N2SimplePopover.prototype.setCallback = function (sID, fFn) { this.myCustomCallbacks[sID] = fFn; }
N2SimplePopover.prototype.getID = function() { return this.myID; };
N2SimplePopover.prototype.getObjectName = function() { return this.objectName; };
N2SimplePopover.prototype.getHotspotID = function() { return this.linkID; };
N2SimplePopover.prototype.setPopulate = function (fn) { this.populate = fn; };
N2SimplePopover.prototype.configureAnimation = function(nOpen, nClose, sOpenStyle, sCloseStyle) {
this.nAnimateOpen=nOpen;
this.nAnimateClose=nClose;
this.sAnimateOpenStyle = sOpenStyle;
this.sAnimateCloseStyle = sCloseStyle;
};
N2SimplePopover.prototype.configureTabTitle = function(bNoConnector) {
this.bIsTabTitled = true;
if (!bNoConnector) {
this.connID = this.myID + "_conn";
this.createConnectorHTML();
}
}
N2SimplePopover.prototype.preConfigureNTier = function(nPopLevel, regFeatureID, parentFeatureID, childFeatureID) {
this.regFeatureID = regFeatureID;
this.parentPopFeatureID = parentFeatureID;
this.childPopFeatureID = childFeatureID;
this.nPopLevel = nPopLevel;
}
N2SimplePopover.prototype.setBorderImage = function(sImg, sURL) {
this.oBorderImg[sImg] = sURL;
}
N2SimplePopover.prototype.configureLADSupport = function(b, sKey, sField, nTimeoutMs, nRetryMs,
sLoadingMsg, sTimeoutMsg) {
this.bLADSupported = b;
if (sKey)        {this.sLADKey = sKey;}
if (sField)      {this.sLADField = sField;}
if (nTimeoutMs)  {this.nLADTimeoutMs = nTimeoutMs;}
if (nRetryMs)   {this.nLADRetryMs = nRetryMs;}
if (sLoadingMsg) {this.sLADLoadingMessage = sLoadingMsg;}
if (sTimeoutMsg) {this.sLADTimeoutMessage = sTimeoutMsg;}
};
N2SimplePopover.prototype.show = function (oHotspot) {
if (goN2U.isDefined(this.myCustomCallbacks['beforeShow'])) {
;
this.myCustomCallbacks['beforeShow'](this);
}
if (this.bIsTabTitled) {
this.oCurHotspot = oHotspot.oLink;
this.oCurTabTitle = this.oCurHotspot;
if (this.oCurHotspot.id) {
var eTab = goN2U.getElement(this.oCurHotspot.id + '_tab', true);
if (eTab) {
this.oCurTabTitle = eTab;
}
}
}
this._showPrepare(oHotspot);
var sLinkID = oHotspot.sLinkID;
var oLNI = new N2LinkNameInfo(sLinkID);
var sID = oLNI.getID();
var sType = oLNI.getType();
var sParams = oLNI.getParams();
var sHref = oHotspot.href;
var sLinkText = oHotspot.linkText;
var re = /([^\\])'/gi;
sLinkText=sLinkText.replace(re, "$1\\'") ;
;
;
this._hideTooltip(oHotspot.oLink);
this.setCurrentThingData (null, sID, sType, sParams, sLinkID, sHref, sLinkText);
this._showPopulate(null, sID, sType, sParams, sLinkID, sHref, sLinkText);
this._showLocate(oHotspot);
this.saveCurrentElementData();
};
N2SimplePopover.prototype._showPrepare = function (oHotspot) {
this.initialMouseOver=true;
this.initialUpdate=true;
this.cursorCanLeavePopover = (oHotspot.staticFlag & 2);
if (this.makeStatic) { this.makeStatic(oHotspot.staticFlag); }
this.nLADRetries = this.nLADTimeoutMs/this.nLADRetryMs;
this.bLADLoading = false;
this.bWasLADDelayed = false;
this._blurFormElements();
var oParent = this.getParentPopover();
if (oParent) {
oParent.cursorCanLeavePopover = true;
}
if (goN2U.bIsSafari) {
goN2U.show(this.myID);
} else {
goN2U.display(this.myID, 'inline');
}
this.bIsVisible = true;
this.hookEvents();
};
N2SimplePopover.prototype._blurFormElements = function()
{
var aForms = document.getElementsByTagName('form');
for (var i=0; i<aForms.length; i++)
{
var oForm = aForms[i];
for (var j=0; j<oForm.elements.length; j++)
{
var oElem = oForm.elements[j];
if ((oElem.id && oElem.id.substring(0,4) == '_po_' ) ||
(oElem.name && oElem.name.substring(0,4) == '_po_') )
{
continue;
}
if (oElem.blur)
{
oElem.blur();
}
}
}
}
N2SimplePopover.prototype._showPopulate = function (sAction, sID, sType, sParams, sLinkID, sHref, sLinkText) {
this.populate(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText);
};
N2SimplePopover.prototype._showLocate = function (oHotspot) {
if (goN2U.isDefined(this.displayPopoverDiv)) {
this.displayPopoverDiv(true);
}
this.updateLocation(true);
var oLocateHotspot = oHotspot;
if (this.bIsTabTitled) {
oLocateHotspot = new Object();
oLocateHotspot.absleft = goN2U.getScrolledElementLeft(this.oCurTabTitle);
oLocateHotspot.abstop = goN2U.getScrolledElementTop(this.oCurTabTitle);
oLocateHotspot.width = goN2U.getElementWidth(this.oCurTabTitle);
oLocateHotspot.height = goN2U.getElementHeight(this.oCurTabTitle);
}
this.locate(oLocateHotspot);
goN2U.hide(this.myID);
var eTitlebar = goN2U.getElement(this.myID + '_titleBar', true);
if (eTitlebar) {
goN2U.hide(eTitlebar);  // kludge, since we don't HAVE a titlebar yet
}
this.hotLeft = oHotspot.absleft;
this.hotTop = oHotspot.abstop;
this.hotWidth = oHotspot.width;
this.hotHeight = oHotspot.height;
if (this.nAnimateOpen) {
this._displayHotspotClickGrabber(oHotspot);
var thisForClosure = this;
fnDone = function() { thisForClosure._animateOpenDone(); }
goN2U.animateBox(oHotspot.absleft, oHotspot.abstop, oHotspot.width, oHotspot.height,
this.left, this.top, this.width, this.height,
this.nAnimateOpen,
fnDone,
this.sAnimateOpenStyle );
} else {
this._animateOpenDone();
}
};
N2SimplePopover.prototype._createHotspotClickGrabber = function() {
var eGrabber = goN2U.getElement(N2SimplePopover.sClickGrabberID, true);
if (!eGrabber) {
eGrabber = document.createElement("a");
if (eGrabber) {
eGrabber.setAttribute("id", N2SimplePopover.sClickGrabberID);
goN2U.setZIndex(eGrabber, 225); //FIXME: Hack -- animateBox style uses 220
goN2U.display(eGrabber, "none");
eGrabber.style.position = "absolute";
goN2U.setBGColor(eGrabber, "transparent");
document.body.insertBefore(eGrabber,document.body.firstChild);
}
}
};
N2SimplePopover.prototype._displayHotspotClickGrabber = function(oHotspot) {
if (oHotspot.oLink && oHotspot.oLink.href) {
var eGrabber = goN2U.getElement(N2SimplePopover.sClickGrabberID, true);
if (eGrabber) {
eGrabber.setAttribute("href", oHotspot.oLink.href);
goN2U.setWidth(eGrabber, this.hotWidth);
goN2U.setHeight(eGrabber, this.hotHeight);
goN2U.shiftTo(eGrabber, this.hotLeft, this.hotTop);
goN2U.display(eGrabber, "block");
} else {
;
}
}
};
N2SimplePopover.prototype._animateOpenDone = function() {
goN2U.show(this.myID);
var eTitlebar = goN2U.getElement(this.myID + '_titleBar', true);
if (eTitlebar) {
goN2U.show(eTitlebar);
}
var eConnector = goN2U.getElement(this.connID, true);
if (eConnector) {
goN2U.show(eConnector);
}
if (goN2U.isDefined(this.myCustomCallbacks['afterShow'])) {
;
this.myCustomCallbacks['afterShow'](this);
}
var eGrabber = goN2U.getElement(N2SimplePopover.sClickGrabberID, true);
if (eGrabber) {
goN2U.undisplay(eGrabber);
}
};
N2SimplePopover.prototype.hide = function () {
;
if (goN2U.isDefined(this.myCustomCallbacks['beforeHide'])) {
;
if (!this.myCustomCallbacks['beforeHide'](this)) {
;
return;
}
}
this.cursorCanLeavePopover = false;
if (goN2U.bIsSafari) {
goN2U.hide(this.myID);
var eTitlebar = goN2U.getElement(this.myID + '_titleBar', true);
if (eTitlebar) {
goN2U.hide(eTitlebar);  // kludge, since we don't HAVE a titlebar yet
}
} else {
goN2U.undisplay(this.myID);
}
if (this.staticTimer) {
clearTimeout(this.staticTimer);
this.staticTimer = null;
}
this.bIsVisible = false;
if (this.connID) {
goN2U.hide(this.connID);
}
if (this.currentRequest && this.oUpdateManager) {
this.oUpdateManager.cancelRequest(this.currentRequest);
}
if (this.myOnCloseCallback) {
this.myOnCloseCallback(this);
}
this.unhookEvents();
this.hideEx();
if (this.bMoveHEContent && this.sCurrentContent && this.sCurrentHeID) {
var eElem = goN2U.getRawObject(this.sCurrentHeID);
if (eElem) {
eElem.innerHTML = this.sCurrentContent;
} else {
;
}
this.sCurrentContent = '';
}
if (goN2U.isDefined(this.myCustomCallbacks['afterHide'])) {
;
this.myCustomCallbacks['afterHide'](this);
}
if (this.nAnimateClose) {
goN2U.animateBox(this.left, this.top, this.width, this.height,
this.hotLeft+this.hotWidth/2, this.hotTop+this.hotHeight/2, 1, 1,
this.nAnimateClose,
null, this.sAnimateCloseStyle );
}
var oParent = this.getParentPopover();
if (oParent) {
oParent.cursorCanLeavePopover = false;
}
};
N2SimplePopover.prototype.hideEx = function() {};
N2SimplePopover.prototype.setCurrentThingData  = function (action, id, type, params, linkID, href, linkText) {
this.action = action;
this.thingID   = id;
this.thingType = type;
this.thingParams = params;
this.linkID = linkID;
this.linkHref = href;
this.linkText = linkText;
this.sReftagHead='';
this.sReftagTail='';
if (href) {
;
var re = 'ref=([^_]*_[^_]*)(_[^\/]*)?';
var aResult = href.match(re);
if (aResult) {
;
this.sReftagHead = aResult[1];
this.sReftagTail = aResult[2];
}
}
};
N2SimplePopover.prototype.getReftagHead = function() { return this.sReftagHead; };
N2SimplePopover.prototype.getReftagTail = function() { return this.sReftagTail; };
N2SimplePopover.prototype.setContent = function (sHtml) {
sHtml = this.replacePlaceholders(sHtml);
this.popObj = goN2U.getRawObject(this.myID);
if (this.popObj === null) {
this.content = sHtml;
} else {
var innerObj = this.popObj;
if (this.sBorderStyle == 'rounded') {
innerObj = goN2U.getRawObject(this.myID + '_InnerX');
}
innerObj.innerHTML = sHtml;
this.updateLocation(true);
}
};
N2SimplePopover.prototype.getContent = function () {
var sHtml;
this.popObj = goN2U.getRawObject(this.myID);
if (this.popObj === null) {
sHtml = this.content;
} else {
var innerObj = this.popObj;
if (this.sBorderStyle == 'rounded') {
innerObj = goN2U.getRawObject(this.myID + '_InnerX');
}
sHtml = innerObj.innerHTML;
}
return sHtml;
};
N2SimplePopover.prototype.replacePlaceholders = function (sHtml) {
;
if (goN2U.isUndefOrNull(sHtml)) {
return '';
}
if ( sHtml.indexOf('{') == -1) { return sHtml; }
sHtml = sHtml.replace(/{REFTAG_HEAD}/g, this.getReftagHead());
sHtml = sHtml.replace(/{REFTAG_TAIL}/g, this.getReftagTail());
if (this.oUpdateManager) {
sHtml = sHtml.replace(/{SESSION_ID}/g, this.oUpdateManager.sessionID ? this.oUpdateManager.sessionID : '');
}
sHtml = sHtml.replace(/{POPOVER_ID}/g, this.myID);
return  sHtml.replace(/{POPOVER_OBJECT}/g, this.objectName);
};
N2SimplePopover.prototype.getDataArray = function() { return this.aDataArray; };
N2SimplePopover.prototype._makePopoverStatic = function(bMakeStatic) {
if (bMakeStatic == true){
this.cursorCanLeavePopover = true;
} else if (bMakeStatic == false) {
this.cursorCanLeavePopover = false;
if (this.isParent()) {
var oActiveFeatureInstance = this._getActiveWrappedFeatureInstance(this.regFeatureID);
var oActiveChildFeatureInstance = this._getActiveWrappedFeatureInstance(this.childPopFeatureID);
if (oActiveFeatureInstance) {
oActiveFeatureInstance.setMouseIn(true);
}
if (oActiveChildFeatureInstance) {
oActiveChildFeatureInstance.setMouseIn(true);
}
}
goN2Events.validateState();
}
}
N2SimplePopover.prototype._getRelatedWrappedFeature = function (sFeatureID) {
var oWrappedFeature = null;
var oRegFeature = goN2Events.lookupRegFeature(sFeatureID);
if (oRegFeature){
var oFeature = oRegFeature.getFeature();
oWrappedFeature = oFeature.getWrappedFeatureObj();
}
return oWrappedFeature;
};
N2SimplePopover.prototype._getActiveWrappedFeatureInstance = function (sFeatureID) {
var oActiveFeatureInstance = null;
var oRegFeature = goN2Events.lookupRegFeature(sFeatureID);
if (oRegFeature) {
var oFeature = oRegFeature.getFeature();
oActiveFeatureInstance = oFeature.getActiveWrappedFInstance();
}
return oActiveFeatureInstance;
};
N2SimplePopover.prototype.getChildPopover = function() { return this._getRelatedWrappedFeature(this.childPopFeatureID); }
N2SimplePopover.prototype.getParentPopover = function() { return this._getRelatedWrappedFeature(this.parentPopFeatureID); }
N2SimplePopover.prototype.isParent = function() { return (this.childPopFeatureID)? true : false; }
N2SimplePopover.prototype.isChild = function() { return (this.parentPopFeatureID)? true : false; }
N2SimplePopover.prototype.getRegFeatureID = function() { return (this.regFeatureID)? true : false; }
N2SimplePopover.prototype.getPopoverElementID = function() { return this.myID; };
N2SimplePopover.prototype.isActive = function() { return this.bIsVisible; }; // we assume for now that if its visible, it IS active.
N2SimplePopover.prototype.isVisible = function() { return this.bIsVisible; };
N2SimplePopover.prototype.isStatic = function() { return this.cursorCanLeavePopover; };
N2SimplePopover.prototype.locateAt = function (sLocateMethodID, nHAdjust, nVAdjust) {
this._presetLocate(sLocateMethodID, nHAdjust, nVAdjust);
}
N2SimplePopover.prototype._presetLocate = function (sLocateMethodID, nHAdjust, nVAdjust) {
this.nHAdjust = nHAdjust ? nHAdjust : 0;
this.nVAdjust = nVAdjust ? nVAdjust : 0;
if (goN2U.isUndefined(sLocateMethodID) || sLocateMethodID == 'auto') {
this.locate = this._locateLinkAdjacent;
} else if (sLocateMethodID == 'window_center' ) {
this.locate = this._locateWindowCenter;
} else if (sLocateMethodID == 'below_above' ) {
this.locate = this._locateLinkBelowAbove;
} else if (sLocateMethodID == 'topleft' ) {
this.locate = this._locateLinkTopLeft;
} else if (sLocateMethodID == 'left' ) {
this.locate = this._locateLinkLeft;
} else if (sLocateMethodID == 'right' ) {
this.locate = this._locateLinkRight;
} else if (sLocateMethodID == 'above' ) {
this.locate = this._locateAboveLink;
} else if (sLocateMethodID == 'below' ) {
this.locate = this._locateBelowLink;
} else {
;
this.locate = this._locateLinkAdjacent;
}
return this.locate;
};
N2SimplePopover.prototype._locateLinkAdjacent = function (oHotspot) {
var popX;
var popY;
var bOverlapsHotspot = false;
if (oHotspot.availLeft < oHotspot.availRight ) {
this.expandsH ='r';
} else {
this.expandsH ='l';
}
if (this.expandsH == 'l') {
if (this.width + this.nHotPad < oHotspot.availLeft) {
popX = oHotspot.absleft - this.width - this.nHotPad;
} else {
popX = this.nEdgePad;
}
} else {
if (oHotspot.availRight > this.width) {
popX = oHotspot.absleft +  oHotspot.width + this.nHotPad;
} else {
var nWindowWidth = goN2U.getInsideWindowWidth();
var nWindowRight = goN2U.getScrollLeft() + nWindowWidth;
popX = nWindowRight - this.width - 6;
bOverlapsHotspot = true;
}
}
var totalAvailFromLinkTop = oHotspot.height + oHotspot.availUnder;
if (bOverlapsHotspot && this.height <= oHotspot.availUnder) {
popY = oHotspot.abstop + oHotspot.height + 2;
} else if (this.height <= totalAvailFromLinkTop) {
popY = oHotspot.availAbove > 0 ? oHotspot.abstop : oHotspot.abstop - oHotspot.availAbove;
}  else {
popY = oHotspot.abstop - (this.height-totalAvailFromLinkTop+this.nEdgePad);
}
this._doLocate(popX, popY);
};
N2SimplePopover.prototype._doLocate = function (popX, popY) {
goN2U.shiftTo(this.myID, popX, popY);
this.updateLocation();
this.initialLeft = this.left;
this.initialTop = this.top;
;
if (window.goN2Debug)
{
var ePop = goN2U.getElement(this.myID);
;
;
;
;
}
};
N2SimplePopover.prototype._locateLinkTopLeft = function (oHotspot) {
var popX = oHotspot.absleft;
var popY = oHotspot.abstop;
var nHAdj = this.nHAdjust;
var nVAdj = this.nVAdjust;
if (nVAdj == 'c') {
nVAdj = parseInt(oHotspot.height/2);
}
if (nHAdj == 'c') {
nHAdj = parseInt(oHotspot.width/2);
}
this._doLocate (popX + nHAdj, popY + nVAdj);
};
N2SimplePopover.prototype._locateLinkRight = function (oHotspot) {
var popX = oHotspot.absleft + oHotspot.width;
var popY = oHotspot.abstop;
var nHAdj = this.nHAdjust;
var nVAdj = this.nVAdjust;
if (nVAdj == 'c') {
nVAdj = parseInt(oHotspot.height/2 - this.height/2);
} else if (nVAdj == 'b') {
nVAdj = oHotspot.height-this.height;
}
var popLeft = popX + nHAdj;
this._doLocate (popLeft, popY + nVAdj);
if (this.bIsTabTitled && this.connID) {
var connLeft = Math.min(oHotspot.absleft + oHotspot.width - 1, popLeft - 1);
var eConn = goN2U.getElement(this.connID, true);
eConn.style.left = connLeft;
eConn.style.top = oHotspot.abstop;
eConn.style.width = (popLeft - connLeft) + 7;
eConn.style.height = oHotspot.height;
}
};
N2SimplePopover.prototype._locateLinkLeft = function (oHotspot) {
var popX = oHotspot.absleft - this.width;
var popY = oHotspot.abstop;
var nHAdj = this.nHAdjust;
var nVAdj = this.nVAdjust;
if (nVAdj == 'c') {
nVAdj = parseInt(oHotspot.height/2 - this.height/2);
} else if (nVAdj == 'b') {
nVAdj = oHotspot.height-this.height;
}
this._doLocate (popX + nHAdj, Math.max(popY + nVAdj, 4));
};
N2SimplePopover.prototype._locateBelowLink = function (oHotspot) {
var popX = oHotspot.absleft;
var popY = oHotspot.abstop + oHotspot.height;
var nHAdj = this.nHAdjust;
var nVAdj = this.nVAdjust;
if (nHAdj == 'c') {
nHAdj = parseInt(oHotspot.width/2 - this.width/2);
} else if (nHAdj == 'r') {
nHAdj = oHotspot.width-this.width;
}
var popTop = popY + nVAdj;
this._doLocate (Math.max(popX + nHAdj, 4), popTop);
if (this.bIsTabTitled && this.connID) {
var connTop = Math.min(oHotspot.abstop + oHotspot.height - 1, popTop - 1);
var eConn = goN2U.getElement(this.connID, true);
eConn.style.left = oHotspot.absleft;
eConn.style.width = oHotspot.width;
eConn.style.top = connTop;
eConn.style.height = (popTop - connTop) + 7;
}
};
N2SimplePopover.prototype._locateAboveLink = function (oHotspot) {
var popX = oHotspot.absleft;
var popY = oHotspot.abstop - this.height;
var nHAdj = this.nHAdjust;
var nVAdj = this.nVAdjust;
if (nHAdj == 'c') {
nHAdj = parseInt(oHotspot.width/2 - this.width/2);
} else if (nHAdj == 'r') {
nHAdj = oHotspot.width-this.width;
}
this._doLocate (Math.max(popX + nHAdj, 4), popY + nVAdj);
};
N2SimplePopover.prototype._locateLinkBelowAbove = function (oHotspot) {
var popX;
var popY;
var nXOffset = 100;
var nXOffsetL = 20;
var totalAvailFromLinkLeft = oHotspot.availRight + oHotspot.width;
if (this.width < (totalAvailFromLinkLeft - nXOffset) ) {
this.expandsH ='r';
} else {
this.expandsH ='l';
}
this.availDown = oHotspot.availUnder + oHotspot.height;
this.availUp = oHotspot.availAbove;
if (this.availUp < this.availDown - this.height ) {
this.expandsV = 'd';
} else {
this.expandsV = 'u';
}
if (this.expandsH == 'l') {
if (this.width + this.nHotPad < oHotspot.availLeft) {
popX = oHotspot.absleft - this.width - this.nHotPad + nXOffsetL;
} else {
popX = this.nEdgePad;
}
} else {
if (oHotspot.width >120) {
popX = oHotspot.absleft +  nXOffset;
} else {
popX = oHotspot.absleft +  oHotspot.width - nXOffsetL;
}
}
var totalAvailFromLinkTop = oHotspot.height + oHotspot.availUnder;
if (this.height <= oHotspot.availUnder) {
popY = oHotspot.abstop + oHotspot.height + this.nHotPad;
} else {
popY = oHotspot.abstop - (this.height-totalAvailFromLinkTop+this.nEdgePad);
if (oHotspot.width < 120) {
if (this.expandsH == 'r') {
popX = oHotspot.absleft + oHotspot.width + this.nHotPad;
} else {
popX = oHotspot.absleft - this.width - this.nHotPad;
}
}
}
this._doLocate(popX, popY);
};
N2SimplePopover.prototype._locateWindowCenter = function (oHotspot) {
var popX = Math.max(goN2U.getScrollLeft()+((goN2U.getInsideWindowWidth()-this.width)/2), this.nEdgePad);
var popY = Math.max(goN2U.getScrollTop()+((goN2U.getInsideWindowHeight()-this.height)/2), this.nEdgePad);
this._doLocate(popX, popY);
};
N2SimplePopover.prototype.createPopHTML = function (id, objectID, content) {
var gp = '';
var zOrder = 200;
if (this.nPopLevel != null) {
zOrder += (this.nPopLevel * 20) ;
}
if (this.sBorderStyle == 'rounded') {
gp+='<span id="' + id + '" class="n2PopRounded" style="display:inline; z-index:' + zOrder + ' ; visibility:hidden; left:0px; top:0px;"';
gp+='onMouseOver="' + objectID + '.mouseOver();" onMouseOut="' + objectID + '.mouseOut(event);"';
gp+='onMouseMove="' + objectID + '.mouseMove(event);">';
gp+='<table border="0" cellpadding="0" cellspacing="0"><tr>' +
'<td><img src="' + this.oBorderImg['tl'] + '"></td>';
gp+='<td background="' + this.oBorderImg['t'] + '"><img src="' + this.sTransImg + '"></td>';
gp+='<td><img src="' + this.oBorderImg['tr'] + '"></td></tr>' +
'<tr><td background="' + this.oBorderImg['l'] + '"><img src="' + this.sTransImg + '"></td>' +
'<td class="n2PopRounded"><div id="' + id + '_InnerX" style="clear:both;">';
if (content) {
gp+=content;
} else {
gp+='-- CONTENT GOES HERE (simple)--';
}
gp+='</div></td><td background="' + this.oBorderImg['r'] + '"><img src="' + this.sTransImg + '"></td></tr>' +
'<tr><td><img src="' + this.oBorderImg['bl'] + '"></td>' +
'<td background="' + this.oBorderImg['b'] + '"><img src="' + this.sTransImg + '"></td>' +
'<td><img src="' + this.oBorderImg['br'] + '"></td></tr></table>';
gp+='</span>';
} else {
gp+='<span id="' + id + '" class="';
if (this.sBorderStyle == 'none') {
gp+='n2PopNoBorder';
} else {
gp+='n2Pop';
}
gp+='" style="display:inline; visibility:hidden; left:0px; top:0px;"';
gp+='onMouseOver="' + objectID + '.mouseOver();" onMouseOut="' + objectID + '.mouseOut(event);"';
gp+='onMouseMove="' + objectID + '.mouseMove(event);">';
gp+='<span class="n2">';
if (content) {
gp+=content;
} else {
gp+='-- CONTENT GOES HERE (simple)--';
}
gp+='</span>';
gp+='</span>';
}
var spanEl = document.createElement("span");
spanEl.innerHTML = gp;
spanEl.id = id +"_OuterX";
document.body.insertBefore(spanEl,document.body.firstChild);
};
N2SimplePopover.prototype.createConnectorHTML = function() {
var gp = '';
var zOrder = 210;
if (this.nPopLevel != null){
zOrder += (this.nPopLevel * 20);
}
gp ='<div id="' + this.connID + '" style="position: absolute; z-index:' + zOrder + '; visibility: hidden; left: 0px; top: 0px;" ';
gp+='onMouseOver="' + this.objectName + '.mouseOver();" onMouseOut="' + this.objectName + '.mouseOut(event);"';
gp+='onMouseMove="' + this.objectName + '.mouseMove(event);">';
gp+='<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">';
if (this.locate == this._locateBelowLink) {
gp+='<tr height="100%"><td background="' + this.oBorderImg['cl'] + '"><img src="' + this.sTransImg + '"></td><td width="100%" bgcolor="white"><img src="' + this.sTransImg + '"></td><td background="' + this.oBorderImg['cr'] + '"><img src="' + this.sTransImg + '"></td></tr>';
gp+='<tr>';
if (this.nHAdjust == 0) {
gp+='<td><img src="' + this.oBorderImg['cl'] + '"></td>';
} else {
gp+='<td><img src="' + this.oBorderImg['ctl'] + '"></td>';
}
gp+='<td width="100%" bgcolor="white"><img src="' + this.sTransImg + '"></td>';
if (this.nHAdjust == 'r') {
gp+='<td><img src="' + this.oBorderImg['cr'] + '"></td>';
} else {
gp+='<td><img src="' + this.oBorderImg['ctr'] + '"></td>';
}
gp+='</tr>';
} else if (this.locate == this._locateLinkRight) {
gp+='<tr>';
gp+='<td width="100%" background="' + this.oBorderImg['ct'] + '"><img src="' + this.sTransImg + '"></td>';
if (this.nVAdjust == 0) {
gp+='<td><img src="' + this.oBorderImg['ct'] + '"></td>';
} else {
gp+='<td><img src="' + this.oBorderImg['ctl'] + '"></td>';
}
gp+='</tr>';
gp+='<tr height="100%">';
gp+='<td width="100%" bgcolor="white"><img src="' + this.sTransImg + '"></td>';
gp+='<td bgcolor="white"><img src="' + this.sTransImg + '"></td>';
gp+='</tr>';
gp+='<tr>';
gp+='<td width="100%" background="' + this.oBorderImg['cb'] + '"><img src="' + this.sTransImg + '"></td>';
if (this.nVAdjust == 'b') {
gp+='<td><img src="' + this.oBorderImg['cb'] + '"></td>';
} else {
gp+='<td><img src="' + this.oBorderImg['cbl'] + '"></td>';
}
gp+='</tr>';
}
gp+='</table>';
gp+='</div>';
var connEl = document.createElement("span");
connEl.innerHTML = gp;
connEl.id = this.connID + "_OuterX";
document.body.insertBefore(connEl, document.body.firstChild);
};
N2SimplePopover.prototype.saveCurrentElementData = function() { };
N2SimplePopover.prototype._defaultPopulate = function(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText) {
;
if (this.bLADSupported) {
if (!this.isDataAvailable(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText)) {
return false;
}
}
switch (sType) {
case 'he': // id of an HTML element
this.populateUsingElementContents(sID);
break;
case 'ak': // array key
this.populateUsingArrayContents(sID);
break;
case 'a':
case 'am':
case 'n':
case 's':
case 'l':
break;
default:
;
}
if (this.bLADLoading) {
this.sizeOrPositionChanged();
}
return true;
};
N2SimplePopover.prototype.populate = N2SimplePopover.prototype._defaultPopulate;
N2SimplePopover.prototype.populateUsingElementContents = function(id, type, linkID, href, linkText) {
;
;
var eElem = goN2U.getRawObject(id);
if (eElem) {
var tempHTML = eElem.innerHTML;
if (this.bMoveHEContent) {
this.sCurrentContent = eElem.innerHTML;
this.sCurrentHeID = id;
eElem.innerHTML = '';
}
this.setContent(tempHTML);
} else {
;
}
};
N2SimplePopover.prototype.populateUsingArrayContents = function(id, type, linkID, href, linkText) {
;
;
if (goN2U.isDefined(this.aDataArray) ) {
if (goN2U.isDefined(this.aDataArray[id])) {
this.setContent(this.aDataArray[id]);
} else {
;
}
}
else {
;
}
};
N2SimplePopover.prototype.isDataAvailable = function(sAction, sID, sType, sParams, sLinkID, sHref, sLinkText) {
;
;
if ( this._isDataAvailable (sAction, sID, sType, sParams, sLinkID,
this.sLADKey, this.sLADField) ) {
return true;
} else {
if (--this.nLADRetries && this.isVisible()) {
if (!this.bLADLoading) {
this.setContent(this.sLADLoadingMessage);
this.bLADLoading = true;
}
setTimeout (new Function("", this.objectName + ".populate(" +
"'" + (sAction ? sAction : 'null') + "'," +
"'" + (sID ? sID : 'null') + "'," +
"'" + (sType ? sType : 'null') + "'," +
"'" + (sParams ? sParams : 'null') + "'," +
"'" + (sLinkID ? sLinkID : 'null') + "'," +
"'" + (sHref ? sHref : 'null') + "'," +
"'" + (sLinkText ? sLinkText : 'null') + "'" +
");"),
this.nLADRetryMs);
} else {
;
this.setContent(this.sLADTimeoutMessage);
}
return false;
}
};
N2SimplePopover.prototype._isDataAvailable = function(sAction, sID, sType, sParams, sLinkID,
sKey, sField) {
;
;
var bIsAvailable = true;
switch(sType) {
case 'he': // id of an HTML element
if ( sKey && goN2U.getRawObject(sKey)=== null ) {
bIsAvailable = false;
} else if ( goN2U.getRawObject(sID)=== null ) {
bIsAvailable = false;
}
break;
case 'ak': // array key
if (this.aDataArray) {
if ( sKey && goN2U.isUndefined(this.aDataArray[sKey]) ) {
bIsAvailable = false;
} else if ( goN2U.isUndefined(this.aDataArray[sID]) ) {
bIsAvailable = false;
}
}
break;
case 'a':  // key is an ASIN (which means that the aDataArray should usually point ot gaTD)
case 'am':
var sTDKey = sType+sID;
if (this.aDataArray) {
if ( // an entry for this key
goN2U.isUndefined(this.aDataArray[sTDKey]) ||
( sField && goN2U.isUndefined(this.aDataArray[sTDKey][sField]) ) ||
( sKey && goN2U.isUndefined(this.aDataArray[sKey]) ) ||
( sKey && sField && goN2U.isUndefined(this.aDataArray[sKey][sField]) )) {
bIsAvailable = false;
}
}
break;
}
;
return bIsAvailable;
};
N2SimplePopover.prototype.sizeOrPositionChanged = function () {
if (this.myFeatureChangedCallback) {
this.myFeatureChangedCallback(this);
}
};
N2SimplePopover.prototype.updateLocation = function (flag){
var po = this.popObj;
this.left   = goN2U.getObjectLeft(po);
this.top    = goN2U.getObjectTop(po);
this.width  = goN2U.getObjectWidth(po);
this.height = goN2U.getObjectHeight(po);
this.right = this.left + this.width;
this.bottom = this.top + this.height;
};
N2SimplePopover.prototype.isElementContained = function(elem) {
var inPop = false;
if (goN2U.elementIsContainedBy(elem, this.popObj)) {
inPop = true;
} else if (this.bIsTabTitled) {
if (this.connID && goN2U.elementIsContainedBy(elem, goN2U.getElement(this.connID, true))) {
inPop = true;
} else if (goN2U.elementIsContainedBy(elem, this.oCurTabTitle) && !goN2U.elementIsContainedBy(elem, this.oCurHotspot)) {
inPop = true;
}
}
return inPop;
};
N2SimplePopover.prototype.isCoordContained = function(x, y) {
var inPop = false;
var e = this.popObj;
var left = goN2U.getPageElementLeft(e);
var top = goN2U.getPageElementTop(e);
var width = goN2U.getElementWidth(e);
var height = goN2U.getElementHeight(e);
if ((x >= left) && (x < left + width) && (y >= top) && (y < top + height)) {
inPop = true;
} else if (this.bIsTabTitled) {
e = goN2U.getElement(this.connID, true);
left = goN2U.getPageElementLeft(e);
top = goN2U.getPageElementTop(e);
width = goN2U.getElementWidth(e);
height = goN2U.getElementHeight(e);
if ((x >= left) && (x < left + width) && (y >= top) && (y < top + height)) {
inPop = true;
}
e = this.oCurTabTitle;
left = goN2U.getPageElementLeft(e);
top = goN2U.getPageElementTop(e);
width = goN2U.getElementWidth(e);
height = goN2U.getElementHeight(e);
if ((x >= left) && (x < left + width) && (y >= top) && (y < top + height)) {
e = this.oCurHotspot;
left = goN2U.getPageElementLeft(e);
top = goN2U.getPageElementTop(e);
width = goN2U.getElementWidth(e);
height = goN2U.getElementHeight(e);
if (!((x >= left) && (x < left + width) && (y >= top) && (y < top + height))) {
inPop = true;
}
}
}
return inPop;
}
N2SimplePopover.prototype.mouseOver = function () {
if (this.initialMouseOver) {
;
this.initialMouseOver = false;
var ret = true;
if (this.myMouseOverCallback) {
;
ret = this.myMouseOverCallback(this);
}
if (ret) {
}
}
};
N2SimplePopover.prototype.mouseMove = function (evt) {
if (this.initialMouseOver) {
this.mouseOver();
}
};
N2SimplePopover.prototype.mouseOut = function (evt) {
var inPop = false;
var inChildPop = false;
var oChildFeature = this.getChildPopover();
evt = (evt) ? evt : ((window.event) ? window.event : null);
if (evt) {
if (goN2U.bIsIE) {
inPop = this.isElementContained(evt.toElement);
if (oChildFeature) {
inChildPop = oChildFeature.isElementContained(evt.toElement);
}
} else {
var x = evt.pageX;
var y = evt.pageY;
inPop = this.isCoordContained(x, y);
if (oChildFeature){
inChildPop = oChildFeature.isCoordContained(x, y);
}
}
}
if ( inChildPop ){
this._makePopoverStatic(true);
} else if (this.isParent() && !inPop) { //mouse is clearly out of the parent
this._makePopoverStatic(false);
}
if (!inPop && !this.cursorCanLeavePopover && !this.buttonIsDown) {
;
this.initialMouseOver = true;
var ret = true;
if (this.myMouseOutCallback) {
;
ret = this.myMouseOutCallback(this);
;
}
if (ret) {
;
this.hide();
}
var oParentFeature = this.getParentPopover();
if (oParentFeature) {
oParentFeature._makePopoverStatic(false); //make parent non-static if this (child) popover has a mouse out
oParentFeature.mouseOut(evt);
}
}
};
N2SimplePopover.prototype._hideTooltip = function (oLink) {
var firstChild = oLink.firstChild;
if (firstChild && firstChild.alt) {
this.sImgAlt = firstChild.alt;
firstChild.alt = '';
}
};
N2SimplePopover.prototype.hookEvents = function () { };
N2SimplePopover.prototype.unhookEvents = function () { };
if (window.goN2LibMon) { goN2LibMon.endLoad('simplePopover'); }
} // END library code wrapper
n2RunIfLoaded("events", n2SimplePopoverInitLibrary, "simplepopover");

/* simplePopover Ends */



/* staticPopover Starts */

//! ################################################################
//! Copyright (c) 2004 Amazon.com, Inc., and its Affiliates.
//! All rights reserved.
//! Not to be reused without permission
//! $Change: 1675744 $
//! $Revision: #3 $
//! $DateTime: 2008/01/21 02:16:50 $
//! ################################################################
function n2StaticPopoverInitLibrary() { // Begin library code wrapper. Goes all the way to the bottom of the file
if (window.goN2LibMon) goN2LibMon.beginLoad('staticPopover', 'n2CoreLibs');
window.N2MiniPane=function (oPopover, sID) {
this.sID = sID;
this.bIsSubPane=false;
this.maxSubPaneWidth;
this.currentWidth;
this.currentHeight;
this.oPopover=oPopover;
this.nDefaultWidth;           // overrides everything else (inc. min/max)
this.nMinWidth = 0; //201;    // overrides value obtained from sizing content
this.nMaxWidth = 0; //600;    // overrides value obtained from sizing content
this.nDefaultHeight = 'auto'; // overrides everything else (inc. min/max)
this.nMinHeight = 0; //60;    // overrides value obtained from sizing content
this.nMaxHeight = 0; //300;   // overrides value obtained from sizing content
this.setDefaultWidth = function(n) { this.nDefaultWidth = n; }
this.setMinWidth = function(n) { this.nMinWidth = n; }
this.setMaxWidth = function(n) { this.nMaxWidth = n; }
this.setCurrentWidth = function(n) {this.currentWidth = n; }
this.setDefaultHeight = function(n) { this.nDefaultHeight = n; }
this.setMinHeight = function(n) { this.nMinHeight = n; }
this.setMaxHeight = function(n) { this.nMaxHeight = n; }
this.setCurrentHeight = function(n) {this.currentHeight = n; }
this.isSubPane = function() { return this.bIsSubPane; }
this.relocate=null;
this.initialize = function() { }
}
window.N2StaticPopover=function() {
N2SimplePopover.call ( this );
var oCfg = this.oCfg = goN2U.getConfigurationObject('N2StaticPopover');
this.className = 'N2StaticPopover';
this.version = '1.0.0';
this.currentPane = new N2MiniPane(this);
this.currentPane.nMinWidth = 0;//200;  // overrides value obtained from sizing content
this.currentPane.nMaxWidth = 0;//600;  // overrides value obtained from sizing content
this.sMyStyle = 'n2Pop';                              // The outer popup
this.sMyStyleStatic = 'n2PopStatic';
this.sStaticTitlebarStyle = 'popStaticTitle';         // just the titlebar when static
this.sSemiStaticTitlebarStyle = 'popSemiStaticTitle'; // just the titlebar when semi-static
this.sBodyStyle = 'n2PopBody';
this.sTitlebarStyle = this.sStaticTitlebarStyle;
this.sTitleStyle = 'popTitle';
this.sTitle = '';
this.nMinLeftPixelsVisible = oCfg.getValue('minLeftPixelsVisible', 100);
this.nMinTopPixelsVisible = oCfg.getValue('minTopPixelsVisible', 50);
this.nMinRightPixelsVisible = oCfg.getValue('minRightPixelsVisible', 100);
this.nMinBottomPixelsVisible = oCfg.getValue('minBottomPixelsVisible', 100);
this.closeButton = oCfg.getValue('popoverCloseImg',
{
width: 46,
height: 16,
up: 'JSF-close-tan-sm',
upFallback: 'nav2/images/close-tan-sm',
down: 'JSF-close-tan-sm-dn',
downFallback: 'nav2/images/close-tan-sm-dn'
}
);
this.backButton = oCfg.getValue('popoverBackImg',
{
width: 46,
height: 16,
up:'JSF-back-tan-sm',
upFallback:'nav2/images/back-tan-sm',
down:'JSF-back-tan-sm-dn',
downFallback:'nav2/images/back-tan-sm-dn',
disabled: 'JSF-back-tan-sm-dis',
disabledFallback:'nav2/images/back-tan-sm-dis'
}
);
this.nextButton = oCfg.getValue('popoverNextImg',
{
width: 46,
height: 16,
up:'JSF-next-tan-sm',
upFallback:'nav2/images/next-tan-sm',
down:'JSF-next-tan-sm-dn',
downFallback:'nav2/images/next-tan-sm-dn',
disabled: 'JSF-next-tan-sm-dis',
disabledFallback:'nav2/images/next-tan-sm-dis'
}
);
this.oneByOneImg = oCfg.getValue('oneByOneImage', '1x1_trans');
this.loadBarImg = oCfg.getValue('loadingBarImg', 'JSF-loading-bar');
this.loadBarImgFallback = 'nav2/images/loading-bar';
this.bDraggable = true;
this.staticState=0;
this.nPopBorderAdjust=0;
}
N2StaticPopover.prototype = new N2SimplePopover();
N2StaticPopover.prototype.initialize = function (id, objectName, dataArrayName, dispMinMethod,
locateMethod, nHAdjust, nVAdjust) {
this.simplePopoverInitialize(id, objectName, dataArrayName, dispMinMethod,
locateMethod, nHAdjust, nVAdjust);
;
this.fDragEngage = this.returnHandler('_dragEngage');
this.fDragMove = this.returnHandler('_dragMove');
this.fDragRelease = this.returnHandler('_dragRelease');
this.hideBackForwardButtons();
}
N2StaticPopover.prototype.staticPopoverInitialize = N2StaticPopover.prototype.initialize;
N2StaticPopover.prototype.getPane = function () { return this.currentPane; }
N2StaticPopover.prototype.setButtonImages = function(sIdentifier, nWidth, nHeight, sUp, sDown, sDisabled) {
this[sIdentifier+'Button'] =
{
width: nWidth,
height: nHeight,
up: sUp,
upFallback: 'nav2/images/' + sUp,
down: sDown,
downFallback: 'nav2/images/' + sDown,
disabled: sDisabled,
disabledFallback: 'nav2/images/' + sDisabled
};
}
N2StaticPopover.prototype.setDraggable = function (bDraggable) { this.bDraggable = bDraggable; }
N2StaticPopover.prototype.setStyle= function(sOuter, sBody) { this.sMyStyle = sOuter; this.sBodyStyle = sBody; }
N2StaticPopover.prototype.setTitle= function(sTxt) {
this.sTitle = sTxt;
if (this.popObj) {
var oText = goN2U.getRawObject(this.myID + '_titleBarTitle');
if (oText) {
oText.innerHTML = sTxt;
}
}
}
N2StaticPopover.prototype.setTitleStyle= function(s) { this.sTitleStyle = s; }
N2StaticPopover.prototype.setStaticTitlebarStyle= function(s) { this.sStaticTitlebarStyle = s; }
N2StaticPopover.prototype.setSemiStaticTitlebarStyle= function(s) { this.sSemiStaticTitlebarStyle = s; }
N2StaticPopover.prototype.generateButton = function (sID, sObjectID, sActionCode, sImageDir, oProperties) {
if (!oProperties.upFallback)
{
oProperties.upFallback = 'nav2/images/' + oProperties.up;
}
if (!oProperties.downFallback)
{
oProperties.downFallback = 'nav2/images/' + oProperties.down;
}
var downImagePath = goN2Locale.getImageURL(oProperties.down, oProperties.downFallback);
var upImagePath = goN2Locale.getImageURL(oProperties.up, oProperties.upFallback);
var sBuf = '<span class="clickable" onclick="' + sObjectID + sActionCode+ '">'
+'<img id="' + sID + '" class="clickable" src="' + upImagePath + '" width="'+oProperties.width+'" height="'+oProperties.height+'"'
+' border="0" onmousedown="this.src=\'' + downImagePath + '\';" onmouseup="this.src=\'' + upImagePath + '\';"></span>';
if (oProperties.disabled) {
var disabledImagePath = goN2Locale.getImageURL(oProperties.disabled, oProperties.disabledFallback);
sBuf +='<img id="' + sID + 'Dis" class="clickable" src="' + disabledImagePath + '" width="'+oProperties.width+'" height="'+oProperties.height+'" border="0">';
}
return sBuf;
}
N2StaticPopover.prototype.createPopHTML = function (id, objectID, content) {
goN2U.preloadImage(goN2Locale.getImageURL(this.closeButton.up, this.closeButton.upFallback));
goN2U.preloadImage(goN2Locale.getImageURL(this.closeButton.down, this.closeButton.downFallback));
goN2U.preloadImage(goN2Locale.getImageURL(this.loadBarImg, this.loadBarImgFallback));
var outer = '<div id="' + id + '" class="'+this.sMyStyle+'" style="display:block; visibility:hidden; left:0px; top:0px; position:absolute"'
+' onMouseOver="' + objectID + '.mouseOver();" onMouseOut="' + objectID + '.mouseOut(event);"'
+' onMouseMove="' + objectID + '.mouseMove(event);" onMouseDown="' + objectID + '._click(event);">'
+'<div class="n2">';
var tbnc = '<div id="' + id + '_titleBar" class="'+this.sTitlebarStyle+'" style="visibility:inherit; min-height:18px;">'
+ '<div style="float:right; padding: 3px 4px 0 0" id="' + id + '_titleBarTd2">'
+ this.generateButton(id +'_backBtn', objectID, '.goBack()', this.imageDir, this.backButton)
+ this.generateButton(id +'_nextBtn', objectID, '.goForward()', this.imageDir, this.nextButton)
+ this.generateButton(id +'_closeX', objectID, '.hide()', this.imageDir, this.closeButton)
+ '</div>'
+ '<span id="' + id + '_titleBarTitle" class="'+this.sTitleStyle+'">' + this.sTitle + '</span>'
+ '</div>';
var popbody = '<div id="' + id + '_main" class="' + this.sBodyStyle + '" style="clear:both;">';
if (content) popbody +=content;
else popbody +='--CONTENT GOES HERE (static)--';
popbody += '</div>'; // _main
var gp = outer + tbnc + popbody;
gp +='</div>' // n2
+'</div>'; // n2Pop
var spanEl = document.createElement("div");
spanEl.innerHTML = gp;
document.body.insertBefore(spanEl,document.body.firstChild);
return goN2U.getRawObject(id);
}
N2StaticPopover.prototype.populate = function(action, id, type, linkID, href, linkText) {
var nPreChangePopoverWidth = this.width
var nPreChangePopoverHeight = this.height;
this._defaultPopulate(action, id, type, linkID, href, linkText);
this.relocate(this.currentPane, nPreChangePopoverWidth, nPreChangePopoverHeight)
}
N2StaticPopover.prototype.returnHandler = function(methodName) {
var o = {obj:this,method:methodName};
var fn = function(e){
if (!e) e = window.event;
o.obj[o.method](e);
}
return fn;
}
N2StaticPopover.prototype.makeStatic = function (nFlag) {
;
this.updateLocation();
var nTopOffset=0;  //(adjust for TBHeight)
var offset=0;
var nDefaultWidth = this.currentPane.nDefaultWidth;
var currentWidth = goN2U.getObjectWidth(this.popObj);
var currentHeight = goN2U.getObjectHeight(this.popObj);
this.cursorCanLeavePopover = false;
if (nDefaultWidth) goN2U.setWidth(this.popObj, nDefaultWidth);
if (nFlag == 0) {         /// non-static
goN2U.setClass(this.popObj, this.sMyStyle);
goN2U.hide(this.myID+'_titleBar');
goN2U.undisplay(this.myID+'_titleBar');
this.displayCloseButtons(false); // 0524
} else {
if (nFlag & 1) { /// show titlebar
goN2U.display(this.myID+'_titleBar');
goN2U.show(this.myID +'_titleBar');
this.displayCloseButtons(true); // 0609
}
if (nFlag & 2) { /// show close and full static look, and set static mode (cursorCanLeavePopover)
this.displayCloseButtons(true);
this.cursorCanLeavePopover = true;
var elemTitleBar = goN2U.getElement(this.myID + '_titleBar');
goN2U.setClass(elemTitleBar, this.sStaticTitlebarStyle);
if (elemTitleBar)
elemTitleBar.style.cursor = 'move';  // make sure the title bar looks draggable when the mouse is over it
goN2U.setClass(this.popObj, this.sMyStyleStatic);
if (goN2U.isIE()) goN2U.setWidth(this.popObj, currentWidth+2); // +4
else if (goN2U.isMozilla5())goN2U.setWidth(this.popObj, currentWidth-2);
if (this.expandsH == 'l')
offset = -2; // -4  // KLUDGE to allow for border width increase
else
offset = 0;
} else {         /// semi-static look
var elemTitleBar = goN2U.getElement(this.myID + '_titleBar');
goN2U.setClass(elemTitleBar, this.sSemiStaticTitlebarStyle);
if (elemTitleBar)
elemTitleBar.style.cursor = 'move';  // make sure the title bar looks draggable when the mouse is over it
goN2U.setClass(this.popObj, this.sMyStyle);
}
if (this.staticState == 0) nTopOffset = 18;
}
this.staticState=nFlag;
this.top = this.recalcTop(this.top-nTopOffset);
this.left = this.left + offset;
;
goN2U.shiftTo(this.myID, this.left, this.top);
this.updateLocation();
if (this.myFeatureChangedCallback) this.myFeatureChangedCallback(this);
}
N2StaticPopover.prototype.ensureVisible = function () {
this.updateLocation();
var nCurrentTop = this.top;
var nCurrentLeft = this.left;
var nScrollLeft = goN2U.getScrollLeft();
var nWindowWidth = goN2U.getInsideWindowWidth();
var nWindowRight = nScrollLeft + nWindowWidth;
;
this.top = this.recalcTop(this.top);
if (this.left < nScrollLeft ) {
this.left = nScrollLeft + 6; // FIXME: use screen pad
}
;
if (this.right > nWindowRight) {
this.left = nWindowRight - this.width - 6; // FIXME: use screen pad
}
if (this.top != nCurrentTop || this.left != nCurrentLeft) {
;
goN2U.shiftTo(this.myID, this.left, this.top);
this.updateLocation();
if (this.myFeatureChangedCallback) this.myFeatureChangedCallback(this);
} else {
;
}
}
N2StaticPopover.prototype.recalcTop = function (top) {
var edgePad = this.oCfg.getValue('edgePad', 6);
var insideWindowHeight = goN2U.getInsideWindowHeight();
var nScrollTop = goN2U.getScrollTop();
var windowBottomEdge = insideWindowHeight + nScrollTop;
var currentHeight = goN2U.getObjectHeight(this.popObj)
if (top + currentHeight > windowBottomEdge) {
;
top = windowBottomEdge - currentHeight - edgePad;
top = Math.max(top, nScrollTop+edgePad);
;
}
return top;
}
N2StaticPopover.prototype.displayCloseButtons = function (disp) {
if(disp) {
goN2U.display(this.myID+'_closeX', 'inline');
var eC = goN2U.getRawObject(this.myID+'_closeX');
if (eC) eC.src = eC.src;
} else {
goN2U.undisplay(this.myID+'_closeX');
}
}
N2StaticPopover.prototype.hideBackForwardButtons = function () {
goN2U.undisplay(this.myID+'_backBtn');
goN2U.undisplay(this.myID+'_nextBtn');
goN2U.undisplay(this.myID+'_backBtnDis');
goN2U.undisplay(this.myID+'_nextBtnDis');
}
N2StaticPopover.prototype.setContent = function (sHtml, oPane, bDisableScrollbars, bDisableResizing) {
if (bDisableResizing) {
this._setContentNoResize(sHtml, oPane, bDisableScrollbars);
} else {
this._setContent(sHtml, oPane, bDisableScrollbars);
this.ensureVisible();
}
}
N2StaticPopover.prototype.getContent = function (oPane) {
;
var sElemID = oPane.sElementID ? oPane.sElementID : '_main';
sElemID = this.myID+sElemID;
var eElem = goN2U.getRawObject(sElemID);
if (eElem == null) {
;
return null;
}
return eElem.innerHTML;
}
N2StaticPopover.prototype._setContentNoResize = function (sHtml, oPane) {
;
sHtml = this.replacePlaceholders(sHtml);
sElemID = oPane.sElementID ? oPane.sElementID : '_main';
sElemID = this.myID+sElemID;
;
var eElem = goN2U.getRawObject(sElemID);
if (eElem == null) {
this.content = sHtml;
;
;
return;
}
eElem.innerHTML = sHtml;
;
}
N2StaticPopover.prototype._relocate = function (oPane, nOrigWidth, nOrigHeight) {
this.updateLocation();
if (oPane.relocate == null) {
var nNewLeft = this.left;
var nNewTop = this.top;
if (this.expandsH =='l') {
var nLeftNow = this.left;
nNewLeft = nLeftNow + nOrigWidth - goN2U.getObjectWidth(this.popObj);
}
if (this.expandsV =='u') {
var nTopNow = this.top;
}
goN2U.shiftTo(this.popObj, nNewLeft, nNewTop);
} else {
oPane.relocate (nOrigWidth, nOrigHeight);
}
this.ensureVisible();
}
N2StaticPopover.prototype.relocate = N2StaticPopover.prototype._relocate;
N2StaticPopover.prototype._dragEngage = function (evt) {
evt = (evt) ? evt : window.event;
var target = (evt.target) ? evt.target : evt.srcElement;
;
;
var elemTitleBar = goN2U.getElement(this.myID+'_titleBar');
if (this.bDraggable && target && elemTitleBar && goN2U.elementIsContainedBy(target, elemTitleBar)) {
var docBody = document.body;
if (docBody && docBody.setCapture) {
docBody.setCapture();
}
var mouseDownX = goN2U.isDefined(evt.clientX)? evt.clientX : evt.pageX;
var mouseDownY = goN2U.isDefined(evt.clientY)? evt.clientY : evt.pageY;
this.dragOffsetX = mouseDownX - ((this.popObj.offsetLeft) ? this.popObj.offsetLeft : this.popObj.left);
this.dragOffsetY = mouseDownY - ((this.popObj.offsetTop) ? this.popObj.offsetTop : this.popObj.top);
this.buttonIsDown = true;
evt.cancelBubble = true;
if (evt.stopPropagation) {
evt.stopPropagation();
}
if (evt.preventDefault) {
evt.preventDefault();
}
return false;
} else {
return true;
}
}
N2StaticPopover.prototype._dragMove = function (evt) {
evt = (evt) ? evt : window.event;
if (!this.buttonIsDown) {
return true;
}
var nX = goN2U.isDefined(evt.clientX)? evt.clientX : evt.pageX;
nX -= this.dragOffsetX;
var nY = goN2U.isDefined(evt.clientY)? evt.clientY : evt.pageY;
nY -= this.dragOffsetY;
goN2U.shiftTo(this.popObj, nX, nY);
this.updateLocation();
if (this.myFeatureChangedCallback) {
this.myFeatureChangedCallback(this);
}
evt.cancelBubble = true;
if (evt.stopPropagation) {
evt.stopPropagation();
}
if (evt.preventDefault) {
evt.preventDefault();
}
return false;
}
N2StaticPopover.prototype._dragRelease = function (evt) {
if (!this.buttonIsDown) {
return true;
}
this._ensurePartiallyVisible();
if (document.body && document.body.releaseCapture) {
document.body.releaseCapture();
}
this.buttonIsDown = false;
evt.cancelBubble = true;
if (evt.stopPropagation) {
evt.stopPropagation();
}
if (evt.preventDefault) {
evt.preventDefault();
}
return false;
}
N2StaticPopover.prototype._click = function(evt) {
evt = (evt) ? evt : window.event;
;
if(!this.isStatic()) this.makeStatic(3);
}
N2StaticPopover.prototype._ensurePartiallyVisible = function (evt) {
var nLeft = this.left;
var nTop = this.top;
var nWindowWidth = goN2U.getInsideWindowWidth();
var nWindowHeight = goN2U.getInsideWindowHeight();
var nScrollLeft = goN2U.getScrollLeft();
var nScrollTop = goN2U.getScrollTop();
if (this.right < 0) {
nLeft = (-this.right + this.nMinLeftPixelsVisible) - Math.abs(this.left);
;
}
if (this.top < 0) {
;
nTop = this.nMinTopPixelsVisible;
}
if (this.left > (nWindowWidth + nScrollLeft)) {
;
nLeft = nWindowWidth + nScrollLeft - this.nMinRightPixelsVisible;
}
if (this.top > (nWindowHeight + nScrollTop)) {
;
nTop = nWindowHeight + nScrollTop - this.nMinBottomPixelsVisible;
}
;
goN2U.shiftTo(this.popObj, nLeft, nTop);
this.updateLocation();
}
N2StaticPopover.prototype.hookEvents = function () {
;
goN2Events.addEventHandler('mousedown', this.fDragEngage);
goN2Events.addEventHandler('mousemove', this.fDragMove);
goN2Events.addEventHandler('mouseup', this.fDragRelease);
}
N2StaticPopover.prototype.unhookEvents = function () {
;
goN2Events.removeEventHandler('mousedown', this.fDragEngage);
goN2Events.removeEventHandler('mousemove', this.fDragMove);
goN2Events.removeEventHandler('mouseup', this.fDragRelease);
}
N2StaticPopover.prototype._setContent = function (sHtml, oPane, bDisableScrollbars, bReadjustPopoverDimensions) {
var bResetTitlebar = false;
var nNoContentHeight;
var nUpdatedPopoverWidth, nUpdatedPopoverHeight;
oPane = oPane ? oPane : this.currentPane;
;
bDisableScrollbars = bDisableScrollbars ? true : false;
bReadjustPopoverDimensions = bReadjustPopoverDimensions ? true : false;
var nTitleBarHeight=0;
if (this.staticState >0) {
var TBVisibleHeight = goN2U.getObjectHeight(this.popObj);
goN2U.hide(this.myID+'_titleBar');
goN2U.undisplay(this.myID+'_titleBar');
nTitleBarHeight = TBVisibleHeight - goN2U.getObjectHeight(this.popObj);
;
bResetTitlebar = true;
}
sHtml = this.replacePlaceholders(sHtml);
sElemID = oPane.sElementID ? oPane.sElementID : '_main';
;
var eElem = goN2U.getRawObject(this.myID+sElemID);
if (eElem == null) {
this.content = sHtml;
;
return;
}
var oElemParent = eElem.parentNode;
;
eElem.innerHTML = '';
goN2U.setWidth(eElem, null);
goN2U.setHeight(eElem, null);
var nPopBorderAdjust=0;
if ( !oPane.isSubPane() || bReadjustPopoverDimensions) {
;
goN2U.setWidth(this.popObj, null);
goN2U.setHeight(this.popObj, null);
if (this.nPopBorderAdjust) {
nPopBorderAdjust = this.nPopBorderAdjust;
} else {
this.nPopBorderAdjust = nPopBorderAdjust = goN2U.getObjectWidth(this.popObj) - goN2U.getObjectWidth(eElem);
}
}
;
var nParentWidth = goN2U.getObjectWidth(oElemParent);
var nParentHeight = goN2U.getObjectHeight(oElemParent);
;
var nPopoverWidth = goN2U.getObjectWidth(this.popObj);
var nPopoverHeight = goN2U.getObjectHeight(this.popObj);
;
var newWidth, newHeight; //, unconstrainedMaxWidth, unconstrainedMaxHeight;
eElem.innerHTML = sHtml;
nParentWidth = goN2U.getObjectWidth(oElemParent);
nParentHeight = goN2U.getObjectHeight(oElemParent);
;
nPopoverWidth = goN2U.getObjectWidth(this.popObj);
nPopoverHeight = goN2U.getObjectHeight(this.popObj);
;
var bSetWidth = true;
newWidth = goN2U.getObjectWidth(eElem);
;
if (oPane.nDefaultWidth) {
if (oPane.nDefaultWidth == 'auto') {
;
bSetWidth = false; // testing
} else newWidth = oPane.nDefaultWidth;
}
var nMin = oPane.nMinWidth;
var nMax = oPane.nMaxWidth
if (nMax && (newWidth > nMax)) {
bSetWidth = true;
newWidth = nMax;
;
} else if (nMin && (newWidth < nMin)) {
bSetWidth = true;
newWidth = nMin;
;
}
if ( oPane.isSubPane() ) {
if (bSetWidth) {
goN2U.setWidth(eElem, newWidth);
;
}
} else {
var w = goN2U.isNumber(newWidth) ? newWidth + nPopBorderAdjust : newWidth;
;
goN2U.setWidth(this.popObj, w);
}
oPane.setCurrentWidth(newWidth);
var newHeight = goN2U.getObjectHeight(eElem);
;
if ( !bDisableScrollbars && ((oPane.nDefaultHeight && (newHeight > oPane.nDefaultHeight)) ||
(oPane.nMaxHeight && newHeight>oPane.nMaxHeight)) ) {
;
if(goN2U.isIE() || goN2U.isMozilla5()) {
eElem.style.overflow='auto';
} else
eElem.style.overflow='auto';
} else {
eElem.style.overflow='';
}
var bSetHeight = true;
if (oPane.nDefaultHeight) {
;
if (oPane.nDefaultHeight == 'auto') {
bSetHeight = false;
} else {
newHeight = oPane.nDefaultHeight;
;
}
}
nMin = oPane.nMinHeight;
nMax = oPane.nMaxHeight
if (nMax && (newHeight > nMax)) {
bSetHeight = true;
newHeight = nMax;
;
} else if (nMin && (newHeight < nMin)) {
bSetHeight = true;
newHeight = nMin;
;
}
if (bSetHeight) {
;
goN2U.setHeight(eElem, newHeight);
oPane.setCurrentHeight(newHeight);
}
if (bResetTitlebar) {
goN2U.show(this.myID+'_titleBar');
goN2U.display(this.myID+'_titleBar');
}
;
}
N2StaticPopover.prototype.contentChanging = function (oPane) {
oPane = oPane ? oPane : this.currentPane;
sElemID = oPane.sElementID ? oPane.sElementID : '_main';
;
var eElem = goN2U.getRawObject(this.myID+sElemID);
goN2U.setWidth(this.popObj, null);
goN2U.setHeight(this.popObj, null);
goN2U.setWidth(eElem, null);
goN2U.setHeight(eElem, null);
}
N2StaticPopover.prototype.contentChanged = function (oPane) {
oPane = oPane ? oPane : this.currentPane;
sElemID = oPane.sElementID ? oPane.sElementID : '_main';
;
var eElem = goN2U.getRawObject(this.myID+sElemID);
this.setContent(eElem.innerHTML);
if (this.myFeatureChangedCallback) this.myFeatureChangedCallback(this);
}
N2StaticPopover.prototype.callContentUpdater = function (fFn) {
this.contentChanging();
fFn();
this.contentChanged();
}
N2StaticPopover.prototype.displayPopoverDiv = function (bDisplayIt) {
if (bDisplayIt) {
goN2U.display(this.myID +'_main');
} else {
goN2U.undisplay(this.myID +'_main');
}
}
if (window.goN2LibMon) goN2LibMon.endLoad('staticPopover');
} // END library code wrapper
n2RunIfLoaded("simplepopover", n2StaticPopoverInitLibrary, "staticpopover");

/* staticPopover Ends */
