");
}
}
gbBsCreateDiv = true;
}
function BSSCPopup_Timeout()
{
if ((gPopupIFrame.document.readyState == "complete") &&
(gPopupIFrame.document.body != null) &&
(gPopupIFrame.location.href.indexOf(gbBlankPageForIFrame) == -1)) {
window.gPopupDivStyle.visibility = gBsStyVisShow;
BSSCPopup_TimeoutReal();
} else {
setTimeout("BSSCPopup_Timeout()", 100);
}
}
function BSSCPopup_TimeoutReal()
{
window.gbPopupTimeoutExpired = true;
if (gPopupIFrame.document) {
BSSCPopup_ChangeTargettoParent(gPopupIFrame.document);
gPopupIFrame.document.body.onclick = BSSCPopupClicked;
}
document.onmousedown = BSSCPopupParentClicked;
}
function BSSCPopup_ChangeTargettoParent(tagsObject)
{
var collA = tagsObject.all.tags("A");
var j = 0;
if (collA != null) {
for (j = 0; j < collA.length; j ++ )
{
collA[j].target = "_parent";
}
}
}
function BSPSPopupTopicWinHelp(strURL)
{
_BSSCPopup(strURL);
return;
}
var gb_strURL = "";
function _BSSCPopup(strURL)
{
gb_strURL = strURL;
if (DHTMLPopupSupport()) {
// If we are already in a popup, replace the contents
if (BSSCPopup_IsPopup()) {
location.href = strURL;
parent.window.gbPopupTimeoutExpired = false;
if (gbMac) {
setTimeout("BSSCPopup_AfterLoad()", 400);
} else {
setTimeout("BSSCPopup_AfterLoad()", 100);
}
} else {
var tempColl = document.all.tags("DIV");
for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
if (tempColl(iDiv).id == gstrPopupID) {
gPopupDiv = tempColl(iDiv);
}
if (tempColl(iDiv).id == gstrPopupShadowID) {
gPopupShadow = tempColl(iDiv);
}
if (tempColl(iDiv).id == gstrPopupTopicID) {
gPopupTopic = tempColl(iDiv);
}
}
gPopupIFrame = eval("gPopupDiv.document.frames['" + gstrPopupIFrameName + "']");
gPopupDivStyle = eval("gPopupDiv" + gBsSty);
gPopupIFrameStyle = eval(gBsDoc + "['" + gstrPopupIFrameName + "']" + gBsSty);
// Load the requested URL into the IFRAME
gPopupIFrame.location.href = strURL;
window.gbPopupTimeoutExpired = false;
if (gbMac) {
setTimeout("BSSCPopup_AfterLoad()", 400);
} else {
setTimeout("BSSCPopup_AfterLoad()", 100);
}
}
} else {
_BSSCPopup2(strURL);
}
return;
}
function _BSSCPopup2(strURL)
{
if (window.name == gstrPopupSecondWindowName) {
window.location = strURL;
} else {
BSSCHidePopupWindow();
var nX = 0;
var nY = 0;
var nHeight = 300;
var nWidth = 400;
_BSPSGetClientSize();
if (gBsBrowser.ns4) {
nX = window.screenX + (window.outerWidth - window.innerWidth) + window.gnPopupClickX;
nY = window.screenY + (window.outerHeight - window.innerHeight) + window.gnPopupClickY;
} else {
nX = window.gnPopupScreenClickX;
nY = window.gnPopupScreenClickY;
}
if (nY + nHeight + 40 > screen.availHeight) {
nY = screen.availHeight - nHeight - 40;
}
if (nX + nWidth + 40 > screen.availWidth) {
nX = screen.availWidth - nWidth - 40;
}
// Launch a separate window
var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
if (gBsBrowser.ns) {
if (gBsBrowser.ns6) {
strParam += ",Height=" + nHeight + ",Width=" + nWidth;
strParam += ",screenX=" + nX + ",screenY=" + nY;
}
else {
strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;
strParam += ",screenX=" + nX + ",screenY=" + nY;
strParam += ",dependent=yes";
}
}
else {
strParam += ",height=" + nHeight + ",width=" + nWidth;
strParam += ",left=" + nX + ",top=" + nY;
}
window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
if (gBsBrowser.ns4) {
window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);
window.gPopupWindow.onclick = NonIEPopup_HandleClick;
window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
}
else if (gBsBrowser.ie4)
{
window.gPopupWindow.focus();
}
}
return;
}
function NonIEPopup_HandleBlur(e)
{
window.gPopupWindow.focus();
}
function NonIEPopup_HandleClick(e)
{
// Because navigator will give the event to the handler before the hyperlink, let's
// first route the event to see if we are clicking on a Popup menu in a popup.
document.routeEvent(e);
// If a popup menu is active then don't do anything with the click
if (window.gPopupWindow.gbInPopupMenu) {
window.gPopupWindow.captureEvents(Event.CLICK);
window.gPopupWindow.onclick = NonIEPopup_HandleClick;
return false;
}
// Close the popup window
if (e.target.href != null) {
window.location.href = e.target.href;
if (e.target.href.indexOf("BSSCPopup") == -1) {
this.close();
}
} else {
this.close();
}
return false;
}
function BSSCPopup_AfterLoad()
{
if (typeof(window.gPopupIFrame.document) == "unknown") {
_BSSCPopup2(gb_strURL);
return;
}
if ((window.gPopupIFrame.document.readyState == "complete") &&
(window.gPopupIFrame.document.body != null) &&
(window.gPopupIFrame.location.href.indexOf(gbBlankPageForIFrame) == -1)) {
BSSCPopup_ResizeAfterLoad(gb_strURL);
} else {
setTimeout("BSSCPopup_AfterLoad()", 200);
}
}
function BSSCPopup_ResizeAfterLoad(strURL)
{
window.gPopupDivStyle.visibility = gBsStyVisHide;
// Determine the width and height for the window
//var size = new BSSCSize(0, 0);
//BSSCGetContentSize(window.gPopupIFrame, size);
//var nWidth = size.x;
//var nHeight = size.y;
_BSPSGetClientSize();
var size = new BSSCSize(0, 0);
BSSCGetContentSize(window.gPopupIFrame, size);
// Determine the width and height for the window
var nWidth = size.x;
var nHeight = size.y;
window.gPopupDivStyle.width = nWidth;
window.gPopupDivStyle.height = nHeight;
// Determine the position of the window
var nClickX = window.gnPopupClickX;
var nClickY = window.gnPopupClickY;
var nTop = 0;
var nLeft = 0;
if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
nTop = nClickY + 10;
} else {
nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
}
if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
nLeft = nClickX;
} else {
nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
}
if (nTop < document.body.scrollTop ) nTop = document.body.scrollTop + 1;
if (nLeft< document.body.scrollLeft) nLeft = document.body.scrollLeft + 1;
window.gPopupDivStyle.left = nLeft;
window.gPopupDivStyle.top = nTop;
// Set the location of the background blocks
window.gPopupShadow.style.left = 6;
window.gPopupShadow.style.top = 6;
if (gbIE55)
{
window.gPopupShadow.style.left = 4;
window.gPopupShadow.style.top = 4;
}
window.gPopupShadow.style.width = nWidth;
window.gPopupShadow.style.height = nHeight;
window.gPopupTopic.style.width = nWidth;
window.gPopupTopic.style.height = nHeight;
if (gbIE55)
{
window.gPopupShadow.style.width = nWidth + 2;
window.gPopupShadow.style.height = nHeight + 2;
window.gPopupTopic.style.width = nWidth + 2;
window.gPopupTopic.style.height = nHeight + 2;
}
if (gbMac) {
// Total hack on the iMac to get the IFrame to position properly
window.gPopupIFrameStyle.pixelLeft = 100;
window.gPopupIFrameStyle.pixelLeft = 0;
// Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
window.gPopupIFrame.window.BSSCOnLoad();
}
//var nOriWidth = window.gPopupIFrameStyle.width
window.gPopupIFrameStyle.width = nWidth;
window.gPopupIFrameStyle.height = nHeight;
if (gbIE55)
{
window.gPopupIFrameStyle.top = 0;
window.gPopupIFrameStyle.left = 0;
}
gPopupIFrame.location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5.
setTimeout("BSSCPopup_Timeout();", 100);
return false;
}
function BSSCSize(x, y)
{
this.x = x;
this.y = y;
}
function BSSCGetContentSize(thisWindow, size)
{
if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
return;
if (gbMac) {
size.x = 300;
size.y = 300;
return;
}
// Resize the width until it is wide enough to handle the content
// The trick is to start wide and determine when the scrollHeight changes
// because then we know a scrollbar is necessary. We can then go back
// to the next widest size (for no scrollbar)
var ClientRate = gBsClientHeight / gBsClientWidth;
var GoldenSize = new BSSCSize(0,0);
GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;
if (ClientRate > gBRateH_W) {
GoldenSize.y = GoldenSize.x * gBRateH_W;
}
else {
GoldenSize.x = GoldenSize.y / gBRateH_W;
}
// Try to using parent specified max x.
var x = 0;
var maxgoldx = GoldenSize.x;
var maxx = gBsClientWidth * gBMaxXOfParent;
// This double resize causes the document to re-render (and we need it to)
thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
thisWindow.resizeTo(1, 1);
thisWindow.resizeTo(1, 1);
thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can
{
thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
maxy = gBsClientHeight * gBMaxYOfParent;
if (miny > maxy) { // the popup must have a scroll, OK let it be.
miny = maxy;
size.x = maxx;
size.y = maxy;
}
else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
size.y = miny;
// downsize from maxx , now I try to using binary divide.
x = maxx;
deltax = -maxx/2;
//j = 0;
while (true) {
x = x + deltax;
thisWindow.resizeTo(x, miny);
thisWindow.resizeTo(x, miny);
diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
deltax = Math.abs(deltax) /2;
else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
deltax = -Math.abs(deltax) /2;
else
// the y is close enough to wanted.
break;
if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
break;
//j ++;
}
size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;
thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
// Handle absurd cases just in case IE flakes
// if (size.y < 100) {
// size.y = 100;
// }
}
}
else {
// downsize from maxgoldx , now I try to using binary divide.
x = maxgoldx;
deltax = -maxgoldx/2;
//i = 0;
while (true) {
x = x + deltax;
thisWindow.resizeTo(x, miny);
thisWindow.resizeTo(x, miny);
diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
deltax = Math.abs(deltax) /2;
else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
deltax = -Math.abs(deltax) /2;
else
// the y is close enough to wanted.
break;
if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
break;
//i ++;
}
size.x = thisWindow.document.body.scrollWidth ;//+ gBscrollWidth;
size.y = thisWindow.document.body.scrollHeight ;//+ gBscrollHeight;
thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
}
size.x = size.x + 16; //reserve a width for scrollbar
thisWindow.resizeTo(size.x, size.y);
thisWindow.resizeTo(size.x, size.y);
return;
}
function BSSCPopupParentClicked()
{
BSSCPopupClicked();
return;
}
function BSSCPopupClicked()
{
if (!window.gbPopupTimeoutExpired) {
return false;
}
if (gPopupIFrame.window.gbInPopupMenu) {
return false;
}
// Give the user a message about javascript calls through objects.
if ((gPopupIFrame.window.event != null) &&
(gPopupIFrame.window.event.srcElement != null) &&
(gPopupIFrame.window.event.srcElement.tagName == "A") &&
(gPopupIFrame.window.event.srcElement.href.indexOf("javascript:") == 0) &&
(gPopupIFrame.window.event.srcElement.href.indexOf(".") != -1)) {
gPopupIFrame.window.event.cancelBubble = true;
alert('Hyperlinks to objects do not work in popups.');
return false;
}
document.onclick = null;
document.onmousedown = null;
// Simply hide the popup
gPopupDivStyle.visibility = gBsStyVisHide;
gPopupIFrame.location.href = gbBlankPageForIFrame;
window.gbPopupTimeoutExpired = false;
return true;
}
//trace the mouse over's position for hotspot
function BSPSPopupOnMouseOver(event)
{
if (gBsBrowser.ie4) {
window.gnPopupClickX = event.clientX + document.body.scrollLeft;
window.gnPopupClickY = event.clientY + document.body.scrollTop;
window.gnPopupScreenClickX = event.screenX;
window.gnPopupScreenClickY = event.screenY;
} else if (gBsBrowser.ns4) {
window.gnPopupClickX = event.pageX;
window.gnPopupClickY = event.pageY;
}
}
function BSSCHidePopupWindow()
{
if (window.gPopupWindow != null) {
if (gBsBrowser.ns4) {
if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
window.gPopupWindow.close();
window.gPopupWindow = null;
}
}
}
return;
}
var gbPopupMenuTimeoutExpired = false;
var gbInPopupMenu = false;
var gbPopupMenuTopicList = null;
//////////////////////////////////////////////////////////////////////////////////////////
//
// Popup Menu code
//
//////////////////////////////////////////////////////////////////////////////////////////
function _WritePopupMenuLayer()
{
if (gbNav4) {
//Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page...
if (gbNav6)
document.write("");
else
document.write("");
} else {
document.write("");
if (gbIE4) {
document.write("");
}
}
}
//Define variable arguments as: strTitle, strUrl
function PopupMenuTopicEntry()
{
this.strTitle = PopupMenuTopicEntry.arguments[0];
this.strURL = PopupMenuTopicEntry.arguments[1];
}
// If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)
function PopupMenu_SetTopicList(aPopupTopicArray)
{
gbPopupMenuTopicList = aPopupTopicArray;
}
//Seek for the bsscright frame
function _SeekFrameByName( cRoot, strName )
{
if( cRoot == null ) return null;
if( cRoot.frames == null ) return null;
if( cRoot.frames[strName] != null ) return cRoot.frames[strName];
for (var i=0; i");
wndPopupLinks.document.write("");
var strParaLine = "";
for (var i = 0; i < (argLen - 2) / 2; i++) {
strParaLine = "";
strParaLine += "";
strParaLine += fn_arguments[2 * i + 2];
strParaLine += "";
strParaLine += " ";
wndPopupLinks.document.write(strParaLine);
}
wndPopupLinks.document.write("