-// eHelp® Corporation Dynamic HTML JavaScript \r
-// Copyright© 1998-2001 eHelp® Corporation.All rights reserved.\r
-// Version=4.57\r
-\r
-// Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten.\r
-\r
-//// Segment Begin -- (JavaScript 1.0)\r
-\r
-/// Section Begin - General and relative topics(JavaScript 1.0)\r
-\r
-//{{HH_SYMBOL_SECTION\r
-var HH_ChmFilename = "";\r
-var HH_WindowName = "";\r
-var HH_GlossaryFont = "";\r
-var HH_Glossary = "";\r
-var HH_Avenue = "";\r
-var HH_ActiveX = false;\r
-//}}HH_SYMBOL_SECTION\r
-\r
-//Begin to support previous generic parameters\r
-//Get the information about the browser.\r
-var gstrBsAgent = navigator.userAgent.toLowerCase();\r
-var gnBsVer = parseInt(navigator.appVersion);\r
-\r
-var gbBsIE = (gstrBsAgent.indexOf('msie') != -1);\r
-var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1));\r
-var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1);\r
-\r
-var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2));\r
-var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3));\r
-\r
-var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2));\r
-var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3));\r
-var gbBsIE300301 = ((gbBsIE) && (gnBsVer == 2) && ((gstrBsAgent.indexOf("3.00") != -1)||(gstrBsAgent.indexOf("3.0a") != -1)||(gstrBsAgent.indexOf("3.0b")!=-1)||(gstrBsAgent.indexOf("3.01")!=-1)));\r
-var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1));\r
-\r
-var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4));\r
-var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5));\r
-\r
-var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4));\r
-var gbBsIE5 = false;\r
-var gbBsIE55 = false;\r
-\r
-gbBsIE = (navigator.appName.indexOf("Microsoft") != -1);\r
-\r
-if (parseInt(navigator.appVersion) >= 4) {\r
- gbBsIE4 = (navigator.appName.indexOf("Microsoft") != -1);\r
-\r
- if (gbBsIE4) {\r
- var nPos = gstrBsAgent.indexOf("msie");\r
- var strIEversion = gstrBsAgent.substring(nPos + 5);\r
- var nVersion = parseFloat(strIEversion);\r
- if (nVersion >= 5)\r
- gbBsIE5 = true;\r
- if (nVersion >= 5.5)\r
- gbBsIE55 = true;\r
- }\r
-}\r
-\r
-var gbBsMac = (gstrBsAgent.indexOf('mac') != -1);\r
-var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1));\r
-var gbBsOp3 = (gstrBsAgent.indexOf('opera') != -1);\r
-\r
-// Utilities functions.\r
-function BsscHasExtJs()\r
-{\r
- if( gbBsIE3Before || gbBsNS3Before)\r
- return false;\r
- return true;\r
-}\r
-\r
-// Register event handler\r
-var gBsOnLoads = new Array(); // An array holds all the onload event handler.\r
-var gBsOnClicks = new Array(); // An array holds all the onClick event handler.\r
-var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler.\r
-var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler.\r
-var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler.\r
-\r
-var gbOrignalOnMouseDown = null;\r
-\r
-function BsscRegisterOnLoad(funcHandler)\r
-{\r
- var nLength = gBsOnLoads.length;\r
- gBsOnLoads[nLength] = funcHandler;\r
-}\r
-\r
-function BsscRegisterOnClick(funcHandler)\r
-{\r
- var nLength = gBsOnClicks.length;\r
- gBsOnClicks[nLength] = funcHandler;\r
-}\r
-\r
-function BsscRegisterOnUnLoad(funcHandler)\r
-{\r
- var nLength = gBsOnUnLoads.length;\r
- gBsOnUnLoads[nLength] = funcHandler;\r
-}\r
-\r
-function BsscRegisterOnMouseOver(funcHandler)\r
-{\r
- var nLength = gBsOnMouseOvers.length;\r
- gBsOnMouseOvers[nLength] = funcHandler;\r
-}\r
-\r
-function BsscRegisterOnMouseOut(funcHandler)\r
-{\r
- var nLength = gBsOnMouseOuts.length;\r
- gBsOnMouseOuts[nLength] = funcHandler;\r
-}\r
-\r
-\r
-function BsGeneralOnLoad()\r
-{\r
- if (!gbBsIE4 && !gbBsNS4)\r
- return;\r
-\r
- // Make everything visible in navigator\r
- if (gbBsNS4 && !gbBsNS6) {\r
- // Make some special effects items visible\r
- for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {\r
- document.layers[iLayer].visibility = "show";\r
- document.layers[iLayer].left = 0;\r
- }\r
- }\r
-}\r
-\r
-// If resize the netscape browser, need to reload it.\r
-function BsReDo()\r
-{\r
- if (innerWidth != origWidth || innerHeight != origHeight)\r
- location.reload();\r
-}\r
-// End of the local functions.\r
-\r
-// The following functions are used by the html files.\r
-function BSSCOnLoad()\r
-{\r
- if( !BsscHasExtJs() )\r
- return;\r
- for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--)\r
- gBsOnLoads[nElement]();\r
-}\r
-\r
-function BSSCOnClick()\r
-{\r
- if (!BsscHasExtJs()) return;\r
- \r
- for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--)\r
- gBsOnClicks[nElement]();\r
-}\r
-\r
-function BSSCOnUnload()\r
-{\r
- if (!BsscHasExtJs()) return;\r
- for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--)\r
- {\r
- gBsOnUnLoads[nElement]();\r
- }\r
-}\r
-\r
-function BSSCOnMouseOver()\r
-{\r
- if (!BsscHasExtJs()) return;\r
- for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--)\r
- {\r
- gBsOnMouseOvers[nElement]();\r
- }\r
-}\r
-\r
-function BSSCOnMouseOut()\r
-{\r
- if (!BsscHasExtJs()) return;\r
- for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--)\r
- {\r
- gBsOnMouseOuts[nElement]();\r
- }\r
-}\r
-// End of invocation of the event handle functions.\r
-\r
-\r
-// Add the GereralOnLoad to the onload array.\r
-if (typeof(BsscRegisterOnLoad) != "undefined")\r
-{\r
- BsscRegisterOnLoad(BsGeneralOnLoad);\r
-}\r
-if (gbBsNS4&&!gbBsNS6) {\r
- origWidth = innerWidth;\r
- origHeight = innerHeight;\r
- onresize = BsReDo;\r
-}\r
-//End to support previous generic parameters\r
-\r
-//Begin to support previous HHActiveX invoking\r
-function BsHHActivateComponents()\r
-{\r
- if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))\r
- {\r
- var objBody = document.all.tags("BODY")[0];\r
- if( typeof(objBody) == "object" )\r
- {\r
- objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');\r
- if (HHComponentActivator.object)\r
- HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);\r
- }\r
- }\r
-}\r
-\r
-function BsHHActivXOnLoad()\r
-{ \r
- if( gbBsIE4 )\r
- BsHHActivateComponents(); \r
-}\r
-\r
-if( typeof(BsscRegisterOnLoad) != "undefined" )\r
-{\r
- BsscRegisterOnLoad(BsHHActivXOnLoad);\r
-}\r
-//End to support previous HHActiveX invoking\r
-\r
-//Begin to support previous relative topics\r
-//If webHelp needs Related Topics DHTMLcode, it's supposed to add it here\r
-var gbPopupMenuTimeoutExpired = false;\r
-var gbInPopupMenu = false;\r
-var gbPopupMenuTopicList = null;\r
-var gOlddocumentClick = null;\r
-\r
-//////////////////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Popup Menu code\r
-//\r
-//////////////////////////////////////////////////////////////////////////////////////////\r
-\r
-var g_bIsPopupMenuInit = false;\r
-function _WritePopupMenuLayer()\r
-{\r
- if (!g_bIsPopupMenuInit)\r
- {\r
- if (gbBsNS4) {\r
-//Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page...\r
- if (gbBsNS6)\r
- document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");\r
- else\r
- document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");\r
- } else{\r
- document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");\r
- if (gbBsIE4) {\r
- document.write("<STYLE TYPE='text/css'>");\r
- if (gbBsMac) {\r
- document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");\r
- document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");\r
- } else {\r
- document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");\r
- document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");\r
- }\r
- document.write("</STYLE>");\r
- }\r
- }\r
- g_bIsPopupMenuInit = true;\r
- }\r
-}\r
-\r
-//Define variable arguments as: strTitle, strUrl\r
-function MTE() \r
-{\r
- this.strTitle = MTE.arguments[0];\r
- if (MTE.arguments.length > 1)\r
- this.strURL = MTE.arguments[1];\r
- else\r
- this.strURL = this.strTitle;\r
-}\r
-\r
-// If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)\r
-function PopupMenu_SetTopicList(aPopupTopicArray)\r
-{\r
- gbPopupMenuTopicList = aPopupTopicArray;\r
-}\r
-\r
-\r
-//Seek for the bsscright frame \r
-function _SeekFrameByName( cRoot, strName )\r
-{\r
- if( cRoot == null ) return null;\r
- if( cRoot.frames == null ) return null;\r
- if( cRoot.frames[strName] != null ) return cRoot.frames[strName];\r
- for (var i=0; i<cRoot.frames.length; i++)\r
- {\r
- var cObj = null;\r
- if (!gbBsNS6) \r
- cObj = _SeekFrameByName( cRoot.frames(i).document, strName );\r
- else\r
- cObj = _SeekFrameByName( cRoot.frames[i], strName );\r
- if( cObj != null ) return cObj;\r
- };\r
- return null;\r
-}\r
-function _GetFrameByName( cRoot, strName )\r
-{\r
- if( cRoot == null ) return null;\r
- var cRet = _SeekFrameByName(cRoot, strName);\r
- if( cRet != null ) return cRet;\r
- if (cRoot.parent != cRoot)\r
- return _GetFrameByName( cRoot.parent, strName );\r
- else\r
- return null;\r
-}\r
-\r
-function _PopupMenu_Invoke(fn_arguments)\r
-{\r
- // Make sure we have reasonable arguments\r
- var argLen = fn_arguments.length;\r
- if (argLen < 3) {\r
- return false;\r
- }\r
-\r
- // Check to see if we only have one target\r
- var strTarget = "";\r
- var targetDoc = null;\r
- if (fn_arguments[1] == '') {\r
- if (BSSCPopup_IsPopup()) {\r
- targetDoc = parent;\r
- strTarget = "TARGET= _parent";\r
- }\r
- else\r
- targetDoc = window.document;\r
- } else {\r
- targetDoc = _GetFrameByName( parent, fn_arguments[1] );\r
-\r
- strTarget = "TARGET='" + fn_arguments[1] + "'";\r
- }\r
-\r
- if ((!gbBsIE4 && !gbBsNS4) || ((gbBsMac) && (gbBsIE4) && (window.event.srcElement.tagName == "AREA"))) {\r
- \r
- var argLen = fn_arguments.length;\r
-\r
- // Create the window that the hyperlinks will go into\r
- var nHeight = argLen * 15;\r
- var nWidth = 400;\r
- var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";\r
- strParam += ",height=" + nHeight + ",width=200";\r
- strParam += ",resizable";\r
-\r
- // Create a temporary window first to ensure the real popup comes up on top\r
- var wndTemp = window.open("", "temp", strParam);\r
-\r
- // Create the real popup window\r
- var wndPopupLinks = window.open("", "popuplinks", strParam);\r
-\r
- // Close the temporary\r
- wndTemp.close();\r
-\r
- wndPopupLinks.document.open("text/html");\r
- wndPopupLinks.document.write("<html><head></head>");\r
- wndPopupLinks.document.write("<body onBlur=\'self.focus();\'>");\r
- var strParaLine = "";\r
- for (var i = 0; i < (argLen - 2) / 2; i++) {\r
- strParaLine = "";\r
- strParaLine += "<a href=\"javascript:";\r
- if (gbBsIE) {\r
- strParaLine += "onBlur=null; ";\r
- }\r
- strParaLine += "opener.location=\'";\r
- strParaLine += fn_arguments[2 * i + 3];\r
- strParaLine += "\';close();\"";\r
- strParaLine += strTarget;\r
-\r
- strParaLine += ">";\r
- strParaLine += fn_arguments[2 * i + 2];\r
- strParaLine += "</a>";\r
- strParaLine += "<br>";\r
- wndPopupLinks.document.write(strParaLine);\r
- }\r
- wndPopupLinks.document.write("</body></html>");\r
- wndPopupLinks.document.close();\r
- window.gbInPopupMenu = true;\r
- if (!gbBsIE) {\r
- wndPopupLinks.focus();\r
- }\r
-\r
- return false;\r
- }\r
-\r
-\r
- if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||\r
- ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {\r
- // Get the place that we will be putting the topic into\r
- var strURL = "";\r
- if (isNaN(fn_arguments[2]) || (gbPopupMenuTopicList == null)) {\r
- strURL = fn_arguments[3];\r
- }\r
- else {\r
- strURL = gbPopupMenuTopicList[fn_arguments[2]].strURL;\r
- }\r
-\r
- if (targetDoc != null) {\r
- targetDoc.location.href = strURL;\r
- }\r
- else {\r
- if (fn_arguments[1] != null && typeof(fn_arguments[1]) != "undefined")\r
- window.open(strURL, fn_arguments[1]);\r
- else\r
- window.open(strURL);\r
- } \r
- window.gbInPopupMenu = true;\r
- return false;\r
- }\r
- \r
- var strMenu = "";\r
- if (gbBsNS4) {\r
- strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';\r
- } else {\r
- strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';\r
- if (gbBsMac) {\r
- strMenu += ' CELLPADDING=4';\r
- } else {\r
- strMenu += ' CELLPADDING=2';\r
- } \r
- strMenu += ' BGCOLOR=#c0c0c0>';\r
- }\r
- // Add each of the items\r
- var i = 2;\r
- while (i <= argLen - 1) {\r
- strMenu += '<TR><TD><NOBR>'\r
- // If the destination is a number then look it up in the topic list\r
- if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {\r
- strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;\r
- } else {\r
- strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;\r
- }\r
- strMenu += ' onclick="PopupMenu_HandleClick(event);"';\r
- strMenu += ' onmouseover="PopupMenu_Over(event);"';\r
- strMenu += ' onmouseout="PopupMenu_Out(event);"';\r
- strMenu += '>';\r
- if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {\r
- strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';\r
- } else {\r
- strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';\r
- }\r
- strMenu += '</A></DIV></NOBR></TD></TR>';\r
-\r
- if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {\r
- i += 2;\r
- } else {\r
- i += 1;\r
- }\r
- }\r
- strMenu += "</TABLE>";\r
-\r
- if (gbBsMac) {\r
- // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.\r
- strMenu +="<TABLE></TABLE>";\r
- }\r
-\r
- var layerPopup = null;\r
- var stylePopup = null;\r
- var nEventX = 0;\r
- var nEventY = 0;\r
- var nWindowWidth = 0;\r
- if (gbBsIE4) {\r
-\r
- layerPopup = document.all["PopupMenu"];\r
- layerPopup.innerHTML = strMenu;\r
- stylePopup = layerPopup.style;\r
-\r
- _BSPSGetClientSize();\r
-\r
- // Get the position of the item causing the event (relative to its parent)\r
- nEventX = window.event.clientX;\r
- nEventY = window.event.clientY;\r
-\r
- if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {\r
- nEventY += document.body.scrollTop + 10;\r
- } else {\r
- nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;\r
- }\r
- stylePopup.top = nEventY;\r
- \r
- var nPopupWidth = layerPopup.scrollWidth;\r
- if (gbBsMac) {\r
- nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.\r
- }\r
- if (nEventX + nPopupWidth + 20 > gBsClientWidth) {\r
- if (gBsClientWidth - nPopupWidth < 5) {\r
- stylePopup.left = 5;\r
- } else {\r
- stylePopup.left = gBsClientWidth - nPopupWidth - 5;\r
- }\r
- } else {\r
- stylePopup.left = nEventX + document.body.scrollLeft + 20;\r
- }\r
-\r
- stylePopup.visibility = "visible";\r
- if (!gOlddocumentClick && document.onclick)\r
- gOlddocumentClick = document.onclick;\r
- document.onclick = PopupMenu_HandleClick;\r
-\r
- } else if (gbBsNS6) {\r
- layerPopup = document.getElementById("PopupMenu");\r
- layerPopup.style.visibility = "hidden";\r
- \r
- var e = fn_arguments[0];\r
- nEventX = e.pageX;\r
- nEventY = e.pageY;\r
- _BSPSGetClientSize();\r
- layerPopup.innerHTML = strMenu;\r
-\r
- if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) {\r
- nEventY += 20;\r
- } else {\r
- nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;\r
- }\r
-\r
- if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {\r
- if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {\r
- nEventX = 5;\r
- } else {\r
- nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;\r
- }\r
- } else {\r
- nEventX += 20;\r
- }\r
- layerPopup.style.top = nEventY;\r
- layerPopup.style.left = nEventX;\r
- // set again to avoid the stupid frash in netscape 6.\r
- layerPopup.innerHTML = strMenu;\r
- layerPopup.style.visibility = "visible";\r
- //window.captureEvents(Event.MOUSEDOWN);\r
- if (!gOlddocumentClick && document.onclick)\r
- gOlddocumentClick = document.onclick;\r
- window.onclick = PopupMenu_HandleClick;\r
- }\r
- else if (gbBsNS4) {\r
- layerPopup = document.layers.PopupMenu;\r
- layerPopup.visibility = "hide";\r
- stylePopup = layerPopup.document;\r
- stylePopup.write(strMenu);\r
- stylePopup.close();\r
- var e = fn_arguments[0];\r
- nEventX = e.pageX;\r
- nEventY = e.pageY;\r
- _BSPSGetClientSize();\r
- if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {\r
- nEventY += 20;\r
- } else {\r
- nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;\r
- }\r
- layerPopup.top = nEventY;\r
-\r
- if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {\r
- if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {\r
- nEventX = 5;\r
- } else {\r
- nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;\r
- }\r
- } else {\r
- nEventX += 20;\r
- }\r
-\r
- layerPopup.left = nEventX;\r
-\r
- layerPopup.visibility = "show";\r
-\r
- window.captureEvents(Event.MOUSEDOWN);\r
- if (!gOlddocumentClick && document.onmousedown)\r
- gOlddocumentClick = document.onmousedown;\r
- window.onmousedown = PopupMenu_HandleClick;\r
- }\r
-\r
- window.gbInPopupMenu = true;\r
- window.gbPopupMenuTimeoutExpired = false;\r
- setTimeout("PopupMenu_Timeout();", 100);\r
- return false;\r
-}\r
-\r
-\r
-function PopupMenu_Timeout()\r
-{\r
- window.gbPopupMenuTimeoutExpired = true;\r
-}\r
-\r
-function PopupMenu_Over(e)\r
-{\r
- if (gbBsIE4) {\r
- e.srcElement.className = "PopupOver";\r
- } else if (gbBsNS4) {\r
-// this.bgColor = "red";\r
-// e.target.document.className = "PopupOver";\r
- }\r
- return;\r
-}\r
-\r
-function PopupMenu_Out(e)\r
-{\r
- if (gbBsIE4) {\r
- e.srcElement.className = "PopupNotOver";\r
- } else if (gbBsNS4) {\r
- this.bgColor = "#f0f0f0";\r
- }\r
- return;\r
-}\r
-\r
-\r
-function PopupMenu_HandleClick(e)\r
-{\r
- if (window.gbPopupMenuTimeoutExpired) {\r
-\r
- window.gbInPopupMenu = false;\r
-\r
- if (gbBsNS4 && !gbBsNS6) {\r
- window.releaseEvents(Event.MOUSEDOWN);\r
- }\r
-\r
- var layerPopup = null;\r
- var stylePopup = null;\r
- if (gbBsIE4) {\r
- layerPopup = document.all["PopupMenu"];\r
- stylePopup = layerPopup.style;\r
- stylePopup.visibility = "hidden";\r
- } else if (gbBsNS6) {\r
- layerPopup = document.getElementById("PopupMenu");\r
- layerPopup.style.visibility = "hidden";\r
- } else if (gbBsNS4) {\r
- layerPopup = document.layers.PopupMenu;\r
- layerPopup.visibility = "hide";\r
- }\r
- \r
- if (gOlddocumentClick)\r
- {\r
- if (gbBsNS4 && !gbBsNS6)\r
- document.onmousedown = gOlddocumentClick;\r
- else\r
- document.onclick = gOlddocumentClick;\r
- }\r
- }\r
- return;\r
-}\r
-\r
-// This function should be deleted when all old projects are cleaned up\r
-function BSPSWritePopupFrameForIE4()\r
-{\r
- return false;\r
-}\r
-\r
-/////////////////////////////////////////////////////////////////////\r
-function BSSCPopup_ClickMac()\r
-{\r
- if ((!DHTMLPopupSupport()) && (gbBsIE4))\r
- { \r
- var bClickOnAnchor = false;\r
- var el;\r
- if ((window.event != null) &&\r
- (window.event.srcElement != null))\r
- {\r
- el = window.event.srcElement;\r
- while (el != null)\r
- {\r
- if ((el.tagName == "A") || (el.tagName == "AREA")) {\r
- bClickOnAnchor = true;\r
- break;\r
- }\r
- if (el.tagName == "BODY") {\r
- break;\r
- }\r
- el = el.parentElement;\r
- }\r
- }\r
- if (BSSCPopup_IsPopup())\r
- {\r
- if (!bClickOnAnchor) {\r
- parent.window.gPopupWindow = null;\r
- self.close();\r
- }\r
- }\r
- else\r
- {\r
- bClosePopupWindow = true;\r
- if ((bClickOnAnchor) &&\r
- (el.href) &&\r
- ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))\r
- {\r
- bClosePopupWindow = false;\r
- }\r
- if (bClosePopupWindow)\r
- {\r
- if (window.gPopupWindow != null && !window.gPopupWindow.closed )\r
- {\r
- window.gPopupWindow.close();\r
- }\r
- }\r
- }\r
- }\r
- }\r
-\r
-//////////////////////////////////////////////////////////////////////\r
-\r
-function BsPopupOnClick()\r
-{\r
- if (!gbBsIE4)\r
- return;\r
-\r
- BSSCPopup_ClickMac();\r
-}\r
-\r
-function _BSSCOnError(message)\r
-{\r
- if(-1 != message.indexOf("denied") \r
- || -1 != message.indexOf("Object required"))\r
- return true;\r
-}\r
-\r
-//End to support previous relative topics\r
-\r
-\r
-/// Section End - General and relative topics (JavaScript 1.0)\r
-\r
-/// Section Begin - Popup (JavaScript 1.0)\r
-\r
-//Begin to support previous popup functions\r
-//////////////////////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Begin DHTML Popup Functions\r
-//\r
-//////////////////////////////////////////////////////////////////////////////////////////////\r
-//variables used to isolate the browser type\r
-var gBsDoc = null; \r
-var gBsSty = null;\r
-var gBsHtm = null;\r
-var gBsStyVisShow = null;\r
-var gBsStyVisHide = null;\r
-var gBsClientWidth = 640;\r
-var gBsClientHeight = 480;\r
-var gBsBrowser = null;\r
-\r
-// here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.\r
-var gBRateH_W = 0.618; // 1.618 Golden cut.\r
-var gBMaxXOfParent = 0.8; \r
-var gBMaxYOfParent = 0.8;\r
-var gBscrollHeight = 16;\r
-var gBscrollWidth = 16;\r
-var gBpermitXDelta = 3;\r
-var gBpermitYDelta = 3;\r
-\r
-\r
-var arrayPopupURL = new Array();\r
-var arrayAbsPopupURL = new Array();\r
-\r
-var arrayDirty = new Array();\r
-\r
-function setAbsPopupURL(nIndex, strURL)\r
-{\r
- arrayAbsPopupURL[nIndex] = strURL;\r
-}\r
-\r
-function getAbsPopupURL(nIndex)\r
-{\r
- if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;\r
- else \r
- return arrayAbsPopupURL[nIndex];\r
-}\r
-\r
-function getPopupURL(nIndex)\r
-{\r
- if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;\r
- else \r
- return arrayPopupURL[nIndex];\r
-}\r
-\r
-function getPopupID(nIndex)\r
-{\r
- return gstrPopupID + nIndex;\r
-}\r
-\r
-function getPopupShadowID(nIndex)\r
-{\r
- return gstrPopupShadowID + nIndex;\r
-}\r
-\r
-function getPopupTopicID(nIndex)\r
-{\r
- return gstrPopupTopicID + nIndex;\r
-}\r
-\r
-function getPopupIFrameID(nIndex)\r
-{\r
- return gstrPopupIFrameID + nIndex;\r
-}\r
-\r
-function getPopupIFrameName(nIndex)\r
-{\r
- return gstrPopupIFrameName + nIndex;\r
-}\r
-\r
-\r
-function getPopupTopicStyle(nIndex)\r
-{\r
- return eval("document.all['" + getPopupTopicID(nIndex) + "']").style;\r
-}\r
-\r
-function getPopupShadowStyle(nIndex)\r
-{\r
- return eval("document.all['" + getPopupShadowID(nIndex) + "']").style;\r
-}\r
-\r
-function getPopupIFrame(nIndex)\r
-{\r
-\r
- return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");\r
-}\r
-\r
-function getPopupDivStyle(nIndex)\r
-{\r
- return eval("document.all['" + getPopupID(nIndex) + "']").style;\r
-}\r
-\r
-function getPopupIFrameStyle(nIndex)\r
-{\r
- return eval("document.all['" + getPopupIFrameName(nIndex) + "'].style");\r
-}\r
-\r
-\r
-function findDiv(strURL)\r
-{\r
- var i = 0;\r
- for (i = 0; i < arrayPopupURL.length; i ++ ) {\r
- if (arrayPopupURL[i] == strURL) {\r
- return i;\r
- }\r
- }\r
- return -1;\r
-}\r
-\r
-var gnToken = -1;\r
-function takeToken()\r
-{\r
- gnToken ++;\r
- if (gnToken > 10000) gnToken = 0;\r
- return gnToken;\r
-}\r
-\r
-function IsValidToken(nToken)\r
-{\r
- return (gnToken == nToken);\r
-}\r
-\r
-function addDiv(strURL)\r
-{\r
- var i = 0; \r
- for (i = 0; i < arrayPopupURL.length; i ++) {\r
- if (arrayPopupURL[i] == null) {\r
- arrayPopupURL[i] = strURL;\r
- return i;\r
- }\r
- } \r
- arrayPopupURL[i] = strURL;\r
- arrayDirty[i] = true;\r
- return i;\r
-}\r
-\r
-function setDirty()\r
-{\r
- var i = 0;\r
- for (i = 0; i < arrayPopupURL.length; i ++ )\r
- arrayDirty[i] = true;\r
-}\r
-\r
-function IsDirty(nIndex)\r
-{\r
- if (nIndex == -1)\r
- return true;\r
- else \r
- if (arrayDirty.length > nIndex) \r
- return arrayDirty[nIndex];\r
- else\r
- return true;\r
-}\r
-\r
-function hideAll()\r
-{\r
- var i = 0; \r
- for (i = 0; i < arrayPopupURL.length; i ++ )\r
- getPopupDivStyle(i).visibility = gBsStyVisHide;\r
-}\r
-\r
-function getCurrentPopupIFrame()\r
-{\r
- var i = 0;\r
- for (i = 0; i < arrayPopupURL.length; i ++)\r
- if (getPopupDivStyle(i).visibility == gBsStyVisShow)\r
- return getPopupIFrame(i);\r
- return null;\r
-}\r
-\r
-function setClear(nIndex)\r
-{\r
- if (nIndex != -1)\r
- arrayDirty[nIndex] = false;\r
-}\r
-\r
-function _BSSCCreatePopupDiv(strURL)\r
-{\r
- var nIndex = findDiv(strURL);\r
- if (nIndex == -1 ) {\r
- nIndex = addDiv(strURL);\r
- BsPopup_CreateDiv(nIndex);\r
- }\r
- else {\r
- if (IsDirty(nIndex)) {\r
- if("object" == typeof(getPopupIFrame(nIndex).document))\r
- getPopupIFrame(nIndex).document.location.href = strURL;\r
- }\r
- }\r
- return nIndex;\r
-\r
-}\r
-\r
-//the browser information itself\r
-function _BSPSBrowserItself()\r
-{\r
- var agent = navigator.userAgent.toLowerCase();\r
- this.major = parseInt(navigator.appVersion);\r
- this.minor = parseFloat(navigator.appVersion);\r
- this.ns = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));\r
- this.ns2 = ((this.ns) && (this.major == 2));\r
- this.ns3 = ((this.ns) && (this.major == 3));\r
- this.ns4 = ((this.ns) && (this.major >= 4));\r
- this.ns6 = ((this.ns) && (this.major >= 5));\r
- this.ie = (agent.indexOf("msie") != -1);\r
- this.ie3 = ((this.ie) && (this.major == 2));\r
- this.ie4 = ((this.ie) && (this.major >= 4));\r
- this.op3 = (agent.indexOf("opera") != -1);\r
-\r
- if (this.ns4)\r
- {\r
- gBsDoc = "document";\r
- gBsSty = "";\r
- gBsHtm = ".document";\r
- gBsStyVisShow = "show";\r
- gBsStyVisHide = "hide";\r
-\r
- }\r
- else if (this.ie4)\r
- {\r
- gBsDoc = "document.all";\r
- gBsSty = ".style";\r
- gBsHtm = "";\r
- gBsStyVisShow = "visible";\r
- gBsStyVisHide = "hidden";\r
- }\r
-}\r
-\r
-//Here is the browser type \r
-function _BSPSGetBrowserInfo()\r
-{\r
- gBsBrowser = new _BSPSBrowserItself();\r
-}\r
-\r
-_BSPSGetBrowserInfo();\r
-\r
-//Get client size info\r
-function _BSPSGetClientSize()\r
-{\r
- if (gBsBrowser.ns4)\r
- {\r
- gBsClientWidth = innerWidth;\r
- gBsClientHeight = innerHeight;\r
-\r
- }\r
- else if (gBsBrowser.ie4)\r
- {\r
- gBsClientWidth = document.body.clientWidth;\r
- gBsClientHeight = document.body.clientHeight;\r
- }\r
-}\r
-\r
-\r
-var gstrPopupID = 'BSSCPopup';\r
-var gstrPopupShadowID = 'BSSCPopupShadow';\r
-var gstrPopupTopicID = 'BSSCPopupTopic';\r
-var gstrPopupIFrameID = 'BSSCPopupIFrame';\r
-var gstrPopupIFrameName = 'BSSCPopupIFrameName';\r
-\r
-var gstrPopupSecondWindowName = 'BSSCPopup';\r
-\r
-var gPopupWindow = null;\r
-var gnPopupClickX = 0;\r
-var gnPopupClickY = 0;\r
-\r
-var gnPopupScreenClickX = 0;\r
-var gnPopupScreenClickY = 0;\r
-\r
-var gbPopupTimeoutExpired = false;\r
-\r
-\r
-function DHTMLPopupSupport()\r
-{\r
- if ((gbBsIE4) && (!gbBsMac)) {\r
- return true;\r
- }\r
- return false;\r
-}\r
-\r
-\r
-\r
-function BSSCPopup_IsPopup()\r
-{\r
- if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) {\r
- return true;\r
- } else if ((gbBsNS4 || gbBsIE4) && (this.name.indexOf(gstrPopupID) != -1)) {\r
- return true;\r
- } else {\r
- return false;\r
- }\r
-}\r
-\r
-\r
-// If there is a hyperlink in a popup window, display the hyperlink in\r
-// the original window.\r
-if (BSSCPopup_IsPopup() && !gbBsIE4) {\r
- document.write("<base target=\"_parent\">");\r
-}\r
-\r
-// Local functions.\r
-function BsPopup_CreateDiv(nIndex)\r
-{\r
- if(!DHTMLPopupSupport())\r
- return;\r
- // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone.\r
- var strPopupDiv = "<DIV ID='" + getPopupID(nIndex) + "' STYLE='position:absolute; top:-100; left:0; z-index:600; visibility:hidden;'>";\r
- strPopupDiv += "<DIV ID='" + getPopupShadowID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#C0C0C0;\"></DIV>";\r
- strPopupDiv += "<DIV ID='" + getPopupTopicID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#FFFFFF;border:1px #000000 outset;\">";\r
- strPopupDiv += "<IFRAME title=\"Popup Window\" ID='" + getPopupIFrameID(nIndex) + "' name='" + getPopupIFrameName(nIndex) + "' src = '" + getPopupURL(nIndex) + "' frameborder=0 scrolling=auto></IFRAME>";\r
- strPopupDiv += "</DIV></DIV>";\r
-\r
- var objBody = document.all.tags("BODY")[0];\r
- if( typeof(objBody) != "object" )\r
- return;\r
-\r
- objBody.insertAdjacentHTML("beforeEnd", strPopupDiv);\r
-}\r
-\r
-function BSSCPopup_Timeout(nIndex, nToken)\r
-{\r
- if (!IsValidToken(nToken)) return;\r
-\r
- if ((getPopupIFrame(nIndex).document.readyState == "complete") &&\r
- (getPopupIFrame(nIndex).document.body != null)) {\r
- window.getPopupDivStyle(nIndex).visibility = gBsStyVisShow;\r
- setClear(nIndex);\r
- window.gbPopupTimeoutExpired = true;\r
-\r
- BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document);\r
- getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked;\r
-\r
- if (!gbOrignalOnMouseDown && document.onmousedown)\r
- gbOrignalOnMouseDown = document.onmousedown;\r
-\r
- document.onmousedown = BSSCPopupParentClicked;\r
-\r
- } else {\r
- setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100);\r
- }\r
-}\r
-\r
-\r
-// VH 08/10/00 \r
-// do not change target to parent if the href is using javascript\r
-function BSSCPopup_ChangeTargettoParent(tagsObject)\r
-{\r
- var collA = tagsObject.all.tags("A");\r
- BSSCPopup_ChangeTargettoParent2(collA);\r
-\r
- var collIMG = tagsObject.all.tags("IMG");\r
- BSSCPopup_ChangeTargettoParent2(collIMG);\r
-}\r
-\r
-function BSSCPopup_ChangeTargettoParent2(colls)\r
-{\r
- var j = 0;\r
- if (colls != null) {\r
- for (j = 0; j < colls.length; j ++ )\r
- {\r
- var strtemp = colls[j].href;\r
- strtemp = strtemp.toLowerCase();\r
- if (strtemp.indexOf("javascript:") == -1)\r
- if (colls[j].target == "")\r
- colls[j].target = "_parent";\r
- }\r
-\r
- }\r
-}\r
-\r
-function BSPSPopupTopicWinHelp(strURL)\r
-{\r
- _BSSCPopup(strURL);\r
- return;\r
-}\r
-\r
-function _BSSCPopup(strURL, width, height)\r
-{\r
- var cuswidth = 0;\r
- var cusheight = 0;\r
- if ("undefined" != typeof(width) && "undefined" != typeof(height)) {\r
- cuswidth = width;\r
- cusheight= height;\r
- }\r
- \r
- if (DHTMLPopupSupport()) {\r
- // If we are already in a popup, replace the contents\r
- // if (BSSCPopup_IsPopup()) {\r
- // parent._BSSCPopup(strURL, cuswidth, cusheight);\r
- // } else {\r
- var nToken = takeToken(); // take token first.\r
- var nIndex = _BSSCCreatePopupDiv(strURL);\r
- window.gbPopupTimeoutExpired = false;\r
- var ntWidth = gBsClientWidth;\r
- var ntHeight = gBsClientHeight;\r
- _BSPSGetClientSize();\r
- if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) {\r
- setDirty();\r
- }\r
-\r
-\r
- if (IsDirty(nIndex)) {\r
- if (gbBsMac) {\r
- setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight +")", 400);\r
- } else {\r
- setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100);\r
- }\r
- }\r
- else {\r
- MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight);\r
- }\r
- // }\r
-\r
- } else {\r
- _BSSCPopup2(strURL, cuswidth, cusheight);\r
- }\r
- return;\r
-}\r
-\r
-if (gbBsIE55)\r
-{\r
- var ehlpdhtm_fOldBefureUnload = window.onbeforeunload;\r
- window.onbeforeunload = window_BUnload;\r
-}\r
- \r
-function window_BUnload()\r
-{\r
- for (var i = 0; i < arrayPopupURL.length; i ++)\r
- document.all(getPopupID(i)).outerHTML = "";\r
- arrayPopupURL.length = 0; \r
- if (ehlpdhtm_fOldBefureUnload)\r
- ehlpdhtm_fOldBefureUnload();\r
-}\r
-\r
-function _BSSCPopup2(strURL, width, height)\r
-{\r
- if (window.name == gstrPopupSecondWindowName) {\r
- window.location = strURL;\r
- } else {\r
- if (!gbBsMac || !gBsBrowser.ns4) {\r
- BSSCHidePopupWindow();\r
- }\r
- var nX = 0;\r
- var nY = 0;\r
- var nHeight = 300;\r
- var nWidth = 400;\r
- if (width > 0 && height > 0) {\r
- nHeight = height;\r
- nWidth = width;\r
- }\r
- _BSPSGetClientSize();\r
-\r
- nX = window.gnPopupScreenClickX;\r
- nY = window.gnPopupScreenClickY;\r
-\r
- if (nY + nHeight + 40 > screen.availHeight) {\r
- nY = screen.availHeight - nHeight - 40;\r
- }\r
- if (nX + nWidth + 40 > screen.availWidth) {\r
- nX = screen.availWidth - nWidth - 40;\r
- }\r
- // Launch a separate window\r
- var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";\r
- if (gBsBrowser.ns) {\r
- if (gBsBrowser.ns6) {\r
- strParam += ",Height=" + nHeight + ",Width=" + nWidth;\r
- strParam += ",screenX=" + nX + ",screenY=" + nY;\r
- }\r
- else {\r
- strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;\r
- strParam += ",screenX=" + nX + ",screenY=" + nY;\r
- strParam += ",dependent=yes";\r
- }\r
- }\r
- else {\r
- strParam += ",height=" + nHeight + ",width=" + nWidth;\r
- strParam += ",left=" + nX + ",top=" + nY;\r
- }\r
- window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);\r
-\r
- if (gBsBrowser.ns4) {\r
- window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);\r
- window.gPopupWindow.onclick = NonIEPopup_HandleClick;\r
- window.gPopupWindow.onblur = NonIEPopup_HandleBlur;\r
- }\r
- else if (gBsBrowser.ie4)\r
- {\r
- setTimeout("setPopupFocus();", 100);\r
- }\r
- }\r
- return;\r
-}\r
-\r
-function setPopupFocus()\r
-{\r
- window.gPopupWindow.focus();\r
-}\r
-\r
-function NonIEPopup_HandleBlur(e)\r
-{\r
- window.gPopupWindow.focus();\r
-}\r
-\r
-function NonIEPopup_HandleClick(e)\r
-{\r
- // Because navigator will give the event to the handler before the hyperlink, let's\r
- // first route the event to see if we are clicking on a Popup menu in a popup.\r
- document.routeEvent(e);\r
-\r
- // If a popup menu is active then don't do anything with the click\r
- if (window.gPopupWindow.gbInPopupMenu) {\r
- window.gPopupWindow.captureEvents(Event.CLICK);\r
- window.gPopupWindow.onclick = NonIEPopup_HandleClick;\r
- return false;\r
- }\r
-\r
- // Close the popup window\r
- if (e.target.href) {\r
- if (e.target.target == "")\r
- window.location.href = e.target.href;\r
- else\r
- window.open(e.target.href, e.target.target);\r
- \r
- if (e.target.href.indexOf("javascript:void(0)") == -1 && e.target.href.indexOf("javascript:null") == -1 && e.target.href.indexOf("BsscPopup") == -1) {\r
- this.close();\r
- }\r
- } else {\r
- this.close();\r
- }\r
- return false;\r
-\r
-}\r
-\r
-function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight)\r
-{ \r
- if (typeof(window.getPopupIFrame(nIndex).document) == "unknown") {\r
- _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight);\r
- return;\r
- }\r
- if (!IsValidToken(nToken)) return;\r
-\r
- if ((window.getPopupIFrame(nIndex).document.readyState == "complete") &&\r
- (window.getPopupIFrame(nIndex).document.body != null)) {\r
- if (window.getPopupIFrame(nIndex).document.location.href.indexOf("about:blank") != -1) { // add this check. IE will use about:blank" as the default vaule for Iframe.\r
- window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);\r
- setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);\r
- }\r
- else\r
- {\r
- setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.\r
- BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);\r
- }\r
- } else {\r
- setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);\r
- }\r
-}\r
-\r
-\r
-function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight)\r
-{\r
- if (window.gbPopupTimeoutExpired) return;\r
-\r
- if (!IsValidToken(nToken)) return;\r
-\r
- getPopupDivStyle(nIndex).visibility = gBsStyVisHide;\r
-\r
- // Determine the width and height for the window\r
- //var size = new BSSCSize(0, 0);\r
- //BSSCGetContentSize(window.getPopupIFrame(nIndex), size);\r
- //var nWidth = size.x;\r
- //var nHeight = size.y;\r
-\r
- _BSPSGetClientSize();\r
- \r
- var size = new BSSCSize(0, 0);\r
-\r
- if (cuswidth <= 0 || cusheight <= 0)\r
- BSSCGetContentSize(window.getPopupIFrame(nIndex), size);\r
- else {\r
- size.x = cuswidth;\r
- size.y = cusheight;\r
- }\r
-\r
- // Determine the width and height for the window\r
- var nWidth = size.x;\r
- var nHeight = size.y;\r
-\r
- // for small popup size, we should allow any size.\r
- // The popup size should be ok if bigger than 0\r
- if (nWidth < 0 || nHeight < 0) return; // there must be something terribly wrong. \r
- // if (nWidth < 40 || nHeight < 40) return; // there must be something terribly wrong.\r
-\r
- window.getPopupDivStyle(nIndex).pixelWidth = nWidth;\r
- window.getPopupDivStyle(nIndex).pixelHeight = nHeight;\r
-\r
- window.getPopupShadowStyle(nIndex).pixelWidth = nWidth;\r
- window.getPopupShadowStyle(nIndex).pixelHeight = nHeight;\r
- window.getPopupTopicStyle(nIndex).pixelWidth = nWidth;\r
- window.getPopupTopicStyle(nIndex).pixelHeight = nHeight;\r
- if (gbBsIE55)\r
- {\r
- window.getPopupShadowStyle(nIndex).pixelWidth = nWidth + 2;\r
- window.getPopupShadowStyle(nIndex).pixelHeight = nHeight + 2;\r
- window.getPopupTopicStyle(nIndex).pixelWidth = nWidth + 2;\r
- window.getPopupTopicStyle(nIndex).pixelHeight = nHeight + 2;\r
- }\r
-\r
- window.getPopupIFrameStyle(nIndex).pixelWidth = nWidth;\r
- window.getPopupIFrameStyle(nIndex).pixelHeight = nHeight;\r
- if (gbBsIE55)\r
- {\r
- window.getPopupIFrameStyle(nIndex).top = 0;\r
- window.getPopupIFrameStyle(nIndex).left = 0;\r
- }\r
- \r
- var strURL = getPopupURL(nIndex);\r
- if (strURL.indexOf("#") != -1)\r
- getPopupIFrame(nIndex).location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5.\r
- \r
- MoveDivAndShow(nIndex, nToken, cuswidth, cusheight);\r
-}\r
-\r
-function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight)\r
-{\r
- if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again.\r
- window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);\r
- setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);\r
- return;\r
- }\r
-\r
- // Determine the position of the window\r
- var nClickX = window.gnPopupClickX;\r
- var nClickY = window.gnPopupClickY;\r
- var nTop = 0;\r
- var nLeft = 0;\r
-\r
- var nWidth = window.getPopupDivStyle(nIndex).pixelWidth;\r
- var nHeight = window.getPopupDivStyle(nIndex).pixelHeight;\r
-\r
- if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {\r
- nTop = nClickY + 10;\r
- } else {\r
- nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;\r
- }\r
- if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {\r
- nLeft = nClickX;\r
- } else {\r
- nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;\r
- }\r
- \r
- if (nTop < document.body.scrollTop ) nTop = document.body.scrollTop + 1;\r
- if (nLeft< document.body.scrollLeft) nLeft = document.body.scrollLeft + 1;\r
-\r
-\r
- window.getPopupDivStyle(nIndex).left = nLeft;\r
- window.getPopupDivStyle(nIndex).top = nTop;\r
-\r
- // Set the location of the background blocks\r
- window.getPopupShadowStyle(nIndex).left = 6;\r
- window.getPopupShadowStyle(nIndex).top = 6;\r
- if (gbBsIE55)\r
- {\r
- window.getPopupShadowStyle(nIndex).left = 4;\r
- window.getPopupShadowStyle(nIndex).top = 4;\r
- }\r
-\r
- if (gbBsMac) {\r
- // Total hack on the iMac to get the IFrame to position properly\r
- window.getPopupIFrameStyle(nIndex).pixelLeft = 100;\r
- window.getPopupIFrameStyle(nIndex).pixelLeft = 0;\r
- // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it\r
- window.getPopupIFrame(nIndex).window.BSSCOnLoad();\r
- }\r
-\r
- BSSCPopup_Timeout(nIndex , nToken );\r
- \r
- return;\r
-}\r
-\r
-function BSSCSize(x, y)\r
-{\r
- this.x = x;\r
- this.y = y;\r
-}\r
-\r
-function BSSCGetContentSize(thisWindow, size)\r
-{\r
- if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))\r
- return;\r
-\r
- if (gbBsMac) {\r
- size.x = 300;\r
- size.y = 300;\r
- return;\r
- }\r
-\r
- // Resize the width until it is wide enough to handle the content\r
- // The trick is to start wide and determine when the scrollHeight changes\r
- // because then we know a scrollbar is necessary. We can then go back\r
- // to the next widest size (for no scrollbar)\r
-\r
- var ClientRate = gBsClientHeight / gBsClientWidth;\r
-\r
- var GoldenSize = new BSSCSize(0,0);\r
- GoldenSize.x = gBsClientWidth * gBMaxXOfParent;\r
- GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;\r
-\r
- if (ClientRate > gBRateH_W) {\r
- GoldenSize.y = GoldenSize.x * gBRateH_W;\r
- }\r
- else {\r
- GoldenSize.x = GoldenSize.y / gBRateH_W;\r
- }\r
-\r
- // Try to using parent specified max x.\r
- var x = 0;\r
- var maxgoldx = GoldenSize.x;\r
- var maxx = gBsClientWidth * gBMaxXOfParent;\r
- \r
- // This double resize causes the document to re-render (and we need it to)\r
- if (!gbBsIE5)\r
- thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.\r
- thisWindow.resizeTo(1, 1);\r
- thisWindow.resizeTo(1, 1);\r
- thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);\r
- thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);\r
- \r
- var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;\r
- \r
- 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\r
- {\r
- thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);\r
- thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);\r
- \r
- miny = thisWindow.document.body.scrollHeight + gBscrollHeight;\r
- maxy = gBsClientHeight * gBMaxYOfParent;\r
- \r
- if (miny > maxy) { // the popup must have a scroll, OK let it be.\r
- miny = maxy;\r
- size.x = maxx;\r
- size.y = maxy;\r
- thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.\r
- }\r
- else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.\r
- size.y = miny;\r
- \r
- // downsize from maxx , now I try to using binary divide.\r
- x = maxx;\r
- deltax = -maxx/2;\r
- //j = 0;\r
- while (true) {\r
- x = x + deltax;\r
- thisWindow.resizeTo(x, miny);\r
- thisWindow.resizeTo(x, miny);\r
- diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;\r
- if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter\r
- deltax = Math.abs(deltax) /2;\r
- else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter\r
- deltax = -Math.abs(deltax) /2;\r
- else \r
- // the y is close enough to wanted.\r
- break;\r
- if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.\r
- break;\r
- }\r
- size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;\r
- size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight; \r
- thisWindow.document.body.scroll = 'no';\r
- \r
- // Handle absurd cases just in case IE flakes\r
- // if (size.y < 100) {\r
- // size.y = 100;\r
- // }\r
- }\r
- }\r
- else {\r
- if (thisWindow.document.body.scrollWidth > maxgoldx) {\r
- size.x = maxx; \r
- size.y = miny; \r
- thisWindow.document.body.scroll = 'yes';\r
- }\r
- else {\r
- // downsize from maxgoldx , now I try to using binary divide.\r
- x = maxgoldx;\r
- deltax = -maxgoldx/2;\r
- //i = 0;\r
- while (true) {\r
- x = x + deltax;\r
- thisWindow.resizeTo(x, miny);\r
- thisWindow.resizeTo(x, miny);\r
- diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;\r
- if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter\r
- deltax = Math.abs(deltax) /2;\r
- else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter\r
- deltax = -Math.abs(deltax) /2;\r
- else \r
- // the y is close enough to wanted.\r
- break;\r
- if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.\r
- break;\r
- //i ++;\r
- \r
- }\r
- //size.x = x - gBscrollWidth;\r
- size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;\r
- size.y = thisWindow.document.body.scrollHeight ;\r
- thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.\r
- thisWindow.resizeTo(size.x, size.y);\r
- if (thisWindow.document.body.scrollWidth > size.x)\r
- {\r
- size.x = thisWindow.document.body.scrollWidth;\r
- }\r
- if (thisWindow.document.body.scrollHeight > size.y)\r
- {\r
- size.y = thisWindow.document.body.scrollHeight;\r
- }\r
- }\r
- }\r
- \r
- // no reload no scrollbar.\r
- //size.x = size.x + 16; //reserve a width for scrollbar (IE 4.0 only)\r
-\r
- thisWindow.resizeTo(size.x, size.y);\r
- thisWindow.resizeTo(size.x, size.y);\r
- return;\r
-}\r
-\r
-\r
-\r
-function BSSCPopupParentClicked()\r
-{\r
- if (!window.gbPopupTimeoutExpired) {\r
- return false;\r
- }\r
- \r
- document.onmousedown = gbOrignalOnMouseDown;\r
-\r
- // Simply hide the popup\r
- hideAll();\r
-\r
- window.gbPopupTimeoutExpired = false;\r
-\r
- return true;\r
-}\r
-\r
-\r
-function BSSCPopupClicked()\r
-{\r
- if (!window.gbPopupTimeoutExpired) {\r
- return false;\r
- }\r
-\r
-\r
- var popupIFrame = getCurrentPopupIFrame();\r
- if (popupIFrame == null) {\r
- return true;\r
- }\r
-\r
-/*\r
- if ("undefined" != typeof(popupIFrame.gbInPopupMenu) &&\r
- popupIFrame.gbInPopupMenu) {\r
- return true;\r
- }*/\r
-\r
- if (!((popupIFrame.window.event != null) &&\r
- (popupIFrame.window.event.srcElement != null) &&\r
- ((popupIFrame.window.event.srcElement.tagName == "A") ||\r
- (popupIFrame.window.event.srcElement.tagName == "IMG")))) {\r
- document.onmousedown = gbOrignalOnMouseDown;\r
-\r
- // Simply hide the popup\r
- hideAll();\r
-\r
- window.gbPopupTimeoutExpired = false;\r
-\r
- return true;\r
- }\r
-}\r
-\r
-\r
-//trace the mouse over's position for hotspot\r
-function BSPSPopupOnMouseOver(event)\r
-{\r
- if (gBsBrowser.ie4) {\r
- window.gnPopupClickX = event.clientX + document.body.scrollLeft;\r
- window.gnPopupClickY = event.clientY + document.body.scrollTop;\r
- window.gnPopupScreenClickX = event.screenX;\r
- window.gnPopupScreenClickY = event.screenY;\r
- } else if (gBsBrowser.ns4) {\r
- window.gnPopupClickX = event.pageX - window.pageXOffset;\r
- window.gnPopupClickY = event.pageY - window.pageYOffset;\r
- window.gnPopupScreenClickX = event.screenX - window.pageXOffset;\r
- window.gnPopupScreenClickY = event.screenY - window.pageYOffset;\r
- }\r
-}\r
-\r
-\r
-function BSSCHidePopupWindow()\r
-{\r
- if (window.gPopupWindow != null) {\r
- if (gBsBrowser.ns4) {\r
- if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {\r
- window.gPopupWindow.close();\r
- window.gPopupWindow = null;\r
- }\r
- }\r
- }\r
-\r
- return;\r
-}\r
-\r
-// Add the PopupOnClick to the onclick array.\r
-if (typeof(BsscRegisterOnClick) != "undefined")\r
-{\r
- BsscRegisterOnClick(BsPopupOnClick);\r
-}\r
-//End to support previous popup functions\r
-\r
-/// Section End - Popup (JavaScript 1.0)\r
-\r
-/// Section Begin - Embedded Stub (JavaScript 1.0)\r
-\r
-var s_strAgent = navigator.userAgent.toLowerCase();\r
-var s_nVer = parseInt(navigator.appVersion);\r
-\r
-var s_bIE = (s_strAgent.indexOf('msie') != -1);\r
-var s_bNS = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));\r
-var s_bOpera = (s_strAgent.indexOf('opera') != -1);\r
-\r
-var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));\r
-var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));\r
-\r
-var s_bNS2 = ((s_bNS) && (s_nVer <= 2));\r
-var s_bNS3 = ((s_bNS) && (s_nVer == 3));\r
-var s_bIE300301 = ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));\r
-var s_bIE302 = ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));\r
-\r
-\r
-function HasExtJs()\r
-{\r
- if (s_bIE3Before) { return false;}\r
- if (s_bNS3Before) { return false;}\r
- if (typeof (BsGeneralOnLoad) == "undefined"){ return false; }\r
- return true;\r
-}\r
-\r
-\r
-function BSSCCreatePopupDiv()\r
-{\r
- return;\r
-}\r
-\r
-\r
-function WritePopupMenuLayer()\r
-{\r
- if (HasExtJs()) {_WritePopupMenuLayer();}\r
-}\r
-\r
-function BSSCPopup(strURL, width, height)\r
-{\r
- if (HasExtJs()) { \r
- _BSSCPopup(strURL, width, height);\r
- }else{\r
- //Create a temporary window first to ensure the real popup comes up on top\r
- var wndTemp = null;\r
- if (!s_bNS3) {\r
- wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");\r
- }\r
- // Create the real popup window\r
- var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");\r
- // Close the temporary\r
- if (!s_bNS3) {\r
- wndTemp.close();\r
- } else {\r
- wndPopup.focus();\r
- }\r
- }\r
-}\r
-\r
-var gbWndTemp = null, gbWndPopupLinks = null;\r
-var gbstrParaTotal = "";\r
-\r
-function PopupMenu_Invoke()\r
-{\r
- if (HasExtJs()) {\r
- return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);\r
- }\r
- if (s_bNS3Before || s_bIE3Before ) {\r
- var argLen = PopupMenu_Invoke.arguments.length;\r
- if (argLen < 5) {\r
- window.document.location.href = PopupMenu_Invoke.arguments[3];\r
- return false;\r
- }\r
- gbWndTemp = null;\r
- gbWndPopupLinks = null;\r
- gbstrParaTotal = "";\r
- for (var i = 0; i < (argLen - 2) / 2; i++) {\r
- var strParaLine = "";\r
- if (s_bNS2 || s_bOpera){\r
- strParaLine += "<a href=\"";\r
- strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];\r
- strParaLine += "\">"\r
- strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];\r
- strParaLine += "</a>";\r
- } else {\r
- strParaLine += "<a href=\"javascript:";\r
- strParaLine += "gotoUrl(\'";\r
- strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];\r
- strParaLine += "\');\"";\r
- if (PopupMenu_Invoke.arguments[1] != '') {\r
- strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";\r
- }\r
- strParaLine += ">";\r
- strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];\r
- strParaLine += "</a>";\r
- }\r
- strParaLine += "<br>";\r
- gbstrParaTotal += strParaLine;\r
- }\r
- var nHeight = argLen * 15;\r
- var nWidth = 400;\r
- var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";\r
- strParam += ",height=" + nHeight + ",width=200,resizable";\r
- \r
- //Create a temporary window first to ensure the real popup comes up on top\r
- //var wndTemp = null;\r
- if (!s_bNS3) {\r
- gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");\r
- } \r
- gbWndPopupLinks = window.open("", "popuplinks", strParam);\r
-\r
- setTimeout("Wait_PopupMenuReady()", 100);\r
- }\r
- return true;\r
-}\r
-\r
-function Wait_PopupMenuReady() \r
-{\r
- if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {\r
- PopupMenu_InvokeReady();\r
- }\r
- else \r
- setTimeout("Wait_PopupMenuReady()", 100);\r
-}\r
-\r
-\r
-function PopupMenu_InvokeReady()\r
-{\r
- if (gbWndPopupLinks != null) {\r
- gbWndPopupLinks.document.open("text/html");\r
- gbWndPopupLinks.document.write("<html><head>");\r
- if (s_bNS2 || s_bOpera) {\r
- gbWndPopupLinks.document.write("<base href=\"" + location +"\">");\r
- } else {\r
- //YJ: IE301,302 and NS3.x works fine\r
- gbWndPopupLinks.document.write("<");\r
- gbWndPopupLinks.document.write("script>");\r
- gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");\r
- gbWndPopupLinks.document.write("<");\r
- gbWndPopupLinks.document.write("/script>");\r
- }\r
- gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");\r
- gbWndPopupLinks.document.write(gbstrParaTotal);\r
- gbWndPopupLinks.document.write("</body></html>");\r
- gbWndPopupLinks.document.close();\r
-\r
- // Close the temporary\r
- if (!s_bNS3 && gbWndTemp != null) {\r
- gbWndTemp.close();\r
- }else {\r
- gbWndPopupLinks.focus();\r
- }\r
-\r
- return true;\r
- }\r
- return false;\r
-}\r
-\r
-/// Section End - Embedded Stub (JavaScript 1.0)\r
-\r
-//// Segment End -- (JavaScript 1.0)\r
-\r
-//// Segment Begin -- (JavaScript 1.2)\r
-/// Section Begin - kadov DHTM (JavaScript 1.2)\r
-\r
-//Begin to support extended and dropdown text effects.\r
-function kadovIsParagraph(el)\r
-{\r
- return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;\r
-}\r
-\r
-function kadovInitEachChild(el)\r
-{ \r
- for(var i=0; i<el.children.length; i++)\r
- {\r
- var child = el.children[i];\r
- if( child.tagName == "SCRIPT" || child.tagName == "!" )\r
- continue;\r
-\r
- if( child.id != "" )\r
- {\r
- // to wipe out the onload effects\r
- var onLoadEffect = child.style.getAttribute( "x-on-pageload" );\r
- if( (onLoadEffect != null) && (onLoadEffect > "") )\r
- child.style.setAttribute( "x-on-pageload", "" );\r
- \r
- var href = child.getAttribute("href")\r
- if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 )\r
- kadovFilePopupInit(child.id); // Init for Popup\r
- else if( child.className == "dropspot" || child.className == "expandspot" || \r
- child.className == "glossterm" )\r
- kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text\r
- else if( child.className == "trigger")\r
- kadovInitTrigger(child.id);// Init for Trigger\r
- else\r
- {\r
- kadovInitEffects(child.id);// Init for DHTML effects\r
- CEngine.SetOneTargetInitialState( child.id );\r
- }\r
- }\r
- \r
- if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") )\r
- child.start = "mouseover";// to start a AVI file. fileopen doesn't work\r
-\r
- kadovInitEachChild(child);\r
- }\r
-}\r
-\r
-function kadovRetrieveTextInner(el)\r
-{ \r
- var x = "";\r
- if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" ))\r
- return x;\r
-\r
- if( kadovIsParagraph(el) )\r
- {\r
- var strNewID = " ";\r
- if( el.id != "" )\r
- strNewID += "id=" + el.id + "_NewSpan ";\r
- x = "<span" + strNewID + "style='" + el.style.cssText + "'>" + el.innerHTML + "</span>";\r
- }\r
- else\r
- {\r
- for(var i=0; i<el.children.length; i++)\r
- x += kadovRetrieveTextInner( el.children[i] );\r
- }\r
- return x;\r
-}\r
-\r
-function kadovRetrieveCleanHTML( strRawHTML, strTagOpen, strTagClose, nDistance )\r
-{ \r
- var nTagOpen = strRawHTML.indexOf( strTagOpen, 0 );\r
- if( nTagOpen < 0 )\r
- return strRawHTML;\r
-\r
- var nTagClose = strRawHTML.indexOf( strTagClose, nTagOpen);\r
- if( nTagClose < nTagOpen )\r
- return strRawHTML;\r
- \r
- if( typeof(nDistance) == "number" && nDistance > 0 )\r
- if( (nTagClose - nTagOpen) != nDistance )\r
- return strRawHTML;\r
- \r
- var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ;\r
- return kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose );\r
-}\r
-\r
-function kadovAdjustObjectTag(strRawHTML, nStartPos)\r
-{// adjust object tag for related topics HTML control, because innerHTML misses out the item settings\r
- \r
- //Is there any DTC?\r
- var strDTCTagOpen = '<!--Metadata type="DesignerControl" startspan';\r
- var strDTCTagClose = '<!--Metadata type="DesignerControl" endspan-->';\r
- var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos );\r
- if( nDTCTagOpen < 0 )\r
- return strRawHTML;\r
- var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen );\r
- if( nDTCTagClose < nDTCTagOpen)\r
- return strRawHTML; // no Design Time Controls;\r
- \r
- //Is the DTC HTML Help Control?\r
- var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11';\r
- var strRTObjTagClose = '</OBJECT>';\r
- var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen );\r
- if( nRTObjTagOpen < nDTCTagOpen )\r
- return strRawHTML;\r
- var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen );\r
- if( nRTObjTagClose < nRTObjTagOpen )\r
- return strRawHTML; // is not a HTML help control\r
- \r
- // Is it a related Topics html help control?\r
- var strRTObjLabel = '<PARAM NAME=\"Command\" VALUE=\"Related Topics';\r
- if( strRawHTML.indexOf(strRTObjLabel, nRTObjTagOpen) < 0 )\r
- return strRawHTML;\r
- \r
- // does the commented object tag contain a items parameters \r
- var strRTItemsOpen = '<param name=Items value="';\r
- var strRTItemsClose = '$$**$$" >';\r
- var nRTItemsOpen = strRawHTML.indexOf(strRTItemsOpen, nDTCTagOpen);\r
- if( nRTItemsOpen < nDTCTagOpen )\r
- return strRawHTML;\r
- var nRTItemsClose = strRawHTML.indexOf(strRTItemsClose, nRTItemsOpen);\r
- if( nRTItemsClose < nRTItemsOpen )\r
- return strRawHTML;\r
- \r
- // found a items string\r
- var strItems = strRawHTML.substring( nRTItemsOpen + strRTItemsOpen.length, nRTItemsClose);\r
- if( strItems.length < 1 )\r
- return strRawHTML;\r
- \r
- // to reconstruct the item(s) param tag(s)\r
- var strItemsArray = strItems.split('$$**$$');\r
- if( strItemsArray.length < 1 )\r
- return strRawHTML;\r
- var strRunTimeItemParam = "";\r
- for( var i = 0; i < strItemsArray.length; i++ )\r
- {\r
- strRunTimeItemParam += '<PARAM NAME="Item' + (i+1);\r
- strRunTimeItemParam += '"' + ' VALUE="';\r
- strRunTimeItemParam += strItemsArray[i];\r
- strRunTimeItemParam += '">';\r
- }\r
- \r
- // to insert the reconstructed item params into runtime object tag\r
- var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length);\r
- return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length);\r
-}\r
-\r
-function kadovTextPopupOnLoad( el )\r
-{\r
- if( !CCSSP.bIsWinOS && !CCSSP.bIsSunOS)\r
- return 0;\r
-\r
- if( typeof(el) == "string" )\r
- el = document.all.item(el);\r
-\r
- var src = el.getAttribute( "x-use-popup" );\r
- if(!src)\r
- return 0;\r
-\r
- var name = src;\r
- if( src.substr(0,1) == "#" ) \r
- name = src.substr(1, src.length-1);\r
- var srcDiv = document.all.item(name);\r
- if( !srcDiv )\r
- return 1;\r
-\r
- var type = el.getAttribute( "x-popup-type" );\r
- var setup = el.getAttribute( "x-tmp-setup" );\r
- var newId = name;\r
- if( newId.indexOf( "_tmp") <= 0 )\r
- newId += "_tmp";\r
-\r
- if( !setup )\r
- {\r
- el.setAttribute( "x-tmp-setup", 1 );\r
- \r
- if( type == "pulldown" )\r
- {\r
- var strAdjust = kadovAdjustObjectTag(srcDiv.innerHTML,0);\r
- var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");\r
- strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");\r
-\r
- //work around the bug in HH.exe that highlight the phrases when use Search tab\r
- //this approach is just removing the <FONT...> tag inserted by Microsoft in the runtime\r
- strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<FONT color=#", "\">", 52);\r
- \r
- var strStyle = " style='display:none; position:relative;";\r
- var newDiv = "<div class=droptext id=" + newId + strStyle + "'>" + strCleanHTML + "</div>";\r
-\r
- srcDiv.outerHTML = ""; // empty the original DIV tag\r
- var elParentPra = kadovFindParentParagraph(el);\r
- if( elParentPra )\r
- elParentPra.insertAdjacentHTML( "AfterEnd", newDiv );\r
- }\r
- else if( type == "expanding" )\r
- {\r
- var inner = kadovRetrieveTextInner(srcDiv);\r
- if( inner == "" )\r
- inner = srcDiv.innerHTML;\r
- var strAdjust = kadovAdjustObjectTag(inner,0);\r
- var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");\r
- strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");\r
- var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext";\r
- var newSpan = "<span class=" + strClassName + " style='display: none;' id=" + newId + "> " + strCleanHTML + "</span>";\r
- srcDiv.outerHTML = ""; // empty the original DIV tag\r
- el.insertAdjacentHTML( "AfterEnd", newSpan );\r
- }\r
- }\r
- return 0;\r
-}\r
-\r
-function kadovTextPopup( el )\r
-{\r
- if( (!CCSSP.bIsWinOS && !CCSSP.bIsSunOS) || (window.event == null) )\r
- return;\r
- window.event.cancelBubble = true;\r
-\r
- if( typeof(el) == "string" )\r
- el = document.all.item(el);\r
-\r
- var src = el.getAttribute( "x-use-popup" );\r
- if(!src)\r
- return;\r
-\r
- var name = src;\r
- if( src.substr(0,1) == "#" ) \r
- name = src.substr(1, src.length-1) + "_tmp";\r
- var srcDiv = document.all.item(name);\r
- if( !srcDiv )\r
- return;\r
-\r
- var type = el.getAttribute( "x-popup-type" );\r
- var setup = el.getAttribute( "x-tmp-setup" );\r
- if( srcDiv )\r
- {\r
- if( srcDiv.style.display == "" )\r
- srcDiv.style.display = "none";\r
- else\r
- {\r
- srcDiv.style.display = "";\r
- if( typeof(srcDiv.bInitialized) == "undefined" )\r
- {\r
- srcDiv.bInitialized = true;\r
- kadovInitEffects(name);\r
- kadovInitEachChild(srcDiv);\r
- }\r
- }\r
- }\r
- return;\r
-}\r
-\r
-function kadovFindParentParagraph( el )\r
-{\r
- if( typeof(el) == "string" )\r
- el = document.all.item(el);\r
- if( (!el) || el.tagName == "BODY" )\r
- return null;\r
- if( kadovIsParagraph(el.parentElement) )\r
- return el.parentElement;\r
- else\r
- return kadovFindParentParagraph( el.parentElement );\r
-}\r
-\r
-//Begin HTML code invoked function\r
-function kadovRegisterEventHandler( obj, strEvent, strEventHandler )\r
-{\r
- if( !gbBsIE4 )\r
- return;\r
- CCSSP.RegisterEventHandler( obj, strEvent, strEventHandler );\r
-}\r
-\r
-function kadovTextPopupInit( el )\r
-{\r
- if( (!gbBsIE4) || (!CCSSP.bIsWinOS && !CCSSP.bIsSunOS))\r
- return;\r
- \r
- if( typeof(el) == "string" )\r
- el = document.all.item(el);\r
- if( el != null )\r
- {\r
- CCSSP.RegisterEventHandler( el, "onclick", "kadovTextPopup(" + el.id +");" );\r
- CCSSP.RegisterEventHandler( window, "onload", "kadovTextPopupOnLoad(" + el.id +");" );\r
- }\r
-}\r
-//End HTML code invoked function\r
-\r
-//End to support extended and dropdown text effects.\r
-\r
-//Begin to convert iWrite format to RoboEditor Format for DHTML effects\r
-function kadovInitTriggersInHead( )\r
-{\r
- if( Object.xDelayedInitElements )\r
- {\r
- var x = Object.xDelayedInitElements;\r
- for(i=0; i<x.length; i++)\r
- kadovInitTrigger( x[i] );\r
- }\r
-}\r
-\r
-//Begin HTML code invoked function\r
-function kadovFilePopupInit( el )\r
-{\r
- if( !gbBsIE4 )\r
- return;\r
- if( typeof(el) == "string" )\r
- el = document.all.item(el);\r
-\r
- if( el != null )\r
- CCSSP.RegisterEventHandler( el, "onmouseover", "BSPSPopupOnMouseOver(event);" );\r
-}\r
-\r
-function kadovInitTrigger( element )\r
-{\r
- if( !gbBsIE4 )\r
- return;\r
- var srcElement = element;\r
- if( typeof(srcElement) == "string" )\r
- {\r
- srcElement = document.all.item(element,0);\r
- if(srcElement == null)\r
- return;\r
- }\r
- \r
- if( !kadovIsParentVisible(srcElement) )\r
- return;\r
-\r
- var targets = srcElement.getAttribute( "x-targets" );\r
- var arrOneTarget = targets.split( "," );\r
- for( var i = 0; i < arrOneTarget.length; i ++ )\r
- bsscFXInit( element, arrOneTarget[i], null, null, null, null );\r
-}\r
-\r
-function kadovIsParentVisible( el )\r
-{\r
- if( typeof(el) == "string" )\r
- el = document.all.item(el);\r
- if( (!el) || el.tagName == "BODY" )\r
- return true;\r
- if( el.style.display == 'none' ) //el.visibility == 'hidden' || \r
- return false;\r
- else\r
- return kadovIsParentVisible( el.parentElement );\r
-}\r
-\r
-function kadovInitEffects( element )\r
-{\r
- if( !gbBsIE4 )\r
- return;\r
- var srcElement = element;\r
- if( typeof(srcElement) == "string" )\r
- {\r
- srcElement = document.all.item(element,0);\r
- if(srcElement == null)\r
- return;\r
- }\r
- \r
- if( !kadovIsParentVisible(srcElement) )\r
- return;\r
- \r
- kadovInitEffect( srcElement, "x-on-hover" );\r
- kadovInitEffect( srcElement, "x-on-pageclick" );\r
- kadovInitEffect( srcElement, "x-on-pageload" );\r
- kadovInitEffect( srcElement, "x-on-trigger-1" );\r
- kadovInitEffect( srcElement, "x-on-trigger-2" );\r
-}\r
-//End HTML code invoked function\r
-\r
-function kadovInitEffect( element, prop )\r
-{\r
- var values = null;\r
- if( element.getAttribute( "currentStyle" ) && element.currentStyle.getAttribute)\r
- values = element.currentStyle.getAttribute( prop );\r
- else if (element.style.getAttribute)\r
- values = element.style.getAttribute( prop );\r
- if( !values )\r
- return;\r
-\r
- var functions = new Array();\r
- var nIdx = 0, nStart = 0;\r
- var nNext = values.indexOf( "\)", 0);\r
- while( nNext >= 0 && nNext < values.length )\r
- {\r
- functions[nIdx] = values.substr( nStart, nNext-nStart+1);\r
- nStart = nNext + 1;\r
- nIdx++;\r
- nNext = values.indexOf( "\)", nStart);\r
- }\r
- \r
- for( var i=0; i<functions.length; i++)\r
- {\r
- var id = element.getAttribute( "id" );\r
- var translatedProp = kadovTranslateProp(prop);\r
-\r
- var lp = functions[i].indexOf( "(" );\r
- var fnname = functions[i].substring(0, lp);\r
- var srcargs = functions[i].substring(lp+1, functions[i].length-1);\r
- \r
- var nClickTimes = 1;\r
- var arrForClickCount = srcargs.split( "," );\r
- for( var j = 0; j < arrForClickCount.length; j++ )\r
- {// to locate and get the "clicks=99" settings\r
- var nPageClick = arrForClickCount[j].indexOf("clicks");\r
- if( nPageClick >= 0 )\r
- {\r
- nPageClick = arrForClickCount[j].indexOf("=");\r
- if( nPageClick > 0 )\r
- {\r
- nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1;\r
- break;\r
- }\r
- }\r
- }\r
- var args = srcargs;\r
- if( j < arrForClickCount.length )\r
- {// to strip out the "clicks=99" from the arguments string\r
- args = "";\r
- for( var k = 0; k < arrForClickCount.length; k ++ )\r
- {\r
- if( k != j )\r
- {\r
- args += arrForClickCount[k];\r
- if( k < arrForClickCount.length - 1 )\r
- args += ",";\r
- }\r
- }\r
- }\r
- bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes );\r
- }\r
-}\r
-\r
-function kadovTranslateProp( prop )\r
-{\r
- switch( prop )\r
- {\r
- case "x-on-hover" : return "bsschover";\r
- case "x-on-pageclick" : return "bsscpageclick";\r
- case "x-on-pageload" : return "bsscpageload";\r
- case "x-on-trigger-1" : return "bssctrigger1";\r
- case "x-on-trigger-2" : return "bssctrigger2";\r
- }\r
- return null;\r
-}\r
-//End to convert iWrite format to RoboEditor Format for DHTML effects\r
-\r
-//Begin the definition of one entry to DHTML effects\r
-function bsscFXInit( trigger_ID, target_ID, event_type, \r
- action_type, action_setting, event_addional )\r
-{\r
- if( (!CCSSP.bIsWinOS && !CCSSP.bIsSunOS ) || typeof(target_ID) != "string" )//MUST have a target_ID\r
- return; // we don't support Navigator yet\r
- \r
- if( typeof(event_type) == "string" )\r
- event_type = event_type.toLowerCase();\r
- if( typeof(action_type) == "string" )\r
- action_type = action_type.toLowerCase();\r
- if( typeof(action_setting) == "string" )\r
- action_setting = action_setting.toLowerCase();\r
- \r
- // to get the target element then add it to the target list\r
- var eleTarget = CCSSP.GetObject( target_ID );\r
- if( (eleTarget != null) && (event_type != null) && (action_type != null) )\r
- {\r
- CEngine.AddOneTarget( target_ID, eleTarget );\r
- CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional);\r
- }\r
- \r
- // to validate the trigger_ID parameter\r
- if( typeof(trigger_ID) == "string" && trigger_ID != "" )\r
- CEngine.BuildTriggerObject( trigger_ID, target_ID );\r
-} \r
-//End the definition of one entry to DHTML effects\r
-\r
-\r
-/// Section End - kadov DHTM (JavaScript 1.2)\r
-\r
-\r
-/// Section Begin - CCSSP DHTM (JavaScript 1.2)\r
-\r
-//Begin JavaScript libary for cross-platform positioning object.\r
-function CCSSP(){} // constructor of CCSSP class\r
-\r
-CCSSP.strAgent = navigator.userAgent.toLowerCase(); \r
-CCSSP.nAppVersion = parseInt(navigator.appVersion);\r
-\r
-CCSSP.bIsWinOS = ((CCSSP.strAgent.indexOf("win") >= 0) || (CCSSP.strAgent.indexOf("16bit") >= 0));\r
-CCSSP.bIsMacOS = (CCSSP.strAgent.indexOf("mac") >= 0);\r
-CCSSP.bIsSunOS = (CCSSP.strAgent.indexOf("sunos") != -1);\r
-\r
-CCSSP.bIsIE = (navigator.appName.indexOf("Microsoft") >= 0);\r
-CCSSP.bIsIE4 = (CCSSP.bIsIE && (CCSSP.nAppVersion >= 4));\r
-CCSSP.bIsIE5 = (CCSSP.bIsIE4 && (CCSSP.strAgent.indexOf("msie 5") != -1) )\r
-\r
-CCSSP.bIsNav = (navigator.appName.indexOf("Netscape") >= 0);\r
-CCSSP.bIsNav4 = (CCSSP.bIsNav && (CCSSP.nAppVersion >= 4));\r
-CCSSP.bIsNav6 = (CCSSP.bIsNav && (CCSSP.nAppVersion >= 5));\r
-\r
-CCSSP.GetObject = function( obj )\r
-{//convert object name string or reference into a valid object reference\r
- if( typeof(obj) == "object" )\r
- return obj;\r
- else if( typeof(obj) == "string" && obj != "")\r
- {\r
- if( CCSSP.bIsNav4 )\r
- return eval("document." + obj);\r
- else\r
- return eval("document.all." + obj);\r
- }\r
- else\r
- return null;\r
-}\r
-\r
-CCSSP.MoveObjectTo = function(obj, x, y)\r
-{//positioning an object at a specific pixel coordinate\r
- if( CCSSP.bIsNav4 )\r
- obj.moveTo(x,y);\r
- else\r
- {\r
- obj.style.pixelLeft = x;\r
- obj.style.pixelTop = y;\r
- }\r
-}\r
-\r
-CCSSP.MoveObjectBy = function(obj, dx, dy)\r
-{//moveing a object by x and/or y pixel\r
- if( CCSSP.bIsNav4 )\r
- obj.moveBy(dx,dy);\r
- else\r
- {\r
- obj.style.pixelLeft += dx;\r
- obj.style.pixelTop += dy;\r
- }\r
-}\r
-\r
-CCSSP.SetObjectBGColor = function(obj, color)\r
-{//set the background color of an object\r
- if( CCSSP.bIsNav4 )\r
- obj.bgColor = color;\r
- else\r
- obj.style.backgroundColor = color;\r
-}\r
-\r
-CCSSP.ShowObject = function(obj, bShow)\r
-{// set the object to be visible or invisible\r
- if( CCSSP.bIsNav4 )\r
- obj.visibility = (bShow == true) ? 'show' : 'hide';\r
- else\r
- obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.\r
-}\r
-\r
-CCSSP.GetObjectLeft = function(obj)\r
-{// retrieve the x coordinate of a posionable object\r
- if( CCSSP.bIsNav4 )\r
- return obj.left;\r
- else\r
- return obj.style.pixelLeft;\r
-}\r
-\r
-CCSSP.GetObjectTop = function(obj)\r
-{// retrieve the y coordinate of a posionable object\r
- if( CCSSP.bIsNav4 )\r
- return obj.top;\r
- else\r
- return obj.style.pixelTop;\r
-}\r
-\r
-CCSSP.GetObjectContainLeft = function(obj)\r
-{// retrieve the x coordinate of a posionable object relative to it's parent element\r
- if( CCSSP.bIsNav4 )\r
- return obj.pageX;\r
- else\r
- {\r
- if( obj == document.body )\r
- return obj.clientLeft;\r
- else\r
- return obj.offsetLeft;\r
- }\r
-}\r
-\r
-CCSSP.GetObjectWindowLeft = function(obj)\r
-{// retrieve the x coordinate of a posionable object relative to browser window\r
- if( CCSSP.bIsNav4 )\r
- return obj.pageX;\r
- else\r
- {\r
- var nOffsetWindowLeft = 0;\r
- for(var element = obj; element; element = element.offsetParent)\r
- nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);\r
- return nOffsetWindowLeft;\r
- }\r
-}\r
-\r
-CCSSP.GetObjectContainTop = function(obj)\r
-{// retrieve the y coordinate of a posionable object relative to it's parent element\r
- if( CCSSP.bIsNav4 )\r
- return obj.pageY;\r
- else\r
- {\r
- if( obj == document.body )\r
- return obj.clientTop;\r
- else\r
- return obj.offsetTop;\r
- }\r
-}\r
-\r
-CCSSP.GetObjectWindowTop = function(obj)\r
-{// retrieve the y coordinate of a posionable object relative to browser window\r
- if( CCSSP.bIsNav4 )\r
- return obj.pageY;\r
- else\r
- {\r
- var nOffsetWindowTop = 0;\r
- for(var element = obj; element; element = element.offsetParent)\r
- nOffsetWindowTop += CCSSP.GetObjectContainTop(element);\r
- return nOffsetWindowTop;\r
- }\r
-}\r
-\r
-CCSSP.GetObjectHeight = function(obj)\r
-{// retrieve the height of a posionable object\r
- if( CCSSP.bIsNav4 )\r
- return obj.clip.height;\r
- else\r
- return obj.offsetHeight;\r
-}\r
-\r
-CCSSP.GetObjectWidth = function(obj)\r
-{// retrieve the width of a posionable object\r
- if( CCSSP.bIsNav4 )\r
- return obj.clip.width;\r
- else\r
- return obj.offsetWidth;\r
-}\r
-\r
-CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )\r
-{ // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined\r
- if (CCSSP.bIsNav4 && !CCSSP.bIsNav6)\r
- return ;\r
- var oldHandler = "";\r
- if (CCSSP.bIsMacOS && CCSSP.bIsIE4)\r
- {\r
- if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown")\r
- { //search for <SCRIPT> tag which define the event handler\r
- for( var i = 0; i < document.scripts.length; i++ ) \r
- {\r
- var script = document.scripts[i];\r
- if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )\r
- {\r
- oldHandler = script.innerHTML;\r
- break;\r
- }\r
- }\r
- }\r
- }\r
- else\r
- {\r
- var oldInlineHandler = srcObj[rawEventName.toLowerCase()];\r
- if( oldInlineHandler != null && typeof(oldInlineHandler) != "undefined")\r
- {\r
- var functionDefinition = oldInlineHandler.toString();\r
- var bodyStart = functionDefinition.indexOf( "{" );\r
- var bodyEnd = functionDefinition.lastIndexOf( "}" );\r
- if( bodyStart > 0 || bodyEnd > bodyStart )\r
- oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );\r
- }\r
- else if( CCSSP.bIsIE4 )\r
- { //search for <SCRIPT> tag which define the event handler\r
- for( var i = 0; i < document.scripts.length; i++ ) \r
- {\r
- var script = document.scripts[i];\r
- if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )\r
- {\r
- oldHandler = script.innerHTML;\r
- break;\r
- }\r
- }\r
- }\r
- } \r
- if( oldHandler.indexOf(funcHandler) >= 0 )\r
- return;// to prevent register the funtion twice.\r
-\r
- if( CCSSP.bIsNav4 ) // only "onload, onresize, onfocus" apply to window\r
- {// other raw events will apply to layer\r
- var noOn = rawEventName.substring(2, rawEventName.length);\r
- if( typeof(noOn) == "string" && noOn.length > 3 ) {\r
- srcObj.captureEvents( Event[noOn.toUpperCase()] );\r
- }\r
- }\r
-\r
- var newHandler = oldHandler;\r
- if( newHandler.length == 0 )\r
- newHandler = funcHandler;\r
- else\r
- newHandler += "; " + funcHandler;\r
- srcObj[rawEventName.toLowerCase()] = new Function( newHandler );\r
-}\r
-\r
-CCSSP.GetWindowHeight = function()\r
-{// retrieve the height of available content in browser window\r
- if( CCSSP.bIsNav4 )\r
- return window.innerHeight;\r
- else\r
- return document.body.clientHeight;\r
-}\r
-\r
-CCSSP.GetWindowBottom = function()\r
-{// retrieve the bottom postion of browser window\r
- if( CCSSP.bIsNav4 )\r
- return window.outerHeight + window.pageYOffset;\r
- else\r
- return document.body.clientHeight + document.body.scrollTop;\r
-}\r
-\r
-CCSSP.GetWindowWidth = function()\r
-{// retrieve the width of available content in browser window\r
- if( CCSSP.bIsNav4 )\r
- return window.innerWidth;\r
- else\r
- return document.body.clientWidth;\r
-}\r
-\r
-CCSSP.GetWindowRight = function()\r
-{// retrieve the right postion of browser window\r
- if( CCSSP.bIsNav4 )\r
- return window.outerWidth + window.pageXOffset;\r
- else\r
- return document.body.clientWidth + document.body.scrollLeft;\r
-}\r
-\r
-CCSSP.TrimString = function( objString, subtrim )\r
-{// to trim the "subtrim" in the beginning and ending of a string object\r
- if( typeof(subtrim) != "string" || subtrim == null )\r
- return objString;\r
- var strHead = objString.substring(0, 1);\r
- var strRear = objString.substring(objString.length-1, objString.length);\r
- if( strHead != subtrim && strRear != subtrim )\r
- return objString;\r
- \r
- var spacePos = objString.indexOf(subtrim);\r
- if( spacePos < 0 )\r
- return objString;\r
- else if( spacePos == objString.length - 1 )\r
- return objString.substring(0, spacePos);\r
- else\r
- {\r
- var newString = objString.substring( spacePos + 1, objString.length);\r
- return CCSSP.TrimString( newString, subtrim );\r
- }\r
-}\r
-\r
-CCSSP.TrimSpace = function( objString )\r
-{\r
- var Trim1 = CCSSP.TrimString( objString, " ");\r
- return CCSSP.TrimString( Trim1, "\'");\r
-}\r
-\r
-CCSSP.GetEventElement = function( navEventObject )\r
-{// to get the element who fired the current event\r
- if(CCSSP.bIsNav4 ) \r
- if (CCSSP.bIsNav6)\r
- return null;\r
- else\r
- navEventObject.target;\r
- else\r
- return event.srcElement;\r
-}\r
-\r
-CCSSP.PrepareFilter = function( Obj )\r
-{//to prepare for making the filter work\r
- Obj.style.filter = "";\r
- if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )\r
- return;\r
- Obj.style.height = CCSSP.GetObjectHeight(Obj);\r
-}\r
-\r
-CCSSP.IsDescendant = function( progenitor, progeny )\r
-{\r
- if( typeof(progeny) == "undefined" || progeny == null )\r
- return false;\r
- else if( progeny == progenitor )\r
- return true; \r
- else if( progeny.id == progenitor.id ) \r
- return true; \r
- else if( progeny.parentElement == progenitor.parentElement )\r
- return false;\r
- else\r
- return CCSSP.IsDescendant( progenitor, progeny.parentElement );\r
-}\r
-\r
-CCSSP.IsTextTag = function( Obj )\r
-{\r
- if( typeof( Obj.tagName ) == "undefined" )\r
- return false;\r
- return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" || \r
- Obj.tagName == "FONT" || Obj.tagName == "SPAN" );\r
-}\r
-\r
-//End JavaScript libary for cross-platform positioning object.\r
-\r
-/// Section End - CCSSP DHTM (JavaScript 1.2)\r
-\r
-/// Section Begin - CCSSP DHTM 1 (JavaScript 1.2)\r
-\r
-//Begin the definition of class CTrigger\r
-function CTrigger( TriggerElement )\r
-{\r
- // object : the trigger element. Never be null. \r
- this.eleTrigger = TriggerElement;\r
- \r
- // number : the click counter number: only 3 values: 0,1,2;\r
- this.nCounter = 0; \r
- \r
- //object as associative array of string:\r
- // the associate target ID strings; one element at least. \r
- this.objStrTarget = new Object();\r
- this.eleTrigger.style.cursor = "hand";\r
- if( this.eleTrigger.tagName == "AREA" && this.eleTrigger.getAttribute("href") == "" )\r
- this.eleTrigger.setAttribute("href", "#") // to make a hand cursor for image map\r
-}\r
-\r
-CTrigger.prototype.AddTargetID = function( strTargetID )\r
-{// add one target ID string to the objStrTarget\r
- if( typeof(strTargetID) != "string" )\r
- return ;\r
- if( typeof(this.objStrTarget[strTargetID]) != "string" )\r
- this.objStrTarget[strTargetID] = strTargetID;\r
-}\r
-\r
-CTrigger.prototype.OnTriggerClick = function()\r
-{// to activate all asociated target\r
- var strEventType = ( (this.nCounter++)% 2 == 0 ) ? \r
- "bssctrigger1" : "bssctrigger2";\r
- \r
- // to enumerate associative target element's ID string\r
- for( var strTargetID in this.objStrTarget ) \r
- CEngine.SendEventToOneTarget( strTargetID, strEventType );\r
-}\r
-//End the definition of class CTrigger\r
-\r
-//Begin the definition of class CTarget\r
-function CTarget( TargetElement )\r
-{\r
- // object : the target element. Never be null.\r
- this.eleTarget = TargetElement;\r
- this.objManager = new Object(); // object: the event manager\r
-} \r
-\r
-CTarget.nPageClickCounter = 0;// static class property.\r
-\r
-CTarget.prototype.GetAgencyObject = function(str_action_type,action_setting )\r
-{// return the action agency ( effect )object's refernece \r
- switch( str_action_type )\r
- {\r
- case "show":return new CAgencyShow( this.eleTarget, true ) ;\r
- case "hide":return new CAgencyShow( this.eleTarget, false ) ;\r
-\r
- case "flyin" : \r
- return new CAgencyFly(this.eleTarget, action_setting, true);\r
- case "flyout" : \r
- return new CAgencyFly(this.eleTarget, action_setting, false);\r
- case "spiralin" : \r
- return new CAgencySpiral(this.eleTarget, action_setting, true);\r
- case "spiralout" : \r
- return new CAgencySpiral(this.eleTarget, action_setting, false);\r
- case "zoomin" :\r
- return new CAgencyZoom(this.eleTarget, action_setting, true);\r
- case "zoomout" : \r
- return new CAgencyZoom(this.eleTarget, action_setting, false);\r
- case "elastic" : \r
- return new CAgencyElastic(this.eleTarget, action_setting);\r
- \r
- case "fadein" : \r
- return (CCSSP.bIsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, true) : null;\r
- case "fadeout" :\r
- return (CCSSP.bIsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, false) : null;\r
- case "rockrollstatic" :\r
- case "rockroll" :\r
- return (CCSSP.bIsIE4)? new CAgencyWave(this.eleTarget, action_setting, false) : null;\r
- \r
- case "glow":\r
- return (CCSSP.bIsIE4)? new CAgencyGlow(this.eleTarget,action_setting) : null;\r
- case "dropshadow":\r
- return (CCSSP.bIsIE4)? new CAgencyDropShadow(this.eleTarget,action_setting) : null;\r
- case "transition" :\r
- return (CCSSP.bIsIE4)? new CAgencyRevealTrans(this.eleTarget,action_setting) : null;\r
- case "blur" :\r
- return (CCSSP.bIsIE4)? new CAgencyBlur(this.eleTarget,action_setting) : null;\r
-\r
- case "fliph" : // all these 4 do NOT need any parameters\r
- case "flipv" :\r
- case "invert":\r
- case "gray" :\r
- return (CCSSP.bIsIE4)? new CAgencyChangeFilter(this.eleTarget, str_action_type) : null;\r
- \r
- case "fontchange": // the effects below change the style on the fly, so won't work in Navigator\r
- return (CCSSP.bIsIE4)? new CAgencyFontChange(this.eleTarget,action_setting) : null;\r
- case "boderchange": \r
- case "stylechange":\r
- return (CCSSP.bIsIE4)? new CAgencyChangeStyle(this.eleTarget,action_setting) : null;\r
-\r
- default: return null;\r
- }\r
-}\r
-\r
-CTarget.prototype.SetEventManager = function( \r
- one_event_type,str_action_type,action_setting,event_additional)\r
-{// to set the event manager with specified action \r
- if( typeof( one_event_type ) != "string" || \r
- typeof( str_action_type ) != "string"||\r
- typeof( action_setting ) != "string" )\r
- return false;\r
- if( typeof(this.objManager[one_event_type]) == "undefined" )\r
- {\r
- this.objManager[one_event_type] = new Object();\r
- this.objManager[one_event_type].length = 0;\r
- }\r
- \r
- var eventAgency = this.GetAgencyObject(str_action_type,action_setting);\r
- if( eventAgency != null )\r
- {\r
- var ct = this.objManager[one_event_type].length ++;\r
- this.objManager[one_event_type][ct] = eventAgency;\r
- \r
- if( one_event_type == "bsscpageclick" )\r
- {// to deal with the "number of pageclick" stuff\r
- if( typeof(event_additional) == "number" )\r
- this.objManager[one_event_type][ct].nPageClick = event_additional;\r
- else // set the default number \r
- this.objManager[one_event_type][ct].nPageClick = 1;\r
- \r
- if( (typeof(this.objManager.nMinPageClickIndex) == "undefined") ||\r
- (this.objManager[one_event_type][ct].nPageClick < \r
- this.objManager[one_event_type][this.objManager.nMinPageClickIndex].nPageClick) )\r
- this.objManager.nMinPageClickIndex = ct;\r
- }\r
- \r
- //hide the object blindly,SetState function will take care of the final correct state\r
- if( ((one_event_type == "bsscpageclick") && \r
- (this.objManager[one_event_type][ct].nPageClick == 1)) ||\r
- one_event_type == "bsscpageload" ||\r
- one_event_type == "bssctrigger1" )\r
- CCSSP.ShowObject( this.eleTarget, false );\r
- \r
- if( one_event_type == "bssctrigger1" || one_event_type == "bssctrigger2" )\r
- if( typeof( this.strTriggerEvent ) == "undefined" )\r
- this.strTriggerEvent = ( one_event_type == "bssctrigger1" ) ? "bssctrigger2" : "bssctrigger1";\r
- \r
- return true;\r
- }\r
- return false;\r
-}\r
-\r
-CTarget.prototype.OnEvent = function( strBsscEvent )\r
-{// response to the event ( bssc format )\r
- if( typeof(this.objManager[strBsscEvent]) == "object" )\r
- { // to get the event agency from the event manager\r
- var eventAgency = this.objManager[strBsscEvent];\r
- for( var i = 0; i < eventAgency.length; i++ )\r
- {\r
- if( strBsscEvent == "bsscpageclick" && \r
- eventAgency[i].nPageClick != CTarget.nPageClickCounter )\r
- continue;\r
- else if( strBsscEvent == "bsschover" && event.type == "mouseout" )\r
- eventAgency[i].EndEffect();\r
- else // to invoke the unified function in effect object \r
- eventAgency[i].UpdateEffect(); \r
- }\r
- }\r
-}\r
-\r
-CTarget.prototype.SetState = function( strBsscEvent )\r
-{\r
- if( typeof(this.objManager[strBsscEvent]) != "object" )\r
- return false;\r
-\r
- // to get the event agency from the event manager\r
- var eventAgency = this.objManager[strBsscEvent];\r
- \r
- if( strBsscEvent == "bsscpageclick" )\r
- {// we only set the initial state for the minium number of pageclick \r
- eventAgency[this.objManager.nMinPageClickIndex].PrepareEffect();\r
- return true;\r
- }\r
- else\r
- {\r
- for( var i = 0; i < eventAgency.length; i++ )\r
- eventAgency[i].PrepareEffect(); // to invoke the unified function in effect object \r
- if( i > 0 )\r
- return true;\r
- else\r
- return false;\r
- }\r
-}\r
-//End the definition of class CTarget\r
-\r
-//Begin the definition of CEngine class\r
-function CEngine(){}// all properities are going be "class" properities\r
-\r
-// object : as associative array of trigger objects\r
-CEngine.objTrigger = new Object();\r
-// object : as associative array of target objects \r
-CEngine.objTarget = new Object(); \r
-\r
-// Array : each element is a CAgencyXXX animation object\r
-CEngine.arrAnimation = new Array();\r
-CEngine.PerformAnimation = function( nIndex )\r
-{// animation : update effects function\r
- CEngine.arrAnimation[nIndex].UpdateEffect();\r
-}\r
-\r
-CEngine.AddOneTrigger = function(TriggerID,TriggerElement)\r
-{// add one Trigger object into the trigger array\r
- if( typeof(TriggerID) != "string" || TriggerElement == null ||\r
- typeof(TriggerElement) != "object" )\r
- return;\r
- if( typeof(CEngine.objTrigger[TriggerID] ) != "object" )\r
- CEngine.objTrigger[TriggerID] = new CTrigger(TriggerElement);\r
-}\r
- \r
-CEngine.AddOneTarget = function(TargetID, TargetElement)\r
-{// add one Target object into the target array\r
- if( typeof(TargetID) != "string" || TargetElement == null ||\r
- typeof(TargetElement) != "object" )\r
- return;\r
- if( typeof(CEngine.objTarget[TargetID]) != "object" )\r
- CEngine.objTarget[TargetID] = new CTarget( TargetElement );\r
-}\r
-\r
-CEngine.SendEventToOneTarget = function(strTargetID, strBsscEvent )\r
-{// to activate one target object\r
- if( typeof(CEngine.objTarget[strTargetID]) == "object" ) \r
- {\r
- if( strBsscEvent == "bssctrigger1" || strBsscEvent == "bssctrigger2" )\r
- {//now, the "bssctrigger1" and "bssctrigger2" work like a toggle\r
- if( strBsscEvent == CEngine.objTarget[strTargetID].strTriggerEvent )\r
- strBsscEvent = (strBsscEvent == "bssctrigger1") ? "bssctrigger2" : "bssctrigger1";\r
- CEngine.objTarget[strTargetID].strTriggerEvent = strBsscEvent;\r
- }\r
- CEngine.objTarget[strTargetID].OnEvent( strBsscEvent );\r
- }\r
-}\r
-\r
-CEngine.SendEventToAllTarget = function( strBsscEvent )\r
-{ //to activate all target associative to the BSSC event\r
- for( var strTargetID in CEngine.objTarget ) //to enumerate all target\r
- CEngine.SendEventToOneTarget( strTargetID, strBsscEvent );\r
-}\r
-\r
-CEngine.SetOneTargetInitialState = function( strTargetID )\r
-{// only invoked after ALL effects for the target have been set\r
- if( typeof(CEngine.objTarget[strTargetID]) == "object" ) \r
- {// to get target object\r
- var objTarget = CEngine.objTarget[strTargetID];\r
- if( objTarget.SetState( "bsscpageload" ) == false )\r
- {\r
- objTarget.SetState( "bsscpageclick" );\r
- objTarget.SetState( "bssctrigger1" );\r
- }\r
- }\r
-}\r
-\r
-CEngine.AdjustPageClickCounter = function()\r
-{\r
- var nAdjustedClickCounter = CTarget.nPageClickCounter;\r
- var bAdjusted = false;\r
- for( var strTargetID in CEngine.objTarget ) //to enumerate all target\r
- {// try to find the minum pageCliclConter greater than CTarget.nPageClickCounter\r
- var objEventPageClick = CEngine.objTarget[strTargetID].objManager.bsscpageclick;\r
- if( objEventPageClick != null )\r
- {\r
- for( var i = 0; i < objEventPageClick.length; i++ )\r
- {\r
- var nOtherPageClick = objEventPageClick[i].nPageClick;\r
- if( nOtherPageClick == CTarget.nPageClickCounter )\r
- return;\r
- if( nOtherPageClick > CTarget.nPageClickCounter )\r
- {\r
- if( !bAdjusted )\r
- {\r
- nAdjustedClickCounter = nOtherPageClick;\r
- bAdjusted = true;\r
- }\r
- else if( nOtherPageClick < nAdjustedClickCounter )\r
- nAdjustedClickCounter = nOtherPageClick;\r
- }\r
- }\r
- }\r
- }\r
- CTarget.nPageClickCounter = nAdjustedClickCounter;\r
-}\r
-\r
-CEngine.OnPageLoad = function()\r
-{ \r
- // first, to set all target's initial state\r
- for( var strTargetID in CEngine.objTarget )\r
- CEngine.SetOneTargetInitialState( strTargetID );\r
- \r
- // to invoke all target's onpageload handler\r
- CEngine.SendEventToAllTarget( "bsscpageload" );\r
-}\r
-\r
-CEngine.OnPageClick = function()\r
-{ // to invoke all target's onpageclick handler\r
- var src = CCSSP.GetEventElement( arguments[0] );\r
- if( src == null )\r
- return;\r
- \r
- var objClickedTrigger = null;\r
- for( var strTriggerID in CEngine.objTrigger )\r
- { // to detect which trigger is clicked\r
- if( CCSSP.IsDescendant( CEngine.objTrigger[strTriggerID].eleTrigger,src) )\r
- {\r
- objClickedTrigger = CEngine.objTrigger[strTriggerID];\r
- break;\r
- }\r
- }\r
- \r
- if( objClickedTrigger != null) // the clicked trigger found\r
- objClickedTrigger.OnTriggerClick();\r
- else // no trigger is clicked\r
- { // to send PageClick event to all target\r
- CTarget.nPageClickCounter++;\r
- CEngine.AdjustPageClickCounter();\r
- CEngine.SendEventToAllTarget( "bsscpageclick" );\r
- }\r
-} \r
-\r
-CEngine.OnMouseOver = function()\r
-{ // to invoke all target's onpageload handler\r
- var src = CCSSP.GetEventElement( arguments[0] );\r
- if( src == null )\r
- return;\r
- \r
- var strHoveredTargetID = null;\r
- for( var strTargetID in CEngine.objTarget )\r
- { // to detect which Target is hovering on\r
- if( CCSSP.IsDescendant( CEngine.objTarget[strTargetID].eleTarget, src ) )\r
- {\r
- strHoveredTargetID = strTargetID;\r
- break;\r
- }\r
- }\r
- \r
- if( strHoveredTargetID != null ) // the hovered target found\r
- CEngine.SendEventToOneTarget( strHoveredTargetID, "bsschover" );\r
-}\r
-\r
-CEngine.BuildTargetObject = function(target_ID,event_type,action_type,\r
- action_setting, event_additional)\r
-{// to build target object \r
- // to get the target object\r
- if( typeof( CEngine.objTarget[target_ID] ) != "object" )\r
- return false;// the engine's AddOneTarget function might have failed.\r
- var TargetObject = CEngine.objTarget[target_ID];\r
- \r
- // to prepare the parameters for the event manager\r
- var arrEvent = event_type.split("|"); // to split the combined event_type string\r
- var arrAction = action_type.split("|");//to split the combined action_type string\r
- for( var trim = 0; trim < arrEvent.length; trim++ )\r
- arrEvent[trim] = CCSSP.TrimSpace(arrEvent[trim]);\r
- \r
- for( trim = 0; trim < arrAction.length; trim++ )\r
- arrAction[trim] = CCSSP.TrimSpace(arrAction[trim]);\r
- \r
- var arrSetting = new Array(); \r
- if( typeof(action_setting) == "string" )\r
- arrSetting = action_setting.split("|");// to split the combined action_setting string\r
- // to calibrate the arrays\r
- for( var i = arrSetting.length; i < arrAction.length; i++ )\r
- {\r
- if( typeof(arrSetting[i]) != "string" )\r
- arrSetting[i] = "";\r
- } \r
-\r
- // to prepare for dealing with the absolute posioning element\r
- TargetObject.eleTarget.ABSX = CCSSP.GetObjectLeft( TargetObject.eleTarget );\r
- TargetObject.eleTarget.ABSY = CCSSP.GetObjectTop( TargetObject.eleTarget );\r
-\r
- if( arrEvent.length > 1 )\r
- {// if event is combined, it must be : "bssctrigger1 | bssctrigger2"\r
- if( arrAction.length != 2 )\r
- return false; // if event is combined, there must be 2 actions\r
- for( i = 0 ; i < 2; i++ )\r
- {\r
- if( TargetObject.SetEventManager(arrEvent[i], arrAction[i], \r
- arrSetting[i], event_additional) == false )\r
- return false; // the event manager has not been set up\r
- }\r
- }\r
- else // the event_type string is not combined\r
- {\r
- for( i = 0 ; i < arrAction.length; i++ )\r
- {\r
- TargetObject.SetEventManager(event_type, arrAction[i], arrSetting[i], event_additional);\r
- // to validate the event manager\r
- if( typeof(TargetObject.objManager[event_type]) != "object" ||\r
- typeof(TargetObject.objManager[event_type][i]) != "object" )\r
- return false; // the event manager has not been set up\r
- }\r
- }\r
- return true;\r
-}\r
-\r
-CEngine.BuildTriggerObject = function(trigger_ID, target_ID)\r
-{// to build the trigger object\r
- var arrTrigger = trigger_ID.split("|"); // to split the combined trigger_ID string\r
- for( var i = 0; i < arrTrigger.length; i ++ )\r
- {// to get the trigger element then add it to the trigger list\r
- arrTrigger[i] = CCSSP.TrimSpace( arrTrigger[i] );\r
- var eleTrigger = CCSSP.GetObject( arrTrigger[i] );\r
- if( eleTrigger == null )\r
- continue; // the trigger_ID string in the HTML code maybe wrong\r
- CEngine.AddOneTrigger( arrTrigger[i], eleTrigger );\r
-\r
- // to get the target object\r
- if( typeof( this.objTrigger[arrTrigger[i]] ) != "object" )\r
- continue;// the engine's AddOneTarget function might have failed.\r
- CEngine.objTrigger[arrTrigger[i]].AddTargetID( target_ID );\r
- }\r
-}\r
-//End the definition of CEngine class\r
-\r
-/// Section End - CCSSP DHTM 1 (JavaScript 1.2)\r
-\r
-/// Section Begin - CCSSP DHTM 2 (JavaScript 1.2)\r
-\r
-//Begin the definition of CAgencyXXXX classes\r
-\r
-//Begin of the CAgencyShow definition\r
-function CAgencyShow( element, bIsShow )\r
-{\r
- this.ele = element;\r
- this.bIsShow = bIsShow;\r
-}\r
-\r
-CAgencyShow.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.ShowObject( this.ele, !this.bIsShow );\r
-}\r
-\r
-CAgencyShow.prototype.UpdateEffect = function()\r
-{\r
- CCSSP.ShowObject( this.ele, this.bIsShow );\r
-}\r
-\r
-CAgencyShow.prototype.EndEffect = function()\r
-{\r
- CCSSP.ShowObject( this.ele, !this.bIsShow );\r
-}\r
-// End of the CAgencyShow definition\r
-\r
-// Begin of CAgencyFly definition\r
-function CAgencyFly( element, settings, bIsIn )\r
-{\r
- this.ele = element;\r
- this.bIsIn = bIsIn;\r
- this.duration = 1000; // default\r
- this.direction = "right";\r
-\r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "speed" : this.duration = 100000/arrOneSet[1]; break;\r
- case "direction" : this.direction = arrOneSet[1]; break;\r
- }\r
- }\r
- \r
- if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )\r
- this.ele.style.position = "relative";\r
- this.timer = null;\r
- this.aniIndex = CEngine.arrAnimation.length;\r
- CEngine.arrAnimation[this.aniIndex] = this;\r
-}\r
-\r
-CAgencyFly.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.ShowObject(this.ele, !this.bIsIn );\r
-}\r
-\r
-CAgencyFly.prototype.UpdateEffect = function()\r
-{\r
- if( this.timer == null )\r
- this.ResetParameters();\r
-\r
- var percent = ((new Date()).getTime() - this.startTime)/this.duration;\r
- if( percent >= 1.0 )\r
- this.EndEffect();\r
- else\r
- {\r
- var newX = this.startX*(1.0-percent) + this.finalX*percent;\r
- var newY = this.startY*(1.0-percent) + this.finalY*percent;\r
- CCSSP.MoveObjectTo(this.ele, newX, newY);\r
- if( this.timer == null )\r
- this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );\r
- }\r
-}\r
-\r
-CAgencyFly.prototype.EndEffect = function()\r
-{\r
- clearInterval( this.timer );\r
- this.timer = null;\r
-\r
- if( this.bIsIn ) // FlyIn\r
- CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);\r
- else // FlyOut\r
- CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);\r
- CCSSP.ShowObject(this.ele, this.bIsIn );\r
-}\r
-\r
-CAgencyFly.prototype.ResetParameters = function()\r
-{\r
- this.PrepareEffect();\r
- CCSSP.ShowObject(this.ele, true );\r
-\r
- this.startX = 0;\r
- this.startY = 0;\r
- this.finalX = 0;\r
- this.finalY = 0; \r
- \r
- var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;\r
- var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;\r
- var offsetRight = CCSSP.GetWindowRight();\r
- var offsetBottom = CCSSP.GetWindowBottom();\r
-\r
- if( this.bIsIn )\r
- { // FlyIn\r
- this.finalX = this.ele.ABSX;\r
- this.finalY = this.ele.ABSY;\r
-\r
- switch( this.direction )\r
- {\r
- case "right": this.startX = offsetRight; this.startY = this.finalY; break;\r
- case "left": this.startX = -offsetLeft; this.startY = this.finalY; break;\r
- case "down": this.startY = offsetBottom; this.startX = this.finalX; break;\r
- case "up": this.startY = -offsetTop; this.startX = this.finalX; break;\r
- case "downright":\r
- this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;\r
- this.startY = this.startX; break;\r
- case "upright":\r
- this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;\r
- this.startY = -this.startX; break;\r
- case "upleft":\r
- this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);\r
- this.startY = this.startX; break;\r
- case "downleft":\r
- this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);\r
- this.startY = -this.startX; break;\r
- }\r
- }\r
- else\r
- { // FlyOut\r
- this.startX = this.ele.ABSX;\r
- this.startY = this.ele.ABSY;\r
-\r
- switch( this.direction )\r
- {\r
- case "right": this.finalX = offsetRight; this.finalY = this.startY; break;\r
- case "left": this.finalX = -offsetLeft; this.finalY = this.startY; break;\r
- case "down": this.finalY = offsetBottom; this.finalX = this.startX; break;\r
- case "up": this.finalY = -offsetTop; this.finalX = this.startX; break;\r
- case "downright":\r
- this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;\r
- this.finalY = this.finalX; break;\r
- case "upright":\r
- this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;\r
- this.finalY = -this.finalX; break;\r
- case "upleft":\r
- this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);\r
- this.finalY = this.finalX; break;\r
- case "downleft":\r
- this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);\r
- this.finalY = -this.finalX; break;\r
- }\r
- }\r
- CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);\r
- this.startTime = (new Date()).getTime();\r
-}\r
-// End of the CAgencyFly definition\r
-\r
-// Begin of CAgencySpiral\r
-function CAgencySpiral( element, settings, bIsIn )\r
-{\r
- this.ele = element;\r
- this.bIsIn = bIsIn;\r
- this.duration = 1000; // default\r
-\r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "speed" : this.duration = 100000/arrOneSet[1]; break;\r
- }\r
- }\r
-\r
- if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )\r
- this.ele.style.position = "relative";\r
- this.timer = null;\r
- this.aniIndex = CEngine.arrAnimation.length;\r
- CEngine.arrAnimation[this.aniIndex] = this;\r
-}\r
-\r
-CAgencySpiral.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.ShowObject(this.ele, !this.bIsIn );\r
-}\r
-\r
-CAgencySpiral.prototype.UpdateEffect = function()\r
-{\r
- if( this.timer == null )\r
- this.ResetParameters();\r
-\r
- var percent = ((new Date()).getTime() - this.startTime)/this.duration;\r
- if( percent >= 1.0 )\r
- this.EndEffect();\r
- else\r
- {\r
- var rf = (this.bIsIn)? (1.0 - percent) : percent; \r
- var t = (1.0-rf) * 4.0 * Math.PI\r
- var rxP = (this.bIsIn)? this.startX : this.finalX; \r
- var ryP = (this.bIsIn)? this.startY : this.finalY; \r
- var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;\r
- var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;\r
-\r
- var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;\r
- var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;\r
- CCSSP.MoveObjectTo(this.ele, newX, newY);\r
- if( this.timer == null )\r
- this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );\r
- }\r
-}\r
-\r
-CAgencySpiral.prototype.EndEffect = function()\r
-{\r
- clearInterval( this.timer );\r
- this.timer = null;\r
- \r
- if( this.bIsIn ) // In\r
- CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);\r
- else // Out\r
- CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);\r
- CCSSP.ShowObject(this.ele, this.bIsIn );\r
-}\r
-\r
-CAgencySpiral.prototype.ResetParameters = function()\r
-{\r
- this.PrepareEffect();\r
- CCSSP.ShowObject(this.ele, true );\r
- this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;\r
- this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;\r
- this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();\r
- this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom(); \r
- \r
- CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);\r
- this.startTime = (new Date()).getTime();\r
-}\r
-// End of CAgencySpiral\r
-\r
-// Begin of CAgencyElastic\r
-function CAgencyElastic( element, settings)\r
-{\r
- this.ele = element;\r
- this.duration = 1000; // default\r
- this.direction = "right";\r
-\r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "speed" : this.duration = 100000/arrOneSet[1]; break;\r
- case "direction" : this.direction = arrOneSet[1]; break;\r
- }\r
- }\r
- \r
- if( CCSSP.bIsIE5 && this.ele.style.position != "absolute" )\r
- this.ele.style.position = "relative";\r
- this.timer = null;\r
- this.aniIndex = CEngine.arrAnimation.length;\r
- CEngine.arrAnimation[this.aniIndex] = this;\r
-}\r
-\r
-CAgencyElastic.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.ShowObject(this.ele, false );\r
-}\r
-\r
-CAgencyElastic.prototype.UpdateEffect = function()\r
-{\r
- if( this.timer == null )\r
- this.ResetParameters();\r
-\r
- var percent = ((new Date()).getTime() - this.startTime)/this.duration;\r
- if( percent >= 1.0 )\r
- this.EndEffect();\r
- else\r
- {\r
- var newX = this.startX;\r
- var newY = this.startY;\r
- var rf = Math.exp(-percent*3);\r
- var t = percent * 1.5 * Math.PI\r
- var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;\r
- switch (this.direction )\r
- {\r
- case "left": \r
- case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;\r
- case "up": \r
- case "down" : newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;\r
- }\r
- CCSSP.MoveObjectTo(this.ele, newX, newY);\r
- if( this.timer == null )\r
- this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );\r
- }\r
-}\r
-\r
-CAgencyElastic.prototype.EndEffect = function()\r
-{\r
- CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);\r
- clearInterval( this.timer );\r
- this.timer = null;\r
-}\r
-\r
-CAgencyElastic.prototype.ResetParameters = function()\r
-{\r
- CCSSP.ShowObject(this.ele, true );\r
- this.startX = this.ele.ABSX;\r
- this.finalX = this.ele.ABSX;\r
- this.startY = this.ele.ABSY;\r
- this.finalY = this.ele.ABSY;\r
- \r
- switch (this.direction)\r
- { \r
- case "left": this.startX = -this.ele.offsetWidth; break;\r
- case "right": this.startX = this.ele.offsetWidth; break;\r
- case "up": this.startY = -this.ele.offsetHeight;break;\r
- case "down": this.startY = this.ele.offsetHeight; break;\r
- }\r
- CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);\r
- this.startTime = (new Date()).getTime();\r
-}\r
-// End of CAgencyElastic\r
-\r
-// Begin of CAgencyZoom\r
-function CAgencyZoom( element, settings, bIsIn)\r
-{\r
- this.ele = element;\r
- this.duration = 1000; // default\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "speed" : this.duration = 100000/arrOneSet[1]; break;\r
- }\r
- }\r
-\r
- this.bIsIn = bIsIn;\r
- this.timer = null;\r
- this.aniIndex = CEngine.arrAnimation.length;\r
- CEngine.arrAnimation[this.aniIndex] = this;\r
-}\r
-\r
-CAgencyZoom.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.ShowObject(this.ele, false);\r
-}\r
-\r
-CAgencyZoom.prototype.UpdateEffect = function()\r
-{\r
- if( this.timer == null )\r
- this.ResetParameters();\r
-\r
- var percent = ((new Date()).getTime() - this.startTime)/this.duration;\r
- if( percent >= 1.0 )\r
- this.EndEffect();\r
- else\r
- {\r
- var nFactorIn = Math.ceil(50+50*percent);\r
- var nFactorOut = Math.ceil(100+200*(1-percent));\r
- var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";\r
- var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;\r
- \r
- this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);\r
- for(var index = 0; index < this.ele.all.length; index++)\r
- this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);\r
- \r
- if( this.timer == null )\r
- this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );\r
- }\r
-}\r
-\r
-CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)\r
-{\r
- if( CCSSP.IsTextTag(child) )\r
- child.style.fontSize = FontSize;\r
- else\r
- {\r
- if( typeof(child.orgWidth) == "number" )\r
- child.style.width = Factor * child.orgWidth;\r
- if( typeof(child.orgHeight) == "number" )\r
- child.style.height = Factor * child.orgHeight;\r
- }\r
-}\r
-\r
-CAgencyZoom.prototype.EndEffect = function()\r
-{\r
- this.EndEffectAllChildren(this.ele);\r
- for(var index = 0; index < this.ele.all.length; index++)\r
- this.EndEffectAllChildren(this.ele.all[index]);\r
- \r
- clearInterval( this.timer );\r
- this.timer = null;\r
-}\r
-\r
-CAgencyZoom.prototype.EndEffectAllChildren = function( child )\r
-{ \r
- if( CCSSP.IsTextTag(child) )\r
- child.style.fontSize = child.orgFontSize;\r
- else\r
- {\r
- if( typeof(child.intactWidth) != "undefined" )\r
- {\r
- child.width = child.intactWidth;\r
- child.height = child.intactHeight;\r
- }\r
- else if( typeof(child.style.intactPixelWidth) != "undefined" )\r
- {\r
- child.style.pixelWidth = child.style.intactPixelWidth;\r
- child.style.pixelHeight = child.style.intactPixelHeight;\r
- }\r
- }\r
-}\r
-\r
-CAgencyZoom.prototype.ResetParameters = function()\r
-{\r
- this.PrepareEffect();\r
- this.ResetParametersAllChildren( this.ele );\r
- for(var index = 0; index < this.ele.all.length; index++)\r
- this.ResetParametersAllChildren(this.ele.all[index]);\r
- \r
- this.startTime = (new Date()).getTime();\r
-}\r
-\r
-CAgencyZoom.prototype.ResetParametersAllChildren = function( child )\r
-{\r
- CCSSP.ShowObject(child, true );\r
- if( (child.tagName == "DIV") && (child.parentElement.tagName == "TD") )\r
- child.width = "100%";// if the div is inside a cell of table, we need the this hack\r
- \r
- if( CCSSP.IsTextTag(child) )\r
- child.orgFontSize = child.style.fontSize;\r
- else\r
- {\r
- if( child.width > "" || child.height > "" )\r
- {\r
- child.orgWidth = child.intactWidth = child.width;\r
- child.orgHeight = child.intactHeight = child.height;\r
- }\r
- else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )\r
- {\r
- child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;\r
- child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;\r
- }\r
- }\r
-}\r
-// End of CAgencyZoom\r
-\r
-//// the following effects will use IE's exclusive "filter" function ////\r
-// Begin of CAgencyAlpha definition\r
-function CAgencyAlpha( element, settings, bIsIn )\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
- this.bIsIn = bIsIn;\r
-\r
- // to set the default value\r
- this.startOpacity = (this.bIsIn) ? 0 : 100;\r
- this.endOpacity = (this.bIsIn) ? 100 : 0;\r
- \r
- this.duration = 1000; // default\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "speed" : this.duration = 100000/arrOneSet[1]; break;\r
- }\r
- }\r
- \r
- this.timer = null;\r
- this.aniIndex = CEngine.arrAnimation.length;\r
- CEngine.arrAnimation[this.aniIndex] = this;\r
-}\r
-\r
-CAgencyAlpha.prototype.PrepareEffect = function()\r
-{// to set the visual filter function\r
- // the visual filter ONLY work when set by "Width and Height" or\r
- // absolute position for DIV, SPAN and normal tag ( such as p )\r
- // but, "absolute" cause the following elements overlap, so:\r
- CCSSP.PrepareFilter( this.ele );\r
- CCSSP.ShowObject(this.ele, !this.bIsIn );\r
-}\r
-\r
-CAgencyAlpha.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- if( this.timer == null )\r
- this.ResetParameters();\r
- if( typeof(this.ele.filters.alpha) != "object" )\r
- {\r
- this.EndEffect();\r
- return;\r
- }\r
-\r
- var percent = ((new Date()).getTime() - this.startTime)/this.duration;\r
- if( percent >= 1.0 )\r
- this.EndEffect();\r
- else if( typeof(this.ele.filters.alpha) == "object" )\r
- {\r
- this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;\r
- if( this.timer == null )\r
- this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );\r
- }\r
-}\r
-\r
-CAgencyAlpha.prototype.EndEffect = function()\r
-{// to remove the visual filter function\r
- clearInterval( this.timer );\r
- this.timer = null;\r
- this.ele.style.filter = "";\r
- CCSSP.ShowObject(this.ele, this.bIsIn );\r
-}\r
-\r
-CAgencyAlpha.prototype.ResetParameters = function()\r
-{\r
- this.PrepareEffect();\r
- CCSSP.ShowObject(this.ele, true );\r
- this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";\r
- this.startTime = (new Date()).getTime();\r
-}\r
-// End of the CAgencyAlpha definition\r
-\r
-// Begin of CAgencyWave definition\r
-function CAgencyWave( element, settings )\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
-\r
- this.duration = 0; // default\r
- this.strength = 10;\r
- this.freq = 1;\r
- this.lightstrength = 1;\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "duration" : this.duration = 100000/arrOneSet[1]; break;\r
- case "strength" : this.strength = arrOneSet[1]; break;\r
- case "freq" : this.freq = arrOneSet[1]; break;\r
- case "lightstrength" : this.lightstrength = arrOneSet[1]; break;\r
- }\r
- }\r
-\r
- this.timer = null;\r
- this.aniIndex = CEngine.arrAnimation.length;\r
- CEngine.arrAnimation[this.aniIndex] = this;\r
-}\r
-\r
-CAgencyWave.prototype.PrepareEffect = function()\r
-{// to set the visual filter function\r
- CCSSP.PrepareFilter(this.ele);\r
-\r
- CCSSP.ShowObject(this.ele, true );\r
-}\r
-\r
-CAgencyWave.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- if( this.timer == null )\r
- this.ResetParameters();\r
- if( typeof(this.ele.filters.wave) != "object" )\r
- {\r
- this.EndEffect();\r
- return;\r
- }\r
-\r
- if( this.duration > 0 )\r
- {\r
- var percent = ((new Date()).getTime() - this.startTime)/this.duration;\r
- if( percent >= 1.0 )\r
- {\r
- this.EndEffect();\r
- return;\r
- }\r
- }\r
- \r
- this.ele.filters.wave.phase += 5;\r
- this.ele.filters.wave.phase %= 100;\r
- if( this.timer == null )\r
- this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );\r
-}\r
-\r
-CAgencyWave.prototype.EndEffect = function()\r
-{// to remove the visual filter function\r
- this.ele.style.filter = "";\r
- clearInterval( this.timer );\r
- this.timer = null;\r
-}\r
-\r
-CAgencyWave.prototype.ResetParameters = function()\r
-{\r
- this.PrepareEffect();\r
- this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" + \r
- this.freq +", lightstrength=" + this.lightstrength +",phase=0);";\r
- this.startTime = (new Date()).getTime();\r
-}\r
-// End of the CAgencyWave definition\r
-\r
-// Begin of CAgencyGlow definition\r
-function CAgencyGlow( element, settings )\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
-\r
- // to set the default value\r
- this.glowColor = "green";\r
- this.glowStrength = "3";\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "color" : this.glowColor = arrOneSet[1]; break;\r
- case "strength" : this.glowStrength = arrOneSet[1]; break;\r
- }\r
- }\r
-}\r
-\r
-CAgencyGlow.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.PrepareFilter(this.ele);\r
- CCSSP.ShowObject(this.ele, true );\r
- if( this.ele.style.backgroundColor != "" )\r
- {//style.backgroundColor somehow stop the visual filter\r
- this.ele.intactBackgroundColor = this.ele.style.backgroundColor;\r
- this.ele.style.backgroundColor = "";\r
- }\r
-}\r
-\r
-CAgencyGlow.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- this.PrepareEffect();\r
- this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" + \r
- this.glowStrength + ", enabled=true" +")";\r
-}\r
-\r
-CAgencyGlow.prototype.EndEffect = function()\r
-{// to remove the visual filter function\r
- this.ele.style.filter = "";\r
- if( typeof(this.ele.intactBackgroundColor) != "undefined" )\r
- this.ele.style.backgroundColor = this.ele.intactBackgroundColor;\r
-}\r
-// End of the CAgencyGlow definition\r
-\r
-// Begin of CAgencyDropShadow definition\r
-function CAgencyDropShadow( element, settings )\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
-\r
- // to set the default value\r
- this.shadowColor = "black"; \r
- this.shadowOffx = "1";\r
- this.shadowOffy = "1";\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "color" : this.shadowColor = arrOneSet[1]; break;\r
- case "offx" : this.shadowOffx = arrOneSet[1]; break;\r
- case "offy" : this.shadowOffy = arrOneSet[1]; break;\r
- }\r
- }\r
-}\r
-\r
-CAgencyDropShadow.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.PrepareFilter(this.ele);\r
- CCSSP.ShowObject(this.ele, true );\r
- \r
- if( this.ele.style.backgroundColor != "" )\r
- {//style.backgroundColor somehow stop the visual filter\r
- this.ele.intactBackgroundColor = this.ele.style.backgroundColor;\r
- this.ele.style.backgroundColor = "";\r
- }\r
-}\r
-\r
-CAgencyDropShadow.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- this.PrepareEffect();\r
- this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" + \r
- this.shadowOffx + ", offy=" + this.shadowOffy + ")";\r
-}\r
-\r
-CAgencyDropShadow.prototype.EndEffect = function()\r
-{// to remove the visual filter function\r
- this.ele.style.filter = "";\r
- if( typeof(this.ele.intactBackgroundColor) != "undefined" )\r
- this.ele.style.backgroundColor = this.ele.intactBackgroundColor;\r
-}\r
-// End of the CAgencyDropShadow definition\r
-\r
-// Begin of CAgencyRevealTrans definition\r
-function CAgencyRevealTrans( element, settings )\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
-\r
- // to set the default value\r
- this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).\r
- this.transition = 0;\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "type" : this.transition = arrOneSet[1]; break;\r
- case "duration" : this.duration = 100/arrOneSet[1]; break;\r
- }\r
- }\r
-}\r
-\r
-CAgencyRevealTrans.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.PrepareFilter(this.ele);\r
- CCSSP.ShowObject( this.ele, false);\r
-}\r
-\r
-CAgencyRevealTrans.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- if( typeof( this.ele.filters.RevealTrans ) == "object" )\r
- {\r
- if( this.ele.filters.RevealTrans.status == 2 )\r
- this.ele.filters.RevealTrans.stop(); \r
- }\r
-\r
- this.PrepareEffect();\r
- \r
- this.ele.style.filter = "RevealTrans(duration=" + this.duration + \r
- ", transition=" + this.transition + ")";\r
- \r
- if( typeof( this.ele.filters.RevealTrans ) == "object" )\r
- {\r
- this.ele.filters.RevealTrans.apply();\r
- CCSSP.ShowObject( this.ele, true);\r
- this.ele.filters.RevealTrans.play(); \r
- }\r
- else\r
- CCSSP.ShowObject( this.ele, true);\r
-}\r
-\r
-CAgencyRevealTrans.prototype.EndEffect = function()\r
-{\r
- if( typeof( this.ele.filters.RevealTrans ) == "object" )\r
- this.ele.filters.RevealTrans.stop(); \r
- this.ele.style.filter = "";\r
-}\r
-// End of the CAgencyRevealTrans definition\r
-\r
-// Begin of CAgencyBlur definition\r
-function CAgencyBlur( element, settings )\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
-\r
- // to set the default value\r
- this.strength = "5";\r
- this.direction = "90";\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "strength" : this.strength = arrOneSet[1]; break;\r
- case "direction" : this.direction = arrOneSet[1]; break;\r
- }\r
- }\r
-}\r
-\r
-CAgencyBlur.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.PrepareFilter(this.ele);\r
- CCSSP.ShowObject(this.ele, true );\r
-}\r
-\r
-CAgencyBlur.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- CCSSP.PrepareFilter(this.ele);\r
- this.ele.style.filter = "blur(strength=" + this.strength + \r
- ", direction=" + this.direction + ")";\r
-}\r
-\r
-CAgencyBlur.prototype.EndEffect = function()\r
-{// to remove the visual filter function\r
- this.ele.style.filter = "";\r
-}\r
-// End of the CAgencyBlur definition\r
-\r
-// Begin of CAgencyChangeFilter definition\r
-function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,\r
-{// because of "visual filter" style, this won't work in Navigator\r
- this.ele = element;\r
-\r
- // to set the default value\r
- this.filterFunction = settings;\r
-}\r
-\r
-CAgencyChangeFilter.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.PrepareFilter(this.ele);\r
- CCSSP.ShowObject(this.ele, true );\r
-}\r
-\r
-CAgencyChangeFilter.prototype.UpdateEffect = function()\r
-{// to set the visual filter function\r
- CCSSP.PrepareFilter(this.ele);\r
- this.ele.style.filter = this.filterFunction;\r
-}\r
-\r
-CAgencyChangeFilter.prototype.EndEffect = function()\r
-{// to remove the visual filter function\r
- this.ele.style.filter = "";\r
-}\r
-// End of the CAgencyChangeFilter definition\r
-\r
-// The effects below change the style on the fly, so they won't work in Navigator\r
-\r
-// Begin of CAgencyFontChange definition, \r
-function CAgencyFontChange( element, settings )\r
-{//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.\r
- this.ele = element;\r
- \r
- // to retrieve the original font style\r
- this.RetrieveOldFont( this.ele );\r
- \r
- // to set the default font to change\r
- this.newfontFamily = this.ele.oldFontFamily;\r
- this.newfColor = this.ele.oldColor;\r
- this.newtextDecoration = this.ele.oldTextDecoration;\r
- this.newfontWeight = this.ele.oldFontWeight;\r
- this.newfontStyle = this.ele.oldFontStyle;\r
- this.newfontSize = this.ele.oldFontSize;\r
- this.newBackgroundColor = this.ele.oldBackgroundColor;\r
- \r
- var arrAllSet = settings.split(",");\r
- for( var i = 0; i < arrAllSet.length; i ++ )\r
- {// to retrieve the setting\r
- arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);\r
- var arrOneSet = arrAllSet[i].split("=");\r
- for( var j = 0; j < arrOneSet.length; j++ )\r
- arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);\r
- switch( arrOneSet[0] )\r
- {\r
- case "font-family" : this.newfontFamily = arrOneSet[1]; break;\r
- case "color" : this.newfColor = arrOneSet[1]; break;\r
- case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;\r
- case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;\r
- case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;\r
- case "size" : this.newfontSize = arrOneSet[1]; break;\r
- case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;\r
- }\r
- }\r
-}\r
-\r
-CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)\r
-{\r
- if( typeof(objChild.oldFontFamily) == "undefined" )\r
- objChild.oldFontFamily = objChild.style.fontFamily;\r
- if( typeof(objChild.oldColor) == "undefined" )\r
- objChild.oldColor = objChild.style.color;\r
- if( typeof(objChild.oldTextDecoration) == "undefined" )\r
- objChild.oldTextDecoration = objChild.style.textDecoration;\r
- if( typeof(objChild.oldFontWeight) == "undefined" )\r
- objChild.oldFontWeight = objChild.style.fontWeight;\r
- if( typeof(objChild.oldFontStyle) == "undefined" )\r
- objChild.oldFontStyle = objChild.style.fontStyle;\r
- if( typeof(objChild.oldFontSize) == "undefined" )\r
- objChild.oldFontSize = objChild.style.fontSize;\r
- if( typeof(objChild.oldBackgroundColor) == "undefined" )\r
- objChild.oldBackgroundColor = objChild.style.backgroundColor;\r
-}\r
-\r
-CAgencyFontChange.prototype.PrepareEffect = function()\r
-{\r
- // as for expanding text, the child is created after the constructor called\r
- for(var index = 0; index < this.ele.all.length; index++)\r
- this.RetrieveOldFont(this.ele.all[index]);\r
- CCSSP.ShowObject(this.ele, true );\r
-}\r
-\r
-CAgencyFontChange.prototype.UpdateEffect = function()\r
-{// to change the font\r
- this.PrepareEffect();\r
- this.UpdateEffectAllChildren( this.ele );\r
- for( var index = 0; index < this.ele.all.length; index++)\r
- this.UpdateEffectAllChildren(this.ele.all[index]);\r
-}\r
-\r
-CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)\r
-{\r
- objChild.style.fontFamily = this.newfontFamily;\r
- objChild.style.color = this.newfColor;\r
- objChild.style.textDecoration = this.newtextDecoration;\r
- objChild.style.fontWeight = this.newfontWeight;\r
- objChild.style.fontStyle = this.newfontStyle;\r
- objChild.style.fontSize = this.newfontSize;\r
- objChild.style.backgroundColor = this.newBackgroundColor;\r
-}\r
-\r
-CAgencyFontChange.prototype.EndEffect = function()\r
-{// to reinstate the original font style\r
- this.EndEffectAllChildren( this.ele );\r
- for( var index = 0; index < this.ele.all.length; index++)\r
- this.EndEffectAllChildren(this.ele.all[index]);\r
-}\r
-\r
-CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )\r
-{\r
- if( typeof(objChild.oldFontFamily) != "undefined" )\r
- objChild.style.fontFamily = objChild.oldFontFamily;\r
- if( typeof(objChild.oldColor) != "undefined" )\r
- objChild.style.color = objChild.oldColor;\r
- if( typeof(objChild.oldFontWeight) != "undefined" )\r
- objChild.style.fontWeight = objChild.oldFontWeight;\r
- if( typeof(objChild.oldFontStyle) != "undefined" )\r
- objChild.style.fontStyle = objChild.oldFontStyle;\r
- if( typeof(objChild.oldFontSize) != "undefined" )\r
- objChild.style.fontSize = objChild.oldFontSize;\r
- if( typeof(objChild.oldTextDecoration) != "undefined" )\r
- objChild.style.textDecoration = objChild.oldTextDecoration;\r
- if( typeof(objChild.oldBackgroundColor) != "undefined" )\r
- objChild.style.backgroundColor = objChild.oldBackgroundColor;\r
-}\r
-// End of the CAgencyFontChange definition\r
-\r
-// Begin of the CAgencyChangeStyle definition\r
-function CAgencyChangeStyle( element, settings )\r
-{//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.\r
- this.ele = element;\r
- \r
- // to retrieve the original style\r
- this.oldstyle = this.ele.style.cssText;\r
- \r
- // to set the default style\r
- this.newStyle = this.oldstyle;\r
- \r
- if( typeof(settings) == "string" && settings.length > 1 )\r
- this.newStyle = this.oldstyle + " " + settings;\r
-}\r
-\r
-CAgencyChangeStyle.prototype.PrepareEffect = function()\r
-{\r
- CCSSP.ShowObject(this.ele, true );\r
-}\r
-\r
-CAgencyChangeStyle.prototype.UpdateEffect = function()\r
-{// to change the style\r
- this.ele.style.cssText = this.newStyle;\r
-}\r
-\r
-CAgencyChangeStyle.prototype.EndEffect = function()\r
-{// to reinstate the original style\r
- this.ele.style.cssText = this.oldStyle;\r
-}\r
-// End of the CAgencyChangeStyle definition\r
-\r
-//End the definition of CAgencyXXXX classes\r
-\r
-//Begin to collaborate with other event handler settings \r
-CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");\r
-CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");\r
-CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );\r
-CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );\r
-CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");\r
-//End to collaborate with other event handler settings\r
-\r
-\r
-/// Section End - CCSSP DHTM 2 (JavaScript 1.2)\r
-\r
-//// Segment End -- (JavaScript 1.2)\r
+// eHelp® Corporation Dynamic HTML JavaScript
+// Copyright© 1998-2003 eHelp® Corporation.All rights reserved.
+// Version=4.82
+
+// Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten.
+
+//// Segment Begin -- (JavaScript 1.0)
+
+/// Section Begin - General and relative topics(JavaScript 1.0)
+
+//{{HH_SYMBOL_SECTION
+var HH_ChmFilename = "";
+var HH_WindowName = "";
+var HH_GlossaryFont = "";
+var HH_Glossary = "";
+var HH_Avenue = "";
+var HH_ActiveX = false;
+//}}HH_SYMBOL_SECTION
+
+//Begin to support previous generic parameters
+//Get the information about the browser.
+var gstrBsAgent = navigator.userAgent.toLowerCase();
+var gnBsVer = parseInt(navigator.appVersion);
+
+var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1);
+var gbBsKonqueror = (gstrBsAgent.indexOf('konqueror') != -1);
+var gbBsSafari = (gstrBsAgent.indexOf('safari') != -1);
+var gbBsIE = (gstrBsAgent.indexOf('msie') != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
+var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1)) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
+
+var gbBsMac = (gstrBsAgent.indexOf('mac') != -1);
+var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1));
+var gbBsSunOS = (gstrBsAgent.indexOf("sunos") != -1);
+
+var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2));
+var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3));
+
+var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2));
+var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3));
+var gbBsIE300301 = ((gbBsIE) && (gnBsVer == 2) && ((gstrBsAgent.indexOf("3.00") != -1)||(gstrBsAgent.indexOf("3.0a") != -1)||(gstrBsAgent.indexOf("3.0b")!=-1)||(gstrBsAgent.indexOf("3.01")!=-1)));
+var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1));
+
+var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4));
+var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5));
+var gbBsNS7 = false;
+
+var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4));
+var gbBsIE5 = false;
+var gbBsIE55 = false;
+
+var gbBsOpera6 = false;
+var gbBsOpera7 = false;
+
+var gbBsKonqueror3 = false;
+
+
+
+gbBsIE = (navigator.appName.indexOf("Microsoft") != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;;
+if (gbBsIE)
+{
+ if (parseInt(navigator.appVersion) >= 4) {
+ gbBsIE4 = true;
+ if (gbBsIE4) {
+ var nPos = gstrBsAgent.indexOf("msie");
+ var strIEversion = gstrBsAgent.substring(nPos + 5);
+ var nVersion = parseFloat(strIEversion);
+ if (nVersion >= 5)
+ gbBsIE5 = true;
+ if (nVersion >= 5.5)
+ gbBsIE55 = true;
+ }
+ }
+}
+if (gbBsNS6)
+{
+ var nPos=gstrBsAgent.indexOf("gecko");
+ if(nPos!=-1)
+ {
+ var nPos2=gstrBsAgent.indexOf("/", nPos);
+ if(nPos2!=-1)
+ {
+ var nVersion=parseFloat(gstrBsAgent.substring(nPos2+1));
+ if (nVersion>=20020823)
+ gbBsNS7=true;
+ }
+ }
+}
+if (gbBsOpera)
+{
+ var nPos = gstrBsAgent.indexOf("opera");
+ if(nPos!=-1)
+ {
+ var nVersion = parseFloat(gstrBsAgent.substring(nPos+6));
+ if (nVersion >= 6)
+ {
+ gbBsOpera6=true;
+ if (nVersion >=7)
+ gbBsOpera7=true;
+ }
+ }
+}
+if (gbBsKonqueror)
+{
+ var nPos = gstrBsAgent.indexOf("konqueror");
+ if(nPos!=-1)
+ {
+ var nVersion = parseFloat(gstrBsAgent.substring(nPos+10));
+ if (nVersion >= 3)
+ {
+ gbBsKonqueror3=true;
+ }
+ }
+}
+
+function insertAdjacentHTML(obj, where, htmlStr)
+{
+ if (gbBsIE || gbBsOpera7)
+ {
+ obj.insertAdjacentHTML(where, htmlStr);
+ }
+ else if (gbBsNS6 || gbBsSafari)
+ {
+ var r = obj.ownerDocument.createRange();
+ r.setStartBefore(obj);
+ var parsedHTML = r.createContextualFragment(htmlStr);
+
+ switch (where){
+ case 'beforeBegin':
+ obj.parentNode.insertBefore(parsedHTML,obj);
+ break;
+ case 'afterBegin':
+ obj.insertBefore(parsedHTML,obj.firstChild);
+ break;
+ case 'beforeEnd':
+ obj.appendChild(parsedHTML);
+ break;
+ case 'afterEnd':
+ if (obj.nextSibling){
+ obj.parentNode.insertBefore(parsedHTML,obj.nextSibling);
+ } else {
+ obj.parentNode.appendChild(parsedHTML);
+ }
+ break;
+ }
+ }
+}
+
+// Utilities functions.
+function BsscHasExtJs()
+{
+ if( gbBsIE3Before || gbBsNS3Before)
+ return false;
+ return true;
+}
+
+// Register event handler
+var gBsOnLoads = new Array(); // An array holds all the onload event handler.
+var gBsOnClicks = new Array(); // An array holds all the onClick event handler.
+var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler.
+var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler.
+var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler.
+
+var gbOrignalOnMouseDown = null;
+
+function BsscRegisterOnLoad(funcHandler)
+{
+ var nLength = gBsOnLoads.length;
+ gBsOnLoads[nLength] = funcHandler;
+}
+
+function BsscRegisterOnClick(funcHandler)
+{
+ var nLength = gBsOnClicks.length;
+ gBsOnClicks[nLength] = funcHandler;
+}
+
+function BsscRegisterOnUnLoad(funcHandler)
+{
+ var nLength = gBsOnUnLoads.length;
+ gBsOnUnLoads[nLength] = funcHandler;
+}
+
+function BsscRegisterOnMouseOver(funcHandler)
+{
+ var nLength = gBsOnMouseOvers.length;
+ gBsOnMouseOvers[nLength] = funcHandler;
+}
+
+function BsscRegisterOnMouseOut(funcHandler)
+{
+ var nLength = gBsOnMouseOuts.length;
+ gBsOnMouseOuts[nLength] = funcHandler;
+}
+
+function BsGeneralOnLoad()
+{
+ if (!gbBsIE4 && !gbBsNS4)
+ return;
+
+ // Make everything visible in navigator
+ if (gbBsNS4 && !gbBsNS6) {
+ // Make some special effects items visible
+ for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
+ document.layers[iLayer].visibility = "show";
+ document.layers[iLayer].left = 0;
+ }
+ }
+}
+
+// If resize the netscape browser, need to reload it.
+function BsReDo()
+{
+ if (innerWidth != origWidth || innerHeight != origHeight)
+ location.reload();
+}
+// End of the local functions.
+
+// The following functions are used by the html files.
+function BSSCOnLoad()
+{
+ if( !BsscHasExtJs() )
+ return;
+ for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--)
+ gBsOnLoads[nElement]();
+}
+
+function BSSCOnClick()
+{
+ if (!BsscHasExtJs()) return;
+
+ for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--)
+ gBsOnClicks[nElement]();
+}
+
+function BSSCOnUnload()
+{
+ if (!BsscHasExtJs()) return;
+ for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--)
+ gBsOnUnLoads[nElement]();
+}
+
+function BSSCOnMouseOver()
+{
+ if (!BsscHasExtJs()) return;
+ for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--)
+ gBsOnMouseOvers[nElement]();
+}
+
+function BSSCOnMouseOut()
+{
+ if (!BsscHasExtJs()) return;
+ for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--)
+ {
+ gBsOnMouseOuts[nElement]();
+ }
+}
+// End of invocation of the event handle functions.
+
+// Add the GereralOnLoad to the onload array.
+if (typeof(BsscRegisterOnLoad) != "undefined")
+{
+ BsscRegisterOnLoad(BsGeneralOnLoad);
+}
+if (gbBsNS4&&!gbBsNS6) {
+ origWidth = innerWidth;
+ origHeight = innerHeight;
+ onresize = BsReDo;
+}
+//End to support previous generic parameters
+
+//Begin to support previous HHActiveX invoking
+function BsHHActivateComponents()
+{
+ if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
+ {
+ var objBody = getElementsByTag(document,"BODY")[0];
+ if( typeof(objBody) == "object" )
+ {
+ insertAdjacentHTML(objBody, "beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
+ if (HHComponentActivator.object)
+ HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
+ }
+ }
+}
+
+function BsHHActivXOnLoad()
+{
+ if( gbBsIE4 )
+ BsHHActivateComponents();
+}
+
+if( typeof(BsscRegisterOnLoad) != "undefined" )
+{
+ BsscRegisterOnLoad(BsHHActivXOnLoad);
+}
+//End to support previous HHActiveX invoking
+
+//Begin to support previous relative topics
+//If webHelp needs Related Topics DHTMLcode, it's supposed to add it here
+var gbPopupMenuTimeoutExpired = false;
+var gbInPopupMenu = false;
+var gbPopupMenuTopicList = null;
+var gOlddocumentClick = null;
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//
+// Popup Menu code
+//
+//////////////////////////////////////////////////////////////////////////////////////////
+
+var g_bIsPopupMenuInit = false;
+function _WritePopupMenuLayer()
+{
+ if (!g_bIsPopupMenuInit)
+ {
+ if (gbBsNS4&&!gbBsNS6) {
+//Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page...
+ document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
+ } else{
+ document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
+ if (!(gbBsNS4&&!gbBsNS6)) {
+ document.write("<STYLE TYPE='text/css'>");
+ if (gbBsMac&&gbBsIE4) {
+ document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
+ document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
+ } else {
+ document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
+ document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
+ }
+ document.write("</STYLE>");
+ }
+ }
+ g_bIsPopupMenuInit = true;
+ }
+}
+
+//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<cRoot.frames.length; i++)
+ {
+ var cObj = null;
+ if (!gbBsNS6)
+ cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
+ else
+ cObj = _SeekFrameByName( cRoot.frames[i], strName );
+ if( cObj != null ) return cObj;
+ };
+ return null;
+}
+function _GetFrameByName( cRoot, strName )
+{
+ if( cRoot == null ) return null;
+ var cRet = _SeekFrameByName(cRoot, strName);
+ if( cRet != null ) return cRet;
+ if (cRoot.parent != cRoot)
+ return _GetFrameByName( cRoot.parent, strName );
+ else
+ return null;
+}
+
+var gfn_arguments = null;
+function _PopupMenu_Invoke(fn_arguments)
+{
+ gfn_arguments = fn_arguments;
+ if (gbBsOpera6&&gbBsMac)
+ {
+ var wndOldPopupLinks= window.open(document.location.href, "popuplinks");
+ wndOldPopupLinks.close();
+ setTimeout("_PopupMenu_Invoke_2();",100);
+ }
+ else
+ {
+ _PopupMenu_Invoke_2();
+ }
+}
+
+function _PopupMenu_Invoke_2()
+{
+ var fn_arguments = gfn_arguments;
+ gfn_arguments = null;
+
+ // Make sure we have reasonable arguments
+ var argLen = fn_arguments.length;
+ if (argLen < 3) {
+ return false;
+ }
+
+ // Check to see if we only have one target
+ var strTarget = "";
+ var targetDoc = null;
+ if (fn_arguments[1] == '') {
+ if (BSSCPopup_IsPopup()) {
+ targetDoc = parent;
+ strTarget = "TARGET= _parent";
+ }
+ else
+ targetDoc = window.document;
+ } else {
+ targetDoc = _GetFrameByName( parent, fn_arguments[1] );
+
+ strTarget = "TARGET='" + fn_arguments[1] + "'";
+ }
+
+ if ((!gbBsIE4 && !gbBsNS4 && !gbBsOpera7 && !gbBsKonqueror3 &&!gbBsSafari) || ((gbBsMac) && (gbBsIE4) && (window.event.srcElement.tagName == "AREA"))) {
+
+ var argLen = fn_arguments.length;
+
+ // Create the window that the hyperlinks will go into
+ var nHeight = argLen * 15;
+ var nWidth = 400;
+ var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
+ strParam += ",height=" + nHeight + ",width=200";
+ strParam += ",resizable";
+
+ var wndTemp=null;
+ // Create a temporary window first to ensure the real popup comes up on top
+ if (!gbBsOpera)
+ wndTemp = window.open("", "temp", strParam);
+
+ // Create the real popup window
+ var wndPopupLinks=null;
+ if (gbBsOpera&&gbBsMac)
+ {
+ wndTemp = window.open(document.location.href, "temp", strParam);
+ wndPopupLinks= window.open(document.location.href, "popuplinks", strParam);
+ }
+ else
+ wndPopupLinks= window.open("", "popuplinks", strParam);
+ wndPopupLinks.document.open("text/html");
+
+ // Close the temporary
+ if (wndTemp)
+ wndTemp.close();
+
+ var sHTML="<html><head></head>";
+ sHTML+="<body onBlur=\'self.focus();\'>";
+ var strParaLine = "";
+ for (var i = 0; i < (argLen - 2) / 2; i++) {
+ strParaLine = "";
+ strParaLine += "<a href=\"javascript:";
+ if (gbBsIE) {
+ strParaLine += "onBlur=null; ";
+ }
+ strParaLine += "opener.location=\'";
+ strParaLine += fn_arguments[2 * i + 3];
+ strParaLine += "\';close();\"";
+ strParaLine += strTarget;
+
+ strParaLine += ">";
+ strParaLine += fn_arguments[2 * i + 2];
+ strParaLine += "</a>";
+ strParaLine += "<br>";
+ sHTML+=strParaLine;
+ }
+ sHTML+="</body></html>";
+ wndPopupLinks.document.write(sHTML);
+ wndPopupLinks.document.close();
+ window.gbInPopupMenu = true;
+ if (!gbBsIE) {
+ wndPopupLinks.focus();
+ }
+ return false;
+ }
+
+ if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
+ ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
+ // Get the place that we will be putting the topic into
+ var strURL = "";
+ if (isNaN(fn_arguments[2]) || (gbPopupMenuTopicList == null)) {
+ strURL = fn_arguments[3];
+ }
+ else {
+ strURL = gbPopupMenuTopicList[fn_arguments[2]].strURL;
+ }
+
+ if (targetDoc != null) {
+ targetDoc.location.href = strURL;
+ }
+ else {
+ if (fn_arguments[1] != null && typeof(fn_arguments[1]) != "undefined")
+ window.open(strURL, fn_arguments[1]);
+ else
+ window.open(strURL);
+ }
+ window.gbInPopupMenu = true;
+ return false;
+ }
+
+ var strMenu = "";
+ if (gbBsNS4&&!gbBsNS6) {
+ strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
+ } else {
+ strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
+ if (gbBsMac) {
+ strMenu += ' CELLPADDING=4';
+ } else {
+ strMenu += ' CELLPADDING=2';
+ }
+ strMenu += ' BGCOLOR=#c0c0c0>';
+ }
+ // Add each of the items
+ var i = 2;
+ while (i <= argLen - 1) {
+ strMenu += '<TR><TD><NOBR>'
+ // If the destination is a number then look it up in the topic list
+ if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
+ strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
+ } else {
+ strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
+ }
+ strMenu += ' onclick="PopupMenu_HandleClick(event);"';
+ strMenu += ' onmouseover="PopupMenu_Over(event);"';
+ strMenu += ' onmouseout="PopupMenu_Out(event);"';
+ strMenu += '>';
+ if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
+ strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
+ } else {
+ strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
+ }
+ strMenu += '</A></DIV></NOBR></TD></TR>';
+
+ if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
+ i += 2;
+ } else {
+ i += 1;
+ }
+ }
+ strMenu += "</TABLE>";
+
+ if (gbBsMac) {
+ // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
+ strMenu +="<TABLE></TABLE>";
+ }
+
+ var layerPopup = null;
+ var stylePopup = null;
+ var nEventX = 0;
+ var nEventY = 0;
+ var nWindowWidth = 0;
+ if (gbBsIE4 || gbBsOpera7) {
+
+ layerPopup = getElement("PopupMenu");
+ layerPopup.innerHTML = strMenu;
+ stylePopup = layerPopup.style;
+
+ _BSPSGetClientSize();
+
+ // Get the position of the item causing the event (relative to its parent)
+ nEventX = window.event.clientX;
+ nEventY = window.event.clientY;
+
+ if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
+ nEventY += document.body.scrollTop + 10;
+ } else {
+ nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
+ }
+ stylePopup.top = nEventY;
+
+ var nPopupWidth = layerPopup.scrollWidth;
+ if (gbBsMac) {
+ nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.
+ }
+ if (nEventX + nPopupWidth + 20 > gBsClientWidth) {
+ if (gBsClientWidth - nPopupWidth < 5) {
+ stylePopup.left = 5;
+ } else {
+ stylePopup.left = gBsClientWidth - nPopupWidth - 5;
+ }
+ } else {
+ stylePopup.left = nEventX + document.body.scrollLeft + 20;
+ }
+
+ stylePopup.visibility = "visible";
+ if (!gOlddocumentClick && document.onclick)
+ gOlddocumentClick = document.onclick;
+ document.onclick = PopupMenu_HandleClick;
+
+ } else if (gbBsNS6 || gbBsKonqueror3||gbBsSafari) {
+ layerPopup = getElement("PopupMenu");
+ layerPopup.style.visibility = "hidden";
+
+ if (gbBsNS6)
+ {
+ var e = fn_arguments[0];
+ nEventX = e.pageX;
+ nEventY = e.pageY;
+ }
+ else
+ {
+ nEventX = window.event.clientX;
+ nEventY = window.event.clientY;
+ }
+ _BSPSGetClientSize();
+ layerPopup.innerHTML = strMenu;
+
+ if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) {
+ nEventY += 20;
+ } else {
+ nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
+ }
+
+ if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
+ if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
+ nEventX = 5;
+ } else {
+ nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
+ }
+ } else {
+ nEventX += 20;
+ }
+ layerPopup.style.top = nEventY;
+ layerPopup.style.left = nEventX;
+ // set again to avoid the stupid frash in netscape 6.
+ layerPopup.innerHTML = strMenu;
+ layerPopup.style.visibility = "visible";
+ //window.captureEvents(Event.MOUSEDOWN);
+ if (!gOlddocumentClick && document.onclick)
+ gOlddocumentClick = document.onclick;
+ window.onclick = PopupMenu_HandleClick;
+ }
+ else if (gbBsNS4) {
+ layerPopup = document.layers.PopupMenu;
+ layerPopup.visibility = "hide";
+ stylePopup = layerPopup.document;
+ stylePopup.write(strMenu);
+ stylePopup.close();
+ var e = fn_arguments[0];
+ nEventX = e.pageX;
+ nEventY = e.pageY;
+ _BSPSGetClientSize();
+ if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
+ nEventY += 20;
+ } else {
+ nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
+ }
+ layerPopup.top = nEventY;
+
+ if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
+ if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
+ nEventX = 5;
+ } else {
+ nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
+ }
+ } else {
+ nEventX += 20;
+ }
+
+ layerPopup.left = nEventX;
+
+ layerPopup.visibility = "show";
+
+ window.captureEvents(Event.MOUSEDOWN);
+ if (!gOlddocumentClick && document.onmousedown)
+ gOlddocumentClick = document.onmousedown;
+ window.onmousedown = PopupMenu_HandleClick;
+ }
+
+ window.gbInPopupMenu = true;
+ window.gbPopupMenuTimeoutExpired = false;
+ setTimeout("PopupMenu_Timeout();", 100);
+ return false;
+}
+
+function PopupMenu_Timeout()
+{
+ window.gbPopupMenuTimeoutExpired = true;
+}
+
+function PopupMenu_Over(e)
+{
+ if (gbBsIE4||gbBsOpera7)
+ e.srcElement.className = "PopupOver";
+ else if (gbBsNS6)
+ e.target.parentNode.className = "PopupOver";
+ return;
+}
+
+function PopupMenu_Out(e)
+{
+ if (gbBsIE4||gbBsOpera7)
+ e.srcElement.className = "PopupNotOver";
+ else if (gbBsNS6)
+ e.target.parentNode.className = "PopupNotOver";
+ return;
+}
+
+function PopupMenu_HandleClick(e)
+{
+ if (window.gbPopupMenuTimeoutExpired) {
+ window.gbInPopupMenu = false;
+ if (gbBsNS4 && !gbBsNS6) {
+ window.releaseEvents(Event.MOUSEDOWN);
+ }
+
+ var layerPopup = null;
+ if (gbBsNS4&&!gbBsNS6) {
+ layerPopup = document.layers.PopupMenu;
+ layerPopup.visibility = "hide";
+ } else {
+ layerPopup = getElement("PopupMenu");
+ layerPopup.style.visibility = "hidden";
+ }
+
+ if (gOlddocumentClick)
+ {
+ if (gbBsNS4 && !gbBsNS6)
+ document.onmousedown = gOlddocumentClick;
+ else
+ document.onclick = gOlddocumentClick;
+ }
+ }
+ return;
+}
+
+function BSSCPopup_ClickMac()
+{
+ if ((!DHTMLPopupSupport()) && (gbBsIE4 || gbBsOpera7))
+ {
+ var bClickOnAnchor = false;
+ var el;
+ if ((window.event != null) &&
+ (window.event.srcElement != null))
+ {
+ el = window.event.srcElement;
+ while (el != null)
+ {
+ if ((el.tagName == "A") || (el.tagName == "AREA")) {
+ bClickOnAnchor = true;
+ break;
+ }
+ if (el.tagName == "BODY") {
+ break;
+ }
+ el = getParentNode(el);
+ }
+ }
+ if (BSSCPopup_IsPopup())
+ {
+ if (!bClickOnAnchor) {
+ parent.window.gPopupWindow = null;
+ self.close();
+ }
+ }
+ else
+ {
+ bClosePopupWindow = true;
+ if ((bClickOnAnchor) &&
+ (el.href) &&
+ ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))
+ {
+ bClosePopupWindow = false;
+ }
+ if (bClosePopupWindow)
+ {
+ if (window.gPopupWindow != null && !window.gPopupWindow.closed )
+ {
+ window.gPopupWindow.close();
+ }
+ }
+ }
+ }
+}
+
+function BsPopupOnClick()
+{
+ if (!gbBsIE4 && !gbBsOpera7)
+ return;
+
+ BSSCPopup_ClickMac();
+}
+
+function _BSSCOnError(message)
+{
+ if(-1 != message.indexOf("denied")
+ || -1 != message.indexOf("Object required"))
+ return true;
+}
+
+//End to support previous relative topics
+
+/// Section End - General and relative topics (JavaScript 1.0)
+
+/// Section Begin - Popup (JavaScript 1.0)
+//Begin to support previous popup functions
+
+//variables used to isolate the browser type
+var gBsStyVisShow = null;
+var gBsStyVisHide = null;
+var gBsClientWidth = 640;
+var gBsClientHeight = 480;
+
+// here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
+var gBRateH_W = 0.618; // 1.618 Golden cut.
+var gBMaxXOfParent = 0.8;
+var gBMaxYOfParent = 0.8;
+var gBscrollHeight = 16;
+var gBscrollWidth = 16;
+var gBpermitXDelta = 3;
+var gBpermitYDelta = 3;
+
+
+var arrayPopupURL = new Array();
+var arrayAbsPopupURL = new Array();
+
+var arrayDirty = new Array();
+
+function setAbsPopupURL(nIndex, strURL)
+{
+ arrayAbsPopupURL[nIndex] = strURL;
+}
+
+function getAbsPopupURL(nIndex)
+{
+ if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;
+ else
+ return arrayAbsPopupURL[nIndex];
+}
+
+function getPopupURL(nIndex)
+{
+ if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;
+ else
+ return arrayPopupURL[nIndex];
+}
+
+function getPopupID(nIndex)
+{
+ return gstrPopupID + nIndex;
+}
+
+function getPopupShadowID(nIndex)
+{
+ return gstrPopupShadowID + nIndex;
+}
+
+function getPopupTopicID(nIndex)
+{
+ return gstrPopupTopicID + nIndex;
+}
+
+function getPopupIFrameID(nIndex)
+{
+ return gstrPopupIFrameID + nIndex;
+}
+
+function getPopupIFrameName(nIndex)
+{
+ return gstrPopupIFrameName + nIndex;
+}
+
+
+function getPopupTopicStyle(nIndex)
+{
+ return getElement(getPopupTopicID(nIndex)).style;
+}
+
+function getPopupShadowStyle(nIndex)
+{
+ return getElement(getPopupShadowID(nIndex)).style;
+}
+
+function getPopupIFrame(nIndex)
+{
+ if (gbBsNS6)
+ return eval("window.frames['" + getPopupIFrameName(nIndex) + "']");
+ else
+ return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");
+}
+
+function getPopupDivStyle(nIndex)
+{
+ return getElement(getPopupID(nIndex)).style;
+}
+
+function getPopupIFrameStyle(nIndex)
+{
+ return getElement(getPopupIFrameID(nIndex)).style;
+}
+
+
+function findDiv(strURL)
+{
+ for (var i = 0; i < arrayPopupURL.length; i ++ ) {
+ if (arrayPopupURL[i] == strURL) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+var gnToken = -1;
+function takeToken()
+{
+ gnToken ++;
+ if (gnToken > 10000) gnToken = 0;
+ return gnToken;
+}
+
+function IsValidToken(nToken)
+{
+ return (gnToken == nToken);
+}
+
+function addDiv(strURL)
+{
+ for (var i = 0; i < arrayPopupURL.length; i ++) {
+ if (arrayPopupURL[i] == null) {
+ arrayPopupURL[i] = strURL;
+ return i;
+ }
+ }
+ arrayPopupURL[i] = strURL;
+ arrayDirty[i] = true;
+ return i;
+}
+
+function setDirty()
+{
+ for (var i = 0; i < arrayPopupURL.length; i ++ )
+ arrayDirty[i] = true;
+}
+
+function IsDirty(nIndex)
+{
+ if (nIndex == -1)
+ return true;
+ else
+ if (arrayDirty.length > nIndex)
+ return arrayDirty[nIndex];
+ else
+ return true;
+}
+
+function hideAll()
+{
+ for (var i = 0; i < arrayPopupURL.length; i ++ )
+ {
+ getPopupDivStyle(i).visibility = gBsStyVisHide;
+ getPopupIFrameStyle(i).visibility = gBsStyVisHide;
+ }
+}
+
+function getCurrentPopupIFrame()
+{
+ for (var i = 0; i < arrayPopupURL.length; i ++)
+ if (getPopupDivStyle(i).visibility == gBsStyVisShow)
+ return getPopupIFrame(i);
+ return null;
+}
+
+function setClear(nIndex)
+{
+ if (nIndex != -1)
+ arrayDirty[nIndex] = false;
+}
+
+function _BSSCCreatePopupDiv(strURL)
+{
+ var nIndex = findDiv(strURL);
+ if (nIndex == -1 ) {
+ nIndex = addDiv(strURL);
+ BsPopup_CreateDiv(nIndex);
+ }
+ else {
+ if (IsDirty(nIndex)) {
+ if("object" == typeof(getPopupIFrame(nIndex).document))
+ getPopupIFrame(nIndex).document.location.href = strURL;
+ }
+ }
+ return nIndex;
+}
+
+//Here is the browser type
+function _BSPSGetBrowserInfo()
+{
+ if (gbBsNS4&&!gbBsNS6)
+ {
+ gBsStyVisShow = "show";
+ gBsStyVisHide = "hide";
+ }
+ else
+ {
+ gBsStyVisShow = "visible";
+ gBsStyVisHide = "hidden";
+ }
+}
+
+_BSPSGetBrowserInfo();
+
+//Get client size info
+function _BSPSGetClientSize()
+{
+ if (gbBsNS4||gbBsKonqueror3||gbBsSafari)
+ {
+ gBsClientWidth = innerWidth;
+ gBsClientHeight = innerHeight;
+ }
+ else if (gbBsIE4 || gbBsOpera7)
+ {
+ gBsClientWidth = document.body.clientWidth;
+ gBsClientHeight = document.body.clientHeight;
+ }
+}
+
+var gstrPopupID = 'BSSCPopup';
+var gstrPopupShadowID = 'BSSCPopupShadow';
+var gstrPopupTopicID = 'BSSCPopupTopic';
+var gstrPopupIFrameID = 'BSSCPopupIFrame';
+var gstrPopupIFrameName = 'BSSCPopupIFrameName';
+
+var gstrPopupSecondWindowName = 'BSSCPopup';
+
+var gPopupWindow = null;
+var gnPopupClickX = 0;
+var gnPopupClickY = 0;
+
+var gnPopupScreenClickX = 0;
+var gnPopupScreenClickY = 0;
+
+var gbPopupTimeoutExpired = false;
+
+function DHTMLPopupSupport()
+{
+ if (((gbBsIE4) && (!gbBsMac))||gbBsOpera7|| gbBsNS7) {
+ return true;
+ }
+ return false;
+}
+
+function BSSCPopup_IsPopup()
+{
+ if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) {
+ return true;
+ } else if ((gbBsNS4 || gbBsIE4 || gbBsOpera7) && (this.name.indexOf(gstrPopupID) != -1)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+// If there is a hyperlink in a popup window, display the hyperlink in
+// the original window. (bsscright)
+if (BSSCPopup_IsPopup() && !gbBsIE4 && !gbBsOpera7) {
+ document.write("<base target=\"bsscright\">");
+}
+
+// Local functions.
+function BsPopup_CreateDiv(nIndex)
+{
+ if(!DHTMLPopupSupport())
+ return;
+ // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone.
+ var strPopupDiv = "<DIV ID='" + getPopupID(nIndex) + "' STYLE='position:absolute; top:-100; left:0; z-index:600; visibility:hidden;'>";
+ strPopupDiv += "<DIV ID='" + getPopupShadowID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#C0C0C0;\"></DIV>";
+ strPopupDiv += "<DIV ID='" + getPopupTopicID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#FFFFFF;border:1px #000000 outset;\">";
+ strPopupDiv += "<IFRAME title=\"Popup Window\" ID='" + getPopupIFrameID(nIndex) + "' name='" + getPopupIFrameName(nIndex) + "' src = '" + getPopupURL(nIndex) + "' frameborder=0 scrolling=auto></IFRAME>";
+ strPopupDiv += "</DIV></DIV>";
+
+ var objBody = getElementsByTag(document, "BODY")[0];
+ if( typeof(objBody) != "object" )
+ return;
+
+ insertAdjacentHTML(objBody, "beforeEnd", strPopupDiv);
+}
+
+function handleLoadNS()
+{
+ if (this.id)
+ {
+ var nIndex = parseInt(this.id.substring(gstrPopupIFrameID.length));
+ BSSCPopup_PostWork(nIndex);
+ }
+}
+
+function BSSCPopup_PostWork(nIndex)
+{
+ getPopupDivStyle(nIndex).visibility = gBsStyVisShow;
+ getPopupIFrameStyle(nIndex).visibility =gBsStyVisShow;
+
+ setClear(nIndex);
+ window.gbPopupTimeoutExpired = true;
+
+ BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document);
+ if (gbBsNS6)
+ getPopupIFrame(nIndex).document.body.addEventListener("click",BSSCPopupClicked,false);
+ else
+ getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked;
+
+ if (!gbOrignalOnMouseDown && document.onmousedown)
+ gbOrignalOnMouseDown = document.onmousedown;
+
+ if (gbBsNS6)
+ document.addEventListener("mousedown", BSSCPopupParentClicked,false);
+ else
+ document.onmousedown = BSSCPopupParentClicked;
+}
+
+function BSSCPopup_Timeout(nIndex, nToken)
+{
+ if (!IsValidToken(nToken)) return;
+
+ if (gbBsNS6||((getPopupIFrame(nIndex).document.readyState == "complete") &&
+ (getPopupIFrame(nIndex).document.body != null))) {
+ BSSCPopup_PostWork(nIndex);
+ } else {
+ setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100);
+ }
+}
+
+// VH 08/10/00
+// do not change target to parent if the href is using javascript
+function BSSCPopup_ChangeTargettoParent(tagsObject)
+{
+ var collA = getElementsByTag(tagsObject, "A");
+ BSSCPopup_ChangeTargettoParent2(collA);
+
+ var collIMG = getElementsByTag(tagsObject,"IMG");
+ BSSCPopup_ChangeTargettoParent2(collIMG);
+}
+
+function BSSCPopup_ChangeTargettoParent2(colls)
+{
+ if (colls != null) {
+ for (var j = 0; j < colls.length; j ++ )
+ {
+ var strtemp = colls[j].href;
+ if (strtemp)
+ {
+ strtemp = strtemp.toLowerCase();
+ if (strtemp.indexOf("javascript:") == -1)
+ if (colls[j].target == "")
+ colls[j].target = "_parent";
+ }
+ }
+ }
+}
+
+function BSPSPopupTopicWinHelp(strURL)
+{
+ _BSSCPopup(strURL);
+ return;
+}
+
+function _BSSCPopup(strURL, width, height)
+{
+ var cuswidth = 0;
+ var cusheight = 0;
+ if ("undefined" != typeof(width) && "undefined" != typeof(height)) {
+ cuswidth = width;
+ cusheight= height;
+ }
+
+ if (DHTMLPopupSupport()) {
+ var nToken = takeToken(); // take token first.
+ var nIndex = _BSSCCreatePopupDiv(strURL);
+ window.gbPopupTimeoutExpired = false;
+ var ntWidth = gBsClientWidth;
+ var ntHeight = gBsClientHeight;
+ _BSPSGetClientSize();
+ if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) {
+ setDirty();
+ }
+
+ if (IsDirty(nIndex)) {
+ if (gbBsMac) {
+ setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight +")", 400);
+ } else {
+ setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100);
+ }
+ }
+ else {
+ MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight);
+ }
+ } else {
+ _BSSCPopup2(strURL, cuswidth, cusheight);
+ }
+ return;
+}
+
+if (gbBsIE55)
+{
+ var ehlpdhtm_fOldBefureUnload = window.onbeforeunload;
+ var gnBsUnload=0;
+ window.onbeforeunload = window_BUnload;
+}
+
+function window_BUnload()
+{
+ gnBsUnload++;
+ if (gnBsUnload>1)
+ return;
+ for (var i = 0; i < arrayPopupURL.length; i ++)
+ removeThis(document.all(getPopupID(i)));
+ arrayPopupURL.length = 0;
+ if (ehlpdhtm_fOldBefureUnload)
+ ehlpdhtm_fOldBefureUnload();
+}
+
+function _BSSCPopup2(strURL, width, height)
+{
+ if (gbBsOpera6&&gbBsMac)
+ {
+ var wmTemp = window.open(document.location.href, gstrPopupSecondWindowName);
+ wmTemp.close();
+ setTimeout("_BSSCPopup3(\""+strURL+"\","+width+","+height+");",100);
+ }
+ else
+ _BSSCPopup3(strURL, width, height);
+}
+
+function _BSSCPopup3(strURL, width, height)
+{
+ if (window.name == gstrPopupSecondWindowName) {
+ window.location = strURL;
+ } else {
+ if (!gbBsMac || !gbBsNS4) {
+ BSSCHidePopupWindow();
+ }
+ var nX = 0;
+ var nY = 0;
+ var nHeight = 300;
+ var nWidth = 400;
+ if (width > 0 && height > 0) {
+ nHeight = height;
+ nWidth = width;
+ }
+ _BSPSGetClientSize();
+
+ 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 (gbBsNS) {
+ if (gbBsNS6) {
+ strParam += ",Height=" + nHeight + ",Width=" + nWidth;
+ strParam += ",screenX=" + nX + ",screenY=" + nY;
+ strParam += ",dependent=yes";
+ }
+ 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;
+ }
+ if (gbBsSafari)
+ {
+ if (window.gPopupWindow)
+ window.gPopupWindow.close();
+ window.gPopupWindow = window.open(strURL, "", strParam);
+ window.gPopupWindow.name = gstrPopupSecondWindowName;
+ window.gPopupWindow.moveTo(nX, nY);
+ widnow.gPopupWindow.document.location.reload();
+ }
+ else
+ {
+ var wmTemp=null;
+ if (gbBsKonqueror3)
+ {
+ if (window.gPopupWindow)
+ window.gPopupWindow.close();
+ }
+ if (gbBsOpera&&gbBsMac)
+ {
+ wmTemp= window.open(document.location.href, "Temp", strParam);
+ }
+ window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
+ if (!gbBsIE)
+ window.gPopupWindow.focus();
+
+ if (wmTemp)
+ wmTemp.close();
+ }
+
+ if (gbBsNS4)
+ setEventHandle();
+ else if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3)
+ setTimeout("setPopupFocus();", 100);
+ }
+ return;
+}
+
+function setEventHandle()
+{
+ window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUR);
+ window.gPopupWindow.onclick = NonIEPopup_HandleClick;
+ window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
+}
+
+function setPopupFocus()
+{
+ window.gPopupWindow.focus();
+}
+
+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)
+ {
+ if(e.target.href.indexOf("javascript:")==-1)
+ {
+ if (e.target.target=="")
+ window.location.href = e.target.href;
+ else
+ window.open(e.target.href, e.target.target);
+ this.close();
+ }
+ }
+ else
+ this.close();
+ return false;
+}
+
+function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight)
+{
+ if (!window.getPopupIFrame(nIndex).document) {
+ _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight);
+ return;
+ }
+
+ if (!IsValidToken(nToken)) return;
+
+ if (gbBsNS6)
+ {
+ setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
+ BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
+ return;
+ }
+
+ if ((window.getPopupIFrame(nIndex).document.readyState == "complete") &&
+ (window.getPopupIFrame(nIndex).document.body != null)) {
+ if (window.getPopupIFrame(nIndex).document.location.href.indexOf("about:blank") != -1) { // add this check. IE will use about:blank" as the default vaule for Iframe.
+ window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
+ setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
+ }
+ else
+ {
+ setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
+ BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
+ }
+ } else {
+ setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
+ }
+}
+
+function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight)
+{
+ if (window.gbPopupTimeoutExpired) return;
+
+ if (!IsValidToken(nToken)) return;
+
+ getPopupDivStyle(nIndex).visibility = gBsStyVisHide;
+ getPopupIFrameStyle(nIndex).visibility = gBsStyVisHide;
+
+ // Determine the width and height for the window
+ _BSPSGetClientSize();
+
+ var size = new BSSCSize(0, 0);
+
+ if (cuswidth <= 0 || cusheight <= 0)
+ BSSCGetContentSize(window.getPopupIFrame(nIndex), size);
+ else {
+ size.x = cuswidth;
+ size.y = cusheight;
+ }
+
+ // Determine the width and height for the window
+ var nWidth = size.x;
+ var nHeight = size.y;
+
+ // for small popup size, we should allow any size.
+ // The popup size should be ok if bigger than 0
+ if (nWidth < 0 || nHeight < 0) return; // there must be something terribly wrong.
+
+ getPopupDivStyle(nIndex).width = nWidth;
+ getPopupDivStyle(nIndex).height = nHeight;
+
+ getPopupShadowStyle(nIndex).width = nWidth;
+ getPopupShadowStyle(nIndex).height = nHeight;
+ getPopupTopicStyle(nIndex).width = nWidth;
+ getPopupTopicStyle(nIndex).height = nHeight;
+ if (gbBsIE55)
+ {
+ getPopupShadowStyle(nIndex).width = nWidth + 2;
+ getPopupShadowStyle(nIndex).height = nHeight + 2;
+ getPopupTopicStyle(nIndex).width = nWidth + 2;
+ getPopupTopicStyle(nIndex).height = nHeight + 2;
+ }
+
+ getPopupIFrameStyle(nIndex).width = nWidth;
+ getPopupIFrameStyle(nIndex).height = nHeight;
+ if (gbBsIE55 || gbBsNS6)
+ {
+ getPopupIFrameStyle(nIndex).top = 0;
+ getPopupIFrameStyle(nIndex).left = 0;
+ }
+
+ var strURL = getPopupURL(nIndex);
+ if (strURL.indexOf("#") != -1&&gbBsNS6)
+ getPopupIFrame(nIndex).location.reload();
+ else if (strURL.indexOf("#") != -1||gbBsNS6)
+ getPopupIFrame(nIndex).location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5.
+
+ MoveDivAndShow(nIndex, nToken, cuswidth, cusheight);
+}
+
+function getScrollLeft()
+{
+ if (document.body.scrollLeft)
+ return document.body.scrollLeft;
+ else if (window.pageXOffset)
+ return window.pageXOffset;
+ else
+ return 0;
+}
+
+function getScrollTop()
+{
+ if (document.body.scrollTop)
+ return document.body.scrollTop;
+ else if (window.pageYOffset)
+ return window.pageYOffset;
+ else
+ return 0;
+}
+
+
+function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight)
+{
+ if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again.
+ window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
+ setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
+ return;
+ }
+
+ // Determine the position of the window
+ var nClickX = window.gnPopupClickX;
+ var nClickY = window.gnPopupClickY;
+ var nTop = 0;
+ var nLeft = 0;
+
+ var nWidth = parseInt(getPopupDivStyle(nIndex).width);
+ var nHeight = parseInt(getPopupDivStyle(nIndex).height);
+
+ if (nClickY + nHeight + 20 < gBsClientHeight + getScrollTop()) {
+ nTop = nClickY + 10;
+ } else {
+ nTop = (getScrollTop() + gBsClientHeight) - nHeight - 20;
+ }
+ if (nClickX + nWidth < gBsClientWidth + getScrollLeft()) {
+ nLeft = nClickX;
+ } else {
+ nLeft = (getScrollLeft() + gBsClientWidth) - nWidth - 8;
+ }
+
+ if (nTop < getScrollTop()) nTop = getScrollTop() + 1;
+ if (nLeft< getScrollLeft()) nLeft = getScrollLeft() + 1;
+
+ getPopupDivStyle(nIndex).left = nLeft;
+ getPopupDivStyle(nIndex).top = nTop;
+
+ // Set the location of the background blocks
+ getPopupShadowStyle(nIndex).left = 6;
+ getPopupShadowStyle(nIndex).top = 6;
+ if (gbBsIE55)
+ {
+ getPopupShadowStyle(nIndex).left = 4;
+ getPopupShadowStyle(nIndex).top = 4;
+ }
+
+ if (gbBsMac&&gbBsIE4) {
+ // Total hack on the iMac to get the IFrame to position properly
+ getPopupIFrameStyle(nIndex).pixelLeft = 100;
+ getPopupIFrameStyle(nIndex).pixelLeft = 0;
+ // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
+ getPopupIFrame(nIndex).window.BSSCOnLoad();
+ }
+
+ if (gbBsNS6&&IsDirty(nIndex))
+ getElement(getPopupIFrameID(nIndex)).addEventListener("load", handleLoadNS, false);
+ else
+ BSSCPopup_Timeout(nIndex , nToken );
+ return;
+}
+
+function BSSCSize(x, y)
+{
+ this.x = x;
+ this.y = y;
+}
+
+function BSSCGetContentSize(thisWindow, size)
+{
+ if (!gbBsIE4 && !gbBsOpera7 && !gbBsNS4)
+ return;
+
+ if ((gbBsMac&&gbBsIE4)||gbBsNS4||gbBsOpera7) {
+ size.x = 320;
+ size.y = 180;
+ 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)
+ if (!gbBsIE5)
+ 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;
+ thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.
+ }
+ 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;
+ }
+ size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
+ size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;
+ thisWindow.document.body.scroll = 'no';
+ }
+ }
+ else {
+ if (thisWindow.document.body.scrollWidth > maxgoldx) {
+ size.x = maxx;
+ size.y = miny;
+ thisWindow.document.body.scroll = 'yes';
+ }
+ else {
+ // downsize from maxgoldx , now I try to using binary divide.
+ x = maxgoldx;
+ deltax = -maxgoldx/2;
+ 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;
+ }
+ size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
+ size.y = thisWindow.document.body.scrollHeight ;
+ thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
+ thisWindow.resizeTo(size.x, size.y);
+ if (thisWindow.document.body.scrollWidth > size.x)
+ {
+ size.x = thisWindow.document.body.scrollWidth;
+ }
+ if (thisWindow.document.body.scrollHeight > size.y)
+ {
+ size.y = thisWindow.document.body.scrollHeight;
+ }
+ }
+ }
+ thisWindow.resizeTo(size.x, size.y);
+ thisWindow.resizeTo(size.x, size.y);
+ return;
+}
+
+function BSSCPopupParentClicked()
+{
+ if (!window.gbPopupTimeoutExpired) {
+ return false;
+ }
+
+ document.onmousedown = gbOrignalOnMouseDown;
+
+ // Simply hide the popup
+ hideAll();
+
+ window.gbPopupTimeoutExpired = false;
+
+ return true;
+}
+
+function isInsideHyperLink(obj)
+{
+ if (obj&&obj!=getParentNode(obj))
+ {
+ if (obj.tagName=="A"||obj.tagName=="IMG")
+ return true;
+ else
+ return isInsideHyperLink(getParentNode(obj));
+ }
+ else
+ return false;
+}
+
+function BSSCPopupClicked(e)
+{
+ if (!window.gbPopupTimeoutExpired) {
+ return false;
+ }
+
+ var popupIFrame = getCurrentPopupIFrame();
+ if (popupIFrame == null) {
+ return true;
+ }
+
+ if (gbBsIE4 && (!((popupIFrame.window.event != null) &&
+ (popupIFrame.window.event.srcElement != null) &&
+ isInsideHyperLink(popupIFrame.window.event.srcElement)))) {
+ document.onmousedown = gbOrignalOnMouseDown;
+
+ // Simply hide the popup
+ hideAll();
+ window.gbPopupTimeoutExpired = false;
+ return true;
+ }
+ else if (gbBsNS6 && (!((e != null) &&
+ (e.target!= null) && isInsideHyperLink(e.target))))
+ {
+ document.addEventListener("mousedown", gbOrignalOnMouseDown,false);
+ // Simply hide the popup
+ hideAll();
+ window.gbPopupTimeoutExpired = false;
+ return true;
+ }
+}
+
+//trace the mouse over's position for hotspot
+function BSPSPopupOnMouseOver(event)
+{
+ if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) {
+ window.gnPopupClickX = event.clientX + getScrollLeft();
+ window.gnPopupClickY = event.clientY + getScrollTop();
+ window.gnPopupScreenClickX = event.screenX;
+ window.gnPopupScreenClickY = event.screenY;
+ } else if (gbBsSafari) {
+ window.gnPopupClickX = event.clientX + getScrollLeft();
+ window.gnPopupClickY = event.clientY + getScrollTop();
+ window.gnPopupScreenClickX = event.screenX + window.screenX;
+ window.gnPopupScreenClickY = event.screenY + window.screenY;
+ } else if (gbBsNS4) {
+ window.gnPopupClickX = event.pageX - window.pageXOffset;
+ window.gnPopupClickY = event.pageY - window.pageYOffset;
+ window.gnPopupScreenClickX = event.screenX - window.pageXOffset;
+ window.gnPopupScreenClickY = event.screenY - window.pageYOffset;
+ }
+}
+
+function BSSCHidePopupWindow()
+{
+ if (window.gPopupWindow != null) {
+ if (gbBsNS4) {
+ if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
+ window.gPopupWindow.close();
+ window.gPopupWindow = null;
+ }
+ }
+ }
+ return;
+}
+
+// Add the PopupOnClick to the onclick array.
+if (typeof(BsscRegisterOnClick) != "undefined")
+{
+ BsscRegisterOnClick(BsPopupOnClick);
+}
+//End to support previous popup functions
+
+/// Section End - Popup (JavaScript 1.0)
+
+/// Section Begin - Embedded Stub (JavaScript 1.0)
+
+function BSSCCreatePopupDiv()
+{
+ return;
+}
+
+function WritePopupMenuLayer()
+{
+ if (BsscHasExtJs()) {_WritePopupMenuLayer();}
+}
+
+function BSSCPopup(strURL, width, height)
+{
+ var re = new RegExp("'", 'g');
+ strURL = strURL.replace(re, "%27");
+
+ if (BsscHasExtJs()) {
+ _BSSCPopup(strURL, width, height);
+ }else{
+ //Create a temporary window first to ensure the real popup comes up on top
+ var wndTemp = null;
+ if (!gbBsNS3) {
+ wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
+ }
+ // Create the real popup window
+ var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
+ // Close the temporary
+ if (!gbBsNS3) {
+ wndTemp.close();
+ } else {
+ wndPopup.focus();
+ }
+ }
+}
+
+var gbWndTemp = null, gbWndPopupLinks = null;
+var gbstrParaTotal = "";
+
+function PopupMenu_Invoke()
+{
+ if (typeof(wfRelatedTopic) == 'function' && typeof(IsFlashSupported) == 'function')
+ {
+ if (Number(gsSkinVersion) > 2 && IsFlashSupported())
+ {
+ return wfRelatedTopic(PopupMenu_Invoke.arguments);
+ }
+ }
+ if (BsscHasExtJs()) {
+ return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
+ }
+ if (gbBsNS3Before || gbBsIE3Before ) {
+ var argLen = PopupMenu_Invoke.arguments.length;
+ if (argLen < 5) {
+ window.document.location.href = PopupMenu_Invoke.arguments[3];
+ return false;
+ }
+ gbWndTemp = null;
+ gbWndPopupLinks = null;
+ gbstrParaTotal = "";
+ for (var i = 0; i < (argLen - 2) / 2; i++) {
+ var strParaLine = "";
+ if (gbBsNS2){
+ strParaLine += "<a href=\"";
+ strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
+ strParaLine += "\">"
+ strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
+ strParaLine += "</a>";
+ } else {
+ strParaLine += "<a href=\"javascript:";
+ strParaLine += "gotoUrl(\'";
+ strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
+ strParaLine += "\');\"";
+ if (PopupMenu_Invoke.arguments[1] != '') {
+ strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
+ }
+ strParaLine += ">";
+ strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
+ strParaLine += "</a>";
+ }
+ strParaLine += "<br>";
+ gbstrParaTotal += strParaLine;
+ }
+ var nHeight = argLen * 15;
+ var nWidth = 400;
+ var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
+ strParam += ",height=" + nHeight + ",width=200,resizable";
+
+ //Create a temporary window first to ensure the real popup comes up on top
+ //var wndTemp = null;
+ if (!gbBsNS3) {
+ gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
+ }
+ gbWndPopupLinks = window.open("", "popuplinks", strParam);
+
+ setTimeout("Wait_PopupMenuReady()", 100);
+ }
+ return true;
+}
+
+function Wait_PopupMenuReady()
+{
+ if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
+ PopupMenu_InvokeReady();
+ }
+ else
+ setTimeout("Wait_PopupMenuReady()", 100);
+}
+
+function PopupMenu_InvokeReady()
+{
+ if (gbWndPopupLinks != null) {
+ gbWndPopupLinks.document.open("text/html");
+ gbWndPopupLinks.document.write("<html><head>");
+ if (gbBsNS2) {
+ gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
+ } else {
+ //YJ: IE301,302 and NS3.x works fine
+ gbWndPopupLinks.document.write("<");
+ gbWndPopupLinks.document.write("script>");
+ gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
+ gbWndPopupLinks.document.write("<");
+ gbWndPopupLinks.document.write("/script>");
+ }
+ gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
+ gbWndPopupLinks.document.write(gbstrParaTotal);
+ gbWndPopupLinks.document.write("</body></html>");
+ gbWndPopupLinks.document.close();
+
+ // Close the temporary
+ if (!gbBsNS3 && gbWndTemp != null) {
+ gbWndTemp.close();
+ }else {
+ gbWndPopupLinks.focus();
+ }
+
+ return true;
+ }
+ return false;
+}
+
+/// Section End - Embedded Stub (JavaScript 1.0)
+
+//// Segment End -- (JavaScript 1.0)
+
+//// Segment Begin -- (JavaScript 1.2)
+/// Section Begin - kadov DHTM (JavaScript 1.2)
+
+//Begin to support extended and dropdown text effects.
+function kadovIsParagraph(el)
+{
+ return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;
+}
+
+function kadovInitEachChild(el)
+{
+ for(var i=0; i<getChildNodes(el).length; i++)
+ {
+ var child = getChildNodes(el)[i];
+ if( child.tagName == "SCRIPT" || child.tagName == "!" )
+ continue;
+
+ if( child.id != "" )
+ {
+ // to wipe out the onload effects
+ if (gbBsIE4&&!gbBsMac)
+ {
+ var onLoadEffect = child.style.getAttribute( "x-on-pageload" );
+ if( (onLoadEffect != null) && (onLoadEffect > "") )
+ child.style.setAttribute( "x-on-pageload", "" );
+ }
+
+ var href = child.getAttribute("href")
+ if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 )
+ kadovFilePopupInit(child.id); // Init for Popup
+ else if( child.className == "dropspot" || child.className == "expandspot" ||
+ child.className == "glossterm" )
+ kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text
+ else if( child.className == "trigger")
+ kadovInitTrigger(child.id);// Init for Trigger
+ else
+ {
+ kadovInitEffects(child.id);// Init for DHTML effects
+ CEngine.SetOneTargetInitialState( child.id );
+ }
+ }
+
+ if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") )
+ child.start = "mouseover";// to start a AVI file. fileopen doesn't work
+
+ kadovInitEachChild(child);
+ }
+}
+
+function kadovRetrieveTextInner(el)
+{
+ var x = "";
+ if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" ))
+ return x;
+
+ if( kadovIsParagraph(el) )
+ {
+ var strNewID = " ";
+ if( el.id != "" )
+ strNewID += "id=" + el.id + "_NewSpan ";
+ x = "<span" + strNewID + "style='" + el.style.cssText + "'>" + el.innerHTML + "</span>";
+ }
+ else
+ {
+ for(var i=0; i<getChildNodes(el).length; i++)
+ x += kadovRetrieveTextInner( getChildNodes(el)[i] );
+ }
+ return x;
+}
+
+function kadovRetrieveCleanHTML( strRawHTML, strTagOpen, strTagClose, nDistance )
+{
+ var nTagOpen = strRawHTML.indexOf( strTagOpen, 0 );
+ if( nTagOpen < 0 )
+ return strRawHTML;
+
+ var nTagClose = strRawHTML.indexOf( strTagClose, nTagOpen);
+ if( nTagClose < nTagOpen )
+ return strRawHTML;
+
+ if( typeof(nDistance) == "number" && nDistance > 0 )
+ if( (nTagClose - nTagOpen) != nDistance )
+ return strRawHTML;
+
+ var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ;
+ return kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose );
+}
+
+function kadovAdjustObjectTag(strRawHTML, nStartPos)
+{// adjust object tag for related topics HTML control, because innerHTML misses out the item settings
+
+ //Is there any DTC?
+ var strDTCTagOpen = '<!--Metadata type="DesignerControl" startspan';
+ var strDTCTagClose = '<!--Metadata type="DesignerControl" endspan-->';
+ var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos );
+ if( nDTCTagOpen < 0 )
+ return strRawHTML;
+ var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen );
+ if( nDTCTagClose < nDTCTagOpen)
+ return strRawHTML; // no Design Time Controls;
+
+ //Is the DTC HTML Help Control?
+ var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11';
+ var strRTObjTagClose = '</OBJECT>';
+ var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen );
+ if( nRTObjTagOpen < nDTCTagOpen )
+ return strRawHTML;
+ var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen );
+ if( nRTObjTagClose < nRTObjTagOpen )
+ return strRawHTML; // is not a HTML help control
+
+ // Is it a related Topics html help control?
+ var strRTObjLabel = '<PARAM NAME=\"Command\" VALUE=\"Related Topics';
+ if( strRawHTML.indexOf(strRTObjLabel, nRTObjTagOpen) < 0 )
+ return strRawHTML;
+
+ // does the commented object tag contain a items parameters
+ var strRTItemsOpen = '<param name="Items" value="';
+ var strRTItemsClose = '$$**$$" >';
+ var strRTItemsClose2 = '$$**$$">';
+
+ var nRTItemsOpen = strRawHTML.indexOf(strRTItemsOpen, nDTCTagOpen);
+ if( nRTItemsOpen < nDTCTagOpen )
+ return strRawHTML;
+ var nRTItemsClose = strRawHTML.indexOf(strRTItemsClose, nRTItemsOpen);
+ if (nRTItemsClose == -1)
+ nRTItemsClose = strRawHTML.indexOf(strRTItemsClose2, nRTItemsOpen);
+ if( nRTItemsClose < nRTItemsOpen )
+ return strRawHTML;
+
+ // found a items string
+ var strItems = strRawHTML.substring( nRTItemsOpen + strRTItemsOpen.length, nRTItemsClose);
+ if( strItems.length < 1 )
+ return strRawHTML;
+
+ // to reconstruct the item(s) param tag(s)
+ var strItemsArray = strItems.split('$$**$$');
+ if( strItemsArray.length < 1 )
+ return strRawHTML;
+ var strRunTimeItemParam = "";
+ for( var i = 0; i < strItemsArray.length; i++ )
+ {
+ strRunTimeItemParam += '<PARAM NAME="Item' + (i+1);
+ strRunTimeItemParam += '"' + ' VALUE="';
+ strRunTimeItemParam += strItemsArray[i];
+ strRunTimeItemParam += '">';
+ }
+
+ // to insert the reconstructed item params into runtime object tag
+ var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length);
+ return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length);
+}
+
+function kadovTextPopupOnLoad( el )
+{
+ if( typeof(el) == "string" )
+ el = getElement(el);
+
+ var src = el.getAttribute( "x-use-popup" );
+ var bNeedMove=true;
+ if(!src&&el.id)
+ {
+ for (var i=0;i<gPopupData.length;i++)
+ if (gPopupData[i].el==el.id)
+ {
+ src=gPopupData[i].popupId;
+ bNeedMove=false;
+ break;
+ }
+ }
+ if(!src)
+ src = el.style.getAttribute( "x-use-popup" );
+ if (!src)
+ return 0;
+
+ var name = src;
+ if( src.substr(0,1) == "#" )
+ name = src.substr(1, src.length-1);
+ var srcDiv = getElement(name);
+ if( !srcDiv )
+ return 1;
+
+ if (bNeedMove)
+ {
+ var type = el.getAttribute( "x-popup-type" );
+ if (!type)
+ type = el.style.getAttribute("x-popup-type");
+ if (!type)
+ return 1;
+ var setup = el.getAttribute( "x-tmp-setup" );
+ var newId = name;
+ if( newId.indexOf( "_tmp") <= 0 )
+ newId += "_tmp";
+
+ if( !setup)
+ {
+ el.setAttribute( "x-tmp-setup", 1 );
+
+ if( type == "pulldown" )
+ {
+ var strAdjust = kadovAdjustObjectTag(srcDiv.innerHTML,0);
+ var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
+ strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
+
+ //work around the bug in HH.exe that highlight the phrases when use Search tab
+ //this approach is just removing the <FONT...> tag inserted by Microsoft in the runtime
+ strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<FONT color=#", "\">", 52);
+
+ var strStyle = " style='display:none; position:relative;";
+ var newDiv = "<div class=droptext id=" + newId + strStyle + "'>" + strCleanHTML + "</div>";
+
+ removeThis(srcDiv); // empty the original DIV tag
+ var elParentPra = kadovFindParentParagraph(el);
+ if( elParentPra )
+ insertAdjacentHTML(elParentPra, "afterEnd", newDiv );
+ }
+ else if( type == "expanding" )
+ {
+ var inner = kadovRetrieveTextInner(srcDiv);
+ if( inner == "" )
+ inner = srcDiv.innerHTML;
+ var strAdjust = kadovAdjustObjectTag(inner,0);
+ var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
+ strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
+ var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext";
+ var newSpan = "<span class=" + strClassName + " style='display: none;' id=" + newId + "> " + strCleanHTML + "</span>";
+ removeThis(srcDiv); // empty the original DIV tag
+ insertAdjacentHTML(el, "afterEnd", newSpan );
+ }
+ }
+ }
+ else
+ {
+ srcDiv.style.display = "none";
+ }
+ return 0;
+}
+
+function getElementsByTag(obj,sTagName)
+{
+ if(obj.getElementsByTagName)
+ return obj.getElementsByTagName(sTagName);
+ else if(obj.all)
+ return obj.all.tags(sTagName);
+ return null;
+}
+
+function getElement(sID)
+{
+ if(document.getElementById)
+ return document.getElementById(sID);
+ else if(document.all)
+ return document.all(sID);
+ return null;
+}
+
+function getParentNode(obj)
+{
+ if(obj.parentNode)
+ return obj.parentNode;
+ else if(obj.parentElement)
+ return obj.parentElement;
+ return null;
+}
+
+function getChildNodes(obj)
+{
+ if(obj.childNodes)
+ {
+ var children = new Array();
+ for (var i = 0; i < obj.childNodes.length; i++)
+ {
+ if (obj.childNodes[i].nodeType == 1)
+ children[children.length] = obj.childNodes[i];
+ }
+ return children;
+ }
+ else if(obj.children)
+ return obj.children;
+ return null;
+}
+
+function removeThis(obj)
+{
+ if(obj.parentNode)
+ obj.parentNode.removeChild(obj);
+ else
+ obj.outerHTML="";
+}
+
+function kadovTextPopup( el )
+{
+ if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3 )
+ return;
+
+ var bNeedMove=true;
+
+ if (window.event)
+ window.event.cancelBubble = true;
+
+ if( typeof(el) == "string" )
+ el = getElement(el);
+
+ if (!el||el==window)
+ return;
+
+ var src = el.getAttribute( "x-use-popup" );
+ if(!src&&el.id)
+ {
+ for (var i=0;i<gPopupData.length;i++)
+ if (gPopupData[i].el==el.id)
+ {
+ src=gPopupData[i].popupId;
+ bNeedMove=false;
+ break;
+ }
+ }
+ if(!src)
+ src = el.style.getAttribute( "x-use-popup" );
+ if(!src)
+ return;
+
+ var name = src;
+ if( src.substr(0,1) == "#" )
+ if (bNeedMove)
+ name = src.substr(1, src.length-1) + "_tmp";
+ else
+ name = src.substr(1, src.length-1);
+
+ var srcDiv = getElement(name);
+ if( !srcDiv )
+ return;
+
+ if( srcDiv )
+ {
+ if( srcDiv.style.display == "" )
+ srcDiv.style.display = "none";
+ else
+ {
+ srcDiv.style.display = "";
+ if( typeof(srcDiv.bInitialized) == "undefined" )
+ {
+ srcDiv.bInitialized = true;
+ kadovInitEffects(name);
+ kadovInitEachChild(srcDiv);
+ }
+ }
+ }
+ if(gbBsIE4)
+ event.returnValue=false;
+ return;
+}
+
+function kadovFindParentParagraph( el )
+{
+ if( typeof(el) == "string" )
+ el = getElement(el);
+ if( (!el) || el.tagName == "BODY" )
+ return null;
+ if( kadovIsParagraph(getParentNode(el)) )
+ return getParentNode(el);
+ else
+ return kadovFindParentParagraph( getParentNode(el) );
+}
+
+//Begin HTML code invoked function
+function kadovRegisterEventHandler( obj, strEvent, strEventHandler )
+{
+ if( !gbBsIE4 )
+ return;
+ CCSSP.RegisterEventHandler( obj, strEvent, strEventHandler );
+}
+
+function textPopupData(el, popupId)
+{
+ this.el = el;
+ this.popupId = "#"+popupId;
+}
+
+var gPopupData = new Array();
+
+function kadovTextPopupInit( el, popupId)
+{
+ if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3)
+ return;
+
+ if( typeof(el) == "string" )
+ {
+ if (popupId)
+ {
+ gPopupData[gPopupData.length]=new textPopupData(el, popupId);
+ }
+ el = getElement(el);
+ }
+
+ if( el != null )
+ {
+ CCSSP.RegisterEventHandler( el, "onclick", "kadovTextPopup(\"" + el.id +"\");" );
+ CCSSP.RegisterEventHandler( window, "onload", "kadovTextPopupOnLoad(\"" + el.id +"\");" );
+ }
+}
+//End HTML code invoked function
+
+//End to support extended and dropdown text effects.
+
+//Begin to convert iWrite format to RoboEditor Format for DHTML effects
+function kadovInitTriggersInHead( )
+{
+ if( Object.xDelayedInitElements )
+ {
+ var x = Object.xDelayedInitElements;
+ for(i=0; i<x.length; i++)
+ kadovInitTrigger( x[i] );
+ }
+}
+
+//Begin HTML code invoked function
+function kadovFilePopupInit( el )
+{
+ if( typeof(el) == "string" )
+ el = getElement(el);
+
+ if( el != null )
+ CCSSP.RegisterEventHandler( el, "onmouseover", "BSPSPopupOnMouseOver(event);" );
+}
+
+function kadovInitTrigger( element )
+{
+ if( !gbBsIE4 )
+ return;
+ var srcElement = element;
+ if( typeof(srcElement) == "string" )
+ {
+ srcElement = getElement(element,0);
+ if(srcElement == null)
+ return;
+ }
+
+ if( !kadovIsParentVisible(srcElement) )
+ return;
+
+ var targets = srcElement.getAttribute( "x-targets" );
+ if (!targets)
+ targets = srcElement.style.getAttribute("x-targets");
+ if (!targets)
+ return;
+ var arrOneTarget = targets.split( "," );
+ for( var i = 0; i < arrOneTarget.length; i ++ )
+ bsscFXInit( element, arrOneTarget[i], null, null, null, null );
+}
+
+function kadovIsParentVisible( el )
+{
+ if( typeof(el) == "string" )
+ el = getElement(el);
+ if( (!el) || el.tagName == "BODY" )
+ return true;
+ if( el.style.display == 'none' ) //el.visibility == 'hidden' ||
+ return false;
+ else
+ return kadovIsParentVisible( getParentNode(el) );
+}
+
+function kadovInitEffects( element )
+{
+ if( !gbBsIE4 )
+ return;
+ var srcElement = element;
+ if( typeof(srcElement) == "string" )
+ {
+ srcElement = getElement(element,0);
+ if(srcElement == null)
+ return;
+ }
+
+ if( !kadovIsParentVisible(srcElement) )
+ return;
+
+ kadovInitEffect( srcElement, "x-on-hover" );
+ kadovInitEffect( srcElement, "x-on-pageclick" );
+ kadovInitEffect( srcElement, "x-on-pageload" );
+ kadovInitEffect( srcElement, "x-on-trigger-1" );
+ kadovInitEffect( srcElement, "x-on-trigger-2" );
+}
+//End HTML code invoked function
+
+function kadovInitEffect( element, prop )
+{
+ var values = null;
+ if( element.getAttribute( "currentStyle" ) && element.currentStyle.getAttribute)
+ values = element.currentStyle.getAttribute( prop );
+ else if (element.style.getAttribute)
+ values = element.style.getAttribute( prop );
+ if( !values )
+ return;
+
+ var functions = new Array();
+ var nIdx = 0, nStart = 0;
+ var nNext = values.indexOf( "\)", 0);
+ while( nNext >= 0 && nNext < values.length )
+ {
+ functions[nIdx] = values.substr( nStart, nNext-nStart+1);
+ nStart = nNext + 1;
+ nIdx++;
+ nNext = values.indexOf( "\)", nStart);
+ }
+
+ for( var i=0; i<functions.length; i++)
+ {
+ var id = element.getAttribute( "id" );
+ var translatedProp = kadovTranslateProp(prop);
+
+ var lp = functions[i].indexOf( "(" );
+ var fnname = functions[i].substring(0, lp);
+ var srcargs = functions[i].substring(lp+1, functions[i].length-1);
+
+ var nClickTimes = 1;
+ var arrForClickCount = srcargs.split( "," );
+ for( var j = 0; j < arrForClickCount.length; j++ )
+ {// to locate and get the "clicks=99" settings
+ var nPageClick = arrForClickCount[j].indexOf("clicks");
+ if( nPageClick >= 0 )
+ {
+ nPageClick = arrForClickCount[j].indexOf("=");
+ if( nPageClick > 0 )
+ {
+ nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1;
+ break;
+ }
+ }
+ }
+ var args = srcargs;
+ if( j < arrForClickCount.length )
+ {// to strip out the "clicks=99" from the arguments string
+ args = "";
+ for( var k = 0; k < arrForClickCount.length; k ++ )
+ {
+ if( k != j )
+ {
+ args += arrForClickCount[k];
+ if( k < arrForClickCount.length - 1 )
+ args += ",";
+ }
+ }
+ }
+ bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes );
+ }
+}
+
+function kadovTranslateProp( prop )
+{
+ switch( prop )
+ {
+ case "x-on-hover" : return "bsschover";
+ case "x-on-pageclick" : return "bsscpageclick";
+ case "x-on-pageload" : return "bsscpageload";
+ case "x-on-trigger-1" : return "bssctrigger1";
+ case "x-on-trigger-2" : return "bssctrigger2";
+ }
+ return null;
+}
+//End to convert iWrite format to RoboEditor Format for DHTML effects
+
+//Begin the definition of one entry to DHTML effects
+function bsscFXInit( trigger_ID, target_ID, event_type,
+ action_type, action_setting, event_addional )
+{
+ if( (!gbBsWindows && !gbBsSunOS && !(gbBsMac&&gbBsIE5)) || typeof(target_ID) != "string" )//MUST have a target_ID
+ return; // we don't support Navigator yet
+
+ if( typeof(event_type) == "string" )
+ event_type = event_type.toLowerCase();
+ if( typeof(action_type) == "string" )
+ action_type = action_type.toLowerCase();
+ if( typeof(action_setting) == "string" )
+ action_setting = action_setting.toLowerCase();
+
+ // to get the target element then add it to the target list
+ var eleTarget = CCSSP.GetObject( target_ID );
+ if( (eleTarget != null) && (event_type != null) && (action_type != null) )
+ {
+ CEngine.AddOneTarget( target_ID, eleTarget );
+ CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional);
+ }
+
+ // to validate the trigger_ID parameter
+ if( typeof(trigger_ID) == "string" && trigger_ID != "" )
+ CEngine.BuildTriggerObject( trigger_ID, target_ID );
+}
+//End the definition of one entry to DHTML effects
+
+/// Section End - kadov DHTM (JavaScript 1.2)
+
+/// Section Begin - CCSSP DHTM (JavaScript 1.2)
+
+//Begin JavaScript libary for cross-platform positioning object.
+function CCSSP(){} // constructor of CCSSP class
+
+CCSSP.GetObject = function( obj )
+{//convert object name string or reference into a valid object reference
+ if( typeof(obj) == "object" )
+ return obj;
+ else if( typeof(obj) == "string" && obj != "")
+ {
+ if( gbBsNS4 )
+ return eval("document." + obj);
+ else
+ return eval("document.all(\"" + obj + "\")");
+ }
+ else
+ return null;
+}
+
+CCSSP.MoveObjectTo = function(obj, x, y)
+{//positioning an object at a specific pixel coordinate
+ if( gbBsNS4 )
+ obj.moveTo(x,y);
+ else
+ {
+ obj.style.pixelLeft = x;
+ obj.style.pixelTop = y;
+ }
+}
+
+CCSSP.MoveObjectBy = function(obj, dx, dy)
+{//moveing a object by x and/or y pixel
+ if( gbBsNS4 )
+ obj.moveBy(dx,dy);
+ else
+ {
+ obj.style.pixelLeft += dx;
+ obj.style.pixelTop += dy;
+ }
+}
+
+CCSSP.SetObjectBGColor = function(obj, color)
+{//set the background color of an object
+ if( gbBsNS4 )
+ obj.bgColor = color;
+ else
+ obj.style.backgroundColor = color;
+}
+
+CCSSP.ShowObject = function(obj, bShow)
+{// set the object to be visible or invisible
+ if( gbBsNS4 )
+ obj.visibility = (bShow == true) ? 'show' : 'hide';
+ else
+ obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.
+}
+
+CCSSP.GetObjectLeft = function(obj)
+{// retrieve the x coordinate of a posionable object
+ if( gbBsNS4 )
+ return obj.left;
+ else
+ return obj.style.pixelLeft;
+}
+
+CCSSP.GetObjectTop = function(obj)
+{// retrieve the y coordinate of a posionable object
+ if( gbBsNS4 )
+ return obj.top;
+ else
+ return obj.style.pixelTop;
+}
+
+CCSSP.GetObjectContainLeft = function(obj)
+{// retrieve the x coordinate of a posionable object relative to it's parent element
+ if( gbBsNS4 )
+ return obj.pageX;
+ else
+ {
+ if( obj == document.body )
+ return obj.clientLeft;
+ else
+ return obj.offsetLeft;
+ }
+}
+
+CCSSP.GetObjectWindowLeft = function(obj)
+{// retrieve the x coordinate of a posionable object relative to browser window
+ if( gbBsNS4 )
+ return obj.pageX;
+ else
+ {
+ var nOffsetWindowLeft = 0;
+ for(var element = obj; element; element = element.offsetParent)
+ nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);
+ return nOffsetWindowLeft;
+ }
+}
+
+CCSSP.GetObjectContainTop = function(obj)
+{// retrieve the y coordinate of a posionable object relative to it's parent element
+ if( gbBsNS4 )
+ return obj.pageY;
+ else
+ {
+ if( obj == document.body )
+ return obj.clientTop;
+ else
+ return obj.offsetTop;
+ }
+}
+
+CCSSP.GetObjectWindowTop = function(obj)
+{// retrieve the y coordinate of a posionable object relative to browser window
+ if( gbBsNS4 )
+ return obj.pageY;
+ else
+ {
+ var nOffsetWindowTop = 0;
+ for(var element = obj; element; element = element.offsetParent)
+ nOffsetWindowTop += CCSSP.GetObjectContainTop(element);
+ return nOffsetWindowTop;
+ }
+}
+
+CCSSP.GetObjectHeight = function(obj)
+{// retrieve the height of a posionable object
+ if( gbBsNS4 )
+ return obj.clip.height;
+ else
+ return obj.offsetHeight;
+}
+
+CCSSP.GetObjectWidth = function(obj)
+{// retrieve the width of a posionable object
+ if( gbBsNS4 )
+ return obj.clip.width;
+ else
+ return obj.offsetWidth;
+}
+
+CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )
+{ // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined
+ if (gbBsNS4 && !gbBsNS6)
+ return ;
+
+ var oldHandler = "";
+
+ if (gbBsMac &&gbBsIE4&&!gbBsIE5)
+ {
+ if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown")
+ { //search for <SCRIPT> tag which define the event handler
+ for( var i = 0; i < document.scripts.length; i++ )
+ {
+ var script = document.scripts[i];
+ if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
+ {
+ oldHandler = script.innerHTML;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ var oldInlineHandler = srcObj[rawEventName.toLowerCase()];
+ if( oldInlineHandler != null && typeof(oldInlineHandler) != "undefined")
+ {
+ var functionDefinition = oldInlineHandler.toString();
+ var bodyStart = functionDefinition.indexOf( "{" );
+ var bodyEnd = functionDefinition.lastIndexOf( "}" );
+ if( bodyStart > 0 || bodyEnd > bodyStart )
+ oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );
+ }
+ else if( gbBsIE4 )
+ { //search for <SCRIPT> tag which define the event handler
+ for( var i = 0; i < document.scripts.length; i++ )
+ {
+ var script = document.scripts[i];
+ if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
+ {
+ oldHandler = script.innerHTML;
+ break;
+ }
+ }
+ }
+ }
+ if( oldHandler.indexOf(funcHandler) >= 0 )
+ return;// to prevent register the funtion twice.
+
+ if( gbBsNS4 ) // only "onload, onresize, onfocus" apply to window
+ {// other raw events will apply to layer
+ var noOn = rawEventName.substring(2, rawEventName.length);
+ if( typeof(noOn) == "string" && noOn.length > 3 ) {
+ if (srcObj.captureEvents)
+ srcObj.captureEvents( Event[noOn.toUpperCase()] );
+ }
+ }
+
+ var newHandler = oldHandler;
+ if( newHandler.length == 0 )
+ newHandler = funcHandler;
+ else
+ newHandler += "; " + funcHandler;
+
+ srcObj[rawEventName.toLowerCase()] = new Function( newHandler );
+}
+
+CCSSP.GetWindowHeight = function()
+{// retrieve the height of available content in browser window
+ if( gbBsNS4 )
+ return window.innerHeight;
+ else
+ return document.body.clientHeight;
+}
+
+CCSSP.GetWindowBottom = function()
+{// retrieve the bottom postion of browser window
+ if( gbBsNS4 )
+ return window.outerHeight + window.pageYOffset;
+ else
+ return document.body.clientHeight + document.body.scrollTop;
+}
+
+CCSSP.GetWindowWidth = function()
+{// retrieve the width of available content in browser window
+ if( gbBsNS4 )
+ return window.innerWidth;
+ else
+ return document.body.clientWidth;
+}
+
+CCSSP.GetWindowRight = function()
+{// retrieve the right postion of browser window
+ if( gbBsNS4 )
+ return window.outerWidth + window.pageXOffset;
+ else
+ return document.body.clientWidth + document.body.scrollLeft;
+}
+
+CCSSP.TrimString = function( objString, subtrim )
+{// to trim the "subtrim" in the beginning and ending of a string object
+ if( typeof(subtrim) != "string" || subtrim == null )
+ return objString;
+ var strHead = objString.substring(0, 1);
+ var strRear = objString.substring(objString.length-1, objString.length);
+ if( strHead != subtrim && strRear != subtrim )
+ return objString;
+
+ var spacePos = objString.indexOf(subtrim);
+ if( spacePos < 0 )
+ return objString;
+ else if( spacePos == objString.length - 1 )
+ return objString.substring(0, spacePos);
+ else
+ {
+ var newString = objString.substring( spacePos + 1, objString.length);
+ return CCSSP.TrimString( newString, subtrim );
+ }
+}
+
+CCSSP.TrimSpace = function( objString )
+{
+ var Trim1 = CCSSP.TrimString( objString, " ");
+ return CCSSP.TrimString( Trim1, "\'");
+}
+
+CCSSP.GetEventElement = function( navEventObject )
+{// to get the element who fired the current event
+ if(gbBsNS4)
+ if (gbBsNS6)
+ return null;
+ else
+ navEventObject.target;
+ else
+ return event.srcElement;
+}
+
+CCSSP.PrepareFilter = function( Obj )
+{//to prepare for making the filter work
+ Obj.style.filter = "";
+ if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )
+ return;
+ Obj.style.height = CCSSP.GetObjectHeight(Obj);
+}
+
+CCSSP.IsDescendant = function( progenitor, progeny )
+{
+ if( typeof(progeny) == "undefined" || progeny == null )
+ return false;
+ else if( progeny == progenitor )
+ return true;
+ else if( progeny.id == progenitor.id )
+ return true;
+ else if( getParentNode(progeny) == getParentNode(progenitor))
+ return false;
+ else
+ return CCSSP.IsDescendant( progenitor, getParentNode(progeny));
+}
+
+CCSSP.IsTextTag = function( Obj )
+{
+ if( typeof( Obj.tagName ) == "undefined" )
+ return false;
+ return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" ||
+ Obj.tagName == "FONT" || Obj.tagName == "SPAN" );
+}
+
+//End JavaScript libary for cross-platform positioning object.
+
+/// Section End - CCSSP DHTM (JavaScript 1.2)
+
+/// Section Begin - CCSSP DHTM 1 (JavaScript 1.2)
+
+//Begin the definition of class CTrigger
+function CTrigger( TriggerElement )
+{
+ // object : the trigger element. Never be null.
+ this.eleTrigger = TriggerElement;
+
+ // number : the click counter number: only 3 values: 0,1,2;
+ this.nCounter = 0;
+
+ //object as associative array of string:
+ // the associate target ID strings; one element at least.
+ this.objStrTarget = new Object();
+ this.eleTrigger.style.cursor = "hand";
+ if( this.eleTrigger.tagName == "AREA" && this.eleTrigger.getAttribute("href") == "" )
+ this.eleTrigger.setAttribute("href", "#") // to make a hand cursor for image map
+}
+
+CTrigger.prototype.AddTargetID = function( strTargetID )
+{// add one target ID string to the objStrTarget
+ if( typeof(strTargetID) != "string" )
+ return ;
+ if( typeof(this.objStrTarget[strTargetID]) != "string" )
+ this.objStrTarget[strTargetID] = strTargetID;
+}
+
+CTrigger.prototype.OnTriggerClick = function()
+{// to activate all asociated target
+ var strEventType = ( (this.nCounter++)% 2 == 0 ) ?
+ "bssctrigger1" : "bssctrigger2";
+
+ // to enumerate associative target element's ID string
+ for( var strTargetID in this.objStrTarget )
+ CEngine.SendEventToOneTarget( strTargetID, strEventType );
+}
+//End the definition of class CTrigger
+
+//Begin the definition of class CTarget
+function CTarget( TargetElement )
+{
+ // object : the target element. Never be null.
+ this.eleTarget = TargetElement;
+ this.objManager = new Object(); // object: the event manager
+}
+
+CTarget.nPageClickCounter = 0;// static class property.
+
+CTarget.prototype.GetAgencyObject = function(str_action_type,action_setting )
+{// return the action agency ( effect )object's refernece
+ switch( str_action_type )
+ {
+ case "show":return new CAgencyShow( this.eleTarget, true ) ;
+ case "hide":return new CAgencyShow( this.eleTarget, false ) ;
+
+ case "flyin" :
+ return new CAgencyFly(this.eleTarget, action_setting, true);
+ case "flyout" :
+ return new CAgencyFly(this.eleTarget, action_setting, false);
+ case "spiralin" :
+ return new CAgencySpiral(this.eleTarget, action_setting, true);
+ case "spiralout" :
+ return new CAgencySpiral(this.eleTarget, action_setting, false);
+ case "zoomin" :
+ return new CAgencyZoom(this.eleTarget, action_setting, true);
+ case "zoomout" :
+ return new CAgencyZoom(this.eleTarget, action_setting, false);
+ case "elastic" :
+ return new CAgencyElastic(this.eleTarget, action_setting);
+
+ case "fadein" :
+ return (gbBsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, true) : null;
+ case "fadeout" :
+ return (gbBsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, false) : null;
+ case "rockrollstatic" :
+ case "rockroll" :
+ return (gbBsIE4)? new CAgencyWave(this.eleTarget, action_setting, false) : null;
+
+ case "glow":
+ return (gbBsIE4)? new CAgencyGlow(this.eleTarget,action_setting) : null;
+ case "dropshadow":
+ return (gbBsIE4)? new CAgencyDropShadow(this.eleTarget,action_setting) : null;
+ case "transition" :
+ return (gbBsIE4)? new CAgencyRevealTrans(this.eleTarget,action_setting) : null;
+ case "blur" :
+ return (gbBsIE4)? new CAgencyBlur(this.eleTarget,action_setting) : null;
+
+ case "fliph" : // all these 4 do NOT need any parameters
+ case "flipv" :
+ case "invert":
+ case "gray" :
+ return (gbBsIE4)? new CAgencyChangeFilter(this.eleTarget, str_action_type) : null;
+
+ case "fontchange": // the effects below change the style on the fly, so won't work in Navigator
+ return (gbBsIE4)? new CAgencyFontChange(this.eleTarget,action_setting) : null;
+ case "boderchange":
+ case "stylechange":
+ return (gbBsIE4)? new CAgencyChangeStyle(this.eleTarget,action_setting) : null;
+
+ default: return null;
+ }
+}
+
+CTarget.prototype.SetEventManager = function(
+ one_event_type,str_action_type,action_setting,event_additional)
+{// to set the event manager with specified action
+ if( typeof( one_event_type ) != "string" ||
+ typeof( str_action_type ) != "string"||
+ typeof( action_setting ) != "string" )
+ return false;
+ if( typeof(this.objManager[one_event_type]) == "undefined" )
+ {
+ this.objManager[one_event_type] = new Object();
+ this.objManager[one_event_type].length = 0;
+ }
+
+ var eventAgency = this.GetAgencyObject(str_action_type,action_setting);
+ if( eventAgency != null )
+ {
+ var ct = this.objManager[one_event_type].length ++;
+ this.objManager[one_event_type][ct] = eventAgency;
+
+ if( one_event_type == "bsscpageclick" )
+ {// to deal with the "number of pageclick" stuff
+ if( typeof(event_additional) == "number" )
+ this.objManager[one_event_type][ct].nPageClick = event_additional;
+ else // set the default number
+ this.objManager[one_event_type][ct].nPageClick = 1;
+
+ if( (typeof(this.objManager.nMinPageClickIndex) == "undefined") ||
+ (this.objManager[one_event_type][ct].nPageClick <
+ this.objManager[one_event_type][this.objManager.nMinPageClickIndex].nPageClick) )
+ this.objManager.nMinPageClickIndex = ct;
+ }
+
+ //hide the object blindly,SetState function will take care of the final correct state
+ if( ((one_event_type == "bsscpageclick") &&
+ (this.objManager[one_event_type][ct].nPageClick == 1)) ||
+ one_event_type == "bsscpageload" ||
+ one_event_type == "bssctrigger1" )
+ CCSSP.ShowObject( this.eleTarget, false );
+
+ if( one_event_type == "bssctrigger1" || one_event_type == "bssctrigger2" )
+ if( typeof( this.strTriggerEvent ) == "undefined" )
+ this.strTriggerEvent = ( one_event_type == "bssctrigger1" ) ? "bssctrigger2" : "bssctrigger1";
+
+ return true;
+ }
+ return false;
+}
+
+CTarget.prototype.OnEvent = function( strBsscEvent )
+{// response to the event ( bssc format )
+ if( typeof(this.objManager[strBsscEvent]) == "object" )
+ { // to get the event agency from the event manager
+ var eventAgency = this.objManager[strBsscEvent];
+ for( var i = 0; i < eventAgency.length; i++ )
+ {
+ if( strBsscEvent == "bsscpageclick" &&
+ eventAgency[i].nPageClick != CTarget.nPageClickCounter )
+ continue;
+ else if( strBsscEvent == "bsschover" && event.type == "mouseout" )
+ eventAgency[i].EndEffect();
+ else // to invoke the unified function in effect object
+ eventAgency[i].UpdateEffect();
+ }
+ }
+}
+
+CTarget.prototype.SetState = function( strBsscEvent )
+{
+ if( typeof(this.objManager[strBsscEvent]) != "object" )
+ return false;
+
+ // to get the event agency from the event manager
+ var eventAgency = this.objManager[strBsscEvent];
+
+ if( strBsscEvent == "bsscpageclick" )
+ {// we only set the initial state for the minium number of pageclick
+ eventAgency[this.objManager.nMinPageClickIndex].PrepareEffect();
+ return true;
+ }
+ else
+ {
+ for( var i = 0; i < eventAgency.length; i++ )
+ eventAgency[i].PrepareEffect(); // to invoke the unified function in effect object
+ if( i > 0 )
+ return true;
+ else
+ return false;
+ }
+}
+//End the definition of class CTarget
+
+//Begin the definition of CEngine class
+function CEngine(){}// all properities are going be "class" properities
+
+// object : as associative array of trigger objects
+CEngine.objTrigger = new Object();
+// object : as associative array of target objects
+CEngine.objTarget = new Object();
+
+// Array : each element is a CAgencyXXX animation object
+CEngine.arrAnimation = new Array();
+CEngine.PerformAnimation = function( nIndex )
+{// animation : update effects function
+ CEngine.arrAnimation[nIndex].UpdateEffect();
+}
+
+CEngine.AddOneTrigger = function(TriggerID,TriggerElement)
+{// add one Trigger object into the trigger array
+ if( typeof(TriggerID) != "string" || TriggerElement == null ||
+ typeof(TriggerElement) != "object" )
+ return;
+ if( typeof(CEngine.objTrigger[TriggerID] ) != "object" )
+ CEngine.objTrigger[TriggerID] = new CTrigger(TriggerElement);
+}
+
+CEngine.AddOneTarget = function(TargetID, TargetElement)
+{// add one Target object into the target array
+ if( typeof(TargetID) != "string" || TargetElement == null ||
+ typeof(TargetElement) != "object" )
+ return;
+ if( typeof(CEngine.objTarget[TargetID]) != "object" )
+ CEngine.objTarget[TargetID] = new CTarget( TargetElement );
+}
+
+CEngine.SendEventToOneTarget = function(strTargetID, strBsscEvent )
+{// to activate one target object
+ if( typeof(CEngine.objTarget[strTargetID]) == "object" )
+ {
+ if( strBsscEvent == "bssctrigger1" || strBsscEvent == "bssctrigger2" )
+ {//now, the "bssctrigger1" and "bssctrigger2" work like a toggle
+ if( strBsscEvent == CEngine.objTarget[strTargetID].strTriggerEvent )
+ strBsscEvent = (strBsscEvent == "bssctrigger1") ? "bssctrigger2" : "bssctrigger1";
+ CEngine.objTarget[strTargetID].strTriggerEvent = strBsscEvent;
+ }
+ CEngine.objTarget[strTargetID].OnEvent( strBsscEvent );
+ }
+}
+
+CEngine.SendEventToAllTarget = function( strBsscEvent )
+{ //to activate all target associative to the BSSC event
+ for( var strTargetID in CEngine.objTarget ) //to enumerate all target
+ CEngine.SendEventToOneTarget( strTargetID, strBsscEvent );
+}
+
+CEngine.SetOneTargetInitialState = function( strTargetID )
+{// only invoked after ALL effects for the target have been set
+ if( typeof(CEngine.objTarget[strTargetID]) == "object" )
+ {// to get target object
+ var objTarget = CEngine.objTarget[strTargetID];
+ if( objTarget.SetState( "bsscpageload" ) == false )
+ {
+ objTarget.SetState( "bsscpageclick" );
+ objTarget.SetState( "bssctrigger1" );
+ }
+ }
+}
+
+CEngine.AdjustPageClickCounter = function()
+{
+ var nAdjustedClickCounter = CTarget.nPageClickCounter;
+ var bAdjusted = false;
+ for( var strTargetID in CEngine.objTarget ) //to enumerate all target
+ {// try to find the minum pageCliclConter greater than CTarget.nPageClickCounter
+ var objEventPageClick = CEngine.objTarget[strTargetID].objManager.bsscpageclick;
+ if( objEventPageClick != null )
+ {
+ for( var i = 0; i < objEventPageClick.length; i++ )
+ {
+ var nOtherPageClick = objEventPageClick[i].nPageClick;
+ if( nOtherPageClick == CTarget.nPageClickCounter )
+ return;
+ if( nOtherPageClick > CTarget.nPageClickCounter )
+ {
+ if( !bAdjusted )
+ {
+ nAdjustedClickCounter = nOtherPageClick;
+ bAdjusted = true;
+ }
+ else if( nOtherPageClick < nAdjustedClickCounter )
+ nAdjustedClickCounter = nOtherPageClick;
+ }
+ }
+ }
+ }
+ CTarget.nPageClickCounter = nAdjustedClickCounter;
+}
+
+CEngine.OnPageLoad = function()
+{
+ // first, to set all target's initial state
+ for( var strTargetID in CEngine.objTarget )
+ CEngine.SetOneTargetInitialState( strTargetID );
+
+ // to invoke all target's onpageload handler
+ CEngine.SendEventToAllTarget( "bsscpageload" );
+}
+
+CEngine.OnPageClick = function()
+{ // to invoke all target's onpageclick handler
+ var src = CCSSP.GetEventElement( arguments[0] );
+ if( src == null )
+ return;
+
+ var objClickedTrigger = null;
+ for( var strTriggerID in CEngine.objTrigger )
+ { // to detect which trigger is clicked
+ if( CCSSP.IsDescendant( CEngine.objTrigger[strTriggerID].eleTrigger,src) )
+ {
+ objClickedTrigger = CEngine.objTrigger[strTriggerID];
+ break;
+ }
+ }
+
+ if( objClickedTrigger != null) // the clicked trigger found
+ objClickedTrigger.OnTriggerClick();
+ else // no trigger is clicked
+ { // to send PageClick event to all target
+ CTarget.nPageClickCounter++;
+ CEngine.AdjustPageClickCounter();
+ CEngine.SendEventToAllTarget( "bsscpageclick" );
+ }
+}
+
+CEngine.OnMouseOver = function()
+{ // to invoke all target's onpageload handler
+ var src = CCSSP.GetEventElement( arguments[0] );
+ if( src == null )
+ return;
+
+ var strHoveredTargetID = null;
+ for( var strTargetID in CEngine.objTarget )
+ { // to detect which Target is hovering on
+ if( CCSSP.IsDescendant( CEngine.objTarget[strTargetID].eleTarget, src ) )
+ {
+ strHoveredTargetID = strTargetID;
+ break;
+ }
+ }
+
+ if( strHoveredTargetID != null ) // the hovered target found
+ CEngine.SendEventToOneTarget( strHoveredTargetID, "bsschover" );
+}
+
+CEngine.BuildTargetObject = function(target_ID,event_type,action_type,
+ action_setting, event_additional)
+{// to build target object
+ // to get the target object
+ if( typeof( CEngine.objTarget[target_ID] ) != "object" )
+ return false;// the engine's AddOneTarget function might have failed.
+ var TargetObject = CEngine.objTarget[target_ID];
+
+ // to prepare the parameters for the event manager
+ var arrEvent = event_type.split("|"); // to split the combined event_type string
+ var arrAction = action_type.split("|");//to split the combined action_type string
+ for( var trim = 0; trim < arrEvent.length; trim++ )
+ arrEvent[trim] = CCSSP.TrimSpace(arrEvent[trim]);
+
+ for( trim = 0; trim < arrAction.length; trim++ )
+ arrAction[trim] = CCSSP.TrimSpace(arrAction[trim]);
+
+ var arrSetting = new Array();
+ if( typeof(action_setting) == "string" )
+ arrSetting = action_setting.split("|");// to split the combined action_setting string
+ // to calibrate the arrays
+ for( var i = arrSetting.length; i < arrAction.length; i++ )
+ {
+ if( typeof(arrSetting[i]) != "string" )
+ arrSetting[i] = "";
+ }
+
+ // to prepare for dealing with the absolute posioning element
+ TargetObject.eleTarget.ABSX = CCSSP.GetObjectLeft( TargetObject.eleTarget );
+ TargetObject.eleTarget.ABSY = CCSSP.GetObjectTop( TargetObject.eleTarget );
+
+ if( arrEvent.length > 1 )
+ {// if event is combined, it must be : "bssctrigger1 | bssctrigger2"
+ if( arrAction.length != 2 )
+ return false; // if event is combined, there must be 2 actions
+ for( i = 0 ; i < 2; i++ )
+ {
+ if( TargetObject.SetEventManager(arrEvent[i], arrAction[i],
+ arrSetting[i], event_additional) == false )
+ return false; // the event manager has not been set up
+ }
+ }
+ else // the event_type string is not combined
+ {
+ for( i = 0 ; i < arrAction.length; i++ )
+ {
+ TargetObject.SetEventManager(event_type, arrAction[i], arrSetting[i], event_additional);
+ // to validate the event manager
+ if( typeof(TargetObject.objManager[event_type]) != "object" ||
+ typeof(TargetObject.objManager[event_type][i]) != "object" )
+ return false; // the event manager has not been set up
+ }
+ }
+ return true;
+}
+
+CEngine.BuildTriggerObject = function(trigger_ID, target_ID)
+{// to build the trigger object
+ var arrTrigger = trigger_ID.split("|"); // to split the combined trigger_ID string
+ for( var i = 0; i < arrTrigger.length; i ++ )
+ {// to get the trigger element then add it to the trigger list
+ arrTrigger[i] = CCSSP.TrimSpace( arrTrigger[i] );
+ var eleTrigger = CCSSP.GetObject( arrTrigger[i] );
+ if( eleTrigger == null )
+ continue; // the trigger_ID string in the HTML code maybe wrong
+ CEngine.AddOneTrigger( arrTrigger[i], eleTrigger );
+
+ // to get the target object
+ if( typeof( this.objTrigger[arrTrigger[i]] ) != "object" )
+ continue;// the engine's AddOneTarget function might have failed.
+ CEngine.objTrigger[arrTrigger[i]].AddTargetID( target_ID );
+ }
+}
+//End the definition of CEngine class
+
+/// Section End - CCSSP DHTM 1 (JavaScript 1.2)
+
+/// Section Begin - CCSSP DHTM 2 (JavaScript 1.2)
+
+//Begin the definition of CAgencyXXXX classes
+
+//Begin of the CAgencyShow definition
+function CAgencyShow( element, bIsShow )
+{
+ this.ele = element;
+ this.bIsShow = bIsShow;
+}
+
+CAgencyShow.prototype.PrepareEffect = function()
+{
+ CCSSP.ShowObject( this.ele, !this.bIsShow );
+}
+
+CAgencyShow.prototype.UpdateEffect = function()
+{
+ CCSSP.ShowObject( this.ele, this.bIsShow );
+}
+
+CAgencyShow.prototype.EndEffect = function()
+{
+ CCSSP.ShowObject( this.ele, !this.bIsShow );
+}
+// End of the CAgencyShow definition
+
+// Begin of CAgencyFly definition
+function CAgencyFly( element, settings, bIsIn )
+{
+ this.ele = element;
+ this.bIsIn = bIsIn;
+ this.duration = 1000; // default
+ this.direction = "right";
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "speed" : this.duration = 100000/arrOneSet[1]; break;
+ case "direction" : this.direction = arrOneSet[1]; break;
+ }
+ }
+
+ if( gbBsIE5 && this.ele.style.position != "absolute" )
+ this.ele.style.position = "relative";
+ this.timer = null;
+ this.aniIndex = CEngine.arrAnimation.length;
+ CEngine.arrAnimation[this.aniIndex] = this;
+}
+
+CAgencyFly.prototype.PrepareEffect = function()
+{
+ CCSSP.ShowObject(this.ele, !this.bIsIn );
+}
+
+CAgencyFly.prototype.UpdateEffect = function()
+{
+ if( this.timer == null )
+ this.ResetParameters();
+
+ var percent = ((new Date()).getTime() - this.startTime)/this.duration;
+ if( percent >= 1.0 )
+ this.EndEffect();
+ else
+ {
+ var newX = this.startX*(1.0-percent) + this.finalX*percent;
+ var newY = this.startY*(1.0-percent) + this.finalY*percent;
+ CCSSP.MoveObjectTo(this.ele, newX, newY);
+ if( this.timer == null )
+ this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
+ }
+}
+
+CAgencyFly.prototype.EndEffect = function()
+{
+ clearInterval( this.timer );
+ this.timer = null;
+
+ if( this.bIsIn ) // FlyIn
+ CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
+ else // FlyOut
+ CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
+ CCSSP.ShowObject(this.ele, this.bIsIn );
+}
+
+CAgencyFly.prototype.ResetParameters = function()
+{
+ this.PrepareEffect();
+ CCSSP.ShowObject(this.ele, true );
+
+ this.startX = 0;
+ this.startY = 0;
+ this.finalX = 0;
+ this.finalY = 0;
+
+ var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;
+ var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;
+ var offsetRight = CCSSP.GetWindowRight();
+ var offsetBottom = CCSSP.GetWindowBottom();
+
+ if( this.bIsIn )
+ { // FlyIn
+ this.finalX = this.ele.ABSX;
+ this.finalY = this.ele.ABSY;
+
+ switch( this.direction )
+ {
+ case "right": this.startX = offsetRight; this.startY = this.finalY; break;
+ case "left": this.startX = -offsetLeft; this.startY = this.finalY; break;
+ case "down": this.startY = offsetBottom; this.startX = this.finalX; break;
+ case "up": this.startY = -offsetTop; this.startX = this.finalX; break;
+ case "downright":
+ this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
+ this.startY = this.startX; break;
+ case "upright":
+ this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;
+ this.startY = -this.startX; break;
+ case "upleft":
+ this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
+ this.startY = this.startX; break;
+ case "downleft":
+ this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
+ this.startY = -this.startX; break;
+ }
+ }
+ else
+ { // FlyOut
+ this.startX = this.ele.ABSX;
+ this.startY = this.ele.ABSY;
+
+ switch( this.direction )
+ {
+ case "right": this.finalX = offsetRight; this.finalY = this.startY; break;
+ case "left": this.finalX = -offsetLeft; this.finalY = this.startY; break;
+ case "down": this.finalY = offsetBottom; this.finalX = this.startX; break;
+ case "up": this.finalY = -offsetTop; this.finalX = this.startX; break;
+ case "downright":
+ this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
+ this.finalY = this.finalX; break;
+ case "upright":
+ this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;
+ this.finalY = -this.finalX; break;
+ case "upleft":
+ this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
+ this.finalY = this.finalX; break;
+ case "downleft":
+ this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
+ this.finalY = -this.finalX; break;
+ }
+ }
+ CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
+ this.startTime = (new Date()).getTime();
+}
+// End of the CAgencyFly definition
+
+// Begin of CAgencySpiral
+function CAgencySpiral( element, settings, bIsIn )
+{
+ this.ele = element;
+ this.bIsIn = bIsIn;
+ this.duration = 1000; // default
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "speed" : this.duration = 100000/arrOneSet[1]; break;
+ }
+ }
+
+ if( gbBsIE5 && this.ele.style.position != "absolute" )
+ this.ele.style.position = "relative";
+ this.timer = null;
+ this.aniIndex = CEngine.arrAnimation.length;
+ CEngine.arrAnimation[this.aniIndex] = this;
+}
+
+CAgencySpiral.prototype.PrepareEffect = function()
+{
+ CCSSP.ShowObject(this.ele, !this.bIsIn );
+}
+
+CAgencySpiral.prototype.UpdateEffect = function()
+{
+ if( this.timer == null )
+ this.ResetParameters();
+
+ var percent = ((new Date()).getTime() - this.startTime)/this.duration;
+ if( percent >= 1.0 )
+ this.EndEffect();
+ else
+ {
+ var rf = (this.bIsIn)? (1.0 - percent) : percent;
+ var t = (1.0-rf) * 4.0 * Math.PI
+ var rxP = (this.bIsIn)? this.startX : this.finalX;
+ var ryP = (this.bIsIn)? this.startY : this.finalY;
+ var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;
+ var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;
+
+ var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;
+ var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;
+ CCSSP.MoveObjectTo(this.ele, newX, newY);
+ if( this.timer == null )
+ this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
+ }
+}
+
+CAgencySpiral.prototype.EndEffect = function()
+{
+ clearInterval( this.timer );
+ this.timer = null;
+
+ if( this.bIsIn ) // In
+ CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
+ else // Out
+ CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
+ CCSSP.ShowObject(this.ele, this.bIsIn );
+}
+
+CAgencySpiral.prototype.ResetParameters = function()
+{
+ this.PrepareEffect();
+ CCSSP.ShowObject(this.ele, true );
+ this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;
+ this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;
+ this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();
+ this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom();
+
+ CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
+ this.startTime = (new Date()).getTime();
+}
+// End of CAgencySpiral
+
+// Begin of CAgencyElastic
+function CAgencyElastic( element, settings)
+{
+ this.ele = element;
+ this.duration = 1000; // default
+ this.direction = "right";
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "speed" : this.duration = 100000/arrOneSet[1]; break;
+ case "direction" : this.direction = arrOneSet[1]; break;
+ }
+ }
+
+ if( gbBsIE5 && this.ele.style.position != "absolute" )
+ this.ele.style.position = "relative";
+ this.timer = null;
+ this.aniIndex = CEngine.arrAnimation.length;
+ CEngine.arrAnimation[this.aniIndex] = this;
+}
+
+CAgencyElastic.prototype.PrepareEffect = function()
+{
+ CCSSP.ShowObject(this.ele, false );
+}
+
+CAgencyElastic.prototype.UpdateEffect = function()
+{
+ if( this.timer == null )
+ this.ResetParameters();
+
+ var percent = ((new Date()).getTime() - this.startTime)/this.duration;
+ if( percent >= 1.0 )
+ this.EndEffect();
+ else
+ {
+ var newX = this.startX;
+ var newY = this.startY;
+ var rf = Math.exp(-percent*3);
+ var t = percent * 1.5 * Math.PI
+ var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;
+ switch (this.direction )
+ {
+ case "left":
+ case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;
+ case "up":
+ case "down" : newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;
+ }
+ CCSSP.MoveObjectTo(this.ele, newX, newY);
+ if( this.timer == null )
+ this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
+ }
+}
+
+CAgencyElastic.prototype.EndEffect = function()
+{
+ CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
+ clearInterval( this.timer );
+ this.timer = null;
+}
+
+CAgencyElastic.prototype.ResetParameters = function()
+{
+ CCSSP.ShowObject(this.ele, true );
+ this.startX = this.ele.ABSX;
+ this.finalX = this.ele.ABSX;
+ this.startY = this.ele.ABSY;
+ this.finalY = this.ele.ABSY;
+
+ switch (this.direction)
+ {
+ case "left": this.startX = -this.ele.offsetWidth; break;
+ case "right": this.startX = this.ele.offsetWidth; break;
+ case "up": this.startY = -this.ele.offsetHeight;break;
+ case "down": this.startY = this.ele.offsetHeight; break;
+ }
+ CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
+ this.startTime = (new Date()).getTime();
+}
+// End of CAgencyElastic
+
+// Begin of CAgencyZoom
+function CAgencyZoom( element, settings, bIsIn)
+{
+ this.ele = element;
+ this.duration = 1000; // default
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "speed" : this.duration = 100000/arrOneSet[1]; break;
+ }
+ }
+
+ this.bIsIn = bIsIn;
+ this.timer = null;
+ this.aniIndex = CEngine.arrAnimation.length;
+ CEngine.arrAnimation[this.aniIndex] = this;
+}
+
+CAgencyZoom.prototype.PrepareEffect = function()
+{
+ CCSSP.ShowObject(this.ele, false);
+}
+
+CAgencyZoom.prototype.UpdateEffect = function()
+{
+ if( this.timer == null )
+ this.ResetParameters();
+
+ var percent = ((new Date()).getTime() - this.startTime)/this.duration;
+ if( percent >= 1.0 )
+ this.EndEffect();
+ else
+ {
+ var nFactorIn = Math.ceil(50+50*percent);
+ var nFactorOut = Math.ceil(100+200*(1-percent));
+ var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";
+ var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;
+
+ this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);
+ for(var index = 0; index < this.ele.all.length; index++)
+ this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);
+
+ if( this.timer == null )
+ this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
+ }
+}
+
+CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)
+{
+ if( CCSSP.IsTextTag(child) )
+ child.style.fontSize = FontSize;
+ else
+ {
+ if( typeof(child.orgWidth) == "number" )
+ child.style.width = Factor * child.orgWidth;
+ if( typeof(child.orgHeight) == "number" )
+ child.style.height = Factor * child.orgHeight;
+ }
+}
+
+CAgencyZoom.prototype.EndEffect = function()
+{
+ this.EndEffectAllChildren(this.ele);
+ for(var index = 0; index < this.ele.all.length; index++)
+ this.EndEffectAllChildren(this.ele.all[index]);
+
+ clearInterval( this.timer );
+ this.timer = null;
+}
+
+CAgencyZoom.prototype.EndEffectAllChildren = function( child )
+{
+ if( CCSSP.IsTextTag(child) )
+ child.style.fontSize = child.orgFontSize;
+ else
+ {
+ if( typeof(child.intactWidth) != "undefined" )
+ {
+ child.width = child.intactWidth;
+ child.height = child.intactHeight;
+ }
+ else if( typeof(child.style.intactPixelWidth) != "undefined" )
+ {
+ child.style.pixelWidth = child.style.intactPixelWidth;
+ child.style.pixelHeight = child.style.intactPixelHeight;
+ }
+ }
+}
+
+CAgencyZoom.prototype.ResetParameters = function()
+{
+ this.PrepareEffect();
+ this.ResetParametersAllChildren( this.ele );
+ for(var index = 0; index < this.ele.all.length; index++)
+ this.ResetParametersAllChildren(this.ele.all[index]);
+
+ this.startTime = (new Date()).getTime();
+}
+
+CAgencyZoom.prototype.ResetParametersAllChildren = function( child )
+{
+ CCSSP.ShowObject(child, true );
+ if( (child.tagName == "DIV") && (getParentNode(child).tagName == "TD") )
+ child.width = "100%";// if the div is inside a cell of table, we need the this hack
+
+ if( CCSSP.IsTextTag(child) )
+ child.orgFontSize = child.style.fontSize;
+ else
+ {
+ if( child.width > "" || child.height > "" )
+ {
+ child.orgWidth = child.intactWidth = child.width;
+ child.orgHeight = child.intactHeight = child.height;
+ }
+ else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )
+ {
+ child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;
+ child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;
+ }
+ }
+}
+// End of CAgencyZoom
+
+//// the following effects will use IE's exclusive "filter" function ////
+// Begin of CAgencyAlpha definition
+function CAgencyAlpha( element, settings, bIsIn )
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+ this.bIsIn = bIsIn;
+
+ // to set the default value
+ this.startOpacity = (this.bIsIn) ? 0 : 100;
+ this.endOpacity = (this.bIsIn) ? 100 : 0;
+
+ this.duration = 1000; // default
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "speed" : this.duration = 100000/arrOneSet[1]; break;
+ }
+ }
+
+ this.timer = null;
+ this.aniIndex = CEngine.arrAnimation.length;
+ CEngine.arrAnimation[this.aniIndex] = this;
+}
+
+CAgencyAlpha.prototype.PrepareEffect = function()
+{// to set the visual filter function
+ // the visual filter ONLY work when set by "Width and Height" or
+ // absolute position for DIV, SPAN and normal tag ( such as p )
+ // but, "absolute" cause the following elements overlap, so:
+ CCSSP.PrepareFilter( this.ele );
+ CCSSP.ShowObject(this.ele, !this.bIsIn );
+}
+
+CAgencyAlpha.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ if( this.timer == null )
+ this.ResetParameters();
+ if( typeof(this.ele.filters.alpha) != "object" )
+ {
+ this.EndEffect();
+ return;
+ }
+
+ var percent = ((new Date()).getTime() - this.startTime)/this.duration;
+ if( percent >= 1.0 )
+ this.EndEffect();
+ else if( typeof(this.ele.filters.alpha) == "object" )
+ {
+ this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;
+ if( this.timer == null )
+ this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
+ }
+}
+
+CAgencyAlpha.prototype.EndEffect = function()
+{// to remove the visual filter function
+ clearInterval( this.timer );
+ this.timer = null;
+ this.ele.style.filter = "";
+ CCSSP.ShowObject(this.ele, this.bIsIn );
+}
+
+CAgencyAlpha.prototype.ResetParameters = function()
+{
+ this.PrepareEffect();
+ CCSSP.ShowObject(this.ele, true );
+ this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";
+ this.startTime = (new Date()).getTime();
+}
+// End of the CAgencyAlpha definition
+
+// Begin of CAgencyWave definition
+function CAgencyWave( element, settings )
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+
+ this.duration = 0; // default
+ this.strength = 10;
+ this.freq = 1;
+ this.lightstrength = 1;
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "duration" : this.duration = 100000/arrOneSet[1]; break;
+ case "strength" : this.strength = arrOneSet[1]; break;
+ case "freq" : this.freq = arrOneSet[1]; break;
+ case "lightstrength" : this.lightstrength = arrOneSet[1]; break;
+ }
+ }
+
+ this.timer = null;
+ this.aniIndex = CEngine.arrAnimation.length;
+ CEngine.arrAnimation[this.aniIndex] = this;
+}
+
+CAgencyWave.prototype.PrepareEffect = function()
+{// to set the visual filter function
+ CCSSP.PrepareFilter(this.ele);
+
+ CCSSP.ShowObject(this.ele, true );
+}
+
+CAgencyWave.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ if( this.timer == null )
+ this.ResetParameters();
+ if( typeof(this.ele.filters.wave) != "object" )
+ {
+ this.EndEffect();
+ return;
+ }
+
+ if( this.duration > 0 )
+ {
+ var percent = ((new Date()).getTime() - this.startTime)/this.duration;
+ if( percent >= 1.0 )
+ {
+ this.EndEffect();
+ return;
+ }
+ }
+
+ this.ele.filters.wave.phase += 5;
+ this.ele.filters.wave.phase %= 100;
+ if( this.timer == null )
+ this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );
+}
+
+CAgencyWave.prototype.EndEffect = function()
+{// to remove the visual filter function
+ this.ele.style.filter = "";
+ clearInterval( this.timer );
+ this.timer = null;
+}
+
+CAgencyWave.prototype.ResetParameters = function()
+{
+ this.PrepareEffect();
+ this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" +
+ this.freq +", lightstrength=" + this.lightstrength +",phase=0);";
+ this.startTime = (new Date()).getTime();
+}
+// End of the CAgencyWave definition
+
+// Begin of CAgencyGlow definition
+function CAgencyGlow( element, settings )
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+
+ // to set the default value
+ this.glowColor = "green";
+ this.glowStrength = "3";
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "color" : this.glowColor = arrOneSet[1]; break;
+ case "strength" : this.glowStrength = arrOneSet[1]; break;
+ }
+ }
+}
+
+CAgencyGlow.prototype.PrepareEffect = function()
+{
+ CCSSP.PrepareFilter(this.ele);
+ CCSSP.ShowObject(this.ele, true );
+ if( this.ele.style.backgroundColor != "" )
+ {//style.backgroundColor somehow stop the visual filter
+ this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
+ this.ele.style.backgroundColor = "";
+ }
+}
+
+CAgencyGlow.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ this.PrepareEffect();
+ this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" +
+ this.glowStrength + ", enabled=true" +")";
+}
+
+CAgencyGlow.prototype.EndEffect = function()
+{// to remove the visual filter function
+ this.ele.style.filter = "";
+ if( typeof(this.ele.intactBackgroundColor) != "undefined" )
+ this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
+}
+// End of the CAgencyGlow definition
+
+// Begin of CAgencyDropShadow definition
+function CAgencyDropShadow( element, settings )
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+
+ // to set the default value
+ this.shadowColor = "black";
+ this.shadowOffx = "1";
+ this.shadowOffy = "1";
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "color" : this.shadowColor = arrOneSet[1]; break;
+ case "offx" : this.shadowOffx = arrOneSet[1]; break;
+ case "offy" : this.shadowOffy = arrOneSet[1]; break;
+ }
+ }
+}
+
+CAgencyDropShadow.prototype.PrepareEffect = function()
+{
+ CCSSP.PrepareFilter(this.ele);
+ CCSSP.ShowObject(this.ele, true );
+
+ if( this.ele.style.backgroundColor != "" )
+ {//style.backgroundColor somehow stop the visual filter
+ this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
+ this.ele.style.backgroundColor = "";
+ }
+}
+
+CAgencyDropShadow.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ this.PrepareEffect();
+ this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" +
+ this.shadowOffx + ", offy=" + this.shadowOffy + ")";
+}
+
+CAgencyDropShadow.prototype.EndEffect = function()
+{// to remove the visual filter function
+ this.ele.style.filter = "";
+ if( typeof(this.ele.intactBackgroundColor) != "undefined" )
+ this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
+}
+// End of the CAgencyDropShadow definition
+
+// Begin of CAgencyRevealTrans definition
+function CAgencyRevealTrans( element, settings )
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+
+ // to set the default value
+ this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).
+ this.transition = 0;
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "type" : this.transition = arrOneSet[1]; break;
+ case "duration" : this.duration = 100/arrOneSet[1]; break;
+ }
+ }
+}
+
+CAgencyRevealTrans.prototype.PrepareEffect = function()
+{
+ CCSSP.PrepareFilter(this.ele);
+ CCSSP.ShowObject( this.ele, false);
+}
+
+CAgencyRevealTrans.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ if( typeof( this.ele.filters.RevealTrans ) == "object" )
+ {
+ if( this.ele.filters.RevealTrans.status == 2 )
+ this.ele.filters.RevealTrans.stop();
+ }
+
+ this.PrepareEffect();
+
+ this.ele.style.filter = "RevealTrans(duration=" + this.duration +
+ ", transition=" + this.transition + ")";
+
+ if( typeof( this.ele.filters.RevealTrans ) == "object" )
+ {
+ this.ele.filters.RevealTrans.apply();
+ CCSSP.ShowObject( this.ele, true);
+ this.ele.filters.RevealTrans.play();
+ }
+ else
+ CCSSP.ShowObject( this.ele, true);
+}
+
+CAgencyRevealTrans.prototype.EndEffect = function()
+{
+ if( typeof( this.ele.filters.RevealTrans ) == "object" )
+ this.ele.filters.RevealTrans.stop();
+ this.ele.style.filter = "";
+}
+// End of the CAgencyRevealTrans definition
+
+// Begin of CAgencyBlur definition
+function CAgencyBlur( element, settings )
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+
+ // to set the default value
+ this.strength = "5";
+ this.direction = "90";
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "strength" : this.strength = arrOneSet[1]; break;
+ case "direction" : this.direction = arrOneSet[1]; break;
+ }
+ }
+}
+
+CAgencyBlur.prototype.PrepareEffect = function()
+{
+ CCSSP.PrepareFilter(this.ele);
+ CCSSP.ShowObject(this.ele, true );
+}
+
+CAgencyBlur.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ CCSSP.PrepareFilter(this.ele);
+ this.ele.style.filter = "blur(strength=" + this.strength +
+ ", direction=" + this.direction + ")";
+}
+
+CAgencyBlur.prototype.EndEffect = function()
+{// to remove the visual filter function
+ this.ele.style.filter = "";
+}
+// End of the CAgencyBlur definition
+
+// Begin of CAgencyChangeFilter definition
+function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,
+{// because of "visual filter" style, this won't work in Navigator
+ this.ele = element;
+
+ // to set the default value
+ this.filterFunction = settings;
+}
+
+CAgencyChangeFilter.prototype.PrepareEffect = function()
+{
+ CCSSP.PrepareFilter(this.ele);
+ CCSSP.ShowObject(this.ele, true );
+}
+
+CAgencyChangeFilter.prototype.UpdateEffect = function()
+{// to set the visual filter function
+ CCSSP.PrepareFilter(this.ele);
+ this.ele.style.filter = this.filterFunction;
+}
+
+CAgencyChangeFilter.prototype.EndEffect = function()
+{// to remove the visual filter function
+ this.ele.style.filter = "";
+}
+// End of the CAgencyChangeFilter definition
+
+// The effects below change the style on the fly, so they won't work in Navigator
+
+// Begin of CAgencyFontChange definition,
+function CAgencyFontChange( element, settings )
+{//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
+ this.ele = element;
+
+ // to retrieve the original font style
+ this.RetrieveOldFont( this.ele );
+
+ // to set the default font to change
+ this.newfontFamily = this.ele.oldFontFamily;
+ this.newfColor = this.ele.oldColor;
+ this.newtextDecoration = this.ele.oldTextDecoration;
+ this.newfontWeight = this.ele.oldFontWeight;
+ this.newfontStyle = this.ele.oldFontStyle;
+ this.newfontSize = this.ele.oldFontSize;
+ this.newBackgroundColor = this.ele.oldBackgroundColor;
+
+ var arrAllSet = settings.split(",");
+ for( var i = 0; i < arrAllSet.length; i ++ )
+ {// to retrieve the setting
+ arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
+ var arrOneSet = arrAllSet[i].split("=");
+ for( var j = 0; j < arrOneSet.length; j++ )
+ arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
+ switch( arrOneSet[0] )
+ {
+ case "font-family" : this.newfontFamily = arrOneSet[1]; break;
+ case "color" : this.newfColor = arrOneSet[1]; break;
+ case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;
+ case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;
+ case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;
+ case "size" : this.newfontSize = arrOneSet[1]; break;
+ case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;
+ }
+ }
+}
+
+CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)
+{
+ if( typeof(objChild.oldFontFamily) == "undefined" )
+ objChild.oldFontFamily = objChild.style.fontFamily;
+ if( typeof(objChild.oldColor) == "undefined" )
+ objChild.oldColor = objChild.style.color;
+ if( typeof(objChild.oldTextDecoration) == "undefined" )
+ objChild.oldTextDecoration = objChild.style.textDecoration;
+ if( typeof(objChild.oldFontWeight) == "undefined" )
+ objChild.oldFontWeight = objChild.style.fontWeight;
+ if( typeof(objChild.oldFontStyle) == "undefined" )
+ objChild.oldFontStyle = objChild.style.fontStyle;
+ if( typeof(objChild.oldFontSize) == "undefined" )
+ objChild.oldFontSize = objChild.style.fontSize;
+ if( typeof(objChild.oldBackgroundColor) == "undefined" )
+ objChild.oldBackgroundColor = objChild.style.backgroundColor;
+}
+
+CAgencyFontChange.prototype.PrepareEffect = function()
+{
+ // as for expanding text, the child is created after the constructor called
+ for(var index = 0; index < this.ele.all.length; index++)
+ this.RetrieveOldFont(this.ele.all[index]);
+ CCSSP.ShowObject(this.ele, true );
+}
+
+CAgencyFontChange.prototype.UpdateEffect = function()
+{// to change the font
+ this.PrepareEffect();
+ this.UpdateEffectAllChildren( this.ele );
+ for( var index = 0; index < this.ele.all.length; index++)
+ this.UpdateEffectAllChildren(this.ele.all[index]);
+}
+
+CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)
+{
+ objChild.style.fontFamily = this.newfontFamily;
+ objChild.style.color = this.newfColor;
+ objChild.style.textDecoration = this.newtextDecoration;
+ objChild.style.fontWeight = this.newfontWeight;
+ objChild.style.fontStyle = this.newfontStyle;
+ objChild.style.fontSize = this.newfontSize;
+ objChild.style.backgroundColor = this.newBackgroundColor;
+}
+
+CAgencyFontChange.prototype.EndEffect = function()
+{// to reinstate the original font style
+ this.EndEffectAllChildren( this.ele );
+ for( var index = 0; index < this.ele.all.length; index++)
+ this.EndEffectAllChildren(this.ele.all[index]);
+}
+
+CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )
+{
+ if( typeof(objChild.oldFontFamily) != "undefined" )
+ objChild.style.fontFamily = objChild.oldFontFamily;
+ if( typeof(objChild.oldColor) != "undefined" )
+ objChild.style.color = objChild.oldColor;
+ if( typeof(objChild.oldFontWeight) != "undefined" )
+ objChild.style.fontWeight = objChild.oldFontWeight;
+ if( typeof(objChild.oldFontStyle) != "undefined" )
+ objChild.style.fontStyle = objChild.oldFontStyle;
+ if( typeof(objChild.oldFontSize) != "undefined" )
+ objChild.style.fontSize = objChild.oldFontSize;
+ if( typeof(objChild.oldTextDecoration) != "undefined" )
+ objChild.style.textDecoration = objChild.oldTextDecoration;
+ if( typeof(objChild.oldBackgroundColor) != "undefined" )
+ objChild.style.backgroundColor = objChild.oldBackgroundColor;
+}
+// End of the CAgencyFontChange definition
+
+// Begin of the CAgencyChangeStyle definition
+function CAgencyChangeStyle( element, settings )
+{//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
+ this.ele = element;
+
+ // to retrieve the original style
+ this.oldstyle = this.ele.style.cssText;
+
+ // to set the default style
+ this.newStyle = this.oldstyle;
+
+ if( typeof(settings) == "string" && settings.length > 1 )
+ this.newStyle = this.oldstyle + " " + settings;
+}
+
+CAgencyChangeStyle.prototype.PrepareEffect = function()
+{
+ CCSSP.ShowObject(this.ele, true );
+}
+
+CAgencyChangeStyle.prototype.UpdateEffect = function()
+{// to change the style
+ this.ele.style.cssText = this.newStyle;
+}
+
+CAgencyChangeStyle.prototype.EndEffect = function()
+{// to reinstate the original style
+ this.ele.style.cssText = this.oldStyle;
+}
+// End of the CAgencyChangeStyle definition
+
+//End the definition of CAgencyXXXX classes
+
+//Begin to collaborate with other event handler settings
+CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");
+CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");
+CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );
+CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );
+CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");
+//End to collaborate with other event handler settings
+
+/// Section End - CCSSP DHTM 2 (JavaScript 1.2)
+
+//// Segment End -- (JavaScript 1.2)
\ No newline at end of file