1 // eHelp® Corporation Dynamic HTML JavaScript
2 // Copyright© 1998-2003 eHelp® Corporation.All rights reserved.
5 // Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten.
7 //// Segment Begin -- (JavaScript 1.0)
9 /// Section Begin - General and relative topics(JavaScript 1.0)
12 var HH_ChmFilename = "";
13 var HH_WindowName = "";
14 var HH_GlossaryFont = "";
17 var HH_ActiveX = false;
20 //Begin to support previous generic parameters
21 //Get the information about the browser.
22 var gstrBsAgent = navigator.userAgent.toLowerCase();
23 var gnBsVer = parseInt(navigator.appVersion);
25 var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1);
26 var gbBsKonqueror = (gstrBsAgent.indexOf('konqueror') != -1);
27 var gbBsSafari = (gstrBsAgent.indexOf('safari') != -1);
28 var gbBsIE = (gstrBsAgent.indexOf('msie') != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
29 var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1)) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
31 var gbBsMac = (gstrBsAgent.indexOf('mac') != -1);
32 var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1));
33 var gbBsSunOS = (gstrBsAgent.indexOf("sunos") != -1);
35 var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2));
36 var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3));
38 var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2));
39 var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3));
40 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)));
41 var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1));
43 var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4));
44 var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5));
47 var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4));
51 var gbBsOpera6 = false;
52 var gbBsOpera7 = false;
54 var gbBsKonqueror3 = false;
58 gbBsIE = (navigator.appName.indexOf("Microsoft") != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;;
61 if (parseInt(navigator.appVersion) >= 4) {
64 var nPos = gstrBsAgent.indexOf("msie");
65 var strIEversion = gstrBsAgent.substring(nPos + 5);
66 var nVersion = parseFloat(strIEversion);
76 var nPos=gstrBsAgent.indexOf("gecko");
79 var nPos2=gstrBsAgent.indexOf("/", nPos);
82 var nVersion=parseFloat(gstrBsAgent.substring(nPos2+1));
83 if (nVersion>=20020823)
90 var nPos = gstrBsAgent.indexOf("opera");
93 var nVersion = parseFloat(gstrBsAgent.substring(nPos+6));
104 var nPos = gstrBsAgent.indexOf("konqueror");
107 var nVersion = parseFloat(gstrBsAgent.substring(nPos+10));
115 function insertAdjacentHTML(obj, where, htmlStr)
117 if (gbBsIE || gbBsOpera7)
119 obj.insertAdjacentHTML(where, htmlStr);
121 else if (gbBsNS6 || gbBsSafari)
123 var r = obj.ownerDocument.createRange();
124 r.setStartBefore(obj);
125 var parsedHTML = r.createContextualFragment(htmlStr);
129 obj.parentNode.insertBefore(parsedHTML,obj);
132 obj.insertBefore(parsedHTML,obj.firstChild);
135 obj.appendChild(parsedHTML);
138 if (obj.nextSibling){
139 obj.parentNode.insertBefore(parsedHTML,obj.nextSibling);
141 obj.parentNode.appendChild(parsedHTML);
148 // Utilities functions.
149 function BsscHasExtJs()
151 if( gbBsIE3Before || gbBsNS3Before)
156 // Register event handler
157 var gBsOnLoads = new Array(); // An array holds all the onload event handler.
158 var gBsOnClicks = new Array(); // An array holds all the onClick event handler.
159 var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler.
160 var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler.
161 var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler.
163 var gbOrignalOnMouseDown = null;
165 function BsscRegisterOnLoad(funcHandler)
167 var nLength = gBsOnLoads.length;
168 gBsOnLoads[nLength] = funcHandler;
171 function BsscRegisterOnClick(funcHandler)
173 var nLength = gBsOnClicks.length;
174 gBsOnClicks[nLength] = funcHandler;
177 function BsscRegisterOnUnLoad(funcHandler)
179 var nLength = gBsOnUnLoads.length;
180 gBsOnUnLoads[nLength] = funcHandler;
183 function BsscRegisterOnMouseOver(funcHandler)
185 var nLength = gBsOnMouseOvers.length;
186 gBsOnMouseOvers[nLength] = funcHandler;
189 function BsscRegisterOnMouseOut(funcHandler)
191 var nLength = gBsOnMouseOuts.length;
192 gBsOnMouseOuts[nLength] = funcHandler;
195 function BsGeneralOnLoad()
197 if (!gbBsIE4 && !gbBsNS4)
200 // Make everything visible in navigator
201 if (gbBsNS4 && !gbBsNS6) {
202 // Make some special effects items visible
203 for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
204 document.layers[iLayer].visibility = "show";
205 document.layers[iLayer].left = 0;
210 // If resize the netscape browser, need to reload it.
213 if (innerWidth != origWidth || innerHeight != origHeight)
216 // End of the local functions.
218 // The following functions are used by the html files.
219 function BSSCOnLoad()
221 if( !BsscHasExtJs() )
223 for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--)
224 gBsOnLoads[nElement]();
227 function BSSCOnClick()
229 if (!BsscHasExtJs()) return;
231 for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--)
232 gBsOnClicks[nElement]();
235 function BSSCOnUnload()
237 if (!BsscHasExtJs()) return;
238 for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--)
239 gBsOnUnLoads[nElement]();
242 function BSSCOnMouseOver()
244 if (!BsscHasExtJs()) return;
245 for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--)
246 gBsOnMouseOvers[nElement]();
249 function BSSCOnMouseOut()
251 if (!BsscHasExtJs()) return;
252 for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--)
254 gBsOnMouseOuts[nElement]();
257 // End of invocation of the event handle functions.
259 // Add the GereralOnLoad to the onload array.
260 if (typeof(BsscRegisterOnLoad) != "undefined")
262 BsscRegisterOnLoad(BsGeneralOnLoad);
264 if (gbBsNS4&&!gbBsNS6) {
265 origWidth = innerWidth;
266 origHeight = innerHeight;
269 //End to support previous generic parameters
271 //Begin to support previous HHActiveX invoking
272 function BsHHActivateComponents()
274 if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
276 var objBody = getElementsByTag(document,"BODY")[0];
277 if( typeof(objBody) == "object" )
279 insertAdjacentHTML(objBody, "beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
280 if (HHComponentActivator.object)
281 HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
286 function BsHHActivXOnLoad()
289 BsHHActivateComponents();
292 if( typeof(BsscRegisterOnLoad) != "undefined" )
294 BsscRegisterOnLoad(BsHHActivXOnLoad);
296 //End to support previous HHActiveX invoking
298 //Begin to support previous relative topics
299 //If webHelp needs Related Topics DHTMLcode, it's supposed to add it here
300 var gbPopupMenuTimeoutExpired = false;
301 var gbInPopupMenu = false;
302 var gbPopupMenuTopicList = null;
303 var gOlddocumentClick = null;
305 //////////////////////////////////////////////////////////////////////////////////////////
309 //////////////////////////////////////////////////////////////////////////////////////////
311 var g_bIsPopupMenuInit = false;
312 function _WritePopupMenuLayer()
314 if (!g_bIsPopupMenuInit)
316 if (gbBsNS4&&!gbBsNS6) {
317 //Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page...
318 document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
320 document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
321 if (!(gbBsNS4&&!gbBsNS6)) {
322 document.write("<STYLE TYPE='text/css'>");
323 if (gbBsMac&&gbBsIE4) {
324 document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
325 document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
327 document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
328 document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
330 document.write("</STYLE>");
333 g_bIsPopupMenuInit = true;
337 //Seek for the bsscright frame
338 function _SeekFrameByName( cRoot, strName )
340 if( cRoot == null ) return null;
341 if( cRoot.frames == null ) return null;
342 if( cRoot.frames[strName] != null ) return cRoot.frames[strName];
343 for (var i=0; i<cRoot.frames.length; i++)
347 cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
349 cObj = _SeekFrameByName( cRoot.frames[i], strName );
350 if( cObj != null ) return cObj;
354 function _GetFrameByName( cRoot, strName )
356 if( cRoot == null ) return null;
357 var cRet = _SeekFrameByName(cRoot, strName);
358 if( cRet != null ) return cRet;
359 if (cRoot.parent != cRoot)
360 return _GetFrameByName( cRoot.parent, strName );
365 var gfn_arguments = null;
366 function _PopupMenu_Invoke(fn_arguments)
368 gfn_arguments = fn_arguments;
369 if (gbBsOpera6&&gbBsMac)
371 var wndOldPopupLinks= window.open(document.location.href, "popuplinks");
372 wndOldPopupLinks.close();
373 setTimeout("_PopupMenu_Invoke_2();",100);
377 _PopupMenu_Invoke_2();
381 function _PopupMenu_Invoke_2()
383 var fn_arguments = gfn_arguments;
384 gfn_arguments = null;
386 // Make sure we have reasonable arguments
387 var argLen = fn_arguments.length;
392 // Check to see if we only have one target
394 var targetDoc = null;
395 if (fn_arguments[1] == '') {
396 if (BSSCPopup_IsPopup()) {
398 strTarget = "TARGET= _parent";
401 targetDoc = window.document;
403 targetDoc = _GetFrameByName( parent, fn_arguments[1] );
405 strTarget = "TARGET='" + fn_arguments[1] + "'";
408 if ((!gbBsIE4 && !gbBsNS4 && !gbBsOpera7 && !gbBsKonqueror3 &&!gbBsSafari) || ((gbBsMac) && (gbBsIE4) && (window.event.srcElement.tagName == "AREA"))) {
410 var argLen = fn_arguments.length;
412 // Create the window that the hyperlinks will go into
413 var nHeight = argLen * 15;
415 var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
416 strParam += ",height=" + nHeight + ",width=200";
417 strParam += ",resizable";
420 // Create a temporary window first to ensure the real popup comes up on top
422 wndTemp = window.open("", "temp", strParam);
424 // Create the real popup window
425 var wndPopupLinks=null;
426 if (gbBsOpera&&gbBsMac)
428 wndTemp = window.open(document.location.href, "temp", strParam);
429 wndPopupLinks= window.open(document.location.href, "popuplinks", strParam);
432 wndPopupLinks= window.open("", "popuplinks", strParam);
433 wndPopupLinks.document.open("text/html");
435 // Close the temporary
439 var sHTML="<html><head></head>";
440 sHTML+="<body onBlur=\'self.focus();\'>";
441 var strParaLine = "";
442 for (var i = 0; i < (argLen - 2) / 2; i++) {
444 strParaLine += "<a href=\"javascript:";
446 strParaLine += "onBlur=null; ";
448 strParaLine += "opener.location=\'";
449 strParaLine += fn_arguments[2 * i + 3];
450 strParaLine += "\';close();\"";
451 strParaLine += strTarget;
454 strParaLine += fn_arguments[2 * i + 2];
455 strParaLine += "</a>";
456 strParaLine += "<br>";
459 sHTML+="</body></html>";
460 wndPopupLinks.document.write(sHTML);
461 wndPopupLinks.document.close();
462 window.gbInPopupMenu = true;
464 wndPopupLinks.focus();
469 if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
470 ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
471 // Get the place that we will be putting the topic into
473 if (isNaN(fn_arguments[2]) || (gbPopupMenuTopicList == null)) {
474 strURL = fn_arguments[3];
477 strURL = gbPopupMenuTopicList[fn_arguments[2]].strURL;
480 if (targetDoc != null) {
481 targetDoc.location.href = strURL;
484 if (fn_arguments[1] != null && typeof(fn_arguments[1]) != "undefined")
485 window.open(strURL, fn_arguments[1]);
489 window.gbInPopupMenu = true;
494 if (gbBsNS4&&!gbBsNS6) {
495 strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
497 strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
499 strMenu += ' CELLPADDING=4';
501 strMenu += ' CELLPADDING=2';
503 strMenu += ' BGCOLOR=#c0c0c0>';
505 // Add each of the items
507 while (i <= argLen - 1) {
508 strMenu += '<TR><TD><NOBR>'
509 // If the destination is a number then look it up in the topic list
510 if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
511 strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
513 strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
515 strMenu += ' onclick="PopupMenu_HandleClick(event);"';
516 strMenu += ' onmouseover="PopupMenu_Over(event);"';
517 strMenu += ' onmouseout="PopupMenu_Out(event);"';
519 if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
520 strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
522 strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
524 strMenu += '</A></DIV></NOBR></TD></TR>';
526 if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
532 strMenu += "</TABLE>";
535 // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
536 strMenu +="<TABLE></TABLE>";
539 var layerPopup = null;
540 var stylePopup = null;
543 var nWindowWidth = 0;
544 if (gbBsIE4 || gbBsOpera7) {
546 layerPopup = getElement("PopupMenu");
547 layerPopup.innerHTML = strMenu;
548 stylePopup = layerPopup.style;
550 _BSPSGetClientSize();
552 // Get the position of the item causing the event (relative to its parent)
553 nEventX = window.event.clientX;
554 nEventY = window.event.clientY;
556 if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
557 nEventY += document.body.scrollTop + 10;
559 nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
561 stylePopup.top = nEventY;
563 var nPopupWidth = layerPopup.scrollWidth;
565 nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.
567 if (nEventX + nPopupWidth + 20 > gBsClientWidth) {
568 if (gBsClientWidth - nPopupWidth < 5) {
571 stylePopup.left = gBsClientWidth - nPopupWidth - 5;
574 stylePopup.left = nEventX + document.body.scrollLeft + 20;
577 stylePopup.visibility = "visible";
578 if (!gOlddocumentClick && document.onclick)
579 gOlddocumentClick = document.onclick;
580 document.onclick = PopupMenu_HandleClick;
582 } else if (gbBsNS6 || gbBsKonqueror3||gbBsSafari) {
583 layerPopup = getElement("PopupMenu");
584 layerPopup.style.visibility = "hidden";
588 var e = fn_arguments[0];
594 nEventX = window.event.clientX;
595 nEventY = window.event.clientY;
597 _BSPSGetClientSize();
598 layerPopup.innerHTML = strMenu;
600 if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) {
603 nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
606 if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
607 if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
610 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
615 layerPopup.style.top = nEventY;
616 layerPopup.style.left = nEventX;
617 // set again to avoid the stupid frash in netscape 6.
618 layerPopup.innerHTML = strMenu;
619 layerPopup.style.visibility = "visible";
620 //window.captureEvents(Event.MOUSEDOWN);
621 if (!gOlddocumentClick && document.onclick)
622 gOlddocumentClick = document.onclick;
623 window.onclick = PopupMenu_HandleClick;
626 layerPopup = document.layers.PopupMenu;
627 layerPopup.visibility = "hide";
628 stylePopup = layerPopup.document;
629 stylePopup.write(strMenu);
631 var e = fn_arguments[0];
634 _BSPSGetClientSize();
635 if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
638 nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
640 layerPopup.top = nEventY;
642 if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
643 if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
646 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
652 layerPopup.left = nEventX;
654 layerPopup.visibility = "show";
656 window.captureEvents(Event.MOUSEDOWN);
657 if (!gOlddocumentClick && document.onmousedown)
658 gOlddocumentClick = document.onmousedown;
659 window.onmousedown = PopupMenu_HandleClick;
662 window.gbInPopupMenu = true;
663 window.gbPopupMenuTimeoutExpired = false;
664 setTimeout("PopupMenu_Timeout();", 100);
668 function PopupMenu_Timeout()
670 window.gbPopupMenuTimeoutExpired = true;
673 function PopupMenu_Over(e)
675 if (gbBsIE4||gbBsOpera7)
676 e.srcElement.className = "PopupOver";
678 e.target.parentNode.className = "PopupOver";
682 function PopupMenu_Out(e)
684 if (gbBsIE4||gbBsOpera7)
685 e.srcElement.className = "PopupNotOver";
687 e.target.parentNode.className = "PopupNotOver";
691 function PopupMenu_HandleClick(e)
693 if (window.gbPopupMenuTimeoutExpired) {
694 window.gbInPopupMenu = false;
695 if (gbBsNS4 && !gbBsNS6) {
696 window.releaseEvents(Event.MOUSEDOWN);
699 var layerPopup = null;
700 if (gbBsNS4&&!gbBsNS6) {
701 layerPopup = document.layers.PopupMenu;
702 layerPopup.visibility = "hide";
704 layerPopup = getElement("PopupMenu");
705 layerPopup.style.visibility = "hidden";
708 if (gOlddocumentClick)
710 if (gbBsNS4 && !gbBsNS6)
711 document.onmousedown = gOlddocumentClick;
713 document.onclick = gOlddocumentClick;
719 function BSSCPopup_ClickMac()
721 if ((!DHTMLPopupSupport()) && (gbBsIE4 || gbBsOpera7))
723 var bClickOnAnchor = false;
725 if ((window.event != null) &&
726 (window.event.srcElement != null))
728 el = window.event.srcElement;
731 if ((el.tagName == "A") || (el.tagName == "AREA")) {
732 bClickOnAnchor = true;
735 if (el.tagName == "BODY") {
738 el = getParentNode(el);
741 if (BSSCPopup_IsPopup())
743 if (!bClickOnAnchor) {
744 parent.window.gPopupWindow = null;
750 bClosePopupWindow = true;
751 if ((bClickOnAnchor) &&
753 ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))
755 bClosePopupWindow = false;
757 if (bClosePopupWindow)
759 if (window.gPopupWindow != null && !window.gPopupWindow.closed )
761 window.gPopupWindow.close();
768 function BsPopupOnClick()
770 if (!gbBsIE4 && !gbBsOpera7)
773 BSSCPopup_ClickMac();
776 function _BSSCOnError(message)
778 if(-1 != message.indexOf("denied")
779 || -1 != message.indexOf("Object required"))
783 //End to support previous relative topics
785 /// Section End - General and relative topics (JavaScript 1.0)
787 /// Section Begin - Popup (JavaScript 1.0)
788 //Begin to support previous popup functions
790 //variables used to isolate the browser type
791 var gBsStyVisShow = null;
792 var gBsStyVisHide = null;
793 var gBsClientWidth = 640;
794 var gBsClientHeight = 480;
796 // here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
797 var gBRateH_W = 0.618; // 1.618 Golden cut.
798 var gBMaxXOfParent = 0.8;
799 var gBMaxYOfParent = 0.8;
800 var gBscrollHeight = 16;
801 var gBscrollWidth = 16;
802 var gBpermitXDelta = 3;
803 var gBpermitYDelta = 3;
806 var arrayPopupURL = new Array();
807 var arrayAbsPopupURL = new Array();
809 var arrayDirty = new Array();
811 function setAbsPopupURL(nIndex, strURL)
813 arrayAbsPopupURL[nIndex] = strURL;
816 function getAbsPopupURL(nIndex)
818 if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;
820 return arrayAbsPopupURL[nIndex];
823 function getPopupURL(nIndex)
825 if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;
827 return arrayPopupURL[nIndex];
830 function getPopupID(nIndex)
832 return gstrPopupID + nIndex;
835 function getPopupShadowID(nIndex)
837 return gstrPopupShadowID + nIndex;
840 function getPopupTopicID(nIndex)
842 return gstrPopupTopicID + nIndex;
845 function getPopupIFrameID(nIndex)
847 return gstrPopupIFrameID + nIndex;
850 function getPopupIFrameName(nIndex)
852 return gstrPopupIFrameName + nIndex;
856 function getPopupTopicStyle(nIndex)
858 return getElement(getPopupTopicID(nIndex)).style;
861 function getPopupShadowStyle(nIndex)
863 return getElement(getPopupShadowID(nIndex)).style;
866 function getPopupIFrame(nIndex)
869 return eval("window.frames['" + getPopupIFrameName(nIndex) + "']");
871 return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");
874 function getPopupDivStyle(nIndex)
876 return getElement(getPopupID(nIndex)).style;
879 function getPopupIFrameStyle(nIndex)
881 return getElement(getPopupIFrameID(nIndex)).style;
885 function findDiv(strURL)
887 for (var i = 0; i < arrayPopupURL.length; i ++ ) {
888 if (arrayPopupURL[i] == strURL) {
899 if (gnToken > 10000) gnToken = 0;
903 function IsValidToken(nToken)
905 return (gnToken == nToken);
908 function addDiv(strURL)
910 for (var i = 0; i < arrayPopupURL.length; i ++) {
911 if (arrayPopupURL[i] == null) {
912 arrayPopupURL[i] = strURL;
916 arrayPopupURL[i] = strURL;
917 arrayDirty[i] = true;
923 for (var i = 0; i < arrayPopupURL.length; i ++ )
924 arrayDirty[i] = true;
927 function IsDirty(nIndex)
932 if (arrayDirty.length > nIndex)
933 return arrayDirty[nIndex];
940 for (var i = 0; i < arrayPopupURL.length; i ++ )
942 getPopupDivStyle(i).visibility = gBsStyVisHide;
943 getPopupIFrameStyle(i).visibility = gBsStyVisHide;
947 function getCurrentPopupIFrame()
949 for (var i = 0; i < arrayPopupURL.length; i ++)
950 if (getPopupDivStyle(i).visibility == gBsStyVisShow)
951 return getPopupIFrame(i);
955 function setClear(nIndex)
958 arrayDirty[nIndex] = false;
961 function _BSSCCreatePopupDiv(strURL)
963 var nIndex = findDiv(strURL);
965 nIndex = addDiv(strURL);
966 BsPopup_CreateDiv(nIndex);
969 if (IsDirty(nIndex)) {
970 if("object" == typeof(getPopupIFrame(nIndex).document))
971 getPopupIFrame(nIndex).document.location.href = strURL;
977 //Here is the browser type
978 function _BSPSGetBrowserInfo()
980 if (gbBsNS4&&!gbBsNS6)
982 gBsStyVisShow = "show";
983 gBsStyVisHide = "hide";
987 gBsStyVisShow = "visible";
988 gBsStyVisHide = "hidden";
992 _BSPSGetBrowserInfo();
994 //Get client size info
995 function _BSPSGetClientSize()
997 if (gbBsNS4||gbBsKonqueror3||gbBsSafari)
999 gBsClientWidth = innerWidth;
1000 gBsClientHeight = innerHeight;
1002 else if (gbBsIE4 || gbBsOpera7)
1004 gBsClientWidth = document.body.clientWidth;
1005 gBsClientHeight = document.body.clientHeight;
1009 var gstrPopupID = 'BSSCPopup';
1010 var gstrPopupShadowID = 'BSSCPopupShadow';
1011 var gstrPopupTopicID = 'BSSCPopupTopic';
1012 var gstrPopupIFrameID = 'BSSCPopupIFrame';
1013 var gstrPopupIFrameName = 'BSSCPopupIFrameName';
1015 var gstrPopupSecondWindowName = 'BSSCPopup';
1017 var gPopupWindow = null;
1018 var gnPopupClickX = 0;
1019 var gnPopupClickY = 0;
1021 var gnPopupScreenClickX = 0;
1022 var gnPopupScreenClickY = 0;
1024 var gbPopupTimeoutExpired = false;
1026 function DHTMLPopupSupport()
1028 if (((gbBsIE4) && (!gbBsMac))||gbBsOpera7|| gbBsNS7) {
1034 function BSSCPopup_IsPopup()
1036 if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) {
1038 } else if ((gbBsNS4 || gbBsIE4 || gbBsOpera7) && (this.name.indexOf(gstrPopupID) != -1)) {
1045 // If there is a hyperlink in a popup window, display the hyperlink in
1046 // the original window. (bsscright)
1047 if (BSSCPopup_IsPopup() && !gbBsIE4 && !gbBsOpera7) {
1048 document.write("<base target=\"bsscright\">");
1052 function BsPopup_CreateDiv(nIndex)
1054 if(!DHTMLPopupSupport())
1056 // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone.
1057 var strPopupDiv = "<DIV ID='" + getPopupID(nIndex) + "' STYLE='position:absolute; top:-100; left:0; z-index:600; visibility:hidden;'>";
1058 strPopupDiv += "<DIV ID='" + getPopupShadowID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#C0C0C0;\"></DIV>";
1059 strPopupDiv += "<DIV ID='" + getPopupTopicID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#FFFFFF;border:1px #000000 outset;\">";
1060 strPopupDiv += "<IFRAME title=\"Popup Window\" ID='" + getPopupIFrameID(nIndex) + "' name='" + getPopupIFrameName(nIndex) + "' src = '" + getPopupURL(nIndex) + "' frameborder=0 scrolling=auto></IFRAME>";
1061 strPopupDiv += "</DIV></DIV>";
1063 var objBody = getElementsByTag(document, "BODY")[0];
1064 if( typeof(objBody) != "object" )
1067 insertAdjacentHTML(objBody, "beforeEnd", strPopupDiv);
1070 function handleLoadNS()
1074 var nIndex = parseInt(this.id.substring(gstrPopupIFrameID.length));
1075 BSSCPopup_PostWork(nIndex);
1079 function BSSCPopup_PostWork(nIndex)
1081 getPopupDivStyle(nIndex).visibility = gBsStyVisShow;
1082 getPopupIFrameStyle(nIndex).visibility =gBsStyVisShow;
1085 window.gbPopupTimeoutExpired = true;
1087 BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document);
1089 getPopupIFrame(nIndex).document.body.addEventListener("click",BSSCPopupClicked,false);
1091 getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked;
1093 if (!gbOrignalOnMouseDown && document.onmousedown)
1094 gbOrignalOnMouseDown = document.onmousedown;
1097 document.addEventListener("mousedown", BSSCPopupParentClicked,false);
1099 document.onmousedown = BSSCPopupParentClicked;
1102 function BSSCPopup_Timeout(nIndex, nToken)
1104 if (!IsValidToken(nToken)) return;
1106 if (gbBsNS6||((getPopupIFrame(nIndex).document.readyState == "complete") &&
1107 (getPopupIFrame(nIndex).document.body != null))) {
1108 BSSCPopup_PostWork(nIndex);
1110 setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100);
1115 // do not change target to parent if the href is using javascript
1116 function BSSCPopup_ChangeTargettoParent(tagsObject)
1118 var collA = getElementsByTag(tagsObject, "A");
1119 BSSCPopup_ChangeTargettoParent2(collA);
1121 var collIMG = getElementsByTag(tagsObject,"IMG");
1122 BSSCPopup_ChangeTargettoParent2(collIMG);
1125 function BSSCPopup_ChangeTargettoParent2(colls)
1127 if (colls != null) {
1128 for (var j = 0; j < colls.length; j ++ )
1130 var strtemp = colls[j].href;
1133 strtemp = strtemp.toLowerCase();
1134 if (strtemp.indexOf("javascript:") == -1)
1135 if (colls[j].target == "")
1136 colls[j].target = "_parent";
1142 function BSPSPopupTopicWinHelp(strURL)
1148 function _BSSCPopup(strURL, width, height)
1152 if ("undefined" != typeof(width) && "undefined" != typeof(height)) {
1157 if (DHTMLPopupSupport()) {
1158 var nToken = takeToken(); // take token first.
1159 var nIndex = _BSSCCreatePopupDiv(strURL);
1160 window.gbPopupTimeoutExpired = false;
1161 var ntWidth = gBsClientWidth;
1162 var ntHeight = gBsClientHeight;
1163 _BSPSGetClientSize();
1164 if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) {
1168 if (IsDirty(nIndex)) {
1170 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight +")", 400);
1172 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100);
1176 MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight);
1179 _BSSCPopup2(strURL, cuswidth, cusheight);
1186 var ehlpdhtm_fOldBefureUnload = window.onbeforeunload;
1188 window.onbeforeunload = window_BUnload;
1191 function window_BUnload()
1196 for (var i = 0; i < arrayPopupURL.length; i ++)
1197 removeThis(document.all(getPopupID(i)));
1198 arrayPopupURL.length = 0;
1199 if (ehlpdhtm_fOldBefureUnload)
1200 ehlpdhtm_fOldBefureUnload();
1203 function _BSSCPopup2(strURL, width, height)
1205 if (gbBsOpera6&&gbBsMac)
1207 var wmTemp = window.open(document.location.href, gstrPopupSecondWindowName);
1209 setTimeout("_BSSCPopup3(\""+strURL+"\","+width+","+height+");",100);
1212 _BSSCPopup3(strURL, width, height);
1215 function _BSSCPopup3(strURL, width, height)
1217 if (window.name == gstrPopupSecondWindowName) {
1218 window.location = strURL;
1220 if (!gbBsMac || !gbBsNS4) {
1221 BSSCHidePopupWindow();
1227 if (width > 0 && height > 0) {
1231 _BSPSGetClientSize();
1233 nX = window.gnPopupScreenClickX;
1234 nY = window.gnPopupScreenClickY;
1236 if (nY + nHeight + 40 > screen.availHeight) {
1237 nY = screen.availHeight - nHeight - 40;
1239 if (nX + nWidth + 40 > screen.availWidth) {
1240 nX = screen.availWidth - nWidth - 40;
1243 // Launch a separate window
1244 var strParam="titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
1247 strParam += ",Height=" + nHeight + ",Width=" + nWidth;
1248 strParam += ",screenX=" + nX + ",screenY=" + nY;
1249 strParam += ",dependent=yes";
1252 strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;
1253 strParam += ",screenX=" + nX + ",screenY=" + nY;
1254 strParam += ",dependent=yes";
1258 strParam += ",height=" + nHeight + ",width=" + nWidth;
1259 strParam += ",left=" + nX + ",top=" + nY;
1263 if (window.gPopupWindow)
1264 window.gPopupWindow.close();
1265 window.gPopupWindow = window.open(strURL, "", strParam);
1266 window.gPopupWindow.name = gstrPopupSecondWindowName;
1267 window.gPopupWindow.moveTo(nX, nY);
1268 widnow.gPopupWindow.document.location.reload();
1275 if (window.gPopupWindow)
1276 window.gPopupWindow.close();
1278 if (gbBsOpera&&gbBsMac)
1280 wmTemp= window.open(document.location.href, "Temp", strParam);
1282 window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
1284 window.gPopupWindow.focus();
1292 else if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3)
1293 setTimeout("setPopupFocus();", 100);
1298 function setEventHandle()
1300 window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUR);
1301 window.gPopupWindow.onclick = NonIEPopup_HandleClick;
1302 window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
1305 function setPopupFocus()
1307 window.gPopupWindow.focus();
1310 function NonIEPopup_HandleBlur(e)
1312 window.gPopupWindow.focus();
1315 function NonIEPopup_HandleClick(e)
1317 // Because navigator will give the event to the handler before the hyperlink, let's
1318 // first route the event to see if we are clicking on a Popup menu in a popup.
1319 document.routeEvent(e);
1321 // If a popup menu is active then don't do anything with the click
1322 if (window.gPopupWindow.gbInPopupMenu) {
1323 window.gPopupWindow.captureEvents(Event.CLICK);
1324 window.gPopupWindow.onclick = NonIEPopup_HandleClick;
1328 // Close the popup window
1331 if(e.target.href.indexOf("javascript:")==-1)
1333 if (e.target.target=="")
1334 window.location.href = e.target.href;
1336 window.open(e.target.href, e.target.target);
1345 function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight)
1347 if (!window.getPopupIFrame(nIndex).document) {
1348 _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight);
1352 if (!IsValidToken(nToken)) return;
1356 setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
1357 BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
1361 if ((window.getPopupIFrame(nIndex).document.readyState == "complete") &&
1362 (window.getPopupIFrame(nIndex).document.body != null)) {
1363 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.
1364 window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
1365 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
1369 setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
1370 BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
1373 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
1377 function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight)
1379 if (window.gbPopupTimeoutExpired) return;
1381 if (!IsValidToken(nToken)) return;
1383 getPopupDivStyle(nIndex).visibility = gBsStyVisHide;
1384 getPopupIFrameStyle(nIndex).visibility = gBsStyVisHide;
1386 // Determine the width and height for the window
1387 _BSPSGetClientSize();
1389 var size = new BSSCSize(0, 0);
1391 if (cuswidth <= 0 || cusheight <= 0)
1392 BSSCGetContentSize(window.getPopupIFrame(nIndex), size);
1398 // Determine the width and height for the window
1399 var nWidth = size.x;
1400 var nHeight = size.y;
1402 // for small popup size, we should allow any size.
1403 // The popup size should be ok if bigger than 0
1404 if (nWidth < 0 || nHeight < 0) return; // there must be something terribly wrong.
1406 getPopupDivStyle(nIndex).width = nWidth;
1407 getPopupDivStyle(nIndex).height = nHeight;
1409 getPopupShadowStyle(nIndex).width = nWidth;
1410 getPopupShadowStyle(nIndex).height = nHeight;
1411 getPopupTopicStyle(nIndex).width = nWidth;
1412 getPopupTopicStyle(nIndex).height = nHeight;
1415 getPopupShadowStyle(nIndex).width = nWidth + 2;
1416 getPopupShadowStyle(nIndex).height = nHeight + 2;
1417 getPopupTopicStyle(nIndex).width = nWidth + 2;
1418 getPopupTopicStyle(nIndex).height = nHeight + 2;
1421 getPopupIFrameStyle(nIndex).width = nWidth;
1422 getPopupIFrameStyle(nIndex).height = nHeight;
1423 if (gbBsIE55 || gbBsNS6)
1425 getPopupIFrameStyle(nIndex).top = 0;
1426 getPopupIFrameStyle(nIndex).left = 0;
1429 var strURL = getPopupURL(nIndex);
1430 if (strURL.indexOf("#") != -1&&gbBsNS6)
1431 getPopupIFrame(nIndex).location.reload();
1432 else if (strURL.indexOf("#") != -1||gbBsNS6)
1433 getPopupIFrame(nIndex).location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5.
1435 MoveDivAndShow(nIndex, nToken, cuswidth, cusheight);
1438 function getScrollLeft()
1440 if (document.body.scrollLeft)
1441 return document.body.scrollLeft;
1442 else if (window.pageXOffset)
1443 return window.pageXOffset;
1448 function getScrollTop()
1450 if (document.body.scrollTop)
1451 return document.body.scrollTop;
1452 else if (window.pageYOffset)
1453 return window.pageYOffset;
1459 function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight)
1461 if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again.
1462 window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
1463 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
1467 // Determine the position of the window
1468 var nClickX = window.gnPopupClickX;
1469 var nClickY = window.gnPopupClickY;
1473 var nWidth = parseInt(getPopupDivStyle(nIndex).width);
1474 var nHeight = parseInt(getPopupDivStyle(nIndex).height);
1476 if (nClickY + nHeight + 20 < gBsClientHeight + getScrollTop()) {
1477 nTop = nClickY + 10;
1479 nTop = (getScrollTop() + gBsClientHeight) - nHeight - 20;
1481 if (nClickX + nWidth < gBsClientWidth + getScrollLeft()) {
1484 nLeft = (getScrollLeft() + gBsClientWidth) - nWidth - 8;
1487 if (nTop < getScrollTop()) nTop = getScrollTop() + 1;
1488 if (nLeft< getScrollLeft()) nLeft = getScrollLeft() + 1;
1490 getPopupDivStyle(nIndex).left = nLeft;
1491 getPopupDivStyle(nIndex).top = nTop;
1493 // Set the location of the background blocks
1494 getPopupShadowStyle(nIndex).left = 6;
1495 getPopupShadowStyle(nIndex).top = 6;
1498 getPopupShadowStyle(nIndex).left = 4;
1499 getPopupShadowStyle(nIndex).top = 4;
1502 if (gbBsMac&&gbBsIE4) {
1503 // Total hack on the iMac to get the IFrame to position properly
1504 getPopupIFrameStyle(nIndex).pixelLeft = 100;
1505 getPopupIFrameStyle(nIndex).pixelLeft = 0;
1506 // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
1507 getPopupIFrame(nIndex).window.BSSCOnLoad();
1510 if (gbBsNS6&&IsDirty(nIndex))
1511 getElement(getPopupIFrameID(nIndex)).addEventListener("load", handleLoadNS, false);
1513 BSSCPopup_Timeout(nIndex , nToken );
1517 function BSSCSize(x, y)
1523 function BSSCGetContentSize(thisWindow, size)
1525 if (!gbBsIE4 && !gbBsOpera7 && !gbBsNS4)
1528 if ((gbBsMac&&gbBsIE4)||gbBsNS4||gbBsOpera7) {
1534 // Resize the width until it is wide enough to handle the content
1535 // The trick is to start wide and determine when the scrollHeight changes
1536 // because then we know a scrollbar is necessary. We can then go back
1537 // to the next widest size (for no scrollbar)
1539 var ClientRate = gBsClientHeight / gBsClientWidth;
1542 var GoldenSize = new BSSCSize(0,0);
1543 GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
1544 GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;
1546 if (ClientRate > gBRateH_W) {
1547 GoldenSize.y = GoldenSize.x * gBRateH_W;
1550 GoldenSize.x = GoldenSize.y / gBRateH_W;
1553 // Try to using parent specified max x.
1555 var maxgoldx = GoldenSize.x;
1556 var maxx = gBsClientWidth * gBMaxXOfParent;
1558 // This double resize causes the document to re-render (and we need it to)
1560 thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
1562 thisWindow.resizeTo(1, 1);
1563 thisWindow.resizeTo(1, 1);
1564 thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
1565 thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
1567 var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
1569 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
1571 thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
1572 thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
1574 miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
1575 maxy = gBsClientHeight * gBMaxYOfParent;
1577 if (miny > maxy) { // the popup must have a scroll, OK let it be.
1581 thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.
1583 else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
1586 // downsize from maxx , now I try to using binary divide.
1592 thisWindow.resizeTo(x, miny);
1593 thisWindow.resizeTo(x, miny);
1594 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
1595 if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
1596 deltax = Math.abs(deltax) /2;
1597 else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
1598 deltax = -Math.abs(deltax) /2;
1600 // the y is close enough to wanted.
1602 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
1605 size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
1606 size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;
1607 thisWindow.document.body.scroll = 'no';
1611 if (thisWindow.document.body.scrollWidth > maxgoldx) {
1614 thisWindow.document.body.scroll = 'yes';
1617 // downsize from maxgoldx , now I try to using binary divide.
1619 deltax = -maxgoldx/2;
1622 thisWindow.resizeTo(x, miny);
1623 thisWindow.resizeTo(x, miny);
1624 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
1625 if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
1626 deltax = Math.abs(deltax) /2;
1627 else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
1628 deltax = -Math.abs(deltax) /2;
1630 // the y is close enough to wanted.
1632 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
1635 size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
1636 size.y = thisWindow.document.body.scrollHeight ;
1637 thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
1638 thisWindow.resizeTo(size.x, size.y);
1639 if (thisWindow.document.body.scrollWidth > size.x)
1641 size.x = thisWindow.document.body.scrollWidth;
1643 if (thisWindow.document.body.scrollHeight > size.y)
1645 size.y = thisWindow.document.body.scrollHeight;
1649 thisWindow.resizeTo(size.x, size.y);
1650 thisWindow.resizeTo(size.x, size.y);
1654 function BSSCPopupParentClicked()
1656 if (!window.gbPopupTimeoutExpired) {
1660 document.onmousedown = gbOrignalOnMouseDown;
1662 // Simply hide the popup
1665 window.gbPopupTimeoutExpired = false;
1670 function isInsideHyperLink(obj)
1672 if (obj&&obj!=getParentNode(obj))
1674 if (obj.tagName=="A"||obj.tagName=="IMG")
1677 return isInsideHyperLink(getParentNode(obj));
1683 function BSSCPopupClicked(e)
1685 if (!window.gbPopupTimeoutExpired) {
1689 var popupIFrame = getCurrentPopupIFrame();
1690 if (popupIFrame == null) {
1694 if (gbBsIE4 && (!((popupIFrame.window.event != null) &&
1695 (popupIFrame.window.event.srcElement != null) &&
1696 isInsideHyperLink(popupIFrame.window.event.srcElement)))) {
1697 document.onmousedown = gbOrignalOnMouseDown;
1699 // Simply hide the popup
1701 window.gbPopupTimeoutExpired = false;
1704 else if (gbBsNS6 && (!((e != null) &&
1705 (e.target!= null) && isInsideHyperLink(e.target))))
1707 document.addEventListener("mousedown", gbOrignalOnMouseDown,false);
1708 // Simply hide the popup
1710 window.gbPopupTimeoutExpired = false;
1715 //trace the mouse over's position for hotspot
1716 function BSPSPopupOnMouseOver(event)
1718 if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) {
1719 window.gnPopupClickX = event.clientX + getScrollLeft();
1720 window.gnPopupClickY = event.clientY + getScrollTop();
1721 window.gnPopupScreenClickX = event.screenX;
1722 window.gnPopupScreenClickY = event.screenY;
1723 } else if (gbBsSafari) {
1724 window.gnPopupClickX = event.clientX + getScrollLeft();
1725 window.gnPopupClickY = event.clientY + getScrollTop();
1726 window.gnPopupScreenClickX = event.screenX + window.screenX;
1727 window.gnPopupScreenClickY = event.screenY + window.screenY;
1728 } else if (gbBsNS4) {
1729 window.gnPopupClickX = event.pageX - window.pageXOffset;
1730 window.gnPopupClickY = event.pageY - window.pageYOffset;
1731 window.gnPopupScreenClickX = event.screenX - window.pageXOffset;
1732 window.gnPopupScreenClickY = event.screenY - window.pageYOffset;
1736 function BSSCHidePopupWindow()
1738 if (window.gPopupWindow != null) {
1740 if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
1741 window.gPopupWindow.close();
1742 window.gPopupWindow = null;
1749 // Add the PopupOnClick to the onclick array.
1750 if (typeof(BsscRegisterOnClick) != "undefined")
1752 BsscRegisterOnClick(BsPopupOnClick);
1754 //End to support previous popup functions
1756 /// Section End - Popup (JavaScript 1.0)
1758 /// Section Begin - Embedded Stub (JavaScript 1.0)
1760 function BSSCCreatePopupDiv()
1765 function WritePopupMenuLayer()
1767 if (BsscHasExtJs()) {_WritePopupMenuLayer();}
1770 function BSSCPopup(strURL, width, height)
1772 var re = new RegExp("'", 'g');
1773 strURL = strURL.replace(re, "%27");
1775 if (BsscHasExtJs()) {
1776 _BSSCPopup(strURL, width, height);
1778 //Create a temporary window first to ensure the real popup comes up on top
1781 wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
1783 // Create the real popup window
1784 var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
1785 // Close the temporary
1794 var gbWndTemp = null, gbWndPopupLinks = null;
1795 var gbstrParaTotal = "";
1797 function PopupMenu_Invoke()
1799 if (typeof(wfRelatedTopic) == 'function' && typeof(IsFlashSupported) == 'function')
1801 if (Number(gsSkinVersion) > 2 && IsFlashSupported())
1803 return wfRelatedTopic(PopupMenu_Invoke.arguments);
1806 if (BsscHasExtJs()) {
1807 return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
1809 if (gbBsNS3Before || gbBsIE3Before ) {
1810 var argLen = PopupMenu_Invoke.arguments.length;
1812 window.document.location.href = PopupMenu_Invoke.arguments[3];
1816 gbWndPopupLinks = null;
1817 gbstrParaTotal = "";
1818 for (var i = 0; i < (argLen - 2) / 2; i++) {
1819 var strParaLine = "";
1821 strParaLine += "<a href=\"";
1822 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
1823 strParaLine += "\">"
1824 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
1825 strParaLine += "</a>";
1827 strParaLine += "<a href=\"javascript:";
1828 strParaLine += "gotoUrl(\'";
1829 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
1830 strParaLine += "\');\"";
1831 if (PopupMenu_Invoke.arguments[1] != '') {
1832 strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
1835 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
1836 strParaLine += "</a>";
1838 strParaLine += "<br>";
1839 gbstrParaTotal += strParaLine;
1841 var nHeight = argLen * 15;
1843 var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
1844 strParam += ",height=" + nHeight + ",width=200,resizable";
1846 //Create a temporary window first to ensure the real popup comes up on top
1847 //var wndTemp = null;
1849 gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
1851 gbWndPopupLinks = window.open("", "popuplinks", strParam);
1853 setTimeout("Wait_PopupMenuReady()", 100);
1858 function Wait_PopupMenuReady()
1860 if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
1861 PopupMenu_InvokeReady();
1864 setTimeout("Wait_PopupMenuReady()", 100);
1867 function PopupMenu_InvokeReady()
1869 if (gbWndPopupLinks != null) {
1870 gbWndPopupLinks.document.open("text/html");
1871 gbWndPopupLinks.document.write("<html><head>");
1873 gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
1875 //YJ: IE301,302 and NS3.x works fine
1876 gbWndPopupLinks.document.write("<");
1877 gbWndPopupLinks.document.write("script>");
1878 gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
1879 gbWndPopupLinks.document.write("<");
1880 gbWndPopupLinks.document.write("/script>");
1882 gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
1883 gbWndPopupLinks.document.write(gbstrParaTotal);
1884 gbWndPopupLinks.document.write("</body></html>");
1885 gbWndPopupLinks.document.close();
1887 // Close the temporary
1888 if (!gbBsNS3 && gbWndTemp != null) {
1891 gbWndPopupLinks.focus();
1899 /// Section End - Embedded Stub (JavaScript 1.0)
1901 //// Segment End -- (JavaScript 1.0)
1903 //// Segment Begin -- (JavaScript 1.2)
1904 /// Section Begin - kadov DHTM (JavaScript 1.2)
1906 //Begin to support extended and dropdown text effects.
1907 function kadovIsParagraph(el)
1909 return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;
1912 function kadovInitEachChild(el)
1914 for(var i=0; i<getChildNodes(el).length; i++)
1916 var child = getChildNodes(el)[i];
1917 if( child.tagName == "SCRIPT" || child.tagName == "!" )
1920 if( child.id != "" )
1922 // to wipe out the onload effects
1923 if (gbBsIE4&&!gbBsMac)
1925 var onLoadEffect = child.style.getAttribute( "x-on-pageload" );
1926 if( (onLoadEffect != null) && (onLoadEffect > "") )
1927 child.style.setAttribute( "x-on-pageload", "" );
1930 var href = child.getAttribute("href")
1931 if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 )
1932 kadovFilePopupInit(child.id); // Init for Popup
1933 else if( child.className == "dropspot" || child.className == "expandspot" ||
1934 child.className == "glossterm" )
1935 kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text
1936 else if( child.className == "trigger")
1937 kadovInitTrigger(child.id);// Init for Trigger
1940 kadovInitEffects(child.id);// Init for DHTML effects
1941 CEngine.SetOneTargetInitialState( child.id );
1945 if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") )
1946 child.start = "mouseover";// to start a AVI file. fileopen doesn't work
1948 kadovInitEachChild(child);
1952 function kadovRetrieveTextInner(el)
1955 if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" ))
1958 if( kadovIsParagraph(el) )
1962 strNewID += "id=" + el.id + "_NewSpan ";
1963 x = "<span" + strNewID + "style='" + el.style.cssText + "'>" + el.innerHTML + "</span>";
1967 for(var i=0; i<getChildNodes(el).length; i++)
1968 x += kadovRetrieveTextInner( getChildNodes(el)[i] );
1973 function kadovRetrieveCleanHTML( strRawHTML, strTagOpen, strTagClose, nDistance )
1975 var nTagOpen = strRawHTML.indexOf( strTagOpen, 0 );
1979 var nTagClose = strRawHTML.indexOf( strTagClose, nTagOpen);
1980 if( nTagClose < nTagOpen )
1983 if( typeof(nDistance) == "number" && nDistance > 0 )
1984 if( (nTagClose - nTagOpen) != nDistance )
1987 var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ;
1988 return kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose );
1991 function kadovAdjustObjectTag(strRawHTML, nStartPos)
1992 {// adjust object tag for related topics HTML control, because innerHTML misses out the item settings
1995 var strDTCTagOpen = '<!--Metadata type="DesignerControl" startspan';
1996 var strDTCTagClose = '<!--Metadata type="DesignerControl" endspan-->';
1997 var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos );
1998 if( nDTCTagOpen < 0 )
2000 var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen );
2001 if( nDTCTagClose < nDTCTagOpen)
2002 return strRawHTML; // no Design Time Controls;
2004 //Is the DTC HTML Help Control?
2005 var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11';
2006 var strRTObjTagClose = '</OBJECT>';
2007 var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen );
2008 if( nRTObjTagOpen < nDTCTagOpen )
2010 var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen );
2011 if( nRTObjTagClose < nRTObjTagOpen )
2012 return strRawHTML; // is not a HTML help control
2014 // Is it a related Topics html help control?
2015 var strRTObjLabel = '<PARAM NAME=\"Command\" VALUE=\"Related Topics';
2016 if( strRawHTML.indexOf(strRTObjLabel, nRTObjTagOpen) < 0 )
2019 // does the commented object tag contain a items parameters
2020 var strRTItemsOpen = '<param name="Items" value="';
2021 var strRTItemsClose = '$$**$$" >';
2022 var strRTItemsClose2 = '$$**$$">';
2024 var nRTItemsOpen = strRawHTML.indexOf(strRTItemsOpen, nDTCTagOpen);
2025 if( nRTItemsOpen < nDTCTagOpen )
2027 var nRTItemsClose = strRawHTML.indexOf(strRTItemsClose, nRTItemsOpen);
2028 if (nRTItemsClose == -1)
2029 nRTItemsClose = strRawHTML.indexOf(strRTItemsClose2, nRTItemsOpen);
2030 if( nRTItemsClose < nRTItemsOpen )
2033 // found a items string
2034 var strItems = strRawHTML.substring( nRTItemsOpen + strRTItemsOpen.length, nRTItemsClose);
2035 if( strItems.length < 1 )
2038 // to reconstruct the item(s) param tag(s)
2039 var strItemsArray = strItems.split('$$**$$');
2040 if( strItemsArray.length < 1 )
2042 var strRunTimeItemParam = "";
2043 for( var i = 0; i < strItemsArray.length; i++ )
2045 strRunTimeItemParam += '<PARAM NAME="Item' + (i+1);
2046 strRunTimeItemParam += '"' + ' VALUE="';
2047 strRunTimeItemParam += strItemsArray[i];
2048 strRunTimeItemParam += '">';
2051 // to insert the reconstructed item params into runtime object tag
2052 var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length);
2053 return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length);
2056 function kadovTextPopupOnLoad( el )
2058 if( typeof(el) == "string" )
2059 el = getElement(el);
2061 var src = el.getAttribute( "x-use-popup" );
2065 for (var i=0;i<gPopupData.length;i++)
2066 if (gPopupData[i].el==el.id)
2068 src=gPopupData[i].popupId;
2074 src = el.style.getAttribute( "x-use-popup" );
2079 if( src.substr(0,1) == "#" )
2080 name = src.substr(1, src.length-1);
2081 var srcDiv = getElement(name);
2087 var type = el.getAttribute( "x-popup-type" );
2089 type = el.style.getAttribute("x-popup-type");
2092 var setup = el.getAttribute( "x-tmp-setup" );
2094 if( newId.indexOf( "_tmp") <= 0 )
2099 el.setAttribute( "x-tmp-setup", 1 );
2101 if( type == "pulldown" )
2103 var strAdjust = kadovAdjustObjectTag(srcDiv.innerHTML,0);
2104 var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
2105 strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
2107 //work around the bug in HH.exe that highlight the phrases when use Search tab
2108 //this approach is just removing the <FONT...> tag inserted by Microsoft in the runtime
2109 strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<FONT color=#", "\">", 52);
2111 var strStyle = " style='display:none; position:relative;";
2112 var newDiv = "<div class=droptext id=" + newId + strStyle + "'>" + strCleanHTML + "</div>";
2114 removeThis(srcDiv); // empty the original DIV tag
2115 var elParentPra = kadovFindParentParagraph(el);
2117 insertAdjacentHTML(elParentPra, "afterEnd", newDiv );
2119 else if( type == "expanding" )
2121 var inner = kadovRetrieveTextInner(srcDiv);
2123 inner = srcDiv.innerHTML;
2124 var strAdjust = kadovAdjustObjectTag(inner,0);
2125 var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
2126 strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
2127 var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext";
2128 var newSpan = "<span class=" + strClassName + " style='display: none;' id=" + newId + "> " + strCleanHTML + "</span>";
2129 removeThis(srcDiv); // empty the original DIV tag
2130 insertAdjacentHTML(el, "afterEnd", newSpan );
2136 srcDiv.style.display = "none";
2141 function getElementsByTag(obj,sTagName)
2143 if(obj.getElementsByTagName)
2144 return obj.getElementsByTagName(sTagName);
2146 return obj.all.tags(sTagName);
2150 function getElement(sID)
2152 if(document.getElementById)
2153 return document.getElementById(sID);
2154 else if(document.all)
2155 return document.all(sID);
2159 function getParentNode(obj)
2162 return obj.parentNode;
2163 else if(obj.parentElement)
2164 return obj.parentElement;
2168 function getChildNodes(obj)
2172 var children = new Array();
2173 for (var i = 0; i < obj.childNodes.length; i++)
2175 if (obj.childNodes[i].nodeType == 1)
2176 children[children.length] = obj.childNodes[i];
2180 else if(obj.children)
2181 return obj.children;
2185 function removeThis(obj)
2188 obj.parentNode.removeChild(obj);
2193 function kadovTextPopup( el )
2195 if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3 )
2201 window.event.cancelBubble = true;
2203 if( typeof(el) == "string" )
2204 el = getElement(el);
2206 if (!el||el==window)
2209 var src = el.getAttribute( "x-use-popup" );
2212 for (var i=0;i<gPopupData.length;i++)
2213 if (gPopupData[i].el==el.id)
2215 src=gPopupData[i].popupId;
2221 src = el.style.getAttribute( "x-use-popup" );
2226 if( src.substr(0,1) == "#" )
2228 name = src.substr(1, src.length-1) + "_tmp";
2230 name = src.substr(1, src.length-1);
2232 var srcDiv = getElement(name);
2238 if( srcDiv.style.display == "" )
2239 srcDiv.style.display = "none";
2242 srcDiv.style.display = "";
2243 if( typeof(srcDiv.bInitialized) == "undefined" )
2245 srcDiv.bInitialized = true;
2246 kadovInitEffects(name);
2247 kadovInitEachChild(srcDiv);
2252 event.returnValue=false;
2256 function kadovFindParentParagraph( el )
2258 if( typeof(el) == "string" )
2259 el = getElement(el);
2260 if( (!el) || el.tagName == "BODY" )
2262 if( kadovIsParagraph(getParentNode(el)) )
2263 return getParentNode(el);
2265 return kadovFindParentParagraph( getParentNode(el) );
2268 //Begin HTML code invoked function
2269 function kadovRegisterEventHandler( obj, strEvent, strEventHandler )
2273 CCSSP.RegisterEventHandler( obj, strEvent, strEventHandler );
2276 function textPopupData(el, popupId)
2279 this.popupId = "#"+popupId;
2282 var gPopupData = new Array();
2284 function kadovTextPopupInit( el, popupId)
2286 if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3)
2289 if( typeof(el) == "string" )
2293 gPopupData[gPopupData.length]=new textPopupData(el, popupId);
2295 el = getElement(el);
2300 CCSSP.RegisterEventHandler( el, "onclick", "kadovTextPopup(\"" + el.id +"\");" );
2301 CCSSP.RegisterEventHandler( window, "onload", "kadovTextPopupOnLoad(\"" + el.id +"\");" );
2304 //End HTML code invoked function
2306 //End to support extended and dropdown text effects.
2308 //Begin to convert iWrite format to RoboEditor Format for DHTML effects
2309 function kadovInitTriggersInHead( )
2311 if( Object.xDelayedInitElements )
2313 var x = Object.xDelayedInitElements;
2314 for(i=0; i<x.length; i++)
2315 kadovInitTrigger( x[i] );
2319 //Begin HTML code invoked function
2320 function kadovFilePopupInit( el )
2322 if( typeof(el) == "string" )
2323 el = getElement(el);
2326 CCSSP.RegisterEventHandler( el, "onmouseover", "BSPSPopupOnMouseOver(event);" );
2329 function kadovInitTrigger( element )
2333 var srcElement = element;
2334 if( typeof(srcElement) == "string" )
2336 srcElement = getElement(element,0);
2337 if(srcElement == null)
2341 if( !kadovIsParentVisible(srcElement) )
2344 var targets = srcElement.getAttribute( "x-targets" );
2346 targets = srcElement.style.getAttribute("x-targets");
2349 var arrOneTarget = targets.split( "," );
2350 for( var i = 0; i < arrOneTarget.length; i ++ )
2351 bsscFXInit( element, arrOneTarget[i], null, null, null, null );
2354 function kadovIsParentVisible( el )
2356 if( typeof(el) == "string" )
2357 el = getElement(el);
2358 if( (!el) || el.tagName == "BODY" )
2360 if( el.style.display == 'none' ) //el.visibility == 'hidden' ||
2363 return kadovIsParentVisible( getParentNode(el) );
2366 function kadovInitEffects( element )
2370 var srcElement = element;
2371 if( typeof(srcElement) == "string" )
2373 srcElement = getElement(element,0);
2374 if(srcElement == null)
2378 if( !kadovIsParentVisible(srcElement) )
2381 kadovInitEffect( srcElement, "x-on-hover" );
2382 kadovInitEffect( srcElement, "x-on-pageclick" );
2383 kadovInitEffect( srcElement, "x-on-pageload" );
2384 kadovInitEffect( srcElement, "x-on-trigger-1" );
2385 kadovInitEffect( srcElement, "x-on-trigger-2" );
2387 //End HTML code invoked function
2389 function kadovInitEffect( element, prop )
2392 if( element.getAttribute( "currentStyle" ) && element.currentStyle.getAttribute)
2393 values = element.currentStyle.getAttribute( prop );
2394 else if (element.style.getAttribute)
2395 values = element.style.getAttribute( prop );
2399 var functions = new Array();
2400 var nIdx = 0, nStart = 0;
2401 var nNext = values.indexOf( "\)", 0);
2402 while( nNext >= 0 && nNext < values.length )
2404 functions[nIdx] = values.substr( nStart, nNext-nStart+1);
2407 nNext = values.indexOf( "\)", nStart);
2410 for( var i=0; i<functions.length; i++)
2412 var id = element.getAttribute( "id" );
2413 var translatedProp = kadovTranslateProp(prop);
2415 var lp = functions[i].indexOf( "(" );
2416 var fnname = functions[i].substring(0, lp);
2417 var srcargs = functions[i].substring(lp+1, functions[i].length-1);
2419 var nClickTimes = 1;
2420 var arrForClickCount = srcargs.split( "," );
2421 for( var j = 0; j < arrForClickCount.length; j++ )
2422 {// to locate and get the "clicks=99" settings
2423 var nPageClick = arrForClickCount[j].indexOf("clicks");
2424 if( nPageClick >= 0 )
2426 nPageClick = arrForClickCount[j].indexOf("=");
2427 if( nPageClick > 0 )
2429 nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1;
2435 if( j < arrForClickCount.length )
2436 {// to strip out the "clicks=99" from the arguments string
2438 for( var k = 0; k < arrForClickCount.length; k ++ )
2442 args += arrForClickCount[k];
2443 if( k < arrForClickCount.length - 1 )
2448 bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes );
2452 function kadovTranslateProp( prop )
2456 case "x-on-hover" : return "bsschover";
2457 case "x-on-pageclick" : return "bsscpageclick";
2458 case "x-on-pageload" : return "bsscpageload";
2459 case "x-on-trigger-1" : return "bssctrigger1";
2460 case "x-on-trigger-2" : return "bssctrigger2";
2464 //End to convert iWrite format to RoboEditor Format for DHTML effects
2466 //Begin the definition of one entry to DHTML effects
2467 function bsscFXInit( trigger_ID, target_ID, event_type,
2468 action_type, action_setting, event_addional )
2470 if( (!gbBsWindows && !gbBsSunOS && !(gbBsMac&&gbBsIE5)) || typeof(target_ID) != "string" )//MUST have a target_ID
2471 return; // we don't support Navigator yet
2473 if( typeof(event_type) == "string" )
2474 event_type = event_type.toLowerCase();
2475 if( typeof(action_type) == "string" )
2476 action_type = action_type.toLowerCase();
2477 if( typeof(action_setting) == "string" )
2478 action_setting = action_setting.toLowerCase();
2480 // to get the target element then add it to the target list
2481 var eleTarget = CCSSP.GetObject( target_ID );
2482 if( (eleTarget != null) && (event_type != null) && (action_type != null) )
2484 CEngine.AddOneTarget( target_ID, eleTarget );
2485 CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional);
2488 // to validate the trigger_ID parameter
2489 if( typeof(trigger_ID) == "string" && trigger_ID != "" )
2490 CEngine.BuildTriggerObject( trigger_ID, target_ID );
2492 //End the definition of one entry to DHTML effects
2494 /// Section End - kadov DHTM (JavaScript 1.2)
2496 /// Section Begin - CCSSP DHTM (JavaScript 1.2)
2498 //Begin JavaScript libary for cross-platform positioning object.
2499 function CCSSP(){} // constructor of CCSSP class
2501 CCSSP.GetObject = function( obj )
2502 {//convert object name string or reference into a valid object reference
2503 if( typeof(obj) == "object" )
2505 else if( typeof(obj) == "string" && obj != "")
2508 return eval("document." + obj);
2510 return eval("document.all(\"" + obj + "\")");
2516 CCSSP.MoveObjectTo = function(obj, x, y)
2517 {//positioning an object at a specific pixel coordinate
2522 obj.style.pixelLeft = x;
2523 obj.style.pixelTop = y;
2527 CCSSP.MoveObjectBy = function(obj, dx, dy)
2528 {//moveing a object by x and/or y pixel
2533 obj.style.pixelLeft += dx;
2534 obj.style.pixelTop += dy;
2538 CCSSP.SetObjectBGColor = function(obj, color)
2539 {//set the background color of an object
2541 obj.bgColor = color;
2543 obj.style.backgroundColor = color;
2546 CCSSP.ShowObject = function(obj, bShow)
2547 {// set the object to be visible or invisible
2549 obj.visibility = (bShow == true) ? 'show' : 'hide';
2551 obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.
2554 CCSSP.GetObjectLeft = function(obj)
2555 {// retrieve the x coordinate of a posionable object
2559 return obj.style.pixelLeft;
2562 CCSSP.GetObjectTop = function(obj)
2563 {// retrieve the y coordinate of a posionable object
2567 return obj.style.pixelTop;
2570 CCSSP.GetObjectContainLeft = function(obj)
2571 {// retrieve the x coordinate of a posionable object relative to it's parent element
2576 if( obj == document.body )
2577 return obj.clientLeft;
2579 return obj.offsetLeft;
2583 CCSSP.GetObjectWindowLeft = function(obj)
2584 {// retrieve the x coordinate of a posionable object relative to browser window
2589 var nOffsetWindowLeft = 0;
2590 for(var element = obj; element; element = element.offsetParent)
2591 nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);
2592 return nOffsetWindowLeft;
2596 CCSSP.GetObjectContainTop = function(obj)
2597 {// retrieve the y coordinate of a posionable object relative to it's parent element
2602 if( obj == document.body )
2603 return obj.clientTop;
2605 return obj.offsetTop;
2609 CCSSP.GetObjectWindowTop = function(obj)
2610 {// retrieve the y coordinate of a posionable object relative to browser window
2615 var nOffsetWindowTop = 0;
2616 for(var element = obj; element; element = element.offsetParent)
2617 nOffsetWindowTop += CCSSP.GetObjectContainTop(element);
2618 return nOffsetWindowTop;
2622 CCSSP.GetObjectHeight = function(obj)
2623 {// retrieve the height of a posionable object
2625 return obj.clip.height;
2627 return obj.offsetHeight;
2630 CCSSP.GetObjectWidth = function(obj)
2631 {// retrieve the width of a posionable object
2633 return obj.clip.width;
2635 return obj.offsetWidth;
2638 CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )
2639 { // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined
2640 if (gbBsNS4 && !gbBsNS6)
2643 var oldHandler = "";
2645 if (gbBsMac &&gbBsIE4&&!gbBsIE5)
2647 if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown")
2648 { //search for <SCRIPT> tag which define the event handler
2649 for( var i = 0; i < document.scripts.length; i++ )
2651 var script = document.scripts[i];
2652 if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
2654 oldHandler = script.innerHTML;
2662 var oldInlineHandler = srcObj[rawEventName.toLowerCase()];
2663 if( oldInlineHandler != null && typeof(oldInlineHandler) != "undefined")
2665 var functionDefinition = oldInlineHandler.toString();
2666 var bodyStart = functionDefinition.indexOf( "{" );
2667 var bodyEnd = functionDefinition.lastIndexOf( "}" );
2668 if( bodyStart > 0 || bodyEnd > bodyStart )
2669 oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );
2672 { //search for <SCRIPT> tag which define the event handler
2673 for( var i = 0; i < document.scripts.length; i++ )
2675 var script = document.scripts[i];
2676 if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
2678 oldHandler = script.innerHTML;
2684 if( oldHandler.indexOf(funcHandler) >= 0 )
2685 return;// to prevent register the funtion twice.
2687 if( gbBsNS4 ) // only "onload, onresize, onfocus" apply to window
2688 {// other raw events will apply to layer
2689 var noOn = rawEventName.substring(2, rawEventName.length);
2690 if( typeof(noOn) == "string" && noOn.length > 3 ) {
2691 if (srcObj.captureEvents)
2692 srcObj.captureEvents( Event[noOn.toUpperCase()] );
2696 var newHandler = oldHandler;
2697 if( newHandler.length == 0 )
2698 newHandler = funcHandler;
2700 newHandler += "; " + funcHandler;
2702 srcObj[rawEventName.toLowerCase()] = new Function( newHandler );
2705 CCSSP.GetWindowHeight = function()
2706 {// retrieve the height of available content in browser window
2708 return window.innerHeight;
2710 return document.body.clientHeight;
2713 CCSSP.GetWindowBottom = function()
2714 {// retrieve the bottom postion of browser window
2716 return window.outerHeight + window.pageYOffset;
2718 return document.body.clientHeight + document.body.scrollTop;
2721 CCSSP.GetWindowWidth = function()
2722 {// retrieve the width of available content in browser window
2724 return window.innerWidth;
2726 return document.body.clientWidth;
2729 CCSSP.GetWindowRight = function()
2730 {// retrieve the right postion of browser window
2732 return window.outerWidth + window.pageXOffset;
2734 return document.body.clientWidth + document.body.scrollLeft;
2737 CCSSP.TrimString = function( objString, subtrim )
2738 {// to trim the "subtrim" in the beginning and ending of a string object
2739 if( typeof(subtrim) != "string" || subtrim == null )
2741 var strHead = objString.substring(0, 1);
2742 var strRear = objString.substring(objString.length-1, objString.length);
2743 if( strHead != subtrim && strRear != subtrim )
2746 var spacePos = objString.indexOf(subtrim);
2749 else if( spacePos == objString.length - 1 )
2750 return objString.substring(0, spacePos);
2753 var newString = objString.substring( spacePos + 1, objString.length);
2754 return CCSSP.TrimString( newString, subtrim );
2758 CCSSP.TrimSpace = function( objString )
2760 var Trim1 = CCSSP.TrimString( objString, " ");
2761 return CCSSP.TrimString( Trim1, "\'");
2764 CCSSP.GetEventElement = function( navEventObject )
2765 {// to get the element who fired the current event
2770 navEventObject.target;
2772 return event.srcElement;
2775 CCSSP.PrepareFilter = function( Obj )
2776 {//to prepare for making the filter work
2777 Obj.style.filter = "";
2778 if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )
2780 Obj.style.height = CCSSP.GetObjectHeight(Obj);
2783 CCSSP.IsDescendant = function( progenitor, progeny )
2785 if( typeof(progeny) == "undefined" || progeny == null )
2787 else if( progeny == progenitor )
2789 else if( progeny.id == progenitor.id )
2791 else if( getParentNode(progeny) == getParentNode(progenitor))
2794 return CCSSP.IsDescendant( progenitor, getParentNode(progeny));
2797 CCSSP.IsTextTag = function( Obj )
2799 if( typeof( Obj.tagName ) == "undefined" )
2801 return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" ||
2802 Obj.tagName == "FONT" || Obj.tagName == "SPAN" );
2805 //End JavaScript libary for cross-platform positioning object.
2807 /// Section End - CCSSP DHTM (JavaScript 1.2)
2809 /// Section Begin - CCSSP DHTM 1 (JavaScript 1.2)
2811 //Begin the definition of class CTrigger
2812 function CTrigger( TriggerElement )
2814 // object : the trigger element. Never be null.
2815 this.eleTrigger = TriggerElement;
2817 // number : the click counter number: only 3 values: 0,1,2;
2820 //object as associative array of string:
2821 // the associate target ID strings; one element at least.
2822 this.objStrTarget = new Object();
2823 this.eleTrigger.style.cursor = "hand";
2824 if( this.eleTrigger.tagName == "AREA" && this.eleTrigger.getAttribute("href") == "" )
2825 this.eleTrigger.setAttribute("href", "#") // to make a hand cursor for image map
2828 CTrigger.prototype.AddTargetID = function( strTargetID )
2829 {// add one target ID string to the objStrTarget
2830 if( typeof(strTargetID) != "string" )
2832 if( typeof(this.objStrTarget[strTargetID]) != "string" )
2833 this.objStrTarget[strTargetID] = strTargetID;
2836 CTrigger.prototype.OnTriggerClick = function()
2837 {// to activate all asociated target
2838 var strEventType = ( (this.nCounter++)% 2 == 0 ) ?
2839 "bssctrigger1" : "bssctrigger2";
2841 // to enumerate associative target element's ID string
2842 for( var strTargetID in this.objStrTarget )
2843 CEngine.SendEventToOneTarget( strTargetID, strEventType );
2845 //End the definition of class CTrigger
2847 //Begin the definition of class CTarget
2848 function CTarget( TargetElement )
2850 // object : the target element. Never be null.
2851 this.eleTarget = TargetElement;
2852 this.objManager = new Object(); // object: the event manager
2855 CTarget.nPageClickCounter = 0;// static class property.
2857 CTarget.prototype.GetAgencyObject = function(str_action_type,action_setting )
2858 {// return the action agency ( effect )object's refernece
2859 switch( str_action_type )
2861 case "show":return new CAgencyShow( this.eleTarget, true ) ;
2862 case "hide":return new CAgencyShow( this.eleTarget, false ) ;
2865 return new CAgencyFly(this.eleTarget, action_setting, true);
2867 return new CAgencyFly(this.eleTarget, action_setting, false);
2869 return new CAgencySpiral(this.eleTarget, action_setting, true);
2871 return new CAgencySpiral(this.eleTarget, action_setting, false);
2873 return new CAgencyZoom(this.eleTarget, action_setting, true);
2875 return new CAgencyZoom(this.eleTarget, action_setting, false);
2877 return new CAgencyElastic(this.eleTarget, action_setting);
2880 return (gbBsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, true) : null;
2882 return (gbBsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, false) : null;
2883 case "rockrollstatic" :
2885 return (gbBsIE4)? new CAgencyWave(this.eleTarget, action_setting, false) : null;
2888 return (gbBsIE4)? new CAgencyGlow(this.eleTarget,action_setting) : null;
2890 return (gbBsIE4)? new CAgencyDropShadow(this.eleTarget,action_setting) : null;
2892 return (gbBsIE4)? new CAgencyRevealTrans(this.eleTarget,action_setting) : null;
2894 return (gbBsIE4)? new CAgencyBlur(this.eleTarget,action_setting) : null;
2896 case "fliph" : // all these 4 do NOT need any parameters
2900 return (gbBsIE4)? new CAgencyChangeFilter(this.eleTarget, str_action_type) : null;
2902 case "fontchange": // the effects below change the style on the fly, so won't work in Navigator
2903 return (gbBsIE4)? new CAgencyFontChange(this.eleTarget,action_setting) : null;
2906 return (gbBsIE4)? new CAgencyChangeStyle(this.eleTarget,action_setting) : null;
2908 default: return null;
2912 CTarget.prototype.SetEventManager = function(
2913 one_event_type,str_action_type,action_setting,event_additional)
2914 {// to set the event manager with specified action
2915 if( typeof( one_event_type ) != "string" ||
2916 typeof( str_action_type ) != "string"||
2917 typeof( action_setting ) != "string" )
2919 if( typeof(this.objManager[one_event_type]) == "undefined" )
2921 this.objManager[one_event_type] = new Object();
2922 this.objManager[one_event_type].length = 0;
2925 var eventAgency = this.GetAgencyObject(str_action_type,action_setting);
2926 if( eventAgency != null )
2928 var ct = this.objManager[one_event_type].length ++;
2929 this.objManager[one_event_type][ct] = eventAgency;
2931 if( one_event_type == "bsscpageclick" )
2932 {// to deal with the "number of pageclick" stuff
2933 if( typeof(event_additional) == "number" )
2934 this.objManager[one_event_type][ct].nPageClick = event_additional;
2935 else // set the default number
2936 this.objManager[one_event_type][ct].nPageClick = 1;
2938 if( (typeof(this.objManager.nMinPageClickIndex) == "undefined") ||
2939 (this.objManager[one_event_type][ct].nPageClick <
2940 this.objManager[one_event_type][this.objManager.nMinPageClickIndex].nPageClick) )
2941 this.objManager.nMinPageClickIndex = ct;
2944 //hide the object blindly,SetState function will take care of the final correct state
2945 if( ((one_event_type == "bsscpageclick") &&
2946 (this.objManager[one_event_type][ct].nPageClick == 1)) ||
2947 one_event_type == "bsscpageload" ||
2948 one_event_type == "bssctrigger1" )
2949 CCSSP.ShowObject( this.eleTarget, false );
2951 if( one_event_type == "bssctrigger1" || one_event_type == "bssctrigger2" )
2952 if( typeof( this.strTriggerEvent ) == "undefined" )
2953 this.strTriggerEvent = ( one_event_type == "bssctrigger1" ) ? "bssctrigger2" : "bssctrigger1";
2960 CTarget.prototype.OnEvent = function( strBsscEvent )
2961 {// response to the event ( bssc format )
2962 if( typeof(this.objManager[strBsscEvent]) == "object" )
2963 { // to get the event agency from the event manager
2964 var eventAgency = this.objManager[strBsscEvent];
2965 for( var i = 0; i < eventAgency.length; i++ )
2967 if( strBsscEvent == "bsscpageclick" &&
2968 eventAgency[i].nPageClick != CTarget.nPageClickCounter )
2970 else if( strBsscEvent == "bsschover" && event.type == "mouseout" )
2971 eventAgency[i].EndEffect();
2972 else // to invoke the unified function in effect object
2973 eventAgency[i].UpdateEffect();
2978 CTarget.prototype.SetState = function( strBsscEvent )
2980 if( typeof(this.objManager[strBsscEvent]) != "object" )
2983 // to get the event agency from the event manager
2984 var eventAgency = this.objManager[strBsscEvent];
2986 if( strBsscEvent == "bsscpageclick" )
2987 {// we only set the initial state for the minium number of pageclick
2988 eventAgency[this.objManager.nMinPageClickIndex].PrepareEffect();
2993 for( var i = 0; i < eventAgency.length; i++ )
2994 eventAgency[i].PrepareEffect(); // to invoke the unified function in effect object
3001 //End the definition of class CTarget
3003 //Begin the definition of CEngine class
3004 function CEngine(){}// all properities are going be "class" properities
3006 // object : as associative array of trigger objects
3007 CEngine.objTrigger = new Object();
3008 // object : as associative array of target objects
3009 CEngine.objTarget = new Object();
3011 // Array : each element is a CAgencyXXX animation object
3012 CEngine.arrAnimation = new Array();
3013 CEngine.PerformAnimation = function( nIndex )
3014 {// animation : update effects function
3015 CEngine.arrAnimation[nIndex].UpdateEffect();
3018 CEngine.AddOneTrigger = function(TriggerID,TriggerElement)
3019 {// add one Trigger object into the trigger array
3020 if( typeof(TriggerID) != "string" || TriggerElement == null ||
3021 typeof(TriggerElement) != "object" )
3023 if( typeof(CEngine.objTrigger[TriggerID] ) != "object" )
3024 CEngine.objTrigger[TriggerID] = new CTrigger(TriggerElement);
3027 CEngine.AddOneTarget = function(TargetID, TargetElement)
3028 {// add one Target object into the target array
3029 if( typeof(TargetID) != "string" || TargetElement == null ||
3030 typeof(TargetElement) != "object" )
3032 if( typeof(CEngine.objTarget[TargetID]) != "object" )
3033 CEngine.objTarget[TargetID] = new CTarget( TargetElement );
3036 CEngine.SendEventToOneTarget = function(strTargetID, strBsscEvent )
3037 {// to activate one target object
3038 if( typeof(CEngine.objTarget[strTargetID]) == "object" )
3040 if( strBsscEvent == "bssctrigger1" || strBsscEvent == "bssctrigger2" )
3041 {//now, the "bssctrigger1" and "bssctrigger2" work like a toggle
3042 if( strBsscEvent == CEngine.objTarget[strTargetID].strTriggerEvent )
3043 strBsscEvent = (strBsscEvent == "bssctrigger1") ? "bssctrigger2" : "bssctrigger1";
3044 CEngine.objTarget[strTargetID].strTriggerEvent = strBsscEvent;
3046 CEngine.objTarget[strTargetID].OnEvent( strBsscEvent );
3050 CEngine.SendEventToAllTarget = function( strBsscEvent )
3051 { //to activate all target associative to the BSSC event
3052 for( var strTargetID in CEngine.objTarget ) //to enumerate all target
3053 CEngine.SendEventToOneTarget( strTargetID, strBsscEvent );
3056 CEngine.SetOneTargetInitialState = function( strTargetID )
3057 {// only invoked after ALL effects for the target have been set
3058 if( typeof(CEngine.objTarget[strTargetID]) == "object" )
3059 {// to get target object
3060 var objTarget = CEngine.objTarget[strTargetID];
3061 if( objTarget.SetState( "bsscpageload" ) == false )
3063 objTarget.SetState( "bsscpageclick" );
3064 objTarget.SetState( "bssctrigger1" );
3069 CEngine.AdjustPageClickCounter = function()
3071 var nAdjustedClickCounter = CTarget.nPageClickCounter;
3072 var bAdjusted = false;
3073 for( var strTargetID in CEngine.objTarget ) //to enumerate all target
3074 {// try to find the minum pageCliclConter greater than CTarget.nPageClickCounter
3075 var objEventPageClick = CEngine.objTarget[strTargetID].objManager.bsscpageclick;
3076 if( objEventPageClick != null )
3078 for( var i = 0; i < objEventPageClick.length; i++ )
3080 var nOtherPageClick = objEventPageClick[i].nPageClick;
3081 if( nOtherPageClick == CTarget.nPageClickCounter )
3083 if( nOtherPageClick > CTarget.nPageClickCounter )
3087 nAdjustedClickCounter = nOtherPageClick;
3090 else if( nOtherPageClick < nAdjustedClickCounter )
3091 nAdjustedClickCounter = nOtherPageClick;
3096 CTarget.nPageClickCounter = nAdjustedClickCounter;
3099 CEngine.OnPageLoad = function()
3101 // first, to set all target's initial state
3102 for( var strTargetID in CEngine.objTarget )
3103 CEngine.SetOneTargetInitialState( strTargetID );
3105 // to invoke all target's onpageload handler
3106 CEngine.SendEventToAllTarget( "bsscpageload" );
3109 CEngine.OnPageClick = function()
3110 { // to invoke all target's onpageclick handler
3111 var src = CCSSP.GetEventElement( arguments[0] );
3115 var objClickedTrigger = null;
3116 for( var strTriggerID in CEngine.objTrigger )
3117 { // to detect which trigger is clicked
3118 if( CCSSP.IsDescendant( CEngine.objTrigger[strTriggerID].eleTrigger,src) )
3120 objClickedTrigger = CEngine.objTrigger[strTriggerID];
3125 if( objClickedTrigger != null) // the clicked trigger found
3126 objClickedTrigger.OnTriggerClick();
3127 else // no trigger is clicked
3128 { // to send PageClick event to all target
3129 CTarget.nPageClickCounter++;
3130 CEngine.AdjustPageClickCounter();
3131 CEngine.SendEventToAllTarget( "bsscpageclick" );
3135 CEngine.OnMouseOver = function()
3136 { // to invoke all target's onpageload handler
3137 var src = CCSSP.GetEventElement( arguments[0] );
3141 var strHoveredTargetID = null;
3142 for( var strTargetID in CEngine.objTarget )
3143 { // to detect which Target is hovering on
3144 if( CCSSP.IsDescendant( CEngine.objTarget[strTargetID].eleTarget, src ) )
3146 strHoveredTargetID = strTargetID;
3151 if( strHoveredTargetID != null ) // the hovered target found
3152 CEngine.SendEventToOneTarget( strHoveredTargetID, "bsschover" );
3155 CEngine.BuildTargetObject = function(target_ID,event_type,action_type,
3156 action_setting, event_additional)
3157 {// to build target object
3158 // to get the target object
3159 if( typeof( CEngine.objTarget[target_ID] ) != "object" )
3160 return false;// the engine's AddOneTarget function might have failed.
3161 var TargetObject = CEngine.objTarget[target_ID];
3163 // to prepare the parameters for the event manager
3164 var arrEvent = event_type.split("|"); // to split the combined event_type string
3165 var arrAction = action_type.split("|");//to split the combined action_type string
3166 for( var trim = 0; trim < arrEvent.length; trim++ )
3167 arrEvent[trim] = CCSSP.TrimSpace(arrEvent[trim]);
3169 for( trim = 0; trim < arrAction.length; trim++ )
3170 arrAction[trim] = CCSSP.TrimSpace(arrAction[trim]);
3172 var arrSetting = new Array();
3173 if( typeof(action_setting) == "string" )
3174 arrSetting = action_setting.split("|");// to split the combined action_setting string
3175 // to calibrate the arrays
3176 for( var i = arrSetting.length; i < arrAction.length; i++ )
3178 if( typeof(arrSetting[i]) != "string" )
3182 // to prepare for dealing with the absolute posioning element
3183 TargetObject.eleTarget.ABSX = CCSSP.GetObjectLeft( TargetObject.eleTarget );
3184 TargetObject.eleTarget.ABSY = CCSSP.GetObjectTop( TargetObject.eleTarget );
3186 if( arrEvent.length > 1 )
3187 {// if event is combined, it must be : "bssctrigger1 | bssctrigger2"
3188 if( arrAction.length != 2 )
3189 return false; // if event is combined, there must be 2 actions
3190 for( i = 0 ; i < 2; i++ )
3192 if( TargetObject.SetEventManager(arrEvent[i], arrAction[i],
3193 arrSetting[i], event_additional) == false )
3194 return false; // the event manager has not been set up
3197 else // the event_type string is not combined
3199 for( i = 0 ; i < arrAction.length; i++ )
3201 TargetObject.SetEventManager(event_type, arrAction[i], arrSetting[i], event_additional);
3202 // to validate the event manager
3203 if( typeof(TargetObject.objManager[event_type]) != "object" ||
3204 typeof(TargetObject.objManager[event_type][i]) != "object" )
3205 return false; // the event manager has not been set up
3211 CEngine.BuildTriggerObject = function(trigger_ID, target_ID)
3212 {// to build the trigger object
3213 var arrTrigger = trigger_ID.split("|"); // to split the combined trigger_ID string
3214 for( var i = 0; i < arrTrigger.length; i ++ )
3215 {// to get the trigger element then add it to the trigger list
3216 arrTrigger[i] = CCSSP.TrimSpace( arrTrigger[i] );
3217 var eleTrigger = CCSSP.GetObject( arrTrigger[i] );
3218 if( eleTrigger == null )
3219 continue; // the trigger_ID string in the HTML code maybe wrong
3220 CEngine.AddOneTrigger( arrTrigger[i], eleTrigger );
3222 // to get the target object
3223 if( typeof( this.objTrigger[arrTrigger[i]] ) != "object" )
3224 continue;// the engine's AddOneTarget function might have failed.
3225 CEngine.objTrigger[arrTrigger[i]].AddTargetID( target_ID );
3228 //End the definition of CEngine class
3230 /// Section End - CCSSP DHTM 1 (JavaScript 1.2)
3232 /// Section Begin - CCSSP DHTM 2 (JavaScript 1.2)
3234 //Begin the definition of CAgencyXXXX classes
3236 //Begin of the CAgencyShow definition
3237 function CAgencyShow( element, bIsShow )
3240 this.bIsShow = bIsShow;
3243 CAgencyShow.prototype.PrepareEffect = function()
3245 CCSSP.ShowObject( this.ele, !this.bIsShow );
3248 CAgencyShow.prototype.UpdateEffect = function()
3250 CCSSP.ShowObject( this.ele, this.bIsShow );
3253 CAgencyShow.prototype.EndEffect = function()
3255 CCSSP.ShowObject( this.ele, !this.bIsShow );
3257 // End of the CAgencyShow definition
3259 // Begin of CAgencyFly definition
3260 function CAgencyFly( element, settings, bIsIn )
3264 this.duration = 1000; // default
3265 this.direction = "right";
3267 var arrAllSet = settings.split(",");
3268 for( var i = 0; i < arrAllSet.length; i ++ )
3269 {// to retrieve the setting
3270 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3271 var arrOneSet = arrAllSet[i].split("=");
3272 for( var j = 0; j < arrOneSet.length; j++ )
3273 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3274 switch( arrOneSet[0] )
3276 case "speed" : this.duration = 100000/arrOneSet[1]; break;
3277 case "direction" : this.direction = arrOneSet[1]; break;
3281 if( gbBsIE5 && this.ele.style.position != "absolute" )
3282 this.ele.style.position = "relative";
3284 this.aniIndex = CEngine.arrAnimation.length;
3285 CEngine.arrAnimation[this.aniIndex] = this;
3288 CAgencyFly.prototype.PrepareEffect = function()
3290 CCSSP.ShowObject(this.ele, !this.bIsIn );
3293 CAgencyFly.prototype.UpdateEffect = function()
3295 if( this.timer == null )
3296 this.ResetParameters();
3298 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
3299 if( percent >= 1.0 )
3303 var newX = this.startX*(1.0-percent) + this.finalX*percent;
3304 var newY = this.startY*(1.0-percent) + this.finalY*percent;
3305 CCSSP.MoveObjectTo(this.ele, newX, newY);
3306 if( this.timer == null )
3307 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
3311 CAgencyFly.prototype.EndEffect = function()
3313 clearInterval( this.timer );
3316 if( this.bIsIn ) // FlyIn
3317 CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
3319 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
3320 CCSSP.ShowObject(this.ele, this.bIsIn );
3323 CAgencyFly.prototype.ResetParameters = function()
3325 this.PrepareEffect();
3326 CCSSP.ShowObject(this.ele, true );
3333 var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;
3334 var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;
3335 var offsetRight = CCSSP.GetWindowRight();
3336 var offsetBottom = CCSSP.GetWindowBottom();
3340 this.finalX = this.ele.ABSX;
3341 this.finalY = this.ele.ABSY;
3343 switch( this.direction )
3345 case "right": this.startX = offsetRight; this.startY = this.finalY; break;
3346 case "left": this.startX = -offsetLeft; this.startY = this.finalY; break;
3347 case "down": this.startY = offsetBottom; this.startX = this.finalX; break;
3348 case "up": this.startY = -offsetTop; this.startX = this.finalX; break;
3350 this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
3351 this.startY = this.startX; break;
3353 this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;
3354 this.startY = -this.startX; break;
3356 this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
3357 this.startY = this.startX; break;
3359 this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
3360 this.startY = -this.startX; break;
3365 this.startX = this.ele.ABSX;
3366 this.startY = this.ele.ABSY;
3368 switch( this.direction )
3370 case "right": this.finalX = offsetRight; this.finalY = this.startY; break;
3371 case "left": this.finalX = -offsetLeft; this.finalY = this.startY; break;
3372 case "down": this.finalY = offsetBottom; this.finalX = this.startX; break;
3373 case "up": this.finalY = -offsetTop; this.finalX = this.startX; break;
3375 this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
3376 this.finalY = this.finalX; break;
3378 this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;
3379 this.finalY = -this.finalX; break;
3381 this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
3382 this.finalY = this.finalX; break;
3384 this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
3385 this.finalY = -this.finalX; break;
3388 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
3389 this.startTime = (new Date()).getTime();
3391 // End of the CAgencyFly definition
3393 // Begin of CAgencySpiral
3394 function CAgencySpiral( element, settings, bIsIn )
3398 this.duration = 1000; // default
3400 var arrAllSet = settings.split(",");
3401 for( var i = 0; i < arrAllSet.length; i ++ )
3402 {// to retrieve the setting
3403 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3404 var arrOneSet = arrAllSet[i].split("=");
3405 for( var j = 0; j < arrOneSet.length; j++ )
3406 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3407 switch( arrOneSet[0] )
3409 case "speed" : this.duration = 100000/arrOneSet[1]; break;
3413 if( gbBsIE5 && this.ele.style.position != "absolute" )
3414 this.ele.style.position = "relative";
3416 this.aniIndex = CEngine.arrAnimation.length;
3417 CEngine.arrAnimation[this.aniIndex] = this;
3420 CAgencySpiral.prototype.PrepareEffect = function()
3422 CCSSP.ShowObject(this.ele, !this.bIsIn );
3425 CAgencySpiral.prototype.UpdateEffect = function()
3427 if( this.timer == null )
3428 this.ResetParameters();
3430 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
3431 if( percent >= 1.0 )
3435 var rf = (this.bIsIn)? (1.0 - percent) : percent;
3436 var t = (1.0-rf) * 4.0 * Math.PI
3437 var rxP = (this.bIsIn)? this.startX : this.finalX;
3438 var ryP = (this.bIsIn)? this.startY : this.finalY;
3439 var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;
3440 var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;
3442 var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;
3443 var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;
3444 CCSSP.MoveObjectTo(this.ele, newX, newY);
3445 if( this.timer == null )
3446 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
3450 CAgencySpiral.prototype.EndEffect = function()
3452 clearInterval( this.timer );
3455 if( this.bIsIn ) // In
3456 CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
3458 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
3459 CCSSP.ShowObject(this.ele, this.bIsIn );
3462 CAgencySpiral.prototype.ResetParameters = function()
3464 this.PrepareEffect();
3465 CCSSP.ShowObject(this.ele, true );
3466 this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;
3467 this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;
3468 this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();
3469 this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom();
3471 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
3472 this.startTime = (new Date()).getTime();
3474 // End of CAgencySpiral
3476 // Begin of CAgencyElastic
3477 function CAgencyElastic( element, settings)
3480 this.duration = 1000; // default
3481 this.direction = "right";
3483 var arrAllSet = settings.split(",");
3484 for( var i = 0; i < arrAllSet.length; i ++ )
3485 {// to retrieve the setting
3486 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3487 var arrOneSet = arrAllSet[i].split("=");
3488 for( var j = 0; j < arrOneSet.length; j++ )
3489 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3490 switch( arrOneSet[0] )
3492 case "speed" : this.duration = 100000/arrOneSet[1]; break;
3493 case "direction" : this.direction = arrOneSet[1]; break;
3497 if( gbBsIE5 && this.ele.style.position != "absolute" )
3498 this.ele.style.position = "relative";
3500 this.aniIndex = CEngine.arrAnimation.length;
3501 CEngine.arrAnimation[this.aniIndex] = this;
3504 CAgencyElastic.prototype.PrepareEffect = function()
3506 CCSSP.ShowObject(this.ele, false );
3509 CAgencyElastic.prototype.UpdateEffect = function()
3511 if( this.timer == null )
3512 this.ResetParameters();
3514 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
3515 if( percent >= 1.0 )
3519 var newX = this.startX;
3520 var newY = this.startY;
3521 var rf = Math.exp(-percent*3);
3522 var t = percent * 1.5 * Math.PI
3523 var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;
3524 switch (this.direction )
3527 case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;
3529 case "down" : newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;
3531 CCSSP.MoveObjectTo(this.ele, newX, newY);
3532 if( this.timer == null )
3533 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
3537 CAgencyElastic.prototype.EndEffect = function()
3539 CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
3540 clearInterval( this.timer );
3544 CAgencyElastic.prototype.ResetParameters = function()
3546 CCSSP.ShowObject(this.ele, true );
3547 this.startX = this.ele.ABSX;
3548 this.finalX = this.ele.ABSX;
3549 this.startY = this.ele.ABSY;
3550 this.finalY = this.ele.ABSY;
3552 switch (this.direction)
3554 case "left": this.startX = -this.ele.offsetWidth; break;
3555 case "right": this.startX = this.ele.offsetWidth; break;
3556 case "up": this.startY = -this.ele.offsetHeight;break;
3557 case "down": this.startY = this.ele.offsetHeight; break;
3559 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
3560 this.startTime = (new Date()).getTime();
3562 // End of CAgencyElastic
3564 // Begin of CAgencyZoom
3565 function CAgencyZoom( element, settings, bIsIn)
3568 this.duration = 1000; // default
3570 var arrAllSet = settings.split(",");
3571 for( var i = 0; i < arrAllSet.length; i ++ )
3572 {// to retrieve the setting
3573 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3574 var arrOneSet = arrAllSet[i].split("=");
3575 for( var j = 0; j < arrOneSet.length; j++ )
3576 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3577 switch( arrOneSet[0] )
3579 case "speed" : this.duration = 100000/arrOneSet[1]; break;
3585 this.aniIndex = CEngine.arrAnimation.length;
3586 CEngine.arrAnimation[this.aniIndex] = this;
3589 CAgencyZoom.prototype.PrepareEffect = function()
3591 CCSSP.ShowObject(this.ele, false);
3594 CAgencyZoom.prototype.UpdateEffect = function()
3596 if( this.timer == null )
3597 this.ResetParameters();
3599 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
3600 if( percent >= 1.0 )
3604 var nFactorIn = Math.ceil(50+50*percent);
3605 var nFactorOut = Math.ceil(100+200*(1-percent));
3606 var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";
3607 var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;
3609 this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);
3610 for(var index = 0; index < this.ele.all.length; index++)
3611 this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);
3613 if( this.timer == null )
3614 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
3618 CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)
3620 if( CCSSP.IsTextTag(child) )
3621 child.style.fontSize = FontSize;
3624 if( typeof(child.orgWidth) == "number" )
3625 child.style.width = Factor * child.orgWidth;
3626 if( typeof(child.orgHeight) == "number" )
3627 child.style.height = Factor * child.orgHeight;
3631 CAgencyZoom.prototype.EndEffect = function()
3633 this.EndEffectAllChildren(this.ele);
3634 for(var index = 0; index < this.ele.all.length; index++)
3635 this.EndEffectAllChildren(this.ele.all[index]);
3637 clearInterval( this.timer );
3641 CAgencyZoom.prototype.EndEffectAllChildren = function( child )
3643 if( CCSSP.IsTextTag(child) )
3644 child.style.fontSize = child.orgFontSize;
3647 if( typeof(child.intactWidth) != "undefined" )
3649 child.width = child.intactWidth;
3650 child.height = child.intactHeight;
3652 else if( typeof(child.style.intactPixelWidth) != "undefined" )
3654 child.style.pixelWidth = child.style.intactPixelWidth;
3655 child.style.pixelHeight = child.style.intactPixelHeight;
3660 CAgencyZoom.prototype.ResetParameters = function()
3662 this.PrepareEffect();
3663 this.ResetParametersAllChildren( this.ele );
3664 for(var index = 0; index < this.ele.all.length; index++)
3665 this.ResetParametersAllChildren(this.ele.all[index]);
3667 this.startTime = (new Date()).getTime();
3670 CAgencyZoom.prototype.ResetParametersAllChildren = function( child )
3672 CCSSP.ShowObject(child, true );
3673 if( (child.tagName == "DIV") && (getParentNode(child).tagName == "TD") )
3674 child.width = "100%";// if the div is inside a cell of table, we need the this hack
3676 if( CCSSP.IsTextTag(child) )
3677 child.orgFontSize = child.style.fontSize;
3680 if( child.width > "" || child.height > "" )
3682 child.orgWidth = child.intactWidth = child.width;
3683 child.orgHeight = child.intactHeight = child.height;
3685 else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )
3687 child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;
3688 child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;
3692 // End of CAgencyZoom
3694 //// the following effects will use IE's exclusive "filter" function ////
3695 // Begin of CAgencyAlpha definition
3696 function CAgencyAlpha( element, settings, bIsIn )
3697 {// because of "visual filter" style, this won't work in Navigator
3701 // to set the default value
3702 this.startOpacity = (this.bIsIn) ? 0 : 100;
3703 this.endOpacity = (this.bIsIn) ? 100 : 0;
3705 this.duration = 1000; // default
3707 var arrAllSet = settings.split(",");
3708 for( var i = 0; i < arrAllSet.length; i ++ )
3709 {// to retrieve the setting
3710 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3711 var arrOneSet = arrAllSet[i].split("=");
3712 for( var j = 0; j < arrOneSet.length; j++ )
3713 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3714 switch( arrOneSet[0] )
3716 case "speed" : this.duration = 100000/arrOneSet[1]; break;
3721 this.aniIndex = CEngine.arrAnimation.length;
3722 CEngine.arrAnimation[this.aniIndex] = this;
3725 CAgencyAlpha.prototype.PrepareEffect = function()
3726 {// to set the visual filter function
3727 // the visual filter ONLY work when set by "Width and Height" or
3728 // absolute position for DIV, SPAN and normal tag ( such as p )
3729 // but, "absolute" cause the following elements overlap, so:
3730 CCSSP.PrepareFilter( this.ele );
3731 CCSSP.ShowObject(this.ele, !this.bIsIn );
3734 CAgencyAlpha.prototype.UpdateEffect = function()
3735 {// to set the visual filter function
3736 if( this.timer == null )
3737 this.ResetParameters();
3738 if( typeof(this.ele.filters.alpha) != "object" )
3744 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
3745 if( percent >= 1.0 )
3747 else if( typeof(this.ele.filters.alpha) == "object" )
3749 this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;
3750 if( this.timer == null )
3751 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
3755 CAgencyAlpha.prototype.EndEffect = function()
3756 {// to remove the visual filter function
3757 clearInterval( this.timer );
3759 this.ele.style.filter = "";
3760 CCSSP.ShowObject(this.ele, this.bIsIn );
3763 CAgencyAlpha.prototype.ResetParameters = function()
3765 this.PrepareEffect();
3766 CCSSP.ShowObject(this.ele, true );
3767 this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";
3768 this.startTime = (new Date()).getTime();
3770 // End of the CAgencyAlpha definition
3772 // Begin of CAgencyWave definition
3773 function CAgencyWave( element, settings )
3774 {// because of "visual filter" style, this won't work in Navigator
3777 this.duration = 0; // default
3780 this.lightstrength = 1;
3782 var arrAllSet = settings.split(",");
3783 for( var i = 0; i < arrAllSet.length; i ++ )
3784 {// to retrieve the setting
3785 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3786 var arrOneSet = arrAllSet[i].split("=");
3787 for( var j = 0; j < arrOneSet.length; j++ )
3788 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3789 switch( arrOneSet[0] )
3791 case "duration" : this.duration = 100000/arrOneSet[1]; break;
3792 case "strength" : this.strength = arrOneSet[1]; break;
3793 case "freq" : this.freq = arrOneSet[1]; break;
3794 case "lightstrength" : this.lightstrength = arrOneSet[1]; break;
3799 this.aniIndex = CEngine.arrAnimation.length;
3800 CEngine.arrAnimation[this.aniIndex] = this;
3803 CAgencyWave.prototype.PrepareEffect = function()
3804 {// to set the visual filter function
3805 CCSSP.PrepareFilter(this.ele);
3807 CCSSP.ShowObject(this.ele, true );
3810 CAgencyWave.prototype.UpdateEffect = function()
3811 {// to set the visual filter function
3812 if( this.timer == null )
3813 this.ResetParameters();
3814 if( typeof(this.ele.filters.wave) != "object" )
3820 if( this.duration > 0 )
3822 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
3823 if( percent >= 1.0 )
3830 this.ele.filters.wave.phase += 5;
3831 this.ele.filters.wave.phase %= 100;
3832 if( this.timer == null )
3833 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );
3836 CAgencyWave.prototype.EndEffect = function()
3837 {// to remove the visual filter function
3838 this.ele.style.filter = "";
3839 clearInterval( this.timer );
3843 CAgencyWave.prototype.ResetParameters = function()
3845 this.PrepareEffect();
3846 this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" +
3847 this.freq +", lightstrength=" + this.lightstrength +",phase=0);";
3848 this.startTime = (new Date()).getTime();
3850 // End of the CAgencyWave definition
3852 // Begin of CAgencyGlow definition
3853 function CAgencyGlow( element, settings )
3854 {// because of "visual filter" style, this won't work in Navigator
3857 // to set the default value
3858 this.glowColor = "green";
3859 this.glowStrength = "3";
3861 var arrAllSet = settings.split(",");
3862 for( var i = 0; i < arrAllSet.length; i ++ )
3864 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3865 var arrOneSet = arrAllSet[i].split("=");
3866 for( var j = 0; j < arrOneSet.length; j++ )
3867 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3868 switch( arrOneSet[0] )
3870 case "color" : this.glowColor = arrOneSet[1]; break;
3871 case "strength" : this.glowStrength = arrOneSet[1]; break;
3876 CAgencyGlow.prototype.PrepareEffect = function()
3878 CCSSP.PrepareFilter(this.ele);
3879 CCSSP.ShowObject(this.ele, true );
3880 if( this.ele.style.backgroundColor != "" )
3881 {//style.backgroundColor somehow stop the visual filter
3882 this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
3883 this.ele.style.backgroundColor = "";
3887 CAgencyGlow.prototype.UpdateEffect = function()
3888 {// to set the visual filter function
3889 this.PrepareEffect();
3890 this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" +
3891 this.glowStrength + ", enabled=true" +")";
3894 CAgencyGlow.prototype.EndEffect = function()
3895 {// to remove the visual filter function
3896 this.ele.style.filter = "";
3897 if( typeof(this.ele.intactBackgroundColor) != "undefined" )
3898 this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
3900 // End of the CAgencyGlow definition
3902 // Begin of CAgencyDropShadow definition
3903 function CAgencyDropShadow( element, settings )
3904 {// because of "visual filter" style, this won't work in Navigator
3907 // to set the default value
3908 this.shadowColor = "black";
3909 this.shadowOffx = "1";
3910 this.shadowOffy = "1";
3912 var arrAllSet = settings.split(",");
3913 for( var i = 0; i < arrAllSet.length; i ++ )
3915 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3916 var arrOneSet = arrAllSet[i].split("=");
3917 for( var j = 0; j < arrOneSet.length; j++ )
3918 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3919 switch( arrOneSet[0] )
3921 case "color" : this.shadowColor = arrOneSet[1]; break;
3922 case "offx" : this.shadowOffx = arrOneSet[1]; break;
3923 case "offy" : this.shadowOffy = arrOneSet[1]; break;
3928 CAgencyDropShadow.prototype.PrepareEffect = function()
3930 CCSSP.PrepareFilter(this.ele);
3931 CCSSP.ShowObject(this.ele, true );
3933 if( this.ele.style.backgroundColor != "" )
3934 {//style.backgroundColor somehow stop the visual filter
3935 this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
3936 this.ele.style.backgroundColor = "";
3940 CAgencyDropShadow.prototype.UpdateEffect = function()
3941 {// to set the visual filter function
3942 this.PrepareEffect();
3943 this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" +
3944 this.shadowOffx + ", offy=" + this.shadowOffy + ")";
3947 CAgencyDropShadow.prototype.EndEffect = function()
3948 {// to remove the visual filter function
3949 this.ele.style.filter = "";
3950 if( typeof(this.ele.intactBackgroundColor) != "undefined" )
3951 this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
3953 // End of the CAgencyDropShadow definition
3955 // Begin of CAgencyRevealTrans definition
3956 function CAgencyRevealTrans( element, settings )
3957 {// because of "visual filter" style, this won't work in Navigator
3960 // to set the default value
3961 this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).
3962 this.transition = 0;
3964 var arrAllSet = settings.split(",");
3965 for( var i = 0; i < arrAllSet.length; i ++ )
3967 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
3968 var arrOneSet = arrAllSet[i].split("=");
3969 for( var j = 0; j < arrOneSet.length; j++ )
3970 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
3971 switch( arrOneSet[0] )
3973 case "type" : this.transition = arrOneSet[1]; break;
3974 case "duration" : this.duration = 100/arrOneSet[1]; break;
3979 CAgencyRevealTrans.prototype.PrepareEffect = function()
3981 CCSSP.PrepareFilter(this.ele);
3982 CCSSP.ShowObject( this.ele, false);
3985 CAgencyRevealTrans.prototype.UpdateEffect = function()
3986 {// to set the visual filter function
3987 if( typeof( this.ele.filters.RevealTrans ) == "object" )
3989 if( this.ele.filters.RevealTrans.status == 2 )
3990 this.ele.filters.RevealTrans.stop();
3993 this.PrepareEffect();
3995 this.ele.style.filter = "RevealTrans(duration=" + this.duration +
3996 ", transition=" + this.transition + ")";
3998 if( typeof( this.ele.filters.RevealTrans ) == "object" )
4000 this.ele.filters.RevealTrans.apply();
4001 CCSSP.ShowObject( this.ele, true);
4002 this.ele.filters.RevealTrans.play();
4005 CCSSP.ShowObject( this.ele, true);
4008 CAgencyRevealTrans.prototype.EndEffect = function()
4010 if( typeof( this.ele.filters.RevealTrans ) == "object" )
4011 this.ele.filters.RevealTrans.stop();
4012 this.ele.style.filter = "";
4014 // End of the CAgencyRevealTrans definition
4016 // Begin of CAgencyBlur definition
4017 function CAgencyBlur( element, settings )
4018 {// because of "visual filter" style, this won't work in Navigator
4021 // to set the default value
4022 this.strength = "5";
4023 this.direction = "90";
4025 var arrAllSet = settings.split(",");
4026 for( var i = 0; i < arrAllSet.length; i ++ )
4028 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
4029 var arrOneSet = arrAllSet[i].split("=");
4030 for( var j = 0; j < arrOneSet.length; j++ )
4031 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
4032 switch( arrOneSet[0] )
4034 case "strength" : this.strength = arrOneSet[1]; break;
4035 case "direction" : this.direction = arrOneSet[1]; break;
4040 CAgencyBlur.prototype.PrepareEffect = function()
4042 CCSSP.PrepareFilter(this.ele);
4043 CCSSP.ShowObject(this.ele, true );
4046 CAgencyBlur.prototype.UpdateEffect = function()
4047 {// to set the visual filter function
4048 CCSSP.PrepareFilter(this.ele);
4049 this.ele.style.filter = "blur(strength=" + this.strength +
4050 ", direction=" + this.direction + ")";
4053 CAgencyBlur.prototype.EndEffect = function()
4054 {// to remove the visual filter function
4055 this.ele.style.filter = "";
4057 // End of the CAgencyBlur definition
4059 // Begin of CAgencyChangeFilter definition
4060 function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,
4061 {// because of "visual filter" style, this won't work in Navigator
4064 // to set the default value
4065 this.filterFunction = settings;
4068 CAgencyChangeFilter.prototype.PrepareEffect = function()
4070 CCSSP.PrepareFilter(this.ele);
4071 CCSSP.ShowObject(this.ele, true );
4074 CAgencyChangeFilter.prototype.UpdateEffect = function()
4075 {// to set the visual filter function
4076 CCSSP.PrepareFilter(this.ele);
4077 this.ele.style.filter = this.filterFunction;
4080 CAgencyChangeFilter.prototype.EndEffect = function()
4081 {// to remove the visual filter function
4082 this.ele.style.filter = "";
4084 // End of the CAgencyChangeFilter definition
4086 // The effects below change the style on the fly, so they won't work in Navigator
4088 // Begin of CAgencyFontChange definition,
4089 function CAgencyFontChange( element, settings )
4090 {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
4093 // to retrieve the original font style
4094 this.RetrieveOldFont( this.ele );
4096 // to set the default font to change
4097 this.newfontFamily = this.ele.oldFontFamily;
4098 this.newfColor = this.ele.oldColor;
4099 this.newtextDecoration = this.ele.oldTextDecoration;
4100 this.newfontWeight = this.ele.oldFontWeight;
4101 this.newfontStyle = this.ele.oldFontStyle;
4102 this.newfontSize = this.ele.oldFontSize;
4103 this.newBackgroundColor = this.ele.oldBackgroundColor;
4105 var arrAllSet = settings.split(",");
4106 for( var i = 0; i < arrAllSet.length; i ++ )
4107 {// to retrieve the setting
4108 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
4109 var arrOneSet = arrAllSet[i].split("=");
4110 for( var j = 0; j < arrOneSet.length; j++ )
4111 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
4112 switch( arrOneSet[0] )
4114 case "font-family" : this.newfontFamily = arrOneSet[1]; break;
4115 case "color" : this.newfColor = arrOneSet[1]; break;
4116 case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;
4117 case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;
4118 case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;
4119 case "size" : this.newfontSize = arrOneSet[1]; break;
4120 case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;
4125 CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)
4127 if( typeof(objChild.oldFontFamily) == "undefined" )
4128 objChild.oldFontFamily = objChild.style.fontFamily;
4129 if( typeof(objChild.oldColor) == "undefined" )
4130 objChild.oldColor = objChild.style.color;
4131 if( typeof(objChild.oldTextDecoration) == "undefined" )
4132 objChild.oldTextDecoration = objChild.style.textDecoration;
4133 if( typeof(objChild.oldFontWeight) == "undefined" )
4134 objChild.oldFontWeight = objChild.style.fontWeight;
4135 if( typeof(objChild.oldFontStyle) == "undefined" )
4136 objChild.oldFontStyle = objChild.style.fontStyle;
4137 if( typeof(objChild.oldFontSize) == "undefined" )
4138 objChild.oldFontSize = objChild.style.fontSize;
4139 if( typeof(objChild.oldBackgroundColor) == "undefined" )
4140 objChild.oldBackgroundColor = objChild.style.backgroundColor;
4143 CAgencyFontChange.prototype.PrepareEffect = function()
4145 // as for expanding text, the child is created after the constructor called
4146 for(var index = 0; index < this.ele.all.length; index++)
4147 this.RetrieveOldFont(this.ele.all[index]);
4148 CCSSP.ShowObject(this.ele, true );
4151 CAgencyFontChange.prototype.UpdateEffect = function()
4152 {// to change the font
4153 this.PrepareEffect();
4154 this.UpdateEffectAllChildren( this.ele );
4155 for( var index = 0; index < this.ele.all.length; index++)
4156 this.UpdateEffectAllChildren(this.ele.all[index]);
4159 CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)
4161 objChild.style.fontFamily = this.newfontFamily;
4162 objChild.style.color = this.newfColor;
4163 objChild.style.textDecoration = this.newtextDecoration;
4164 objChild.style.fontWeight = this.newfontWeight;
4165 objChild.style.fontStyle = this.newfontStyle;
4166 objChild.style.fontSize = this.newfontSize;
4167 objChild.style.backgroundColor = this.newBackgroundColor;
4170 CAgencyFontChange.prototype.EndEffect = function()
4171 {// to reinstate the original font style
4172 this.EndEffectAllChildren( this.ele );
4173 for( var index = 0; index < this.ele.all.length; index++)
4174 this.EndEffectAllChildren(this.ele.all[index]);
4177 CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )
4179 if( typeof(objChild.oldFontFamily) != "undefined" )
4180 objChild.style.fontFamily = objChild.oldFontFamily;
4181 if( typeof(objChild.oldColor) != "undefined" )
4182 objChild.style.color = objChild.oldColor;
4183 if( typeof(objChild.oldFontWeight) != "undefined" )
4184 objChild.style.fontWeight = objChild.oldFontWeight;
4185 if( typeof(objChild.oldFontStyle) != "undefined" )
4186 objChild.style.fontStyle = objChild.oldFontStyle;
4187 if( typeof(objChild.oldFontSize) != "undefined" )
4188 objChild.style.fontSize = objChild.oldFontSize;
4189 if( typeof(objChild.oldTextDecoration) != "undefined" )
4190 objChild.style.textDecoration = objChild.oldTextDecoration;
4191 if( typeof(objChild.oldBackgroundColor) != "undefined" )
4192 objChild.style.backgroundColor = objChild.oldBackgroundColor;
4194 // End of the CAgencyFontChange definition
4196 // Begin of the CAgencyChangeStyle definition
4197 function CAgencyChangeStyle( element, settings )
4198 {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
4201 // to retrieve the original style
4202 this.oldstyle = this.ele.style.cssText;
4204 // to set the default style
4205 this.newStyle = this.oldstyle;
4207 if( typeof(settings) == "string" && settings.length > 1 )
4208 this.newStyle = this.oldstyle + " " + settings;
4211 CAgencyChangeStyle.prototype.PrepareEffect = function()
4213 CCSSP.ShowObject(this.ele, true );
4216 CAgencyChangeStyle.prototype.UpdateEffect = function()
4217 {// to change the style
4218 this.ele.style.cssText = this.newStyle;
4221 CAgencyChangeStyle.prototype.EndEffect = function()
4222 {// to reinstate the original style
4223 this.ele.style.cssText = this.oldStyle;
4225 // End of the CAgencyChangeStyle definition
4227 //End the definition of CAgencyXXXX classes
4229 //Begin to collaborate with other event handler settings
4230 CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");
4231 CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");
4232 CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );
4233 CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );
4234 CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");
4235 //End to collaborate with other event handler settings
4237 /// Section End - CCSSP DHTM 2 (JavaScript 1.2)
4239 //// Segment End -- (JavaScript 1.2)