1 // eHelp® Corporation Dynamic HTML JavaScript
\r
2 // Copyright© 1998-2003 eHelp® Corporation.All rights reserved.
\r
5 // Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten.
\r
7 //// Segment Begin -- (JavaScript 1.0)
\r
9 /// Section Begin - General and relative topics(JavaScript 1.0)
\r
11 //{{HH_SYMBOL_SECTION
\r
12 var HH_ChmFilename = "";
\r
13 var HH_WindowName = "";
\r
14 var HH_GlossaryFont = "";
\r
15 var HH_Glossary = "";
\r
17 var HH_ActiveX = false;
\r
18 //}}HH_SYMBOL_SECTION
\r
20 //Begin to support previous generic parameters
\r
21 //Get the information about the browser.
\r
22 var gstrBsAgent = navigator.userAgent.toLowerCase();
\r
23 var gnBsVer = parseInt(navigator.appVersion);
\r
25 var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1);
\r
26 var gbBsKonqueror = (gstrBsAgent.indexOf('konqueror') != -1);
\r
27 var gbBsSafari = (gstrBsAgent.indexOf('safari') != -1);
\r
28 var gbBsIE = (gstrBsAgent.indexOf('msie') != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
\r
29 var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1)) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;
\r
31 var gbBsMac = (gstrBsAgent.indexOf('mac') != -1);
\r
32 var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1));
\r
33 var gbBsSunOS = (gstrBsAgent.indexOf("sunos") != -1);
\r
35 var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2));
\r
36 var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3));
\r
38 var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2));
\r
39 var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3));
\r
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)));
\r
41 var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1));
\r
43 var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4));
\r
44 var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5));
\r
45 var gbBsNS7 = false;
\r
47 var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4));
\r
48 var gbBsIE5 = false;
\r
49 var gbBsIE55 = false;
\r
51 var gbBsOpera6 = false;
\r
52 var gbBsOpera7 = false;
\r
54 var gbBsKonqueror3 = false;
\r
58 gbBsIE = (navigator.appName.indexOf("Microsoft") != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;;
\r
61 if (parseInt(navigator.appVersion) >= 4) {
\r
64 var nPos = gstrBsAgent.indexOf("msie");
\r
65 var strIEversion = gstrBsAgent.substring(nPos + 5);
\r
66 var nVersion = parseFloat(strIEversion);
\r
69 if (nVersion >= 5.5)
\r
76 var nPos=gstrBsAgent.indexOf("gecko");
\r
79 var nPos2=gstrBsAgent.indexOf("/", nPos);
\r
82 var nVersion=parseFloat(gstrBsAgent.substring(nPos2+1));
\r
83 if (nVersion>=20020823)
\r
90 var nPos = gstrBsAgent.indexOf("opera");
\r
93 var nVersion = parseFloat(gstrBsAgent.substring(nPos+6));
\r
104 var nPos = gstrBsAgent.indexOf("konqueror");
\r
107 var nVersion = parseFloat(gstrBsAgent.substring(nPos+10));
\r
110 gbBsKonqueror3=true;
\r
115 function insertAdjacentHTML(obj, where, htmlStr)
\r
117 if (gbBsIE || gbBsOpera7)
\r
119 obj.insertAdjacentHTML(where, htmlStr);
\r
121 else if (gbBsNS6 || gbBsSafari)
\r
123 var r = obj.ownerDocument.createRange();
\r
124 r.setStartBefore(obj);
\r
125 var parsedHTML = r.createContextualFragment(htmlStr);
\r
128 case 'beforeBegin':
\r
129 obj.parentNode.insertBefore(parsedHTML,obj);
\r
132 obj.insertBefore(parsedHTML,obj.firstChild);
\r
135 obj.appendChild(parsedHTML);
\r
138 if (obj.nextSibling){
\r
139 obj.parentNode.insertBefore(parsedHTML,obj.nextSibling);
\r
141 obj.parentNode.appendChild(parsedHTML);
\r
148 // Utilities functions.
\r
149 function BsscHasExtJs()
\r
151 if( gbBsIE3Before || gbBsNS3Before)
\r
156 // Register event handler
\r
157 var gBsOnLoads = new Array(); // An array holds all the onload event handler.
\r
158 var gBsOnClicks = new Array(); // An array holds all the onClick event handler.
\r
159 var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler.
\r
160 var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler.
\r
161 var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler.
\r
163 var gbOrignalOnMouseDown = null;
\r
165 function BsscRegisterOnLoad(funcHandler)
\r
167 var nLength = gBsOnLoads.length;
\r
168 gBsOnLoads[nLength] = funcHandler;
\r
171 function BsscRegisterOnClick(funcHandler)
\r
173 var nLength = gBsOnClicks.length;
\r
174 gBsOnClicks[nLength] = funcHandler;
\r
177 function BsscRegisterOnUnLoad(funcHandler)
\r
179 var nLength = gBsOnUnLoads.length;
\r
180 gBsOnUnLoads[nLength] = funcHandler;
\r
183 function BsscRegisterOnMouseOver(funcHandler)
\r
185 var nLength = gBsOnMouseOvers.length;
\r
186 gBsOnMouseOvers[nLength] = funcHandler;
\r
189 function BsscRegisterOnMouseOut(funcHandler)
\r
191 var nLength = gBsOnMouseOuts.length;
\r
192 gBsOnMouseOuts[nLength] = funcHandler;
\r
195 function BsGeneralOnLoad()
\r
197 if (!gbBsIE4 && !gbBsNS4)
\r
200 // Make everything visible in navigator
\r
201 if (gbBsNS4 && !gbBsNS6) {
\r
202 // Make some special effects items visible
\r
203 for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
\r
204 document.layers[iLayer].visibility = "show";
\r
205 document.layers[iLayer].left = 0;
\r
210 // If resize the netscape browser, need to reload it.
\r
213 if (innerWidth != origWidth || innerHeight != origHeight)
\r
216 // End of the local functions.
\r
218 // The following functions are used by the html files.
\r
219 function BSSCOnLoad()
\r
221 if( !BsscHasExtJs() )
\r
223 for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--)
\r
224 gBsOnLoads[nElement]();
\r
227 function BSSCOnClick()
\r
229 if (!BsscHasExtJs()) return;
\r
231 for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--)
\r
232 gBsOnClicks[nElement]();
\r
235 function BSSCOnUnload()
\r
237 if (!BsscHasExtJs()) return;
\r
238 for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--)
\r
239 gBsOnUnLoads[nElement]();
\r
242 function BSSCOnMouseOver()
\r
244 if (!BsscHasExtJs()) return;
\r
245 for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--)
\r
246 gBsOnMouseOvers[nElement]();
\r
249 function BSSCOnMouseOut()
\r
251 if (!BsscHasExtJs()) return;
\r
252 for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--)
\r
254 gBsOnMouseOuts[nElement]();
\r
257 // End of invocation of the event handle functions.
\r
259 // Add the GereralOnLoad to the onload array.
\r
260 if (typeof(BsscRegisterOnLoad) != "undefined")
\r
262 BsscRegisterOnLoad(BsGeneralOnLoad);
\r
264 if (gbBsNS4&&!gbBsNS6) {
\r
265 origWidth = innerWidth;
\r
266 origHeight = innerHeight;
\r
269 //End to support previous generic parameters
\r
271 //Begin to support previous HHActiveX invoking
\r
272 function BsHHActivateComponents()
\r
274 if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
\r
276 var objBody = getElementsByTag(document,"BODY")[0];
\r
277 if( typeof(objBody) == "object" )
\r
279 insertAdjacentHTML(objBody, "beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
\r
280 if (HHComponentActivator.object)
\r
281 HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
\r
286 function BsHHActivXOnLoad()
\r
289 BsHHActivateComponents();
\r
292 if( typeof(BsscRegisterOnLoad) != "undefined" )
\r
294 BsscRegisterOnLoad(BsHHActivXOnLoad);
\r
296 //End to support previous HHActiveX invoking
\r
298 //Begin to support previous relative topics
\r
299 //If webHelp needs Related Topics DHTMLcode, it's supposed to add it here
\r
300 var gbPopupMenuTimeoutExpired = false;
\r
301 var gbInPopupMenu = false;
\r
302 var gbPopupMenuTopicList = null;
\r
303 var gOlddocumentClick = null;
\r
305 //////////////////////////////////////////////////////////////////////////////////////////
\r
309 //////////////////////////////////////////////////////////////////////////////////////////
\r
311 var g_bIsPopupMenuInit = false;
\r
312 function _WritePopupMenuLayer()
\r
314 if (!g_bIsPopupMenuInit)
\r
316 if (gbBsNS4&&!gbBsNS6) {
\r
317 //Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page...
\r
318 document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
\r
320 document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
\r
321 if (!(gbBsNS4&&!gbBsNS6)) {
\r
322 document.write("<STYLE TYPE='text/css'>");
\r
323 if (gbBsMac&&gbBsIE4) {
\r
324 document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
\r
325 document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; font-style:normal;font-weight:normal;text-decoration:none;}");
\r
327 document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
\r
328 document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; font-style:normal;font-weight:normal;text-decoration:none;}");
\r
330 document.write("</STYLE>");
\r
333 g_bIsPopupMenuInit = true;
\r
337 //Seek for the bsscright frame
\r
338 function _SeekFrameByName( cRoot, strName )
\r
340 if( cRoot == null ) return null;
\r
341 if( cRoot.frames == null ) return null;
\r
342 if( cRoot.frames[strName] != null ) return cRoot.frames[strName];
\r
343 for (var i=0; i<cRoot.frames.length; i++)
\r
347 cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
\r
349 cObj = _SeekFrameByName( cRoot.frames[i], strName );
\r
350 if( cObj != null ) return cObj;
\r
354 function _GetFrameByName( cRoot, strName )
\r
356 if( cRoot == null ) return null;
\r
357 var cRet = _SeekFrameByName(cRoot, strName);
\r
358 if( cRet != null ) return cRet;
\r
359 if (cRoot.parent != cRoot)
\r
360 return _GetFrameByName( cRoot.parent, strName );
\r
365 var gfn_arguments = null;
\r
366 function _PopupMenu_Invoke(fn_arguments)
\r
368 gfn_arguments = fn_arguments;
\r
369 if (gbBsOpera6&&gbBsMac)
\r
371 var wndOldPopupLinks= window.open(document.location.href, "popuplinks");
\r
372 wndOldPopupLinks.close();
\r
373 setTimeout("_PopupMenu_Invoke_2();",100);
\r
377 _PopupMenu_Invoke_2();
\r
381 function _PopupMenu_Invoke_2()
\r
383 var fn_arguments = gfn_arguments;
\r
384 gfn_arguments = null;
\r
386 // Make sure we have reasonable arguments
\r
387 var argLen = fn_arguments.length;
\r
392 // Check to see if we only have one target
\r
393 var strTarget = "";
\r
394 var targetDoc = null;
\r
395 if (fn_arguments[1] == '') {
\r
396 if (BSSCPopup_IsPopup()) {
\r
397 targetDoc = parent;
\r
398 strTarget = "TARGET= _parent";
\r
401 targetDoc = window.document;
\r
403 targetDoc = _GetFrameByName( parent, fn_arguments[1] );
\r
405 strTarget = "TARGET='" + fn_arguments[1] + "'";
\r
408 if ((!gbBsIE4 && !gbBsNS4 && !gbBsOpera7 && !gbBsKonqueror3 &&!gbBsSafari) || ((gbBsMac) && (gbBsIE4) && (window.event.srcElement.tagName == "AREA"))) {
\r
410 var argLen = fn_arguments.length;
\r
412 // Create the window that the hyperlinks will go into
\r
413 var nHeight = argLen * 15;
\r
415 var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
\r
416 strParam += ",height=" + nHeight + ",width=200";
\r
417 strParam += ",resizable";
\r
420 // Create a temporary window first to ensure the real popup comes up on top
\r
422 wndTemp = window.open("", "temp", strParam);
\r
424 // Create the real popup window
\r
425 var wndPopupLinks=null;
\r
426 if (gbBsOpera&&gbBsMac)
\r
428 wndTemp = window.open(document.location.href, "temp", strParam);
\r
429 wndPopupLinks= window.open(document.location.href, "popuplinks", strParam);
\r
432 wndPopupLinks= window.open("", "popuplinks", strParam);
\r
433 wndPopupLinks.document.open("text/html");
\r
435 // Close the temporary
\r
439 var sHTML="<html><head></head>";
\r
440 sHTML+="<body onBlur=\'self.focus();\'>";
\r
441 var strParaLine = "";
\r
442 for (var i = 0; i < (argLen - 2) / 2; i++) {
\r
444 strParaLine += "<a href=\"javascript:";
\r
446 strParaLine += "onBlur=null; ";
\r
448 strParaLine += "opener.location=\'";
\r
449 strParaLine += fn_arguments[2 * i + 3];
\r
450 strParaLine += "\';close();\"";
\r
451 strParaLine += strTarget;
\r
453 strParaLine += ">";
\r
454 strParaLine += fn_arguments[2 * i + 2];
\r
455 strParaLine += "</a>";
\r
456 strParaLine += "<br>";
\r
457 sHTML+=strParaLine;
\r
459 sHTML+="</body></html>";
\r
460 wndPopupLinks.document.write(sHTML);
\r
461 wndPopupLinks.document.close();
\r
462 window.gbInPopupMenu = true;
\r
464 wndPopupLinks.focus();
\r
469 if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
\r
470 ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
\r
471 // Get the place that we will be putting the topic into
\r
473 if (isNaN(fn_arguments[2]) || (gbPopupMenuTopicList == null)) {
\r
474 strURL = fn_arguments[3];
\r
477 strURL = gbPopupMenuTopicList[fn_arguments[2]].strURL;
\r
480 if (targetDoc != null) {
\r
481 targetDoc.location.href = strURL;
\r
484 if (fn_arguments[1] != null && typeof(fn_arguments[1]) != "undefined")
\r
485 window.open(strURL, fn_arguments[1]);
\r
487 window.open(strURL);
\r
489 window.gbInPopupMenu = true;
\r
494 if (gbBsNS4&&!gbBsNS6) {
\r
495 strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
\r
497 strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
\r
499 strMenu += ' CELLPADDING=4';
\r
501 strMenu += ' CELLPADDING=2';
\r
503 strMenu += ' BGCOLOR=#c0c0c0>';
\r
505 // Add each of the items
\r
507 while (i <= argLen - 1) {
\r
508 strMenu += '<TR><TD><NOBR>'
\r
509 // If the destination is a number then look it up in the topic list
\r
510 if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
\r
511 strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
\r
513 strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
\r
515 strMenu += ' onclick="PopupMenu_HandleClick(event);"';
\r
516 strMenu += ' onmouseover="PopupMenu_Over(event);"';
\r
517 strMenu += ' onmouseout="PopupMenu_Out(event);"';
\r
519 if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
\r
520 strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
\r
522 strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
\r
524 strMenu += '</A></DIV></NOBR></TD></TR>';
\r
526 if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
\r
532 strMenu += "</TABLE>";
\r
535 // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
\r
536 strMenu +="<TABLE></TABLE>";
\r
539 var layerPopup = null;
\r
540 var stylePopup = null;
\r
543 var nWindowWidth = 0;
\r
544 if (gbBsIE4 || gbBsOpera7) {
\r
546 layerPopup = getElement("PopupMenu");
\r
547 layerPopup.innerHTML = strMenu;
\r
548 stylePopup = layerPopup.style;
\r
550 _BSPSGetClientSize();
\r
552 // Get the position of the item causing the event (relative to its parent)
\r
553 nEventX = window.event.clientX;
\r
554 nEventY = window.event.clientY;
\r
556 if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
\r
557 nEventY += document.body.scrollTop + 10;
\r
559 nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
\r
561 stylePopup.top = nEventY;
\r
563 var nPopupWidth = layerPopup.scrollWidth;
\r
565 nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup.
\r
567 if (nEventX + nPopupWidth + 20 > gBsClientWidth) {
\r
568 if (gBsClientWidth - nPopupWidth < 5) {
\r
569 stylePopup.left = 5;
\r
571 stylePopup.left = gBsClientWidth - nPopupWidth - 5;
\r
574 stylePopup.left = nEventX + document.body.scrollLeft + 20;
\r
577 stylePopup.visibility = "visible";
\r
578 if (!gOlddocumentClick && document.onclick)
\r
579 gOlddocumentClick = document.onclick;
\r
580 document.onclick = PopupMenu_HandleClick;
\r
582 } else if (gbBsNS6 || gbBsKonqueror3||gbBsSafari) {
\r
583 layerPopup = getElement("PopupMenu");
\r
584 layerPopup.style.visibility = "hidden";
\r
588 var e = fn_arguments[0];
\r
594 nEventX = window.event.clientX;
\r
595 nEventY = window.event.clientY;
\r
597 _BSPSGetClientSize();
\r
598 layerPopup.innerHTML = strMenu;
\r
600 if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) {
\r
603 nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20;
\r
606 if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) {
\r
607 if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) {
\r
610 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20;
\r
615 layerPopup.style.top = nEventY;
\r
616 layerPopup.style.left = nEventX;
\r
617 // set again to avoid the stupid frash in netscape 6.
\r
618 layerPopup.innerHTML = strMenu;
\r
619 layerPopup.style.visibility = "visible";
\r
620 //window.captureEvents(Event.MOUSEDOWN);
\r
621 if (!gOlddocumentClick && document.onclick)
\r
622 gOlddocumentClick = document.onclick;
\r
623 window.onclick = PopupMenu_HandleClick;
\r
625 else if (gbBsNS4) {
\r
626 layerPopup = document.layers.PopupMenu;
\r
627 layerPopup.visibility = "hide";
\r
628 stylePopup = layerPopup.document;
\r
629 stylePopup.write(strMenu);
\r
630 stylePopup.close();
\r
631 var e = fn_arguments[0];
\r
634 _BSPSGetClientSize();
\r
635 if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
\r
638 nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
\r
640 layerPopup.top = nEventY;
\r
642 if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
\r
643 if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
\r
646 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
\r
652 layerPopup.left = nEventX;
\r
654 layerPopup.visibility = "show";
\r
656 window.captureEvents(Event.MOUSEDOWN);
\r
657 if (!gOlddocumentClick && document.onmousedown)
\r
658 gOlddocumentClick = document.onmousedown;
\r
659 window.onmousedown = PopupMenu_HandleClick;
\r
662 window.gbInPopupMenu = true;
\r
663 window.gbPopupMenuTimeoutExpired = false;
\r
664 setTimeout("PopupMenu_Timeout();", 100);
\r
668 function PopupMenu_Timeout()
\r
670 window.gbPopupMenuTimeoutExpired = true;
\r
673 function PopupMenu_Over(e)
\r
675 if (gbBsIE4||gbBsOpera7)
\r
676 e.srcElement.className = "PopupOver";
\r
678 e.target.parentNode.className = "PopupOver";
\r
682 function PopupMenu_Out(e)
\r
684 if (gbBsIE4||gbBsOpera7)
\r
685 e.srcElement.className = "PopupNotOver";
\r
687 e.target.parentNode.className = "PopupNotOver";
\r
691 function PopupMenu_HandleClick(e)
\r
693 if (window.gbPopupMenuTimeoutExpired) {
\r
694 window.gbInPopupMenu = false;
\r
695 if (gbBsNS4 && !gbBsNS6) {
\r
696 window.releaseEvents(Event.MOUSEDOWN);
\r
699 var layerPopup = null;
\r
700 if (gbBsNS4&&!gbBsNS6) {
\r
701 layerPopup = document.layers.PopupMenu;
\r
702 layerPopup.visibility = "hide";
\r
704 layerPopup = getElement("PopupMenu");
\r
705 layerPopup.style.visibility = "hidden";
\r
708 if (gOlddocumentClick)
\r
710 if (gbBsNS4 && !gbBsNS6)
\r
711 document.onmousedown = gOlddocumentClick;
\r
713 document.onclick = gOlddocumentClick;
\r
719 function BSSCPopup_ClickMac()
\r
721 if ((!DHTMLPopupSupport()) && (gbBsIE4 || gbBsOpera7))
\r
723 var bClickOnAnchor = false;
\r
725 if ((window.event != null) &&
\r
726 (window.event.srcElement != null))
\r
728 el = window.event.srcElement;
\r
731 if ((el.tagName == "A") || (el.tagName == "AREA")) {
\r
732 bClickOnAnchor = true;
\r
735 if (el.tagName == "BODY") {
\r
738 el = getParentNode(el);
\r
741 if (BSSCPopup_IsPopup())
\r
743 if (!bClickOnAnchor) {
\r
744 parent.window.gPopupWindow = null;
\r
750 bClosePopupWindow = true;
\r
751 if ((bClickOnAnchor) &&
\r
753 ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1)))
\r
755 bClosePopupWindow = false;
\r
757 if (bClosePopupWindow)
\r
759 if (window.gPopupWindow != null && !window.gPopupWindow.closed )
\r
761 window.gPopupWindow.close();
\r
768 function BsPopupOnClick()
\r
770 if (!gbBsIE4 && !gbBsOpera7)
\r
773 BSSCPopup_ClickMac();
\r
776 function _BSSCOnError(message)
\r
778 if(-1 != message.indexOf("denied")
\r
779 || -1 != message.indexOf("Object required"))
\r
783 //End to support previous relative topics
\r
785 /// Section End - General and relative topics (JavaScript 1.0)
\r
787 /// Section Begin - Popup (JavaScript 1.0)
\r
788 //Begin to support previous popup functions
\r
790 //variables used to isolate the browser type
\r
791 var gBsStyVisShow = null;
\r
792 var gBsStyVisHide = null;
\r
793 var gBsClientWidth = 640;
\r
794 var gBsClientHeight = 480;
\r
796 // here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
\r
797 var gBRateH_W = 0.618; // 1.618 Golden cut.
\r
798 var gBMaxXOfParent = 0.8;
\r
799 var gBMaxYOfParent = 0.8;
\r
800 var gBscrollHeight = 16;
\r
801 var gBscrollWidth = 16;
\r
802 var gBpermitXDelta = 3;
\r
803 var gBpermitYDelta = 3;
\r
806 var arrayPopupURL = new Array();
\r
807 var arrayAbsPopupURL = new Array();
\r
809 var arrayDirty = new Array();
\r
811 function setAbsPopupURL(nIndex, strURL)
\r
813 arrayAbsPopupURL[nIndex] = strURL;
\r
816 function getAbsPopupURL(nIndex)
\r
818 if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null;
\r
820 return arrayAbsPopupURL[nIndex];
\r
823 function getPopupURL(nIndex)
\r
825 if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null;
\r
827 return arrayPopupURL[nIndex];
\r
830 function getPopupID(nIndex)
\r
832 return gstrPopupID + nIndex;
\r
835 function getPopupShadowID(nIndex)
\r
837 return gstrPopupShadowID + nIndex;
\r
840 function getPopupTopicID(nIndex)
\r
842 return gstrPopupTopicID + nIndex;
\r
845 function getPopupIFrameID(nIndex)
\r
847 return gstrPopupIFrameID + nIndex;
\r
850 function getPopupIFrameName(nIndex)
\r
852 return gstrPopupIFrameName + nIndex;
\r
856 function getPopupTopicStyle(nIndex)
\r
858 return getElement(getPopupTopicID(nIndex)).style;
\r
861 function getPopupShadowStyle(nIndex)
\r
863 return getElement(getPopupShadowID(nIndex)).style;
\r
866 function getPopupIFrame(nIndex)
\r
869 return eval("window.frames['" + getPopupIFrameName(nIndex) + "']");
\r
871 return eval("document.frames['" + getPopupIFrameName(nIndex) + "']");
\r
874 function getPopupDivStyle(nIndex)
\r
876 return getElement(getPopupID(nIndex)).style;
\r
879 function getPopupIFrameStyle(nIndex)
\r
881 return getElement(getPopupIFrameID(nIndex)).style;
\r
885 function findDiv(strURL)
\r
887 for (var i = 0; i < arrayPopupURL.length; i ++ ) {
\r
888 if (arrayPopupURL[i] == strURL) {
\r
896 function takeToken()
\r
899 if (gnToken > 10000) gnToken = 0;
\r
903 function IsValidToken(nToken)
\r
905 return (gnToken == nToken);
\r
908 function addDiv(strURL)
\r
910 for (var i = 0; i < arrayPopupURL.length; i ++) {
\r
911 if (arrayPopupURL[i] == null) {
\r
912 arrayPopupURL[i] = strURL;
\r
916 arrayPopupURL[i] = strURL;
\r
917 arrayDirty[i] = true;
\r
921 function setDirty()
\r
923 for (var i = 0; i < arrayPopupURL.length; i ++ )
\r
924 arrayDirty[i] = true;
\r
927 function IsDirty(nIndex)
\r
932 if (arrayDirty.length > nIndex)
\r
933 return arrayDirty[nIndex];
\r
940 for (var i = 0; i < arrayPopupURL.length; i ++ )
\r
942 getPopupDivStyle(i).visibility = gBsStyVisHide;
\r
943 getPopupIFrameStyle(i).visibility = gBsStyVisHide;
\r
947 function getCurrentPopupIFrame()
\r
949 for (var i = 0; i < arrayPopupURL.length; i ++)
\r
950 if (getPopupDivStyle(i).visibility == gBsStyVisShow)
\r
951 return getPopupIFrame(i);
\r
955 function setClear(nIndex)
\r
958 arrayDirty[nIndex] = false;
\r
961 function _BSSCCreatePopupDiv(strURL)
\r
963 var nIndex = findDiv(strURL);
\r
964 if (nIndex == -1 ) {
\r
965 nIndex = addDiv(strURL);
\r
966 BsPopup_CreateDiv(nIndex);
\r
969 if (IsDirty(nIndex)) {
\r
970 if("object" == typeof(getPopupIFrame(nIndex).document))
\r
971 getPopupIFrame(nIndex).document.location.href = strURL;
\r
977 //Here is the browser type
\r
978 function _BSPSGetBrowserInfo()
\r
980 if (gbBsNS4&&!gbBsNS6)
\r
982 gBsStyVisShow = "show";
\r
983 gBsStyVisHide = "hide";
\r
987 gBsStyVisShow = "visible";
\r
988 gBsStyVisHide = "hidden";
\r
992 _BSPSGetBrowserInfo();
\r
994 //Get client size info
\r
995 function _BSPSGetClientSize()
\r
997 if (gbBsNS4||gbBsKonqueror3||gbBsSafari)
\r
999 gBsClientWidth = innerWidth;
\r
1000 gBsClientHeight = innerHeight;
\r
1002 else if (gbBsIE4 || gbBsOpera7)
\r
1004 gBsClientWidth = document.body.clientWidth;
\r
1005 gBsClientHeight = document.body.clientHeight;
\r
1009 var gstrPopupID = 'BSSCPopup';
\r
1010 var gstrPopupShadowID = 'BSSCPopupShadow';
\r
1011 var gstrPopupTopicID = 'BSSCPopupTopic';
\r
1012 var gstrPopupIFrameID = 'BSSCPopupIFrame';
\r
1013 var gstrPopupIFrameName = 'BSSCPopupIFrameName';
\r
1015 var gstrPopupSecondWindowName = 'BSSCPopup';
\r
1017 var gPopupWindow = null;
\r
1018 var gnPopupClickX = 0;
\r
1019 var gnPopupClickY = 0;
\r
1021 var gnPopupScreenClickX = 0;
\r
1022 var gnPopupScreenClickY = 0;
\r
1024 var gbPopupTimeoutExpired = false;
\r
1026 function DHTMLPopupSupport()
\r
1028 if (((gbBsIE4) && (!gbBsMac))||gbBsOpera7|| gbBsNS7) {
\r
1034 function BSSCPopup_IsPopup()
\r
1036 if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) {
\r
1038 } else if ((gbBsNS4 || gbBsIE4 || gbBsOpera7) && (this.name.indexOf(gstrPopupID) != -1)) {
\r
1045 // If there is a hyperlink in a popup window, display the hyperlink in
\r
1046 // the original window. (bsscright)
\r
1047 if (BSSCPopup_IsPopup() && !gbBsIE4 && !gbBsOpera7) {
\r
1048 document.write("<base target=\"bsscright\">");
\r
1051 // Local functions.
\r
1052 function BsPopup_CreateDiv(nIndex)
\r
1054 if(!DHTMLPopupSupport())
\r
1056 // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone.
\r
1057 var strPopupDiv = "<DIV ID='" + getPopupID(nIndex) + "' STYLE='position:absolute; top:-100; left:0; z-index:600; visibility:hidden;'>";
\r
1058 strPopupDiv += "<DIV ID='" + getPopupShadowID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#C0C0C0;\"></DIV>";
\r
1059 strPopupDiv += "<DIV ID='" + getPopupTopicID(nIndex) + "' STYLE=\"position:absolute;top:0; left:0; background-color:#FFFFFF;border:1px #000000 outset;\">";
\r
1060 strPopupDiv += "<IFRAME title=\"Popup Window\" ID='" + getPopupIFrameID(nIndex) + "' name='" + getPopupIFrameName(nIndex) + "' src = '" + getPopupURL(nIndex) + "' frameborder=0 scrolling=auto></IFRAME>";
\r
1061 strPopupDiv += "</DIV></DIV>";
\r
1063 var objBody = getElementsByTag(document, "BODY")[0];
\r
1064 if( typeof(objBody) != "object" )
\r
1067 insertAdjacentHTML(objBody, "beforeEnd", strPopupDiv);
\r
1070 function handleLoadNS()
\r
1074 var nIndex = parseInt(this.id.substring(gstrPopupIFrameID.length));
\r
1075 BSSCPopup_PostWork(nIndex);
\r
1079 function BSSCPopup_PostWork(nIndex)
\r
1081 getPopupDivStyle(nIndex).visibility = gBsStyVisShow;
\r
1082 getPopupIFrameStyle(nIndex).visibility =gBsStyVisShow;
\r
1085 window.gbPopupTimeoutExpired = true;
\r
1087 BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document);
\r
1089 getPopupIFrame(nIndex).document.body.addEventListener("click",BSSCPopupClicked,false);
\r
1091 getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked;
\r
1093 if (!gbOrignalOnMouseDown && document.onmousedown)
\r
1094 gbOrignalOnMouseDown = document.onmousedown;
\r
1097 document.addEventListener("mousedown", BSSCPopupParentClicked,false);
\r
1099 document.onmousedown = BSSCPopupParentClicked;
\r
1102 function BSSCPopup_Timeout(nIndex, nToken)
\r
1104 if (!IsValidToken(nToken)) return;
\r
1106 if (gbBsNS6||((getPopupIFrame(nIndex).document.readyState == "complete") &&
\r
1107 (getPopupIFrame(nIndex).document.body != null))) {
\r
1108 BSSCPopup_PostWork(nIndex);
\r
1110 setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100);
\r
1115 // do not change target to parent if the href is using javascript
\r
1116 function BSSCPopup_ChangeTargettoParent(tagsObject)
\r
1118 var collA = getElementsByTag(tagsObject, "A");
\r
1119 BSSCPopup_ChangeTargettoParent2(collA);
\r
1121 var collIMG = getElementsByTag(tagsObject,"IMG");
\r
1122 BSSCPopup_ChangeTargettoParent2(collIMG);
\r
1125 function BSSCPopup_ChangeTargettoParent2(colls)
\r
1127 if (colls != null) {
\r
1128 for (var j = 0; j < colls.length; j ++ )
\r
1130 var strtemp = colls[j].href;
\r
1133 strtemp = strtemp.toLowerCase();
\r
1134 if (strtemp.indexOf("javascript:") == -1)
\r
1135 if (colls[j].target == "")
\r
1136 colls[j].target = "_parent";
\r
1142 function BSPSPopupTopicWinHelp(strURL)
\r
1144 _BSSCPopup(strURL);
\r
1148 function _BSSCPopup(strURL, width, height)
\r
1151 var cusheight = 0;
\r
1152 if ("undefined" != typeof(width) && "undefined" != typeof(height)) {
\r
1154 cusheight= height;
\r
1157 if (DHTMLPopupSupport()) {
\r
1158 var nToken = takeToken(); // take token first.
\r
1159 var nIndex = _BSSCCreatePopupDiv(strURL);
\r
1160 window.gbPopupTimeoutExpired = false;
\r
1161 var ntWidth = gBsClientWidth;
\r
1162 var ntHeight = gBsClientHeight;
\r
1163 _BSPSGetClientSize();
\r
1164 if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) {
\r
1168 if (IsDirty(nIndex)) {
\r
1170 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight +")", 400);
\r
1172 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100);
\r
1176 MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight);
\r
1179 _BSSCPopup2(strURL, cuswidth, cusheight);
\r
1186 var ehlpdhtm_fOldBefureUnload = window.onbeforeunload;
\r
1188 window.onbeforeunload = window_BUnload;
\r
1191 function window_BUnload()
\r
1196 for (var i = 0; i < arrayPopupURL.length; i ++)
\r
1197 removeThis(document.all(getPopupID(i)));
\r
1198 arrayPopupURL.length = 0;
\r
1199 if (ehlpdhtm_fOldBefureUnload)
\r
1200 ehlpdhtm_fOldBefureUnload();
\r
1203 function _BSSCPopup2(strURL, width, height)
\r
1205 if (gbBsOpera6&&gbBsMac)
\r
1207 var wmTemp = window.open(document.location.href, gstrPopupSecondWindowName);
\r
1209 setTimeout("_BSSCPopup3(\""+strURL+"\","+width+","+height+");",100);
\r
1212 _BSSCPopup3(strURL, width, height);
\r
1215 function _BSSCPopup3(strURL, width, height)
\r
1217 if (window.name == gstrPopupSecondWindowName) {
\r
1218 window.location = strURL;
\r
1220 if (!gbBsMac || !gbBsNS4) {
\r
1221 BSSCHidePopupWindow();
\r
1225 var nHeight = 300;
\r
1227 if (width > 0 && height > 0) {
\r
1231 _BSPSGetClientSize();
\r
1233 nX = window.gnPopupScreenClickX;
\r
1234 nY = window.gnPopupScreenClickY;
\r
1236 if (nY + nHeight + 40 > screen.availHeight) {
\r
1237 nY = screen.availHeight - nHeight - 40;
\r
1239 if (nX + nWidth + 40 > screen.availWidth) {
\r
1240 nX = screen.availWidth - nWidth - 40;
\r
1243 // Launch a separate window
\r
1244 var strParam="titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
\r
1247 strParam += ",Height=" + nHeight + ",Width=" + nWidth;
\r
1248 strParam += ",screenX=" + nX + ",screenY=" + nY;
\r
1249 strParam += ",dependent=yes";
\r
1252 strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;
\r
1253 strParam += ",screenX=" + nX + ",screenY=" + nY;
\r
1254 strParam += ",dependent=yes";
\r
1258 strParam += ",height=" + nHeight + ",width=" + nWidth;
\r
1259 strParam += ",left=" + nX + ",top=" + nY;
\r
1263 if (window.gPopupWindow)
\r
1264 window.gPopupWindow.close();
\r
1265 window.gPopupWindow = window.open(strURL, "", strParam);
\r
1266 window.gPopupWindow.name = gstrPopupSecondWindowName;
\r
1267 window.gPopupWindow.moveTo(nX, nY);
\r
1268 widnow.gPopupWindow.document.location.reload();
\r
1273 if (gbBsKonqueror3)
\r
1275 if (window.gPopupWindow)
\r
1276 window.gPopupWindow.close();
\r
1278 if (gbBsOpera&&gbBsMac)
\r
1280 wmTemp= window.open(document.location.href, "Temp", strParam);
\r
1282 window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
\r
1284 window.gPopupWindow.focus();
\r
1292 else if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3)
\r
1293 setTimeout("setPopupFocus();", 100);
\r
1298 function setEventHandle()
\r
1300 window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUR);
\r
1301 window.gPopupWindow.onclick = NonIEPopup_HandleClick;
\r
1302 window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
\r
1305 function setPopupFocus()
\r
1307 window.gPopupWindow.focus();
\r
1310 function NonIEPopup_HandleBlur(e)
\r
1312 window.gPopupWindow.focus();
\r
1315 function NonIEPopup_HandleClick(e)
\r
1317 // Because navigator will give the event to the handler before the hyperlink, let's
\r
1318 // first route the event to see if we are clicking on a Popup menu in a popup.
\r
1319 document.routeEvent(e);
\r
1321 // If a popup menu is active then don't do anything with the click
\r
1322 if (window.gPopupWindow.gbInPopupMenu) {
\r
1323 window.gPopupWindow.captureEvents(Event.CLICK);
\r
1324 window.gPopupWindow.onclick = NonIEPopup_HandleClick;
\r
1328 // Close the popup window
\r
1331 if(e.target.href.indexOf("javascript:")==-1)
\r
1333 if (e.target.target=="")
\r
1334 window.location.href = e.target.href;
\r
1336 window.open(e.target.href, e.target.target);
\r
1345 function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight)
\r
1347 if (!window.getPopupIFrame(nIndex).document) {
\r
1348 _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight);
\r
1352 if (!IsValidToken(nToken)) return;
\r
1356 setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
\r
1357 BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
\r
1361 if ((window.getPopupIFrame(nIndex).document.readyState == "complete") &&
\r
1362 (window.getPopupIFrame(nIndex).document.body != null)) {
\r
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.
\r
1364 window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
\r
1365 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
\r
1369 setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url.
\r
1370 BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight);
\r
1373 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
\r
1377 function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight)
\r
1379 if (window.gbPopupTimeoutExpired) return;
\r
1381 if (!IsValidToken(nToken)) return;
\r
1383 getPopupDivStyle(nIndex).visibility = gBsStyVisHide;
\r
1384 getPopupIFrameStyle(nIndex).visibility = gBsStyVisHide;
\r
1386 // Determine the width and height for the window
\r
1387 _BSPSGetClientSize();
\r
1389 var size = new BSSCSize(0, 0);
\r
1391 if (cuswidth <= 0 || cusheight <= 0)
\r
1392 BSSCGetContentSize(window.getPopupIFrame(nIndex), size);
\r
1394 size.x = cuswidth;
\r
1395 size.y = cusheight;
\r
1398 // Determine the width and height for the window
\r
1399 var nWidth = size.x;
\r
1400 var nHeight = size.y;
\r
1402 // for small popup size, we should allow any size.
\r
1403 // The popup size should be ok if bigger than 0
\r
1404 if (nWidth < 0 || nHeight < 0) return; // there must be something terribly wrong.
\r
1406 getPopupDivStyle(nIndex).width = nWidth;
\r
1407 getPopupDivStyle(nIndex).height = nHeight;
\r
1409 getPopupShadowStyle(nIndex).width = nWidth;
\r
1410 getPopupShadowStyle(nIndex).height = nHeight;
\r
1411 getPopupTopicStyle(nIndex).width = nWidth;
\r
1412 getPopupTopicStyle(nIndex).height = nHeight;
\r
1415 getPopupShadowStyle(nIndex).width = nWidth + 2;
\r
1416 getPopupShadowStyle(nIndex).height = nHeight + 2;
\r
1417 getPopupTopicStyle(nIndex).width = nWidth + 2;
\r
1418 getPopupTopicStyle(nIndex).height = nHeight + 2;
\r
1421 getPopupIFrameStyle(nIndex).width = nWidth;
\r
1422 getPopupIFrameStyle(nIndex).height = nHeight;
\r
1423 if (gbBsIE55 || gbBsNS6)
\r
1425 getPopupIFrameStyle(nIndex).top = 0;
\r
1426 getPopupIFrameStyle(nIndex).left = 0;
\r
1429 var strURL = getPopupURL(nIndex);
\r
1430 if (strURL.indexOf("#") != -1&&gbBsNS6)
\r
1431 getPopupIFrame(nIndex).location.reload();
\r
1432 else if (strURL.indexOf("#") != -1||gbBsNS6)
\r
1433 getPopupIFrame(nIndex).location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5.
\r
1435 MoveDivAndShow(nIndex, nToken, cuswidth, cusheight);
\r
1438 function getScrollLeft()
\r
1440 if (document.body.scrollLeft)
\r
1441 return document.body.scrollLeft;
\r
1442 else if (window.pageXOffset)
\r
1443 return window.pageXOffset;
\r
1448 function getScrollTop()
\r
1450 if (document.body.scrollTop)
\r
1451 return document.body.scrollTop;
\r
1452 else if (window.pageYOffset)
\r
1453 return window.pageYOffset;
\r
1459 function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight)
\r
1461 if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again.
\r
1462 window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex);
\r
1463 setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200);
\r
1467 // Determine the position of the window
\r
1468 var nClickX = window.gnPopupClickX;
\r
1469 var nClickY = window.gnPopupClickY;
\r
1473 var nWidth = parseInt(getPopupDivStyle(nIndex).width);
\r
1474 var nHeight = parseInt(getPopupDivStyle(nIndex).height);
\r
1476 if (nClickY + nHeight + 20 < gBsClientHeight + getScrollTop()) {
\r
1477 nTop = nClickY + 10;
\r
1479 nTop = (getScrollTop() + gBsClientHeight) - nHeight - 20;
\r
1481 if (nClickX + nWidth < gBsClientWidth + getScrollLeft()) {
\r
1484 nLeft = (getScrollLeft() + gBsClientWidth) - nWidth - 8;
\r
1487 if (nTop < getScrollTop()) nTop = getScrollTop() + 1;
\r
1488 if (nLeft< getScrollLeft()) nLeft = getScrollLeft() + 1;
\r
1490 getPopupDivStyle(nIndex).left = nLeft;
\r
1491 getPopupDivStyle(nIndex).top = nTop;
\r
1493 // Set the location of the background blocks
\r
1494 getPopupShadowStyle(nIndex).left = 6;
\r
1495 getPopupShadowStyle(nIndex).top = 6;
\r
1498 getPopupShadowStyle(nIndex).left = 4;
\r
1499 getPopupShadowStyle(nIndex).top = 4;
\r
1502 if (gbBsMac&&gbBsIE4) {
\r
1503 // Total hack on the iMac to get the IFrame to position properly
\r
1504 getPopupIFrameStyle(nIndex).pixelLeft = 100;
\r
1505 getPopupIFrameStyle(nIndex).pixelLeft = 0;
\r
1506 // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
\r
1507 getPopupIFrame(nIndex).window.BSSCOnLoad();
\r
1510 if (gbBsNS6&&IsDirty(nIndex))
\r
1511 getElement(getPopupIFrameID(nIndex)).addEventListener("load", handleLoadNS, false);
\r
1513 BSSCPopup_Timeout(nIndex , nToken );
\r
1517 function BSSCSize(x, y)
\r
1523 function BSSCGetContentSize(thisWindow, size)
\r
1525 if (!gbBsIE4 && !gbBsOpera7 && !gbBsNS4)
\r
1528 if ((gbBsMac&&gbBsIE4)||gbBsNS4||gbBsOpera7) {
\r
1534 // Resize the width until it is wide enough to handle the content
\r
1535 // The trick is to start wide and determine when the scrollHeight changes
\r
1536 // because then we know a scrollbar is necessary. We can then go back
\r
1537 // to the next widest size (for no scrollbar)
\r
1539 var ClientRate = gBsClientHeight / gBsClientWidth;
\r
1542 var GoldenSize = new BSSCSize(0,0);
\r
1543 GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
\r
1544 GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;
\r
1546 if (ClientRate > gBRateH_W) {
\r
1547 GoldenSize.y = GoldenSize.x * gBRateH_W;
\r
1550 GoldenSize.x = GoldenSize.y / gBRateH_W;
\r
1553 // Try to using parent specified max x.
\r
1555 var maxgoldx = GoldenSize.x;
\r
1556 var maxx = gBsClientWidth * gBMaxXOfParent;
\r
1558 // This double resize causes the document to re-render (and we need it to)
\r
1560 thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
\r
1562 thisWindow.resizeTo(1, 1);
\r
1563 thisWindow.resizeTo(1, 1);
\r
1564 thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
\r
1565 thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
\r
1567 var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
\r
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
\r
1571 thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
\r
1572 thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
\r
1574 miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
\r
1575 maxy = gBsClientHeight * gBMaxYOfParent;
\r
1577 if (miny > maxy) { // the popup must have a scroll, OK let it be.
\r
1581 thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little.
\r
1583 else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
\r
1586 // downsize from maxx , now I try to using binary divide.
\r
1592 thisWindow.resizeTo(x, miny);
\r
1593 thisWindow.resizeTo(x, miny);
\r
1594 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
\r
1595 if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
\r
1596 deltax = Math.abs(deltax) /2;
\r
1597 else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
\r
1598 deltax = -Math.abs(deltax) /2;
\r
1600 // the y is close enough to wanted.
\r
1602 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
\r
1605 size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
\r
1606 size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;
\r
1607 thisWindow.document.body.scroll = 'no';
\r
1611 if (thisWindow.document.body.scrollWidth > maxgoldx) {
\r
1614 thisWindow.document.body.scroll = 'yes';
\r
1617 // downsize from maxgoldx , now I try to using binary divide.
\r
1619 deltax = -maxgoldx/2;
\r
1622 thisWindow.resizeTo(x, miny);
\r
1623 thisWindow.resizeTo(x, miny);
\r
1624 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
\r
1625 if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
\r
1626 deltax = Math.abs(deltax) /2;
\r
1627 else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
\r
1628 deltax = -Math.abs(deltax) /2;
\r
1630 // the y is close enough to wanted.
\r
1632 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
\r
1635 size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
\r
1636 size.y = thisWindow.document.body.scrollHeight ;
\r
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.
\r
1638 thisWindow.resizeTo(size.x, size.y);
\r
1639 if (thisWindow.document.body.scrollWidth > size.x)
\r
1641 size.x = thisWindow.document.body.scrollWidth;
\r
1643 if (thisWindow.document.body.scrollHeight > size.y)
\r
1645 size.y = thisWindow.document.body.scrollHeight;
\r
1649 thisWindow.resizeTo(size.x, size.y);
\r
1650 thisWindow.resizeTo(size.x, size.y);
\r
1654 function BSSCPopupParentClicked()
\r
1656 if (!window.gbPopupTimeoutExpired) {
\r
1660 document.onmousedown = gbOrignalOnMouseDown;
\r
1662 // Simply hide the popup
\r
1665 window.gbPopupTimeoutExpired = false;
\r
1670 function isInsideHyperLink(obj)
\r
1672 if (obj&&obj!=getParentNode(obj))
\r
1674 if (obj.tagName=="A"||obj.tagName=="IMG")
\r
1677 return isInsideHyperLink(getParentNode(obj));
\r
1683 function BSSCPopupClicked(e)
\r
1685 if (!window.gbPopupTimeoutExpired) {
\r
1689 var popupIFrame = getCurrentPopupIFrame();
\r
1690 if (popupIFrame == null) {
\r
1694 if (gbBsIE4 && (!((popupIFrame.window.event != null) &&
\r
1695 (popupIFrame.window.event.srcElement != null) &&
\r
1696 isInsideHyperLink(popupIFrame.window.event.srcElement)))) {
\r
1697 document.onmousedown = gbOrignalOnMouseDown;
\r
1699 // Simply hide the popup
\r
1701 window.gbPopupTimeoutExpired = false;
\r
1704 else if (gbBsNS6 && (!((e != null) &&
\r
1705 (e.target!= null) && isInsideHyperLink(e.target))))
\r
1707 document.addEventListener("mousedown", gbOrignalOnMouseDown,false);
\r
1708 // Simply hide the popup
\r
1710 window.gbPopupTimeoutExpired = false;
\r
1715 //trace the mouse over's position for hotspot
\r
1716 function BSPSPopupOnMouseOver(event)
\r
1718 if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) {
\r
1719 window.gnPopupClickX = event.clientX + getScrollLeft();
\r
1720 window.gnPopupClickY = event.clientY + getScrollTop();
\r
1721 window.gnPopupScreenClickX = event.screenX;
\r
1722 window.gnPopupScreenClickY = event.screenY;
\r
1723 } else if (gbBsSafari) {
\r
1724 window.gnPopupClickX = event.clientX + getScrollLeft();
\r
1725 window.gnPopupClickY = event.clientY + getScrollTop();
\r
1726 window.gnPopupScreenClickX = event.screenX + window.screenX;
\r
1727 window.gnPopupScreenClickY = event.screenY + window.screenY;
\r
1728 } else if (gbBsNS4) {
\r
1729 window.gnPopupClickX = event.pageX - window.pageXOffset;
\r
1730 window.gnPopupClickY = event.pageY - window.pageYOffset;
\r
1731 window.gnPopupScreenClickX = event.screenX - window.pageXOffset;
\r
1732 window.gnPopupScreenClickY = event.screenY - window.pageYOffset;
\r
1736 function BSSCHidePopupWindow()
\r
1738 if (window.gPopupWindow != null) {
\r
1740 if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
\r
1741 window.gPopupWindow.close();
\r
1742 window.gPopupWindow = null;
\r
1749 // Add the PopupOnClick to the onclick array.
\r
1750 if (typeof(BsscRegisterOnClick) != "undefined")
\r
1752 BsscRegisterOnClick(BsPopupOnClick);
\r
1754 //End to support previous popup functions
\r
1756 /// Section End - Popup (JavaScript 1.0)
\r
1758 /// Section Begin - Embedded Stub (JavaScript 1.0)
\r
1760 function BSSCCreatePopupDiv()
\r
1765 function WritePopupMenuLayer()
\r
1767 if (BsscHasExtJs()) {_WritePopupMenuLayer();}
\r
1770 function BSSCPopup(strURL, width, height)
\r
1772 var re = new RegExp("'", 'g');
\r
1773 strURL = strURL.replace(re, "%27");
\r
1775 if (BsscHasExtJs()) {
\r
1776 _BSSCPopup(strURL, width, height);
\r
1778 //Create a temporary window first to ensure the real popup comes up on top
\r
1779 var wndTemp = null;
\r
1781 wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
\r
1783 // Create the real popup window
\r
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");
\r
1785 // Close the temporary
\r
1794 var gbWndTemp = null, gbWndPopupLinks = null;
\r
1795 var gbstrParaTotal = "";
\r
1797 function PopupMenu_Invoke()
\r
1799 if (typeof(wfRelatedTopic) == 'function' && typeof(IsFlashSupported) == 'function')
\r
1801 if (Number(gsSkinVersion) > 2 && IsFlashSupported())
\r
1803 return wfRelatedTopic(PopupMenu_Invoke.arguments);
\r
1806 if (BsscHasExtJs()) {
\r
1807 return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
\r
1809 if (gbBsNS3Before || gbBsIE3Before ) {
\r
1810 var argLen = PopupMenu_Invoke.arguments.length;
\r
1812 window.document.location.href = PopupMenu_Invoke.arguments[3];
\r
1816 gbWndPopupLinks = null;
\r
1817 gbstrParaTotal = "";
\r
1818 for (var i = 0; i < (argLen - 2) / 2; i++) {
\r
1819 var strParaLine = "";
\r
1821 strParaLine += "<a href=\"";
\r
1822 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
\r
1823 strParaLine += "\">"
\r
1824 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
\r
1825 strParaLine += "</a>";
\r
1827 strParaLine += "<a href=\"javascript:";
\r
1828 strParaLine += "gotoUrl(\'";
\r
1829 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
\r
1830 strParaLine += "\');\"";
\r
1831 if (PopupMenu_Invoke.arguments[1] != '') {
\r
1832 strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
\r
1834 strParaLine += ">";
\r
1835 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
\r
1836 strParaLine += "</a>";
\r
1838 strParaLine += "<br>";
\r
1839 gbstrParaTotal += strParaLine;
\r
1841 var nHeight = argLen * 15;
\r
1843 var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
\r
1844 strParam += ",height=" + nHeight + ",width=200,resizable";
\r
1846 //Create a temporary window first to ensure the real popup comes up on top
\r
1847 //var wndTemp = null;
\r
1849 gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
\r
1851 gbWndPopupLinks = window.open("", "popuplinks", strParam);
\r
1853 setTimeout("Wait_PopupMenuReady()", 100);
\r
1858 function Wait_PopupMenuReady()
\r
1860 if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
\r
1861 PopupMenu_InvokeReady();
\r
1864 setTimeout("Wait_PopupMenuReady()", 100);
\r
1867 function PopupMenu_InvokeReady()
\r
1869 if (gbWndPopupLinks != null) {
\r
1870 gbWndPopupLinks.document.open("text/html");
\r
1871 gbWndPopupLinks.document.write("<html><head>");
\r
1873 gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
\r
1875 //YJ: IE301,302 and NS3.x works fine
\r
1876 gbWndPopupLinks.document.write("<");
\r
1877 gbWndPopupLinks.document.write("script>");
\r
1878 gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
\r
1879 gbWndPopupLinks.document.write("<");
\r
1880 gbWndPopupLinks.document.write("/script>");
\r
1882 gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
\r
1883 gbWndPopupLinks.document.write(gbstrParaTotal);
\r
1884 gbWndPopupLinks.document.write("</body></html>");
\r
1885 gbWndPopupLinks.document.close();
\r
1887 // Close the temporary
\r
1888 if (!gbBsNS3 && gbWndTemp != null) {
\r
1889 gbWndTemp.close();
\r
1891 gbWndPopupLinks.focus();
\r
1899 /// Section End - Embedded Stub (JavaScript 1.0)
\r
1901 //// Segment End -- (JavaScript 1.0)
\r
1903 //// Segment Begin -- (JavaScript 1.2)
\r
1904 /// Section Begin - kadov DHTM (JavaScript 1.2)
\r
1906 //Begin to support extended and dropdown text effects.
\r
1907 function kadovIsParagraph(el)
\r
1909 return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false;
\r
1912 function kadovInitEachChild(el)
\r
1914 for(var i=0; i<getChildNodes(el).length; i++)
\r
1916 var child = getChildNodes(el)[i];
\r
1917 if( child.tagName == "SCRIPT" || child.tagName == "!" )
\r
1920 if( child.id != "" )
\r
1922 // to wipe out the onload effects
\r
1923 if (gbBsIE4&&!gbBsMac)
\r
1925 var onLoadEffect = child.style.getAttribute( "x-on-pageload" );
\r
1926 if( (onLoadEffect != null) && (onLoadEffect > "") )
\r
1927 child.style.setAttribute( "x-on-pageload", "" );
\r
1930 var href = child.getAttribute("href")
\r
1931 if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 )
\r
1932 kadovFilePopupInit(child.id); // Init for Popup
\r
1933 else if( child.className == "dropspot" || child.className == "expandspot" ||
\r
1934 child.className == "glossterm" )
\r
1935 kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text
\r
1936 else if( child.className == "trigger")
\r
1937 kadovInitTrigger(child.id);// Init for Trigger
\r
1940 kadovInitEffects(child.id);// Init for DHTML effects
\r
1941 CEngine.SetOneTargetInitialState( child.id );
\r
1945 if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") )
\r
1946 child.start = "mouseover";// to start a AVI file. fileopen doesn't work
\r
1948 kadovInitEachChild(child);
\r
1952 function kadovRetrieveTextInner(el)
\r
1955 if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" ))
\r
1958 if( kadovIsParagraph(el) )
\r
1960 var strNewID = " ";
\r
1962 strNewID += "id=" + el.id + "_NewSpan ";
\r
1963 x = "<span" + strNewID + "style='" + el.style.cssText + "'>" + el.innerHTML + "</span>";
\r
1967 for(var i=0; i<getChildNodes(el).length; i++)
\r
1968 x += kadovRetrieveTextInner( getChildNodes(el)[i] );
\r
1973 function kadovRetrieveCleanHTML( strRawHTML, strTagOpen, strTagClose, nDistance )
\r
1975 var nTagOpen = strRawHTML.indexOf( strTagOpen, 0 );
\r
1976 if( nTagOpen < 0 )
\r
1977 return strRawHTML;
\r
1979 var nTagClose = strRawHTML.indexOf( strTagClose, nTagOpen);
\r
1980 if( nTagClose < nTagOpen )
\r
1981 return strRawHTML;
\r
1983 if( typeof(nDistance) == "number" && nDistance > 0 )
\r
1984 if( (nTagClose - nTagOpen) != nDistance )
\r
1985 return strRawHTML;
\r
1987 var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ;
\r
1988 return kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose );
\r
1991 function kadovAdjustObjectTag(strRawHTML, nStartPos)
\r
1992 {// adjust object tag for related topics HTML control, because innerHTML misses out the item settings
\r
1994 //Is there any DTC?
\r
1995 var strDTCTagOpen = '<!--Metadata type="DesignerControl" startspan';
\r
1996 var strDTCTagClose = '<!--Metadata type="DesignerControl" endspan-->';
\r
1997 var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos );
\r
1998 if( nDTCTagOpen < 0 )
\r
1999 return strRawHTML;
\r
2000 var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen );
\r
2001 if( nDTCTagClose < nDTCTagOpen)
\r
2002 return strRawHTML; // no Design Time Controls;
\r
2004 //Is the DTC HTML Help Control?
\r
2005 var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11';
\r
2006 var strRTObjTagClose = '</OBJECT>';
\r
2007 var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen );
\r
2008 if( nRTObjTagOpen < nDTCTagOpen )
\r
2009 return strRawHTML;
\r
2010 var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen );
\r
2011 if( nRTObjTagClose < nRTObjTagOpen )
\r
2012 return strRawHTML; // is not a HTML help control
\r
2014 // Is it a related Topics html help control?
\r
2015 var strRTObjLabel = '<PARAM NAME=\"Command\" VALUE=\"Related Topics';
\r
2016 if( strRawHTML.indexOf(strRTObjLabel, nRTObjTagOpen) < 0 )
\r
2017 return strRawHTML;
\r
2019 // does the commented object tag contain a items parameters
\r
2020 var strRTItemsOpen = '<param name="Items" value="';
\r
2021 var strRTItemsClose = '$$**$$">';
\r
2022 var nRTItemsOpen = strRawHTML.indexOf(strRTItemsOpen, nDTCTagOpen);
\r
2023 if( nRTItemsOpen < nDTCTagOpen )
\r
2024 return strRawHTML;
\r
2025 var nRTItemsClose = strRawHTML.indexOf(strRTItemsClose, nRTItemsOpen);
\r
2026 if( nRTItemsClose < nRTItemsOpen )
\r
2027 return strRawHTML;
\r
2029 // found a items string
\r
2030 var strItems = strRawHTML.substring( nRTItemsOpen + strRTItemsOpen.length, nRTItemsClose);
\r
2031 if( strItems.length < 1 )
\r
2032 return strRawHTML;
\r
2034 // to reconstruct the item(s) param tag(s)
\r
2035 var strItemsArray = strItems.split('$$**$$');
\r
2036 if( strItemsArray.length < 1 )
\r
2037 return strRawHTML;
\r
2038 var strRunTimeItemParam = "";
\r
2039 for( var i = 0; i < strItemsArray.length; i++ )
\r
2041 strRunTimeItemParam += '<PARAM NAME="Item' + (i+1);
\r
2042 strRunTimeItemParam += '"' + ' VALUE="';
\r
2043 strRunTimeItemParam += strItemsArray[i];
\r
2044 strRunTimeItemParam += '">';
\r
2047 // to insert the reconstructed item params into runtime object tag
\r
2048 var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length);
\r
2049 return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length);
\r
2052 function kadovTextPopupOnLoad( el )
\r
2054 if( typeof(el) == "string" )
\r
2055 el = getElement(el);
\r
2057 var src = el.getAttribute( "x-use-popup" );
\r
2058 var bNeedMove=true;
\r
2061 for (var i=0;i<gPopupData.length;i++)
\r
2062 if (gPopupData[i].el==el.id)
\r
2064 src=gPopupData[i].popupId;
\r
2070 src = el.style.getAttribute( "x-use-popup" );
\r
2075 if( src.substr(0,1) == "#" )
\r
2076 name = src.substr(1, src.length-1);
\r
2077 var srcDiv = getElement(name);
\r
2083 var type = el.getAttribute( "x-popup-type" );
\r
2085 type = el.style.getAttribute("x-popup-type");
\r
2088 var setup = el.getAttribute( "x-tmp-setup" );
\r
2090 if( newId.indexOf( "_tmp") <= 0 )
\r
2095 el.setAttribute( "x-tmp-setup", 1 );
\r
2097 if( type == "pulldown" )
\r
2099 var strAdjust = kadovAdjustObjectTag(srcDiv.innerHTML,0);
\r
2100 var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
\r
2101 strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
\r
2103 //work around the bug in HH.exe that highlight the phrases when use Search tab
\r
2104 //this approach is just removing the <FONT...> tag inserted by Microsoft in the runtime
\r
2105 strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<FONT color=#", "\">", 52);
\r
2107 var strStyle = " style='display:none; position:relative;";
\r
2108 var newDiv = "<div class=droptext id=" + newId + strStyle + "'>" + strCleanHTML + "</div>";
\r
2110 removeThis(srcDiv); // empty the original DIV tag
\r
2111 var elParentPra = kadovFindParentParagraph(el);
\r
2113 insertAdjacentHTML(elParentPra, "afterEnd", newDiv );
\r
2115 else if( type == "expanding" )
\r
2117 var inner = kadovRetrieveTextInner(srcDiv);
\r
2119 inner = srcDiv.innerHTML;
\r
2120 var strAdjust = kadovAdjustObjectTag(inner,0);
\r
2121 var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, "<!--", "-->");
\r
2122 strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "<SCRIPT", "/SCRIPT>");
\r
2123 var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext";
\r
2124 var newSpan = "<span class=" + strClassName + " style='display: none;' id=" + newId + "> " + strCleanHTML + "</span>";
\r
2125 removeThis(srcDiv); // empty the original DIV tag
\r
2126 insertAdjacentHTML(el, "afterEnd", newSpan );
\r
2132 srcDiv.style.display = "none";
\r
2137 function getElementsByTag(obj,sTagName)
\r
2139 if(obj.getElementsByTagName)
\r
2140 return obj.getElementsByTagName(sTagName);
\r
2142 return obj.all.tags(sTagName);
\r
2146 function getElement(sID)
\r
2148 if(document.getElementById)
\r
2149 return document.getElementById(sID);
\r
2150 else if(document.all)
\r
2151 return document.all(sID);
\r
2155 function getParentNode(obj)
\r
2157 if(obj.parentNode)
\r
2158 return obj.parentNode;
\r
2159 else if(obj.parentElement)
\r
2160 return obj.parentElement;
\r
2164 function getChildNodes(obj)
\r
2166 if(obj.childNodes)
\r
2168 var children = new Array();
\r
2169 for (var i = 0; i < obj.childNodes.length; i++)
\r
2171 if (obj.childNodes[i].nodeType == 1)
\r
2172 children[children.length] = obj.childNodes[i];
\r
2176 else if(obj.children)
\r
2177 return obj.children;
\r
2181 function removeThis(obj)
\r
2183 if(obj.parentNode)
\r
2184 obj.parentNode.removeChild(obj);
\r
2189 function kadovTextPopup( el )
\r
2191 if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3 )
\r
2194 var bNeedMove=true;
\r
2197 window.event.cancelBubble = true;
\r
2199 if( typeof(el) == "string" )
\r
2200 el = getElement(el);
\r
2202 if (!el||el==window)
\r
2205 var src = el.getAttribute( "x-use-popup" );
\r
2208 for (var i=0;i<gPopupData.length;i++)
\r
2209 if (gPopupData[i].el==el.id)
\r
2211 src=gPopupData[i].popupId;
\r
2217 src = el.style.getAttribute( "x-use-popup" );
\r
2222 if( src.substr(0,1) == "#" )
\r
2224 name = src.substr(1, src.length-1) + "_tmp";
\r
2226 name = src.substr(1, src.length-1);
\r
2228 var srcDiv = getElement(name);
\r
2234 if( srcDiv.style.display == "" )
\r
2235 srcDiv.style.display = "none";
\r
2238 srcDiv.style.display = "";
\r
2239 if( typeof(srcDiv.bInitialized) == "undefined" )
\r
2241 srcDiv.bInitialized = true;
\r
2242 kadovInitEffects(name);
\r
2243 kadovInitEachChild(srcDiv);
\r
2248 event.returnValue=false;
\r
2252 function kadovFindParentParagraph( el )
\r
2254 if( typeof(el) == "string" )
\r
2255 el = getElement(el);
\r
2256 if( (!el) || el.tagName == "BODY" )
\r
2258 if( kadovIsParagraph(getParentNode(el)) )
\r
2259 return getParentNode(el);
\r
2261 return kadovFindParentParagraph( getParentNode(el) );
\r
2264 //Begin HTML code invoked function
\r
2265 function kadovRegisterEventHandler( obj, strEvent, strEventHandler )
\r
2269 CCSSP.RegisterEventHandler( obj, strEvent, strEventHandler );
\r
2272 function textPopupData(el, popupId)
\r
2275 this.popupId = "#"+popupId;
\r
2278 var gPopupData = new Array();
\r
2280 function kadovTextPopupInit( el, popupId)
\r
2282 if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3)
\r
2285 if( typeof(el) == "string" )
\r
2289 gPopupData[gPopupData.length]=new textPopupData(el, popupId);
\r
2291 el = getElement(el);
\r
2296 CCSSP.RegisterEventHandler( el, "onclick", "kadovTextPopup(\"" + el.id +"\");" );
\r
2297 CCSSP.RegisterEventHandler( window, "onload", "kadovTextPopupOnLoad(\"" + el.id +"\");" );
\r
2300 //End HTML code invoked function
\r
2302 //End to support extended and dropdown text effects.
\r
2304 //Begin to convert iWrite format to RoboEditor Format for DHTML effects
\r
2305 function kadovInitTriggersInHead( )
\r
2307 if( Object.xDelayedInitElements )
\r
2309 var x = Object.xDelayedInitElements;
\r
2310 for(i=0; i<x.length; i++)
\r
2311 kadovInitTrigger( x[i] );
\r
2315 //Begin HTML code invoked function
\r
2316 function kadovFilePopupInit( el )
\r
2318 if( typeof(el) == "string" )
\r
2319 el = getElement(el);
\r
2322 CCSSP.RegisterEventHandler( el, "onmouseover", "BSPSPopupOnMouseOver(event);" );
\r
2325 function kadovInitTrigger( element )
\r
2329 var srcElement = element;
\r
2330 if( typeof(srcElement) == "string" )
\r
2332 srcElement = getElement(element,0);
\r
2333 if(srcElement == null)
\r
2337 if( !kadovIsParentVisible(srcElement) )
\r
2340 var targets = srcElement.getAttribute( "x-targets" );
\r
2342 targets = srcElement.style.getAttribute("x-targets");
\r
2345 var arrOneTarget = targets.split( "," );
\r
2346 for( var i = 0; i < arrOneTarget.length; i ++ )
\r
2347 bsscFXInit( element, arrOneTarget[i], null, null, null, null );
\r
2350 function kadovIsParentVisible( el )
\r
2352 if( typeof(el) == "string" )
\r
2353 el = getElement(el);
\r
2354 if( (!el) || el.tagName == "BODY" )
\r
2356 if( el.style.display == 'none' ) //el.visibility == 'hidden' ||
\r
2359 return kadovIsParentVisible( getParentNode(el) );
\r
2362 function kadovInitEffects( element )
\r
2366 var srcElement = element;
\r
2367 if( typeof(srcElement) == "string" )
\r
2369 srcElement = getElement(element,0);
\r
2370 if(srcElement == null)
\r
2374 if( !kadovIsParentVisible(srcElement) )
\r
2377 kadovInitEffect( srcElement, "x-on-hover" );
\r
2378 kadovInitEffect( srcElement, "x-on-pageclick" );
\r
2379 kadovInitEffect( srcElement, "x-on-pageload" );
\r
2380 kadovInitEffect( srcElement, "x-on-trigger-1" );
\r
2381 kadovInitEffect( srcElement, "x-on-trigger-2" );
\r
2383 //End HTML code invoked function
\r
2385 function kadovInitEffect( element, prop )
\r
2387 var values = null;
\r
2388 if( element.getAttribute( "currentStyle" ) && element.currentStyle.getAttribute)
\r
2389 values = element.currentStyle.getAttribute( prop );
\r
2390 else if (element.style.getAttribute)
\r
2391 values = element.style.getAttribute( prop );
\r
2395 var functions = new Array();
\r
2396 var nIdx = 0, nStart = 0;
\r
2397 var nNext = values.indexOf( "\)", 0);
\r
2398 while( nNext >= 0 && nNext < values.length )
\r
2400 functions[nIdx] = values.substr( nStart, nNext-nStart+1);
\r
2401 nStart = nNext + 1;
\r
2403 nNext = values.indexOf( "\)", nStart);
\r
2406 for( var i=0; i<functions.length; i++)
\r
2408 var id = element.getAttribute( "id" );
\r
2409 var translatedProp = kadovTranslateProp(prop);
\r
2411 var lp = functions[i].indexOf( "(" );
\r
2412 var fnname = functions[i].substring(0, lp);
\r
2413 var srcargs = functions[i].substring(lp+1, functions[i].length-1);
\r
2415 var nClickTimes = 1;
\r
2416 var arrForClickCount = srcargs.split( "," );
\r
2417 for( var j = 0; j < arrForClickCount.length; j++ )
\r
2418 {// to locate and get the "clicks=99" settings
\r
2419 var nPageClick = arrForClickCount[j].indexOf("clicks");
\r
2420 if( nPageClick >= 0 )
\r
2422 nPageClick = arrForClickCount[j].indexOf("=");
\r
2423 if( nPageClick > 0 )
\r
2425 nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1;
\r
2430 var args = srcargs;
\r
2431 if( j < arrForClickCount.length )
\r
2432 {// to strip out the "clicks=99" from the arguments string
\r
2434 for( var k = 0; k < arrForClickCount.length; k ++ )
\r
2438 args += arrForClickCount[k];
\r
2439 if( k < arrForClickCount.length - 1 )
\r
2444 bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes );
\r
2448 function kadovTranslateProp( prop )
\r
2452 case "x-on-hover" : return "bsschover";
\r
2453 case "x-on-pageclick" : return "bsscpageclick";
\r
2454 case "x-on-pageload" : return "bsscpageload";
\r
2455 case "x-on-trigger-1" : return "bssctrigger1";
\r
2456 case "x-on-trigger-2" : return "bssctrigger2";
\r
2460 //End to convert iWrite format to RoboEditor Format for DHTML effects
\r
2462 //Begin the definition of one entry to DHTML effects
\r
2463 function bsscFXInit( trigger_ID, target_ID, event_type,
\r
2464 action_type, action_setting, event_addional )
\r
2466 if( (!gbBsWindows && !gbBsSunOS && !(gbBsMac&&gbBsIE5)) || typeof(target_ID) != "string" )//MUST have a target_ID
\r
2467 return; // we don't support Navigator yet
\r
2469 if( typeof(event_type) == "string" )
\r
2470 event_type = event_type.toLowerCase();
\r
2471 if( typeof(action_type) == "string" )
\r
2472 action_type = action_type.toLowerCase();
\r
2473 if( typeof(action_setting) == "string" )
\r
2474 action_setting = action_setting.toLowerCase();
\r
2476 // to get the target element then add it to the target list
\r
2477 var eleTarget = CCSSP.GetObject( target_ID );
\r
2478 if( (eleTarget != null) && (event_type != null) && (action_type != null) )
\r
2480 CEngine.AddOneTarget( target_ID, eleTarget );
\r
2481 CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional);
\r
2484 // to validate the trigger_ID parameter
\r
2485 if( typeof(trigger_ID) == "string" && trigger_ID != "" )
\r
2486 CEngine.BuildTriggerObject( trigger_ID, target_ID );
\r
2488 //End the definition of one entry to DHTML effects
\r
2490 /// Section End - kadov DHTM (JavaScript 1.2)
\r
2492 /// Section Begin - CCSSP DHTM (JavaScript 1.2)
\r
2494 //Begin JavaScript libary for cross-platform positioning object.
\r
2495 function CCSSP(){} // constructor of CCSSP class
\r
2497 CCSSP.GetObject = function( obj )
\r
2498 {//convert object name string or reference into a valid object reference
\r
2499 if( typeof(obj) == "object" )
\r
2501 else if( typeof(obj) == "string" && obj != "")
\r
2504 return eval("document." + obj);
\r
2506 return eval("document.all(\"" + obj + "\")");
\r
2512 CCSSP.MoveObjectTo = function(obj, x, y)
\r
2513 {//positioning an object at a specific pixel coordinate
\r
2518 obj.style.pixelLeft = x;
\r
2519 obj.style.pixelTop = y;
\r
2523 CCSSP.MoveObjectBy = function(obj, dx, dy)
\r
2524 {//moveing a object by x and/or y pixel
\r
2526 obj.moveBy(dx,dy);
\r
2529 obj.style.pixelLeft += dx;
\r
2530 obj.style.pixelTop += dy;
\r
2534 CCSSP.SetObjectBGColor = function(obj, color)
\r
2535 {//set the background color of an object
\r
2537 obj.bgColor = color;
\r
2539 obj.style.backgroundColor = color;
\r
2542 CCSSP.ShowObject = function(obj, bShow)
\r
2543 {// set the object to be visible or invisible
\r
2545 obj.visibility = (bShow == true) ? 'show' : 'hide';
\r
2547 obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space.
\r
2550 CCSSP.GetObjectLeft = function(obj)
\r
2551 {// retrieve the x coordinate of a posionable object
\r
2555 return obj.style.pixelLeft;
\r
2558 CCSSP.GetObjectTop = function(obj)
\r
2559 {// retrieve the y coordinate of a posionable object
\r
2563 return obj.style.pixelTop;
\r
2566 CCSSP.GetObjectContainLeft = function(obj)
\r
2567 {// retrieve the x coordinate of a posionable object relative to it's parent element
\r
2572 if( obj == document.body )
\r
2573 return obj.clientLeft;
\r
2575 return obj.offsetLeft;
\r
2579 CCSSP.GetObjectWindowLeft = function(obj)
\r
2580 {// retrieve the x coordinate of a posionable object relative to browser window
\r
2585 var nOffsetWindowLeft = 0;
\r
2586 for(var element = obj; element; element = element.offsetParent)
\r
2587 nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element);
\r
2588 return nOffsetWindowLeft;
\r
2592 CCSSP.GetObjectContainTop = function(obj)
\r
2593 {// retrieve the y coordinate of a posionable object relative to it's parent element
\r
2598 if( obj == document.body )
\r
2599 return obj.clientTop;
\r
2601 return obj.offsetTop;
\r
2605 CCSSP.GetObjectWindowTop = function(obj)
\r
2606 {// retrieve the y coordinate of a posionable object relative to browser window
\r
2611 var nOffsetWindowTop = 0;
\r
2612 for(var element = obj; element; element = element.offsetParent)
\r
2613 nOffsetWindowTop += CCSSP.GetObjectContainTop(element);
\r
2614 return nOffsetWindowTop;
\r
2618 CCSSP.GetObjectHeight = function(obj)
\r
2619 {// retrieve the height of a posionable object
\r
2621 return obj.clip.height;
\r
2623 return obj.offsetHeight;
\r
2626 CCSSP.GetObjectWidth = function(obj)
\r
2627 {// retrieve the width of a posionable object
\r
2629 return obj.clip.width;
\r
2631 return obj.offsetWidth;
\r
2634 CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler )
\r
2635 { // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined
\r
2636 if (gbBsNS4 && !gbBsNS6)
\r
2639 var oldHandler = "";
\r
2641 if (gbBsMac &&gbBsIE4&&!gbBsIE5)
\r
2643 if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown")
\r
2644 { //search for <SCRIPT> tag which define the event handler
\r
2645 for( var i = 0; i < document.scripts.length; i++ )
\r
2647 var script = document.scripts[i];
\r
2648 if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
\r
2650 oldHandler = script.innerHTML;
\r
2658 var oldInlineHandler = srcObj[rawEventName.toLowerCase()];
\r
2659 if( oldInlineHandler != null && typeof(oldInlineHandler) != "undefined")
\r
2661 var functionDefinition = oldInlineHandler.toString();
\r
2662 var bodyStart = functionDefinition.indexOf( "{" );
\r
2663 var bodyEnd = functionDefinition.lastIndexOf( "}" );
\r
2664 if( bodyStart > 0 || bodyEnd > bodyStart )
\r
2665 oldHandler = functionDefinition.substr( bodyStart + 1, bodyEnd - bodyStart - 2 );
\r
2667 else if( gbBsIE4 )
\r
2668 { //search for <SCRIPT> tag which define the event handler
\r
2669 for( var i = 0; i < document.scripts.length; i++ )
\r
2671 var script = document.scripts[i];
\r
2672 if( (script.htmlFor == srcObj.id || script.htmlFor == srcObj ) && script.event == rawEventName )
\r
2674 oldHandler = script.innerHTML;
\r
2680 if( oldHandler.indexOf(funcHandler) >= 0 )
\r
2681 return;// to prevent register the funtion twice.
\r
2683 if( gbBsNS4 ) // only "onload, onresize, onfocus" apply to window
\r
2684 {// other raw events will apply to layer
\r
2685 var noOn = rawEventName.substring(2, rawEventName.length);
\r
2686 if( typeof(noOn) == "string" && noOn.length > 3 ) {
\r
2687 if (srcObj.captureEvents)
\r
2688 srcObj.captureEvents( Event[noOn.toUpperCase()] );
\r
2692 var newHandler = oldHandler;
\r
2693 if( newHandler.length == 0 )
\r
2694 newHandler = funcHandler;
\r
2696 newHandler += "; " + funcHandler;
\r
2698 srcObj[rawEventName.toLowerCase()] = new Function( newHandler );
\r
2701 CCSSP.GetWindowHeight = function()
\r
2702 {// retrieve the height of available content in browser window
\r
2704 return window.innerHeight;
\r
2706 return document.body.clientHeight;
\r
2709 CCSSP.GetWindowBottom = function()
\r
2710 {// retrieve the bottom postion of browser window
\r
2712 return window.outerHeight + window.pageYOffset;
\r
2714 return document.body.clientHeight + document.body.scrollTop;
\r
2717 CCSSP.GetWindowWidth = function()
\r
2718 {// retrieve the width of available content in browser window
\r
2720 return window.innerWidth;
\r
2722 return document.body.clientWidth;
\r
2725 CCSSP.GetWindowRight = function()
\r
2726 {// retrieve the right postion of browser window
\r
2728 return window.outerWidth + window.pageXOffset;
\r
2730 return document.body.clientWidth + document.body.scrollLeft;
\r
2733 CCSSP.TrimString = function( objString, subtrim )
\r
2734 {// to trim the "subtrim" in the beginning and ending of a string object
\r
2735 if( typeof(subtrim) != "string" || subtrim == null )
\r
2737 var strHead = objString.substring(0, 1);
\r
2738 var strRear = objString.substring(objString.length-1, objString.length);
\r
2739 if( strHead != subtrim && strRear != subtrim )
\r
2742 var spacePos = objString.indexOf(subtrim);
\r
2743 if( spacePos < 0 )
\r
2745 else if( spacePos == objString.length - 1 )
\r
2746 return objString.substring(0, spacePos);
\r
2749 var newString = objString.substring( spacePos + 1, objString.length);
\r
2750 return CCSSP.TrimString( newString, subtrim );
\r
2754 CCSSP.TrimSpace = function( objString )
\r
2756 var Trim1 = CCSSP.TrimString( objString, " ");
\r
2757 return CCSSP.TrimString( Trim1, "\'");
\r
2760 CCSSP.GetEventElement = function( navEventObject )
\r
2761 {// to get the element who fired the current event
\r
2766 navEventObject.target;
\r
2768 return event.srcElement;
\r
2771 CCSSP.PrepareFilter = function( Obj )
\r
2772 {//to prepare for making the filter work
\r
2773 Obj.style.filter = "";
\r
2774 if( Obj.style.width != "" || Obj.style.height != "" || Obj.style.position == "absolute" )
\r
2776 Obj.style.height = CCSSP.GetObjectHeight(Obj);
\r
2779 CCSSP.IsDescendant = function( progenitor, progeny )
\r
2781 if( typeof(progeny) == "undefined" || progeny == null )
\r
2783 else if( progeny == progenitor )
\r
2785 else if( progeny.id == progenitor.id )
\r
2787 else if( getParentNode(progeny) == getParentNode(progenitor))
\r
2790 return CCSSP.IsDescendant( progenitor, getParentNode(progeny));
\r
2793 CCSSP.IsTextTag = function( Obj )
\r
2795 if( typeof( Obj.tagName ) == "undefined" )
\r
2797 return( Obj.tagName.indexOf("H") == 0 || Obj.tagName == "P" ||
\r
2798 Obj.tagName == "FONT" || Obj.tagName == "SPAN" );
\r
2801 //End JavaScript libary for cross-platform positioning object.
\r
2803 /// Section End - CCSSP DHTM (JavaScript 1.2)
\r
2805 /// Section Begin - CCSSP DHTM 1 (JavaScript 1.2)
\r
2807 //Begin the definition of class CTrigger
\r
2808 function CTrigger( TriggerElement )
\r
2810 // object : the trigger element. Never be null.
\r
2811 this.eleTrigger = TriggerElement;
\r
2813 // number : the click counter number: only 3 values: 0,1,2;
\r
2814 this.nCounter = 0;
\r
2816 //object as associative array of string:
\r
2817 // the associate target ID strings; one element at least.
\r
2818 this.objStrTarget = new Object();
\r
2819 this.eleTrigger.style.cursor = "hand";
\r
2820 if( this.eleTrigger.tagName == "AREA" && this.eleTrigger.getAttribute("href") == "" )
\r
2821 this.eleTrigger.setAttribute("href", "#") // to make a hand cursor for image map
\r
2824 CTrigger.prototype.AddTargetID = function( strTargetID )
\r
2825 {// add one target ID string to the objStrTarget
\r
2826 if( typeof(strTargetID) != "string" )
\r
2828 if( typeof(this.objStrTarget[strTargetID]) != "string" )
\r
2829 this.objStrTarget[strTargetID] = strTargetID;
\r
2832 CTrigger.prototype.OnTriggerClick = function()
\r
2833 {// to activate all asociated target
\r
2834 var strEventType = ( (this.nCounter++)% 2 == 0 ) ?
\r
2835 "bssctrigger1" : "bssctrigger2";
\r
2837 // to enumerate associative target element's ID string
\r
2838 for( var strTargetID in this.objStrTarget )
\r
2839 CEngine.SendEventToOneTarget( strTargetID, strEventType );
\r
2841 //End the definition of class CTrigger
\r
2843 //Begin the definition of class CTarget
\r
2844 function CTarget( TargetElement )
\r
2846 // object : the target element. Never be null.
\r
2847 this.eleTarget = TargetElement;
\r
2848 this.objManager = new Object(); // object: the event manager
\r
2851 CTarget.nPageClickCounter = 0;// static class property.
\r
2853 CTarget.prototype.GetAgencyObject = function(str_action_type,action_setting )
\r
2854 {// return the action agency ( effect )object's refernece
\r
2855 switch( str_action_type )
\r
2857 case "show":return new CAgencyShow( this.eleTarget, true ) ;
\r
2858 case "hide":return new CAgencyShow( this.eleTarget, false ) ;
\r
2861 return new CAgencyFly(this.eleTarget, action_setting, true);
\r
2863 return new CAgencyFly(this.eleTarget, action_setting, false);
\r
2864 case "spiralin" :
\r
2865 return new CAgencySpiral(this.eleTarget, action_setting, true);
\r
2866 case "spiralout" :
\r
2867 return new CAgencySpiral(this.eleTarget, action_setting, false);
\r
2869 return new CAgencyZoom(this.eleTarget, action_setting, true);
\r
2871 return new CAgencyZoom(this.eleTarget, action_setting, false);
\r
2873 return new CAgencyElastic(this.eleTarget, action_setting);
\r
2876 return (gbBsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, true) : null;
\r
2878 return (gbBsIE4)? new CAgencyAlpha(this.eleTarget, action_setting, false) : null;
\r
2879 case "rockrollstatic" :
\r
2881 return (gbBsIE4)? new CAgencyWave(this.eleTarget, action_setting, false) : null;
\r
2884 return (gbBsIE4)? new CAgencyGlow(this.eleTarget,action_setting) : null;
\r
2885 case "dropshadow":
\r
2886 return (gbBsIE4)? new CAgencyDropShadow(this.eleTarget,action_setting) : null;
\r
2887 case "transition" :
\r
2888 return (gbBsIE4)? new CAgencyRevealTrans(this.eleTarget,action_setting) : null;
\r
2890 return (gbBsIE4)? new CAgencyBlur(this.eleTarget,action_setting) : null;
\r
2892 case "fliph" : // all these 4 do NOT need any parameters
\r
2896 return (gbBsIE4)? new CAgencyChangeFilter(this.eleTarget, str_action_type) : null;
\r
2898 case "fontchange": // the effects below change the style on the fly, so won't work in Navigator
\r
2899 return (gbBsIE4)? new CAgencyFontChange(this.eleTarget,action_setting) : null;
\r
2900 case "boderchange":
\r
2901 case "stylechange":
\r
2902 return (gbBsIE4)? new CAgencyChangeStyle(this.eleTarget,action_setting) : null;
\r
2904 default: return null;
\r
2908 CTarget.prototype.SetEventManager = function(
\r
2909 one_event_type,str_action_type,action_setting,event_additional)
\r
2910 {// to set the event manager with specified action
\r
2911 if( typeof( one_event_type ) != "string" ||
\r
2912 typeof( str_action_type ) != "string"||
\r
2913 typeof( action_setting ) != "string" )
\r
2915 if( typeof(this.objManager[one_event_type]) == "undefined" )
\r
2917 this.objManager[one_event_type] = new Object();
\r
2918 this.objManager[one_event_type].length = 0;
\r
2921 var eventAgency = this.GetAgencyObject(str_action_type,action_setting);
\r
2922 if( eventAgency != null )
\r
2924 var ct = this.objManager[one_event_type].length ++;
\r
2925 this.objManager[one_event_type][ct] = eventAgency;
\r
2927 if( one_event_type == "bsscpageclick" )
\r
2928 {// to deal with the "number of pageclick" stuff
\r
2929 if( typeof(event_additional) == "number" )
\r
2930 this.objManager[one_event_type][ct].nPageClick = event_additional;
\r
2931 else // set the default number
\r
2932 this.objManager[one_event_type][ct].nPageClick = 1;
\r
2934 if( (typeof(this.objManager.nMinPageClickIndex) == "undefined") ||
\r
2935 (this.objManager[one_event_type][ct].nPageClick <
\r
2936 this.objManager[one_event_type][this.objManager.nMinPageClickIndex].nPageClick) )
\r
2937 this.objManager.nMinPageClickIndex = ct;
\r
2940 //hide the object blindly,SetState function will take care of the final correct state
\r
2941 if( ((one_event_type == "bsscpageclick") &&
\r
2942 (this.objManager[one_event_type][ct].nPageClick == 1)) ||
\r
2943 one_event_type == "bsscpageload" ||
\r
2944 one_event_type == "bssctrigger1" )
\r
2945 CCSSP.ShowObject( this.eleTarget, false );
\r
2947 if( one_event_type == "bssctrigger1" || one_event_type == "bssctrigger2" )
\r
2948 if( typeof( this.strTriggerEvent ) == "undefined" )
\r
2949 this.strTriggerEvent = ( one_event_type == "bssctrigger1" ) ? "bssctrigger2" : "bssctrigger1";
\r
2956 CTarget.prototype.OnEvent = function( strBsscEvent )
\r
2957 {// response to the event ( bssc format )
\r
2958 if( typeof(this.objManager[strBsscEvent]) == "object" )
\r
2959 { // to get the event agency from the event manager
\r
2960 var eventAgency = this.objManager[strBsscEvent];
\r
2961 for( var i = 0; i < eventAgency.length; i++ )
\r
2963 if( strBsscEvent == "bsscpageclick" &&
\r
2964 eventAgency[i].nPageClick != CTarget.nPageClickCounter )
\r
2966 else if( strBsscEvent == "bsschover" && event.type == "mouseout" )
\r
2967 eventAgency[i].EndEffect();
\r
2968 else // to invoke the unified function in effect object
\r
2969 eventAgency[i].UpdateEffect();
\r
2974 CTarget.prototype.SetState = function( strBsscEvent )
\r
2976 if( typeof(this.objManager[strBsscEvent]) != "object" )
\r
2979 // to get the event agency from the event manager
\r
2980 var eventAgency = this.objManager[strBsscEvent];
\r
2982 if( strBsscEvent == "bsscpageclick" )
\r
2983 {// we only set the initial state for the minium number of pageclick
\r
2984 eventAgency[this.objManager.nMinPageClickIndex].PrepareEffect();
\r
2989 for( var i = 0; i < eventAgency.length; i++ )
\r
2990 eventAgency[i].PrepareEffect(); // to invoke the unified function in effect object
\r
2997 //End the definition of class CTarget
\r
2999 //Begin the definition of CEngine class
\r
3000 function CEngine(){}// all properities are going be "class" properities
\r
3002 // object : as associative array of trigger objects
\r
3003 CEngine.objTrigger = new Object();
\r
3004 // object : as associative array of target objects
\r
3005 CEngine.objTarget = new Object();
\r
3007 // Array : each element is a CAgencyXXX animation object
\r
3008 CEngine.arrAnimation = new Array();
\r
3009 CEngine.PerformAnimation = function( nIndex )
\r
3010 {// animation : update effects function
\r
3011 CEngine.arrAnimation[nIndex].UpdateEffect();
\r
3014 CEngine.AddOneTrigger = function(TriggerID,TriggerElement)
\r
3015 {// add one Trigger object into the trigger array
\r
3016 if( typeof(TriggerID) != "string" || TriggerElement == null ||
\r
3017 typeof(TriggerElement) != "object" )
\r
3019 if( typeof(CEngine.objTrigger[TriggerID] ) != "object" )
\r
3020 CEngine.objTrigger[TriggerID] = new CTrigger(TriggerElement);
\r
3023 CEngine.AddOneTarget = function(TargetID, TargetElement)
\r
3024 {// add one Target object into the target array
\r
3025 if( typeof(TargetID) != "string" || TargetElement == null ||
\r
3026 typeof(TargetElement) != "object" )
\r
3028 if( typeof(CEngine.objTarget[TargetID]) != "object" )
\r
3029 CEngine.objTarget[TargetID] = new CTarget( TargetElement );
\r
3032 CEngine.SendEventToOneTarget = function(strTargetID, strBsscEvent )
\r
3033 {// to activate one target object
\r
3034 if( typeof(CEngine.objTarget[strTargetID]) == "object" )
\r
3036 if( strBsscEvent == "bssctrigger1" || strBsscEvent == "bssctrigger2" )
\r
3037 {//now, the "bssctrigger1" and "bssctrigger2" work like a toggle
\r
3038 if( strBsscEvent == CEngine.objTarget[strTargetID].strTriggerEvent )
\r
3039 strBsscEvent = (strBsscEvent == "bssctrigger1") ? "bssctrigger2" : "bssctrigger1";
\r
3040 CEngine.objTarget[strTargetID].strTriggerEvent = strBsscEvent;
\r
3042 CEngine.objTarget[strTargetID].OnEvent( strBsscEvent );
\r
3046 CEngine.SendEventToAllTarget = function( strBsscEvent )
\r
3047 { //to activate all target associative to the BSSC event
\r
3048 for( var strTargetID in CEngine.objTarget ) //to enumerate all target
\r
3049 CEngine.SendEventToOneTarget( strTargetID, strBsscEvent );
\r
3052 CEngine.SetOneTargetInitialState = function( strTargetID )
\r
3053 {// only invoked after ALL effects for the target have been set
\r
3054 if( typeof(CEngine.objTarget[strTargetID]) == "object" )
\r
3055 {// to get target object
\r
3056 var objTarget = CEngine.objTarget[strTargetID];
\r
3057 if( objTarget.SetState( "bsscpageload" ) == false )
\r
3059 objTarget.SetState( "bsscpageclick" );
\r
3060 objTarget.SetState( "bssctrigger1" );
\r
3065 CEngine.AdjustPageClickCounter = function()
\r
3067 var nAdjustedClickCounter = CTarget.nPageClickCounter;
\r
3068 var bAdjusted = false;
\r
3069 for( var strTargetID in CEngine.objTarget ) //to enumerate all target
\r
3070 {// try to find the minum pageCliclConter greater than CTarget.nPageClickCounter
\r
3071 var objEventPageClick = CEngine.objTarget[strTargetID].objManager.bsscpageclick;
\r
3072 if( objEventPageClick != null )
\r
3074 for( var i = 0; i < objEventPageClick.length; i++ )
\r
3076 var nOtherPageClick = objEventPageClick[i].nPageClick;
\r
3077 if( nOtherPageClick == CTarget.nPageClickCounter )
\r
3079 if( nOtherPageClick > CTarget.nPageClickCounter )
\r
3083 nAdjustedClickCounter = nOtherPageClick;
\r
3086 else if( nOtherPageClick < nAdjustedClickCounter )
\r
3087 nAdjustedClickCounter = nOtherPageClick;
\r
3092 CTarget.nPageClickCounter = nAdjustedClickCounter;
\r
3095 CEngine.OnPageLoad = function()
\r
3097 // first, to set all target's initial state
\r
3098 for( var strTargetID in CEngine.objTarget )
\r
3099 CEngine.SetOneTargetInitialState( strTargetID );
\r
3101 // to invoke all target's onpageload handler
\r
3102 CEngine.SendEventToAllTarget( "bsscpageload" );
\r
3105 CEngine.OnPageClick = function()
\r
3106 { // to invoke all target's onpageclick handler
\r
3107 var src = CCSSP.GetEventElement( arguments[0] );
\r
3111 var objClickedTrigger = null;
\r
3112 for( var strTriggerID in CEngine.objTrigger )
\r
3113 { // to detect which trigger is clicked
\r
3114 if( CCSSP.IsDescendant( CEngine.objTrigger[strTriggerID].eleTrigger,src) )
\r
3116 objClickedTrigger = CEngine.objTrigger[strTriggerID];
\r
3121 if( objClickedTrigger != null) // the clicked trigger found
\r
3122 objClickedTrigger.OnTriggerClick();
\r
3123 else // no trigger is clicked
\r
3124 { // to send PageClick event to all target
\r
3125 CTarget.nPageClickCounter++;
\r
3126 CEngine.AdjustPageClickCounter();
\r
3127 CEngine.SendEventToAllTarget( "bsscpageclick" );
\r
3131 CEngine.OnMouseOver = function()
\r
3132 { // to invoke all target's onpageload handler
\r
3133 var src = CCSSP.GetEventElement( arguments[0] );
\r
3137 var strHoveredTargetID = null;
\r
3138 for( var strTargetID in CEngine.objTarget )
\r
3139 { // to detect which Target is hovering on
\r
3140 if( CCSSP.IsDescendant( CEngine.objTarget[strTargetID].eleTarget, src ) )
\r
3142 strHoveredTargetID = strTargetID;
\r
3147 if( strHoveredTargetID != null ) // the hovered target found
\r
3148 CEngine.SendEventToOneTarget( strHoveredTargetID, "bsschover" );
\r
3151 CEngine.BuildTargetObject = function(target_ID,event_type,action_type,
\r
3152 action_setting, event_additional)
\r
3153 {// to build target object
\r
3154 // to get the target object
\r
3155 if( typeof( CEngine.objTarget[target_ID] ) != "object" )
\r
3156 return false;// the engine's AddOneTarget function might have failed.
\r
3157 var TargetObject = CEngine.objTarget[target_ID];
\r
3159 // to prepare the parameters for the event manager
\r
3160 var arrEvent = event_type.split("|"); // to split the combined event_type string
\r
3161 var arrAction = action_type.split("|");//to split the combined action_type string
\r
3162 for( var trim = 0; trim < arrEvent.length; trim++ )
\r
3163 arrEvent[trim] = CCSSP.TrimSpace(arrEvent[trim]);
\r
3165 for( trim = 0; trim < arrAction.length; trim++ )
\r
3166 arrAction[trim] = CCSSP.TrimSpace(arrAction[trim]);
\r
3168 var arrSetting = new Array();
\r
3169 if( typeof(action_setting) == "string" )
\r
3170 arrSetting = action_setting.split("|");// to split the combined action_setting string
\r
3171 // to calibrate the arrays
\r
3172 for( var i = arrSetting.length; i < arrAction.length; i++ )
\r
3174 if( typeof(arrSetting[i]) != "string" )
\r
3175 arrSetting[i] = "";
\r
3178 // to prepare for dealing with the absolute posioning element
\r
3179 TargetObject.eleTarget.ABSX = CCSSP.GetObjectLeft( TargetObject.eleTarget );
\r
3180 TargetObject.eleTarget.ABSY = CCSSP.GetObjectTop( TargetObject.eleTarget );
\r
3182 if( arrEvent.length > 1 )
\r
3183 {// if event is combined, it must be : "bssctrigger1 | bssctrigger2"
\r
3184 if( arrAction.length != 2 )
\r
3185 return false; // if event is combined, there must be 2 actions
\r
3186 for( i = 0 ; i < 2; i++ )
\r
3188 if( TargetObject.SetEventManager(arrEvent[i], arrAction[i],
\r
3189 arrSetting[i], event_additional) == false )
\r
3190 return false; // the event manager has not been set up
\r
3193 else // the event_type string is not combined
\r
3195 for( i = 0 ; i < arrAction.length; i++ )
\r
3197 TargetObject.SetEventManager(event_type, arrAction[i], arrSetting[i], event_additional);
\r
3198 // to validate the event manager
\r
3199 if( typeof(TargetObject.objManager[event_type]) != "object" ||
\r
3200 typeof(TargetObject.objManager[event_type][i]) != "object" )
\r
3201 return false; // the event manager has not been set up
\r
3207 CEngine.BuildTriggerObject = function(trigger_ID, target_ID)
\r
3208 {// to build the trigger object
\r
3209 var arrTrigger = trigger_ID.split("|"); // to split the combined trigger_ID string
\r
3210 for( var i = 0; i < arrTrigger.length; i ++ )
\r
3211 {// to get the trigger element then add it to the trigger list
\r
3212 arrTrigger[i] = CCSSP.TrimSpace( arrTrigger[i] );
\r
3213 var eleTrigger = CCSSP.GetObject( arrTrigger[i] );
\r
3214 if( eleTrigger == null )
\r
3215 continue; // the trigger_ID string in the HTML code maybe wrong
\r
3216 CEngine.AddOneTrigger( arrTrigger[i], eleTrigger );
\r
3218 // to get the target object
\r
3219 if( typeof( this.objTrigger[arrTrigger[i]] ) != "object" )
\r
3220 continue;// the engine's AddOneTarget function might have failed.
\r
3221 CEngine.objTrigger[arrTrigger[i]].AddTargetID( target_ID );
\r
3224 //End the definition of CEngine class
\r
3226 /// Section End - CCSSP DHTM 1 (JavaScript 1.2)
\r
3228 /// Section Begin - CCSSP DHTM 2 (JavaScript 1.2)
\r
3230 //Begin the definition of CAgencyXXXX classes
\r
3232 //Begin of the CAgencyShow definition
\r
3233 function CAgencyShow( element, bIsShow )
\r
3235 this.ele = element;
\r
3236 this.bIsShow = bIsShow;
\r
3239 CAgencyShow.prototype.PrepareEffect = function()
\r
3241 CCSSP.ShowObject( this.ele, !this.bIsShow );
\r
3244 CAgencyShow.prototype.UpdateEffect = function()
\r
3246 CCSSP.ShowObject( this.ele, this.bIsShow );
\r
3249 CAgencyShow.prototype.EndEffect = function()
\r
3251 CCSSP.ShowObject( this.ele, !this.bIsShow );
\r
3253 // End of the CAgencyShow definition
\r
3255 // Begin of CAgencyFly definition
\r
3256 function CAgencyFly( element, settings, bIsIn )
\r
3258 this.ele = element;
\r
3259 this.bIsIn = bIsIn;
\r
3260 this.duration = 1000; // default
\r
3261 this.direction = "right";
\r
3263 var arrAllSet = settings.split(",");
\r
3264 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3265 {// to retrieve the setting
\r
3266 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3267 var arrOneSet = arrAllSet[i].split("=");
\r
3268 for( var j = 0; j < arrOneSet.length; j++ )
\r
3269 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3270 switch( arrOneSet[0] )
\r
3272 case "speed" : this.duration = 100000/arrOneSet[1]; break;
\r
3273 case "direction" : this.direction = arrOneSet[1]; break;
\r
3277 if( gbBsIE5 && this.ele.style.position != "absolute" )
\r
3278 this.ele.style.position = "relative";
\r
3279 this.timer = null;
\r
3280 this.aniIndex = CEngine.arrAnimation.length;
\r
3281 CEngine.arrAnimation[this.aniIndex] = this;
\r
3284 CAgencyFly.prototype.PrepareEffect = function()
\r
3286 CCSSP.ShowObject(this.ele, !this.bIsIn );
\r
3289 CAgencyFly.prototype.UpdateEffect = function()
\r
3291 if( this.timer == null )
\r
3292 this.ResetParameters();
\r
3294 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
\r
3295 if( percent >= 1.0 )
\r
3299 var newX = this.startX*(1.0-percent) + this.finalX*percent;
\r
3300 var newY = this.startY*(1.0-percent) + this.finalY*percent;
\r
3301 CCSSP.MoveObjectTo(this.ele, newX, newY);
\r
3302 if( this.timer == null )
\r
3303 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
\r
3307 CAgencyFly.prototype.EndEffect = function()
\r
3309 clearInterval( this.timer );
\r
3310 this.timer = null;
\r
3312 if( this.bIsIn ) // FlyIn
\r
3313 CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
\r
3315 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
\r
3316 CCSSP.ShowObject(this.ele, this.bIsIn );
\r
3319 CAgencyFly.prototype.ResetParameters = function()
\r
3321 this.PrepareEffect();
\r
3322 CCSSP.ShowObject(this.ele, true );
\r
3329 var offsetLeft = CCSSP.GetObjectWindowLeft(this.ele) + this.ele.offsetWidth;
\r
3330 var offsetTop = CCSSP.GetObjectWindowTop(this.ele) + this.ele.offsetHeight;
\r
3331 var offsetRight = CCSSP.GetWindowRight();
\r
3332 var offsetBottom = CCSSP.GetWindowBottom();
\r
3336 this.finalX = this.ele.ABSX;
\r
3337 this.finalY = this.ele.ABSY;
\r
3339 switch( this.direction )
\r
3341 case "right": this.startX = offsetRight; this.startY = this.finalY; break;
\r
3342 case "left": this.startX = -offsetLeft; this.startY = this.finalY; break;
\r
3343 case "down": this.startY = offsetBottom; this.startX = this.finalX; break;
\r
3344 case "up": this.startY = -offsetTop; this.startX = this.finalX; break;
\r
3346 this.startX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
\r
3347 this.startY = this.startX; break;
\r
3349 this.startX = (offsetTop < offsetRight)? offsetTop : offsetRight;
\r
3350 this.startY = -this.startX; break;
\r
3352 this.startX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
\r
3353 this.startY = this.startX; break;
\r
3355 this.startX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
\r
3356 this.startY = -this.startX; break;
\r
3361 this.startX = this.ele.ABSX;
\r
3362 this.startY = this.ele.ABSY;
\r
3364 switch( this.direction )
\r
3366 case "right": this.finalX = offsetRight; this.finalY = this.startY; break;
\r
3367 case "left": this.finalX = -offsetLeft; this.finalY = this.startY; break;
\r
3368 case "down": this.finalY = offsetBottom; this.finalX = this.startX; break;
\r
3369 case "up": this.finalY = -offsetTop; this.finalX = this.startX; break;
\r
3371 this.finalX = ( offsetBottom < offsetRight) ? offsetBottom : offsetRight;
\r
3372 this.finalY = this.finalX; break;
\r
3374 this.finalX = (offsetTop < offsetRight)? offsetTop : offsetRight;
\r
3375 this.finalY = -this.finalX; break;
\r
3377 this.finalX = -((offsetTop < offsetRight)? offsetTop : offsetRight);
\r
3378 this.finalY = this.finalX; break;
\r
3380 this.finalX = -(( offsetBottom < offsetRight) ? offsetBottom : offsetRight);
\r
3381 this.finalY = -this.finalX; break;
\r
3384 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
\r
3385 this.startTime = (new Date()).getTime();
\r
3387 // End of the CAgencyFly definition
\r
3389 // Begin of CAgencySpiral
\r
3390 function CAgencySpiral( element, settings, bIsIn )
\r
3392 this.ele = element;
\r
3393 this.bIsIn = bIsIn;
\r
3394 this.duration = 1000; // default
\r
3396 var arrAllSet = settings.split(",");
\r
3397 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3398 {// to retrieve the setting
\r
3399 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3400 var arrOneSet = arrAllSet[i].split("=");
\r
3401 for( var j = 0; j < arrOneSet.length; j++ )
\r
3402 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3403 switch( arrOneSet[0] )
\r
3405 case "speed" : this.duration = 100000/arrOneSet[1]; break;
\r
3409 if( gbBsIE5 && this.ele.style.position != "absolute" )
\r
3410 this.ele.style.position = "relative";
\r
3411 this.timer = null;
\r
3412 this.aniIndex = CEngine.arrAnimation.length;
\r
3413 CEngine.arrAnimation[this.aniIndex] = this;
\r
3416 CAgencySpiral.prototype.PrepareEffect = function()
\r
3418 CCSSP.ShowObject(this.ele, !this.bIsIn );
\r
3421 CAgencySpiral.prototype.UpdateEffect = function()
\r
3423 if( this.timer == null )
\r
3424 this.ResetParameters();
\r
3426 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
\r
3427 if( percent >= 1.0 )
\r
3431 var rf = (this.bIsIn)? (1.0 - percent) : percent;
\r
3432 var t = (1.0-rf) * 4.0 * Math.PI
\r
3433 var rxP = (this.bIsIn)? this.startX : this.finalX;
\r
3434 var ryP = (this.bIsIn)? this.startY : this.finalY;
\r
3435 var rx = (Math.abs(rxP) < 200) ? Math.abs(rxP) : 200;
\r
3436 var ry = (Math.abs(ryP) < 200) ? Math.abs(ryP) : 200;
\r
3438 var newX = Math.ceil(-rf*Math.cos(t)*rx) + this.ele.ABSX;
\r
3439 var newY = Math.ceil(-rf*Math.sin(t)*ry) + this.ele.ABSY;
\r
3440 CCSSP.MoveObjectTo(this.ele, newX, newY);
\r
3441 if( this.timer == null )
\r
3442 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
\r
3446 CAgencySpiral.prototype.EndEffect = function()
\r
3448 clearInterval( this.timer );
\r
3449 this.timer = null;
\r
3451 if( this.bIsIn ) // In
\r
3452 CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
\r
3454 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
\r
3455 CCSSP.ShowObject(this.ele, this.bIsIn );
\r
3458 CAgencySpiral.prototype.ResetParameters = function()
\r
3460 this.PrepareEffect();
\r
3461 CCSSP.ShowObject(this.ele, true );
\r
3462 this.startX = (this.bIsIn)? CCSSP.GetWindowRight() : this.ele.ABSX;
\r
3463 this.startY = (this.bIsIn)? CCSSP.GetWindowBottom() : this.ele.ABSY;
\r
3464 this.finalX = (this.bIsIn)? this.ele.ABSX : CCSSP.GetWindowRight();
\r
3465 this.finalY = (this.bIsIn)? this.ele.ABSY : CCSSP.GetWindowBottom();
\r
3467 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
\r
3468 this.startTime = (new Date()).getTime();
\r
3470 // End of CAgencySpiral
\r
3472 // Begin of CAgencyElastic
\r
3473 function CAgencyElastic( element, settings)
\r
3475 this.ele = element;
\r
3476 this.duration = 1000; // default
\r
3477 this.direction = "right";
\r
3479 var arrAllSet = settings.split(",");
\r
3480 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3481 {// to retrieve the setting
\r
3482 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3483 var arrOneSet = arrAllSet[i].split("=");
\r
3484 for( var j = 0; j < arrOneSet.length; j++ )
\r
3485 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3486 switch( arrOneSet[0] )
\r
3488 case "speed" : this.duration = 100000/arrOneSet[1]; break;
\r
3489 case "direction" : this.direction = arrOneSet[1]; break;
\r
3493 if( gbBsIE5 && this.ele.style.position != "absolute" )
\r
3494 this.ele.style.position = "relative";
\r
3495 this.timer = null;
\r
3496 this.aniIndex = CEngine.arrAnimation.length;
\r
3497 CEngine.arrAnimation[this.aniIndex] = this;
\r
3500 CAgencyElastic.prototype.PrepareEffect = function()
\r
3502 CCSSP.ShowObject(this.ele, false );
\r
3505 CAgencyElastic.prototype.UpdateEffect = function()
\r
3507 if( this.timer == null )
\r
3508 this.ResetParameters();
\r
3510 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
\r
3511 if( percent >= 1.0 )
\r
3515 var newX = this.startX;
\r
3516 var newY = this.startY;
\r
3517 var rf = Math.exp(-percent*3);
\r
3518 var t = percent * 1.5 * Math.PI
\r
3519 var rx = (Math.abs(this.startX) > Math.abs(this.startY)) ? this.startX : this.startY;
\r
3520 switch (this.direction )
\r
3523 case "right" : newX = rf*Math.cos(t)*rx + this.ele.ABSX; break;
\r
3525 case "down" : newY = rf*Math.cos(t)*rx + this.ele.ABSX; break;
\r
3527 CCSSP.MoveObjectTo(this.ele, newX, newY);
\r
3528 if( this.timer == null )
\r
3529 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
\r
3533 CAgencyElastic.prototype.EndEffect = function()
\r
3535 CCSSP.MoveObjectTo(this.ele, this.finalX, this.finalY);
\r
3536 clearInterval( this.timer );
\r
3537 this.timer = null;
\r
3540 CAgencyElastic.prototype.ResetParameters = function()
\r
3542 CCSSP.ShowObject(this.ele, true );
\r
3543 this.startX = this.ele.ABSX;
\r
3544 this.finalX = this.ele.ABSX;
\r
3545 this.startY = this.ele.ABSY;
\r
3546 this.finalY = this.ele.ABSY;
\r
3548 switch (this.direction)
\r
3550 case "left": this.startX = -this.ele.offsetWidth; break;
\r
3551 case "right": this.startX = this.ele.offsetWidth; break;
\r
3552 case "up": this.startY = -this.ele.offsetHeight;break;
\r
3553 case "down": this.startY = this.ele.offsetHeight; break;
\r
3555 CCSSP.MoveObjectTo(this.ele, this.startX, this.startY);
\r
3556 this.startTime = (new Date()).getTime();
\r
3558 // End of CAgencyElastic
\r
3560 // Begin of CAgencyZoom
\r
3561 function CAgencyZoom( element, settings, bIsIn)
\r
3563 this.ele = element;
\r
3564 this.duration = 1000; // default
\r
3566 var arrAllSet = settings.split(",");
\r
3567 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3568 {// to retrieve the setting
\r
3569 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3570 var arrOneSet = arrAllSet[i].split("=");
\r
3571 for( var j = 0; j < arrOneSet.length; j++ )
\r
3572 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3573 switch( arrOneSet[0] )
\r
3575 case "speed" : this.duration = 100000/arrOneSet[1]; break;
\r
3579 this.bIsIn = bIsIn;
\r
3580 this.timer = null;
\r
3581 this.aniIndex = CEngine.arrAnimation.length;
\r
3582 CEngine.arrAnimation[this.aniIndex] = this;
\r
3585 CAgencyZoom.prototype.PrepareEffect = function()
\r
3587 CCSSP.ShowObject(this.ele, false);
\r
3590 CAgencyZoom.prototype.UpdateEffect = function()
\r
3592 if( this.timer == null )
\r
3593 this.ResetParameters();
\r
3595 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
\r
3596 if( percent >= 1.0 )
\r
3600 var nFactorIn = Math.ceil(50+50*percent);
\r
3601 var nFactorOut = Math.ceil(100+200*(1-percent));
\r
3602 var AlterFontsize = ((this.bIsIn)? nFactorIn : nFactorOut) + "%";
\r
3603 var AlterFactor = ((this.bIsIn)? nFactorIn : nFactorOut) / 100;
\r
3605 this.UpdateEffectAllChildren(this.ele, AlterFontsize, AlterFactor);
\r
3606 for(var index = 0; index < this.ele.all.length; index++)
\r
3607 this.UpdateEffectAllChildren(this.ele.all[index], AlterFontsize, AlterFactor);
\r
3609 if( this.timer == null )
\r
3610 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
\r
3614 CAgencyZoom.prototype.UpdateEffectAllChildren = function(child, FontSize, Factor)
\r
3616 if( CCSSP.IsTextTag(child) )
\r
3617 child.style.fontSize = FontSize;
\r
3620 if( typeof(child.orgWidth) == "number" )
\r
3621 child.style.width = Factor * child.orgWidth;
\r
3622 if( typeof(child.orgHeight) == "number" )
\r
3623 child.style.height = Factor * child.orgHeight;
\r
3627 CAgencyZoom.prototype.EndEffect = function()
\r
3629 this.EndEffectAllChildren(this.ele);
\r
3630 for(var index = 0; index < this.ele.all.length; index++)
\r
3631 this.EndEffectAllChildren(this.ele.all[index]);
\r
3633 clearInterval( this.timer );
\r
3634 this.timer = null;
\r
3637 CAgencyZoom.prototype.EndEffectAllChildren = function( child )
\r
3639 if( CCSSP.IsTextTag(child) )
\r
3640 child.style.fontSize = child.orgFontSize;
\r
3643 if( typeof(child.intactWidth) != "undefined" )
\r
3645 child.width = child.intactWidth;
\r
3646 child.height = child.intactHeight;
\r
3648 else if( typeof(child.style.intactPixelWidth) != "undefined" )
\r
3650 child.style.pixelWidth = child.style.intactPixelWidth;
\r
3651 child.style.pixelHeight = child.style.intactPixelHeight;
\r
3656 CAgencyZoom.prototype.ResetParameters = function()
\r
3658 this.PrepareEffect();
\r
3659 this.ResetParametersAllChildren( this.ele );
\r
3660 for(var index = 0; index < this.ele.all.length; index++)
\r
3661 this.ResetParametersAllChildren(this.ele.all[index]);
\r
3663 this.startTime = (new Date()).getTime();
\r
3666 CAgencyZoom.prototype.ResetParametersAllChildren = function( child )
\r
3668 CCSSP.ShowObject(child, true );
\r
3669 if( (child.tagName == "DIV") && (getParentNode(child).tagName == "TD") )
\r
3670 child.width = "100%";// if the div is inside a cell of table, we need the this hack
\r
3672 if( CCSSP.IsTextTag(child) )
\r
3673 child.orgFontSize = child.style.fontSize;
\r
3676 if( child.width > "" || child.height > "" )
\r
3678 child.orgWidth = child.intactWidth = child.width;
\r
3679 child.orgHeight = child.intactHeight = child.height;
\r
3681 else if( ( typeof(child.orgWidth) != "number" ) && (typeof(child.orgHeight) != "number") )
\r
3683 child.orgWidth = child.style.intactPixelWidth = child.style.pixelWidth;
\r
3684 child.orgHeight = child.style.intactPixelHeight = child.style.pixelHeight;
\r
3688 // End of CAgencyZoom
\r
3690 //// the following effects will use IE's exclusive "filter" function ////
\r
3691 // Begin of CAgencyAlpha definition
\r
3692 function CAgencyAlpha( element, settings, bIsIn )
\r
3693 {// because of "visual filter" style, this won't work in Navigator
\r
3694 this.ele = element;
\r
3695 this.bIsIn = bIsIn;
\r
3697 // to set the default value
\r
3698 this.startOpacity = (this.bIsIn) ? 0 : 100;
\r
3699 this.endOpacity = (this.bIsIn) ? 100 : 0;
\r
3701 this.duration = 1000; // default
\r
3703 var arrAllSet = settings.split(",");
\r
3704 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3705 {// to retrieve the setting
\r
3706 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3707 var arrOneSet = arrAllSet[i].split("=");
\r
3708 for( var j = 0; j < arrOneSet.length; j++ )
\r
3709 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3710 switch( arrOneSet[0] )
\r
3712 case "speed" : this.duration = 100000/arrOneSet[1]; break;
\r
3716 this.timer = null;
\r
3717 this.aniIndex = CEngine.arrAnimation.length;
\r
3718 CEngine.arrAnimation[this.aniIndex] = this;
\r
3721 CAgencyAlpha.prototype.PrepareEffect = function()
\r
3722 {// to set the visual filter function
\r
3723 // the visual filter ONLY work when set by "Width and Height" or
\r
3724 // absolute position for DIV, SPAN and normal tag ( such as p )
\r
3725 // but, "absolute" cause the following elements overlap, so:
\r
3726 CCSSP.PrepareFilter( this.ele );
\r
3727 CCSSP.ShowObject(this.ele, !this.bIsIn );
\r
3730 CAgencyAlpha.prototype.UpdateEffect = function()
\r
3731 {// to set the visual filter function
\r
3732 if( this.timer == null )
\r
3733 this.ResetParameters();
\r
3734 if( typeof(this.ele.filters.alpha) != "object" )
\r
3740 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
\r
3741 if( percent >= 1.0 )
\r
3743 else if( typeof(this.ele.filters.alpha) == "object" )
\r
3745 this.ele.filters.alpha.opacity = this.startOpacity*(1.0-percent) + this.endOpacity*percent;
\r
3746 if( this.timer == null )
\r
3747 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 20 );
\r
3751 CAgencyAlpha.prototype.EndEffect = function()
\r
3752 {// to remove the visual filter function
\r
3753 clearInterval( this.timer );
\r
3754 this.timer = null;
\r
3755 this.ele.style.filter = "";
\r
3756 CCSSP.ShowObject(this.ele, this.bIsIn );
\r
3759 CAgencyAlpha.prototype.ResetParameters = function()
\r
3761 this.PrepareEffect();
\r
3762 CCSSP.ShowObject(this.ele, true );
\r
3763 this.ele.style.filter = "alpha(opacity=" + this.startOpacity + ")";
\r
3764 this.startTime = (new Date()).getTime();
\r
3766 // End of the CAgencyAlpha definition
\r
3768 // Begin of CAgencyWave definition
\r
3769 function CAgencyWave( element, settings )
\r
3770 {// because of "visual filter" style, this won't work in Navigator
\r
3771 this.ele = element;
\r
3773 this.duration = 0; // default
\r
3774 this.strength = 10;
\r
3776 this.lightstrength = 1;
\r
3778 var arrAllSet = settings.split(",");
\r
3779 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3780 {// to retrieve the setting
\r
3781 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3782 var arrOneSet = arrAllSet[i].split("=");
\r
3783 for( var j = 0; j < arrOneSet.length; j++ )
\r
3784 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3785 switch( arrOneSet[0] )
\r
3787 case "duration" : this.duration = 100000/arrOneSet[1]; break;
\r
3788 case "strength" : this.strength = arrOneSet[1]; break;
\r
3789 case "freq" : this.freq = arrOneSet[1]; break;
\r
3790 case "lightstrength" : this.lightstrength = arrOneSet[1]; break;
\r
3794 this.timer = null;
\r
3795 this.aniIndex = CEngine.arrAnimation.length;
\r
3796 CEngine.arrAnimation[this.aniIndex] = this;
\r
3799 CAgencyWave.prototype.PrepareEffect = function()
\r
3800 {// to set the visual filter function
\r
3801 CCSSP.PrepareFilter(this.ele);
\r
3803 CCSSP.ShowObject(this.ele, true );
\r
3806 CAgencyWave.prototype.UpdateEffect = function()
\r
3807 {// to set the visual filter function
\r
3808 if( this.timer == null )
\r
3809 this.ResetParameters();
\r
3810 if( typeof(this.ele.filters.wave) != "object" )
\r
3816 if( this.duration > 0 )
\r
3818 var percent = ((new Date()).getTime() - this.startTime)/this.duration;
\r
3819 if( percent >= 1.0 )
\r
3826 this.ele.filters.wave.phase += 5;
\r
3827 this.ele.filters.wave.phase %= 100;
\r
3828 if( this.timer == null )
\r
3829 this.timer = setInterval("CEngine.PerformAnimation(" + this.aniIndex + ")", 50 );
\r
3832 CAgencyWave.prototype.EndEffect = function()
\r
3833 {// to remove the visual filter function
\r
3834 this.ele.style.filter = "";
\r
3835 clearInterval( this.timer );
\r
3836 this.timer = null;
\r
3839 CAgencyWave.prototype.ResetParameters = function()
\r
3841 this.PrepareEffect();
\r
3842 this.ele.style.filter = "wave(strength=" + this.strength + ",freq=" +
\r
3843 this.freq +", lightstrength=" + this.lightstrength +",phase=0);";
\r
3844 this.startTime = (new Date()).getTime();
\r
3846 // End of the CAgencyWave definition
\r
3848 // Begin of CAgencyGlow definition
\r
3849 function CAgencyGlow( element, settings )
\r
3850 {// because of "visual filter" style, this won't work in Navigator
\r
3851 this.ele = element;
\r
3853 // to set the default value
\r
3854 this.glowColor = "green";
\r
3855 this.glowStrength = "3";
\r
3857 var arrAllSet = settings.split(",");
\r
3858 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3860 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3861 var arrOneSet = arrAllSet[i].split("=");
\r
3862 for( var j = 0; j < arrOneSet.length; j++ )
\r
3863 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3864 switch( arrOneSet[0] )
\r
3866 case "color" : this.glowColor = arrOneSet[1]; break;
\r
3867 case "strength" : this.glowStrength = arrOneSet[1]; break;
\r
3872 CAgencyGlow.prototype.PrepareEffect = function()
\r
3874 CCSSP.PrepareFilter(this.ele);
\r
3875 CCSSP.ShowObject(this.ele, true );
\r
3876 if( this.ele.style.backgroundColor != "" )
\r
3877 {//style.backgroundColor somehow stop the visual filter
\r
3878 this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
\r
3879 this.ele.style.backgroundColor = "";
\r
3883 CAgencyGlow.prototype.UpdateEffect = function()
\r
3884 {// to set the visual filter function
\r
3885 this.PrepareEffect();
\r
3886 this.ele.style.filter = "glow(Color=" + this.glowColor + ", Strength=" +
\r
3887 this.glowStrength + ", enabled=true" +")";
\r
3890 CAgencyGlow.prototype.EndEffect = function()
\r
3891 {// to remove the visual filter function
\r
3892 this.ele.style.filter = "";
\r
3893 if( typeof(this.ele.intactBackgroundColor) != "undefined" )
\r
3894 this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
\r
3896 // End of the CAgencyGlow definition
\r
3898 // Begin of CAgencyDropShadow definition
\r
3899 function CAgencyDropShadow( element, settings )
\r
3900 {// because of "visual filter" style, this won't work in Navigator
\r
3901 this.ele = element;
\r
3903 // to set the default value
\r
3904 this.shadowColor = "black";
\r
3905 this.shadowOffx = "1";
\r
3906 this.shadowOffy = "1";
\r
3908 var arrAllSet = settings.split(",");
\r
3909 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3911 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3912 var arrOneSet = arrAllSet[i].split("=");
\r
3913 for( var j = 0; j < arrOneSet.length; j++ )
\r
3914 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3915 switch( arrOneSet[0] )
\r
3917 case "color" : this.shadowColor = arrOneSet[1]; break;
\r
3918 case "offx" : this.shadowOffx = arrOneSet[1]; break;
\r
3919 case "offy" : this.shadowOffy = arrOneSet[1]; break;
\r
3924 CAgencyDropShadow.prototype.PrepareEffect = function()
\r
3926 CCSSP.PrepareFilter(this.ele);
\r
3927 CCSSP.ShowObject(this.ele, true );
\r
3929 if( this.ele.style.backgroundColor != "" )
\r
3930 {//style.backgroundColor somehow stop the visual filter
\r
3931 this.ele.intactBackgroundColor = this.ele.style.backgroundColor;
\r
3932 this.ele.style.backgroundColor = "";
\r
3936 CAgencyDropShadow.prototype.UpdateEffect = function()
\r
3937 {// to set the visual filter function
\r
3938 this.PrepareEffect();
\r
3939 this.ele.style.filter = "dropshadow(color=" + this.shadowColor + ", offx=" +
\r
3940 this.shadowOffx + ", offy=" + this.shadowOffy + ")";
\r
3943 CAgencyDropShadow.prototype.EndEffect = function()
\r
3944 {// to remove the visual filter function
\r
3945 this.ele.style.filter = "";
\r
3946 if( typeof(this.ele.intactBackgroundColor) != "undefined" )
\r
3947 this.ele.style.backgroundColor = this.ele.intactBackgroundColor;
\r
3949 // End of the CAgencyDropShadow definition
\r
3951 // Begin of CAgencyRevealTrans definition
\r
3952 function CAgencyRevealTrans( element, settings )
\r
3953 {// because of "visual filter" style, this won't work in Navigator
\r
3954 this.ele = element;
\r
3956 // to set the default value
\r
3957 this.duration = 1.0; //The value is specified in seconds.milliseconds format (0.0000).
\r
3958 this.transition = 0;
\r
3960 var arrAllSet = settings.split(",");
\r
3961 for( var i = 0; i < arrAllSet.length; i ++ )
\r
3963 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
3964 var arrOneSet = arrAllSet[i].split("=");
\r
3965 for( var j = 0; j < arrOneSet.length; j++ )
\r
3966 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
3967 switch( arrOneSet[0] )
\r
3969 case "type" : this.transition = arrOneSet[1]; break;
\r
3970 case "duration" : this.duration = 100/arrOneSet[1]; break;
\r
3975 CAgencyRevealTrans.prototype.PrepareEffect = function()
\r
3977 CCSSP.PrepareFilter(this.ele);
\r
3978 CCSSP.ShowObject( this.ele, false);
\r
3981 CAgencyRevealTrans.prototype.UpdateEffect = function()
\r
3982 {// to set the visual filter function
\r
3983 if( typeof( this.ele.filters.RevealTrans ) == "object" )
\r
3985 if( this.ele.filters.RevealTrans.status == 2 )
\r
3986 this.ele.filters.RevealTrans.stop();
\r
3989 this.PrepareEffect();
\r
3991 this.ele.style.filter = "RevealTrans(duration=" + this.duration +
\r
3992 ", transition=" + this.transition + ")";
\r
3994 if( typeof( this.ele.filters.RevealTrans ) == "object" )
\r
3996 this.ele.filters.RevealTrans.apply();
\r
3997 CCSSP.ShowObject( this.ele, true);
\r
3998 this.ele.filters.RevealTrans.play();
\r
4001 CCSSP.ShowObject( this.ele, true);
\r
4004 CAgencyRevealTrans.prototype.EndEffect = function()
\r
4006 if( typeof( this.ele.filters.RevealTrans ) == "object" )
\r
4007 this.ele.filters.RevealTrans.stop();
\r
4008 this.ele.style.filter = "";
\r
4010 // End of the CAgencyRevealTrans definition
\r
4012 // Begin of CAgencyBlur definition
\r
4013 function CAgencyBlur( element, settings )
\r
4014 {// because of "visual filter" style, this won't work in Navigator
\r
4015 this.ele = element;
\r
4017 // to set the default value
\r
4018 this.strength = "5";
\r
4019 this.direction = "90";
\r
4021 var arrAllSet = settings.split(",");
\r
4022 for( var i = 0; i < arrAllSet.length; i ++ )
\r
4024 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
4025 var arrOneSet = arrAllSet[i].split("=");
\r
4026 for( var j = 0; j < arrOneSet.length; j++ )
\r
4027 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
4028 switch( arrOneSet[0] )
\r
4030 case "strength" : this.strength = arrOneSet[1]; break;
\r
4031 case "direction" : this.direction = arrOneSet[1]; break;
\r
4036 CAgencyBlur.prototype.PrepareEffect = function()
\r
4038 CCSSP.PrepareFilter(this.ele);
\r
4039 CCSSP.ShowObject(this.ele, true );
\r
4042 CAgencyBlur.prototype.UpdateEffect = function()
\r
4043 {// to set the visual filter function
\r
4044 CCSSP.PrepareFilter(this.ele);
\r
4045 this.ele.style.filter = "blur(strength=" + this.strength +
\r
4046 ", direction=" + this.direction + ")";
\r
4049 CAgencyBlur.prototype.EndEffect = function()
\r
4050 {// to remove the visual filter function
\r
4051 this.ele.style.filter = "";
\r
4053 // End of the CAgencyBlur definition
\r
4055 // Begin of CAgencyChangeFilter definition
\r
4056 function CAgencyChangeFilter( element, settings ) // flipH, flipV, invert, grey,
\r
4057 {// because of "visual filter" style, this won't work in Navigator
\r
4058 this.ele = element;
\r
4060 // to set the default value
\r
4061 this.filterFunction = settings;
\r
4064 CAgencyChangeFilter.prototype.PrepareEffect = function()
\r
4066 CCSSP.PrepareFilter(this.ele);
\r
4067 CCSSP.ShowObject(this.ele, true );
\r
4070 CAgencyChangeFilter.prototype.UpdateEffect = function()
\r
4071 {// to set the visual filter function
\r
4072 CCSSP.PrepareFilter(this.ele);
\r
4073 this.ele.style.filter = this.filterFunction;
\r
4076 CAgencyChangeFilter.prototype.EndEffect = function()
\r
4077 {// to remove the visual filter function
\r
4078 this.ele.style.filter = "";
\r
4080 // End of the CAgencyChangeFilter definition
\r
4082 // The effects below change the style on the fly, so they won't work in Navigator
\r
4084 // Begin of CAgencyFontChange definition,
\r
4085 function CAgencyFontChange( element, settings )
\r
4086 {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
\r
4087 this.ele = element;
\r
4089 // to retrieve the original font style
\r
4090 this.RetrieveOldFont( this.ele );
\r
4092 // to set the default font to change
\r
4093 this.newfontFamily = this.ele.oldFontFamily;
\r
4094 this.newfColor = this.ele.oldColor;
\r
4095 this.newtextDecoration = this.ele.oldTextDecoration;
\r
4096 this.newfontWeight = this.ele.oldFontWeight;
\r
4097 this.newfontStyle = this.ele.oldFontStyle;
\r
4098 this.newfontSize = this.ele.oldFontSize;
\r
4099 this.newBackgroundColor = this.ele.oldBackgroundColor;
\r
4101 var arrAllSet = settings.split(",");
\r
4102 for( var i = 0; i < arrAllSet.length; i ++ )
\r
4103 {// to retrieve the setting
\r
4104 arrAllSet[i] = CCSSP.TrimSpace(arrAllSet[i]);
\r
4105 var arrOneSet = arrAllSet[i].split("=");
\r
4106 for( var j = 0; j < arrOneSet.length; j++ )
\r
4107 arrOneSet[j] = CCSSP.TrimSpace(arrOneSet[j]);
\r
4108 switch( arrOneSet[0] )
\r
4110 case "font-family" : this.newfontFamily = arrOneSet[1]; break;
\r
4111 case "color" : this.newfColor = arrOneSet[1]; break;
\r
4112 case "underline" : this.newtextDecoration = (arrOneSet[1]=="on")? "underline" : "none"; break;
\r
4113 case "bold" : this.newfontWeight = (arrOneSet[1]=="on")? "bold" : "normal"; break;
\r
4114 case "italic" : this.newfontStyle = (arrOneSet[1]=="on")? "italic" : "normal"; break;
\r
4115 case "size" : this.newfontSize = arrOneSet[1]; break;
\r
4116 case "background-color" : this.newBackgroundColor = arrOneSet[1]; break;
\r
4121 CAgencyFontChange.prototype.RetrieveOldFont = function(objChild)
\r
4123 if( typeof(objChild.oldFontFamily) == "undefined" )
\r
4124 objChild.oldFontFamily = objChild.style.fontFamily;
\r
4125 if( typeof(objChild.oldColor) == "undefined" )
\r
4126 objChild.oldColor = objChild.style.color;
\r
4127 if( typeof(objChild.oldTextDecoration) == "undefined" )
\r
4128 objChild.oldTextDecoration = objChild.style.textDecoration;
\r
4129 if( typeof(objChild.oldFontWeight) == "undefined" )
\r
4130 objChild.oldFontWeight = objChild.style.fontWeight;
\r
4131 if( typeof(objChild.oldFontStyle) == "undefined" )
\r
4132 objChild.oldFontStyle = objChild.style.fontStyle;
\r
4133 if( typeof(objChild.oldFontSize) == "undefined" )
\r
4134 objChild.oldFontSize = objChild.style.fontSize;
\r
4135 if( typeof(objChild.oldBackgroundColor) == "undefined" )
\r
4136 objChild.oldBackgroundColor = objChild.style.backgroundColor;
\r
4139 CAgencyFontChange.prototype.PrepareEffect = function()
\r
4141 // as for expanding text, the child is created after the constructor called
\r
4142 for(var index = 0; index < this.ele.all.length; index++)
\r
4143 this.RetrieveOldFont(this.ele.all[index]);
\r
4144 CCSSP.ShowObject(this.ele, true );
\r
4147 CAgencyFontChange.prototype.UpdateEffect = function()
\r
4148 {// to change the font
\r
4149 this.PrepareEffect();
\r
4150 this.UpdateEffectAllChildren( this.ele );
\r
4151 for( var index = 0; index < this.ele.all.length; index++)
\r
4152 this.UpdateEffectAllChildren(this.ele.all[index]);
\r
4155 CAgencyFontChange.prototype.UpdateEffectAllChildren = function(objChild)
\r
4157 objChild.style.fontFamily = this.newfontFamily;
\r
4158 objChild.style.color = this.newfColor;
\r
4159 objChild.style.textDecoration = this.newtextDecoration;
\r
4160 objChild.style.fontWeight = this.newfontWeight;
\r
4161 objChild.style.fontStyle = this.newfontStyle;
\r
4162 objChild.style.fontSize = this.newfontSize;
\r
4163 objChild.style.backgroundColor = this.newBackgroundColor;
\r
4166 CAgencyFontChange.prototype.EndEffect = function()
\r
4167 {// to reinstate the original font style
\r
4168 this.EndEffectAllChildren( this.ele );
\r
4169 for( var index = 0; index < this.ele.all.length; index++)
\r
4170 this.EndEffectAllChildren(this.ele.all[index]);
\r
4173 CAgencyFontChange.prototype.EndEffectAllChildren = function( objChild )
\r
4175 if( typeof(objChild.oldFontFamily) != "undefined" )
\r
4176 objChild.style.fontFamily = objChild.oldFontFamily;
\r
4177 if( typeof(objChild.oldColor) != "undefined" )
\r
4178 objChild.style.color = objChild.oldColor;
\r
4179 if( typeof(objChild.oldFontWeight) != "undefined" )
\r
4180 objChild.style.fontWeight = objChild.oldFontWeight;
\r
4181 if( typeof(objChild.oldFontStyle) != "undefined" )
\r
4182 objChild.style.fontStyle = objChild.oldFontStyle;
\r
4183 if( typeof(objChild.oldFontSize) != "undefined" )
\r
4184 objChild.style.fontSize = objChild.oldFontSize;
\r
4185 if( typeof(objChild.oldTextDecoration) != "undefined" )
\r
4186 objChild.style.textDecoration = objChild.oldTextDecoration;
\r
4187 if( typeof(objChild.oldBackgroundColor) != "undefined" )
\r
4188 objChild.style.backgroundColor = objChild.oldBackgroundColor;
\r
4190 // End of the CAgencyFontChange definition
\r
4192 // Begin of the CAgencyChangeStyle definition
\r
4193 function CAgencyChangeStyle( element, settings )
\r
4194 {//this class can be replace by CAgencyChangeStyle,provided the "settings" is standard CSS string.
\r
4195 this.ele = element;
\r
4197 // to retrieve the original style
\r
4198 this.oldstyle = this.ele.style.cssText;
\r
4200 // to set the default style
\r
4201 this.newStyle = this.oldstyle;
\r
4203 if( typeof(settings) == "string" && settings.length > 1 )
\r
4204 this.newStyle = this.oldstyle + " " + settings;
\r
4207 CAgencyChangeStyle.prototype.PrepareEffect = function()
\r
4209 CCSSP.ShowObject(this.ele, true );
\r
4212 CAgencyChangeStyle.prototype.UpdateEffect = function()
\r
4213 {// to change the style
\r
4214 this.ele.style.cssText = this.newStyle;
\r
4217 CAgencyChangeStyle.prototype.EndEffect = function()
\r
4218 {// to reinstate the original style
\r
4219 this.ele.style.cssText = this.oldStyle;
\r
4221 // End of the CAgencyChangeStyle definition
\r
4223 //End the definition of CAgencyXXXX classes
\r
4225 //Begin to collaborate with other event handler settings
\r
4226 CCSSP.RegisterEventHandler( window, "onload", "CEngine.OnPageLoad();BSSCOnLoad();kadovInitTriggersInHead();");
\r
4227 CCSSP.RegisterEventHandler( document, "onclick", "CEngine.OnPageClick();BSSCOnClick();");
\r
4228 CCSSP.RegisterEventHandler( document, "onmouseover", "CEngine.OnMouseOver();BSSCOnMouseOver();" );
\r
4229 CCSSP.RegisterEventHandler( document, "onmouseout", "CEngine.OnMouseOver();BSSCOnMouseOut();" );
\r
4230 CCSSP.RegisterEventHandler( window, "onunload", "BSSCOnUnload();");
\r
4231 //End to collaborate with other event handler settings
\r
4233 /// Section End - CCSSP DHTM 2 (JavaScript 1.2)
\r
4235 //// Segment End -- (JavaScript 1.2)