Produced by Araxis Merge on 1/2/2018 11:59:28 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Tue Jan 2 16:59:28 2018 UTC | ||
| 2 | HTRE_P2.zip\src.zip\output\IHTA OLH Files.zip\reports.zip | ehlpdhtm.js | Wed Jul 4 05:39:20 2012 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 5450 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | // Dynamic HTML Java Script | |||||
| 2 | // Copyrig ht © 1998- 2012 Adobe Systems I ncorporate d. All rig hts reserv ed. | |||||
| 3 | // Version =9.0 | |||||
| 4 | ||||||
| 5 | // Warning :Do not mo dify this file. It i s generate d by Adobe RoboHelp® and chang es will be overwritt en. | |||||
| 6 | ||||||
| 7 | //// Segme nt Begin - - (JavaScr ipt 1.0) | |||||
| 8 | ||||||
| 9 | /// Sectio n Begin - General an d relative topics(Ja vaScript 1 .0) | |||||
| 10 | ||||||
| 11 | //{{HH_SYM BOL_SECTIO N | |||||
| 12 | var HH_Chm Filename = ""; | |||||
| 13 | var HH_Win dowName = ""; | |||||
| 14 | var HH_Glo ssaryFont = ""; | |||||
| 15 | var HH_Glo ssary = "" ; | |||||
| 16 | var HH_Ave nue = ""; | |||||
| 17 | var HH_Act iveX = fal se; | |||||
| 18 | //}}HH_SYM BOL_SECTIO N | |||||
| 19 | ||||||
| 20 | //Begin to support p revious ge neric para meters | |||||
| 21 | //Get the informatio n about th e browser. | |||||
| 22 | var gstrBs Agent = navi gator.user Agent.toLo werCase(); | |||||
| 23 | var gnBsVe r = parseI nt(navigat or.appVers ion); | |||||
| 24 | ||||||
| 25 | var gbBsOp era = (gst rBsAgent.i ndexOf('op era') != - 1); | |||||
| 26 | var gbBsKo nqueror = (gst rBsAgent.i ndexOf('ko nqueror') != -1); | |||||
| 27 | var gbBsSa fari = (gst rBsAgent.i ndexOf('sa fari') != -1); | |||||
| 28 | var gbBsIE = (gst rBsAgent.i ndexOf('ms ie') != -1 ) && !gbBs Opera && ! gbBsKonque ror && !gb BsSafari; | |||||
| 29 | var gbBsNS = (gst rBsAgent.i ndexOf('mo zilla') != -1) && (( gstrBsAgen t.indexOf( 'spoofer') == -1) && (gstrBsAg ent.indexO f('compati ble') == - 1)) && !gb BsOpera && !gbBsKonq ueror && ! gbBsSafari ; | |||||
| 30 | ||||||
| 31 | var gbBsMa c = (gstrB sAgent.ind exOf('mac' ) != -1); | |||||
| 32 | var gbBsWi ndows = ((gs trBsAgent. indexOf('w in') != -1 ) || (gstr BsAgent.in dexOf('16b it') != -1 )); | |||||
| 33 | var gbBsSu nOS = (gst rBsAgent.i ndexOf("su nos") != - 1); | |||||
| 34 | ||||||
| 35 | var gbBsIE 3Before = ((gb BsIE) && ( gnBsVer <= 2)); | |||||
| 36 | var gbBsNS 3Before = ((gb BsNS) && ( gnBsVer <= 3)); | |||||
| 37 | ||||||
| 38 | var gbBsNS 2 = ((gbBs NS) && (gn BsVer <= 2 )); | |||||
| 39 | var gbBsNS 3 = ((gbBs NS) && (gn BsVer == 3 )); | |||||
| 40 | var gbBsIE 300301 = ((gb BsIE) && ( gnBsVer == 2) && ((g strBsAgent .indexOf(" 3.00") != -1)||(gstr BsAgent.in dexOf("3.0 a") != -1) ||(gstrBsA gent.index Of("3.0b") !=-1)||(gs trBsAgent. indexOf("3 .01")!=-1) )); | |||||
| 41 | var gbBsIE 302 = ((gb BsIE) && ( gnBsVer == 2) && (gs trBsAgent. indexOf("3 .02") != - 1)); | |||||
| 42 | ||||||
| 43 | var gbBsNS 4 = ((gbBs NS) && (gn BsVer >= 4 )); | |||||
| 44 | var gbBsNS 6 = ((gbBs NS) && (gn BsVer >= 5 )); | |||||
| 45 | var gb BsNS7 = false; | |||||
| 46 | ||||||
| 47 | var gbBsIE 4 = ((gbBs IE) && (gn BsVer >= 4 )); | |||||
| 48 | var gbBsIE 5 = false; | |||||
| 49 | var gbBsIE 55 = fals e; | |||||
| 50 | var gbBsIE 7 = false; | |||||
| 51 | ||||||
| 52 | var gbBsOp era6 = fals e; | |||||
| 53 | var gbBsOp era7 = fals e; | |||||
| 54 | ||||||
| 55 | var gbBsKo nqueror3 = fals e; | |||||
| 56 | var gbSafa ri3 = fals e ; | |||||
| 57 | var gbAIR = (gstrB sAgent.ind exOf('adob eair')!=-1 ); | |||||
| 58 | var gbChro me = (gst rBsAgent.i ndexOf('ch rome')!=-1 ); | |||||
| 59 | var isLoca l = docu ment.locat ion.protoc ol.substri ng(0, 4) = = "file"; | |||||
| 60 | var gbChro meLocal = win dow.chrome && isLoca l ; | |||||
| 61 | var gbInsi deCHM = docu ment.locat ion.href.s earch("::" )>0 && doc ument.loca tion.href. search("ch m")>0; | |||||
| 62 | var gbBsIs Mobile = (gst rBsAgent.i ndexOf("mo bile") != -1); | |||||
| 63 | if(gbBsIsM obile == f alse) | |||||
| 64 | { | |||||
| 65 | gb BsIsMobile = isTouch Device(); | |||||
| 66 | } | |||||
| 67 | function i sTouchDevi ce() { | |||||
| 68 | re turn !!('o ntouchstar t' in wind ow) ? 1 : 0; | |||||
| 69 | } | |||||
| 70 | ||||||
| 71 | gbBsIE = ( navigator. appName.in dexOf("Mic rosoft") ! = -1) && ! gbBsOpera && !gbBsKo nqueror && !gbBsSafa ri;; | |||||
| 72 | if (gbBsIE ) | |||||
| 73 | { | |||||
| 74 | if (parseInt (navigator .appVersio n) >= 4) { | |||||
| 75 | gbBs IE4 = true ; | |||||
| 76 | if ( gbBsIE4) { | |||||
| 77 | var nP os = gstrB sAgent.ind exOf("msie "); | |||||
| 78 | var st rIEversion = gstrBsA gent.subst ring(nPos + 5); | |||||
| 79 | var nV ersion = parseFloat (strIEvers ion); | |||||
| 80 | if (nV ersion >= 5) | |||||
| 81 | gbBsIE5 = true; | |||||
| 82 | if (nV ersion >= 5.5) | |||||
| 83 | { | |||||
| 84 | if(nVers ion >= 7) | |||||
| 85 | gbBsIE7 = true; | |||||
| 86 | gbBsIE55 = true; | |||||
| 87 | } | |||||
| 88 | } | |||||
| 89 | } | |||||
| 90 | } | |||||
| 91 | if (gbBsNS 6) | |||||
| 92 | { | |||||
| 93 | va r nPos=gst rBsAgent.i ndexOf("ge cko"); | |||||
| 94 | if (nPos!=-1) | |||||
| 95 | { | |||||
| 96 | var nPos2=gstr BsAgent.in dexOf("/", nPos); | |||||
| 97 | if(n Pos2!=-1) | |||||
| 98 | { | |||||
| 99 | var nV ersion=par seFloat(gs trBsAgent. substring( nPos2+1)); | |||||
| 100 | if (nV ersion>=20 020823) | |||||
| 101 | gbBsNS7= true; | |||||
| 102 | } | |||||
| 103 | } | |||||
| 104 | } | |||||
| 105 | if (gbBsOp era) | |||||
| 106 | { | |||||
| 107 | va r nPos = g strBsAgent .indexOf(" opera"); | |||||
| 108 | if (nPos!=-1) | |||||
| 109 | { | |||||
| 110 | var nVersion = parseFloa t(gstrBsAg ent.substr ing(nPos+6 )); | |||||
| 111 | if ( nVersion > = 6) | |||||
| 112 | { | |||||
| 113 | gbBsOp era6=true; | |||||
| 114 | if (nV ersion >=7 ) | |||||
| 115 | gbBsOper a7=true; | |||||
| 116 | } | |||||
| 117 | } | |||||
| 118 | } | |||||
| 119 | if (gbBsKo nqueror) | |||||
| 120 | { | |||||
| 121 | va r nPos = g strBsAgent .indexOf(" konqueror" ); | |||||
| 122 | if (nPos!=-1) | |||||
| 123 | { | |||||
| 124 | var nVersion = parseFloa t(gstrBsAg ent.substr ing(nPos+1 0)); | |||||
| 125 | if ( nVersion > = 3) | |||||
| 126 | { | |||||
| 127 | gbBsKo nqueror3=t rue; | |||||
| 128 | } | |||||
| 129 | } | |||||
| 130 | } | |||||
| 131 | ||||||
| 132 | if(gbBsSaf ari) | |||||
| 133 | { | |||||
| 134 | va r nPos = g strBsAgent .indexOf(" version/") ; | |||||
| 135 | if (nPos!=-1) | |||||
| 136 | { | |||||
| 137 | var nVersion = parseFloa t(gstrBsAg ent.substr ing(nPos+8 ,nPos+9)); | |||||
| 138 | if ( nVersion > = 3) | |||||
| 139 | { | |||||
| 140 | gbSafa ri3=true; | |||||
| 141 | } | |||||
| 142 | } | |||||
| 143 | } | |||||
| 144 | ||||||
| 145 | if(gbChrom e) | |||||
| 146 | { | |||||
| 147 | // for the ti me being u se same te sts as saf ari | |||||
| 148 | gb BsSafari = true ; | |||||
| 149 | gb Safari3 = true ; | |||||
| 150 | } | |||||
| 151 | ||||||
| 152 | function i nsertAdjac entHTML(ob j, where, htmlStr) | |||||
| 153 | { | |||||
| 154 | if (gbBsIE | | gbBsOper a7) | |||||
| 155 | { | |||||
| 156 | obj. insertAdja centHTML(w here, html Str); | |||||
| 157 | } | |||||
| 158 | el se if (gbB sNS6 || gb BsSafari) | |||||
| 159 | { | |||||
| 160 | var r = obj.ow nerDocumen t.createRa nge(); | |||||
| 161 | r.se tStartBefo re(obj); | |||||
| 162 | var parsed HTML = r.c reateConte xtualFragm ent(htmlSt r); | |||||
| 163 | ||||||
| 164 | swit ch (where) { | |||||
| 165 | case 'beforeBe gin': | |||||
| 166 | obj.pa rentNode.i nsertBefor e(parsedHT ML,obj); | |||||
| 167 | break; | |||||
| 168 | case 'afterBeg in': | |||||
| 169 | obj.in sertBefore (parsedHTM L,obj.firs tChild); | |||||
| 170 | break; | |||||
| 171 | case 'beforeEn d': | |||||
| 172 | obj.ap pendChild( parsedHTML ); | |||||
| 173 | break; | |||||
| 174 | case 'afterEnd ': | |||||
| 175 | if (ob j.nextSibl ing){ | |||||
| 176 | obj.pa rentNode.i nsertBefor e(parsedHT ML,obj.nex tSibling); | |||||
| 177 | } else { | |||||
| 178 | obj.pa rentNode.a ppendChild (parsedHTM L); | |||||
| 179 | } | |||||
| 180 | break; | |||||
| 181 | } | |||||
| 182 | } | |||||
| 183 | } | |||||
| 184 | ||||||
| 185 | ||||||
| 186 | function s etAttribut e(obj, att r, val) | |||||
| 187 | { | |||||
| 188 | if (gbBsIE) | |||||
| 189 | obj.setA ttribute(a ttr,val); | |||||
| 190 | el se | |||||
| 191 | { | |||||
| 192 | if (obj. setAttribu te) | |||||
| 193 | obj. setAttribu te(attr,va l); | |||||
| 194 | else | |||||
| 195 | obj. setPropert y(attr,val ,null); | |||||
| 196 | } | |||||
| 197 | }; | |||||
| 198 | ||||||
| 199 | function g etAttribut e(obj, att r) | |||||
| 200 | { | |||||
| 201 | if (gbB sIE) | |||||
| 202 | return o bj.getAttr ibute(attr ); | |||||
| 203 | el se | |||||
| 204 | { | |||||
| 205 | if ((obj .getAttrib ute)&&(obj .getAttrib ute(attr)) ) | |||||
| 206 | retu rn obj.get Attribute( attr); | |||||
| 207 | else if ((obj.get PropertyVa lue)&&(obj .getProper tyValue(at tr))) | |||||
| 208 | retu rn obj.get PropertyVa lue(attr) ; | |||||
| 209 | else if ((obj.get PropertyCS SValue)&&( obj.getPro pertyCSSVa lue(attr)) ) | |||||
| 210 | retu rn obj.get PropertyCS SValue(att r) ; | |||||
| 211 | else | |||||
| 212 | retu rn null ; | |||||
| 213 | } | |||||
| 214 | }; | |||||
| 215 | ||||||
| 216 | // Utiliti es functio ns. | |||||
| 217 | function B sscHasExtJ s() | |||||
| 218 | { | |||||
| 219 | if ( gbBsIE3B efore || g bBsNS3Befo re) | |||||
| 220 | retu rn false; | |||||
| 221 | re turn true; | |||||
| 222 | } | |||||
| 223 | ||||||
| 224 | // Registe r event ha ndler | |||||
| 225 | var gBsOnL oads = new Ar ray(); // An array holds all the onload event han dler. | |||||
| 226 | var gBsOnC licks = new Ar ray(); // An array holds all the onClic k event ha ndler. | |||||
| 227 | var gBsOnU nLoads = new Ar ray(); // An array holds all the OnUnLo ad event h andler. | |||||
| 228 | var gBsOnM ouseOvers = new Array(); // An arra y holds al l the OnMo useOver ev ent handle r. | |||||
| 229 | var gBsOnM ouseOuts = new Ar ray(); // An array holds all the OnMous eOut event handler. | |||||
| 230 | ||||||
| 231 | var gbOrig nalOnMouse Down = nul l; | |||||
| 232 | ||||||
| 233 | function B sscRegiste rOnLoad(fu ncHandler) | |||||
| 234 | { | |||||
| 235 | va r nLength = gBsOnLoa ds.length; | |||||
| 236 | gB sOnLoads[n Length] = funcHandle r; | |||||
| 237 | } | |||||
| 238 | ||||||
| 239 | function B sscRegiste rOnClick(f uncHandler ) | |||||
| 240 | { | |||||
| 241 | va r nLength = gBsOnCli cks.length ; | |||||
| 242 | gB sOnClicks[ nLength] = funcHandl er; | |||||
| 243 | } | |||||
| 244 | ||||||
| 245 | function B sscRegiste rOnUnLoad( funcHandle r) | |||||
| 246 | { | |||||
| 247 | va r nLength = gBsOnUnL oads.lengt h; | |||||
| 248 | gB sOnUnLoads [nLength] = funcHand ler; | |||||
| 249 | } | |||||
| 250 | ||||||
| 251 | function B sscRegiste rOnMouseOv er(funcHan dler) | |||||
| 252 | { | |||||
| 253 | va r nLength = gBsOnMou seOvers.le ngth; | |||||
| 254 | gB sOnMouseOv ers[nLengt h] = funcH andler; | |||||
| 255 | } | |||||
| 256 | ||||||
| 257 | function B sscRegiste rOnMouseOu t(funcHand ler) | |||||
| 258 | { | |||||
| 259 | va r nLength = gBsOnMou seOuts.len gth; | |||||
| 260 | gB sOnMouseOu ts[nLength ] = funcHa ndler; | |||||
| 261 | } | |||||
| 262 | ||||||
| 263 | function B sGeneralOn Load() | |||||
| 264 | { | |||||
| 265 | if (!gbBsIE4 && !gbBsN S4) | |||||
| 266 | retu rn; | |||||
| 267 | ||||||
| 268 | // Make ever ything vis ible in na vigator | |||||
| 269 | // if (gbBsNS4) { | |||||
| 270 | // // M ake some s pecial eff ects items visible | |||||
| 271 | // var arr ; | |||||
| 272 | // if ( gbBsNS6) | |||||
| 273 | // arr = docu ment.getEl ementsByTa gName('*') ; | |||||
| 274 | // else | |||||
| 275 | // arr = docu ment.layer s ; | |||||
| 276 | // for (var iLaye r = 0; iLa yer < arr. length; iL ayer++) { | |||||
| 277 | // arr[iL ayer].visi bility = " visible"; | |||||
| 278 | // arr[iL ayer].left = 0 + 'px '; | |||||
| 279 | // } | |||||
| 280 | // } | |||||
| 281 | ||||||
| 282 | } | |||||
| 283 | ||||||
| 284 | // If resi ze the net scape brow ser, need to reload it. | |||||
| 285 | function B sReDo() | |||||
| 286 | { | |||||
| 287 | if (inne rWidth != origWidth || innerHe ight != or igHeight) | |||||
| 288 | locat ion.reload (); | |||||
| 289 | } | |||||
| 290 | // End of the local functions. | |||||
| 291 | ||||||
| 292 | // The fol lowing fun ctions are used by t he html fi les. | |||||
| 293 | function B SSCOnLoad( event) | |||||
| 294 | { | |||||
| 295 | if ( !BsscHas ExtJs() ) | |||||
| 296 | retu rn; | |||||
| 297 | fo r (var nEl ement = gB sOnLoads.l ength - 1; nElement >= 0; nEle ment--) | |||||
| 298 | gBsO nLoads[nEl ement](); | |||||
| 299 | } | |||||
| 300 | ||||||
| 301 | function B SSCOnClick (event) | |||||
| 302 | { | |||||
| 303 | if (!BsscHas ExtJs()) r eturn; | |||||
| 304 | ||||||
| 305 | fo r (var nEl ement = gB sOnClicks. length - 1 ; nElement >= 0; nEl ement--) | |||||
| 306 | gBsO nClicks[nE lement](); | |||||
| 307 | } | |||||
| 308 | ||||||
| 309 | function B SSCOnUnloa d(event) | |||||
| 310 | { | |||||
| 311 | if (!BsscHas ExtJs()) r eturn; | |||||
| 312 | fo r (var nEl ement = gB sOnUnLoads .length - 1; nElemen t >= 0; nE lement--) | |||||
| 313 | gBsO nUnLoads[n Element]() ; | |||||
| 314 | } | |||||
| 315 | ||||||
| 316 | function B SSCOnMouse Over(event ) | |||||
| 317 | { | |||||
| 318 | if (!BsscHas ExtJs()) r eturn; | |||||
| 319 | fo r (var nEl ement = gB sOnMouseOv ers.length - 1; nEle ment >= 0; nElement- -) | |||||
| 320 | gBsO nMouseOver s[nElement ](); | |||||
| 321 | } | |||||
| 322 | ||||||
| 323 | function B SSCOnMouse Out(event) | |||||
| 324 | { | |||||
| 325 | if (!BsscHas ExtJs()) r eturn; | |||||
| 326 | fo r (var nEl ement = gB sOnMouseOu ts.length - 1; nElem ent >= 0; nElement-- ) | |||||
| 327 | { | |||||
| 328 | gBsO nMouseOuts [nElement] (); | |||||
| 329 | } | |||||
| 330 | } | |||||
| 331 | // End of invocation of the ev ent handle functions . | |||||
| 332 | ||||||
| 333 | // Add the GereralOn Load to th e onload a rray. | |||||
| 334 | if (typeof (BsscRegis terOnLoad) != "undef ined") | |||||
| 335 | { | |||||
| 336 | Bs scRegister OnLoad(BsG eneralOnLo ad); | |||||
| 337 | } | |||||
| 338 | if (gbBsNS 4&&!gbBsNS 6) { | |||||
| 339 | or igWidth = innerWidth ; | |||||
| 340 | or igHeight = innerHeig ht; | |||||
| 341 | on resize = B sReDo; | |||||
| 342 | } | |||||
| 343 | //End to s upport pre vious gene ric parame ters | |||||
| 344 | ||||||
| 345 | //Begin to support p revious HH ActiveX in voking | |||||
| 346 | function B sHHActivat eComponent s() | |||||
| 347 | { | |||||
| 348 | if ( HH_Activ eX && (HH_ ChmFilenam e != "") & & ((self = = top) || (self == t op.frames[ 0]))) | |||||
| 349 | { | |||||
| 350 | var objBody = getElement sByTag(doc ument,"BOD Y")[0]; | |||||
| 351 | if( typeof(obj Body) == " object" ) | |||||
| 352 | { | |||||
| 353 | insert AdjacentHT ML(objBody , "beforeE nd", '<OBJ ECT ID="HH ComponentA ctivator" CLASSID="C LSID:399CB 6C4-7312-1 1D2-B4D9-0 0105A0422D F" width=0 height=0> </OBJECT>' ); | |||||
| 354 | if (HH ComponentA ctivator.o bject) | |||||
| 355 | HHCompon entActivat or.Activat e(HH_ChmFi lename, HH _WindowNam e, HH_Glos saryFont, HH_Glossar y, HH_Aven ue); | |||||
| 356 | } | |||||
| 357 | } | |||||
| 358 | } | |||||
| 359 | ||||||
| 360 | function B sHHActivXO nLoad() | |||||
| 361 | { | |||||
| 362 | if ( gbBsIE4 ) | |||||
| 363 | BsHH ActivateCo mponents() ; | |||||
| 364 | } | |||||
| 365 | ||||||
| 366 | if( typeof (BsscRegis terOnLoad) != "undef ined" ) | |||||
| 367 | { | |||||
| 368 | Bs scRegister OnLoad(BsH HActivXOnL oad); | |||||
| 369 | } | |||||
| 370 | //End to s upport pre vious HHAc tiveX invo king | |||||
| 371 | ||||||
| 372 | //Begin to support p revious re lative top ics | |||||
| 373 | //If webHe lp needs R elated Top ics DHTMLc ode, it's supposed t o add it h ere | |||||
| 374 | var gbPopu pMenuTimeo utExpired = false; | |||||
| 375 | var gbInPo pupMenu = false; | |||||
| 376 | var gbPopu pMenuTopic List = nul l; | |||||
| 377 | var gOlddo cumentClic k = null; | |||||
| 378 | ||||||
| 379 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |||||
| 380 | // | |||||
| 381 | // Popup M enu code | |||||
| 382 | // | |||||
| 383 | ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// ////////// | |||||
| 384 | ||||||
| 385 | var g_bIsP opupMenuIn it = false ; | |||||
| 386 | function _ WritePopup MenuLayer( ) | |||||
| 387 | { | |||||
| 388 | if (!g_bIsPo pupMenuIni t) | |||||
| 389 | { | |||||
| 390 | if (gbBsNS 4&&!gbBsNS 6) { | |||||
| 391 | //Do not t ry to writ e ininle s tyles for NS! NS ca n not hand le it and will not s top downlo ading the html page. .. | |||||
| 392 | docu ment.write ("<DIV CLA SS='WebHel pPopupMenu ' ID='Popu pMenu'></D IV>"); | |||||
| 393 | } else{ | |||||
| 394 | document.w rite("<DIV ID='Popup Menu' STYL E='positio n:absolute ; left:0px ; top:0px; z-index:4 ; visibili ty:hidden; '></DIV>") ; | |||||
| 395 | if (!(gbBs NS4&&!gbBs NS6)) { | |||||
| 396 | docu ment.write ("<STYLE T YPE='text/ css'>"); | |||||
| 397 | if ( gbBsMac&&g bBsIE4) { | |||||
| 398 | docume nt.write(" .PopupOver {font-fam ily:'Arial '; color:w hite; back ground:nav y; font-si ze:10pt; f ont-style: normal;fon t-weight:n ormal;text -decoratio n:none;}") ; | |||||
| 399 | docume nt.write(" .PopupNotO ver {font- family:'Ar ial'; colo r:black; b ackground: #c0c0c0; f ont-size:1 0pt; font- style:norm al;font-we ight:norma l;text-dec oration:no ne;}"); | |||||
| 400 | } el se { | |||||
| 401 | docume nt.write(" .PopupOver {font-fam ily:'Arial '; color:w hite; back ground:nav y; font-si ze:8pt; fo nt-style:n ormal;font -weight:no rmal;text- decoration :none;}"); | |||||
| 402 | docume nt.write(" .PopupNotO ver {font- family:'Ar ial'; colo r:black; b ackground: #c0c0c0; f ont-size:8 pt; font-s tyle:norma l;font-wei ght:normal ;text-deco ration:non e;}"); | |||||
| 403 | } | |||||
| 404 | docu ment.write ("</STYLE> "); | |||||
| 405 | } | |||||
| 406 | } | |||||
| 407 | g_bIsPopup MenuInit = true; | |||||
| 408 | } | |||||
| 409 | } | |||||
| 410 | ||||||
| 411 | //Seek for the bsscr ight frame | |||||
| 412 | function _ SeekFrameB yName( cRo ot, strNam e ) | |||||
| 413 | { | |||||
| 414 | if ( cRoot == null ) return n ull; | |||||
| 415 | if ( cRoot.fr ames == nu ll ) return nul l; | |||||
| 416 | if ( cRoot.fr ames[strNa me] != nul l ) re turn cRoot .frames[st rName]; | |||||
| 417 | fo r (var i=0 ; i<cRoot. frames.len gth; i++) | |||||
| 418 | { | |||||
| 419 | var cObj = nul l; | |||||
| 420 | if ( !gbBsNS6) | |||||
| 421 | cObj = _SeekFram eByName( c Root.frame s(i).docum ent, strNa me ); | |||||
| 422 | else | |||||
| 423 | cObj = _SeekFram eByName( c Root.frame s[i], strN ame ); | |||||
| 424 | if( cObj != nu ll ) re turn cObj; | |||||
| 425 | }; | |||||
| 426 | re turn null; | |||||
| 427 | } | |||||
| 428 | function _ GetFrameBy Name( cRoo t, strName ) | |||||
| 429 | { | |||||
| 430 | if ( cRoot == null ) return n ull; | |||||
| 431 | va r cRet = _ SeekFrameB yName(cRoo t, strName ); | |||||
| 432 | if ( cRet != null ) return c Ret; | |||||
| 433 | if (cRoot.pa rent != cR oot) | |||||
| 434 | retu rn _GetFra meByName( cRoot.pare nt, strNam e ); | |||||
| 435 | el se | |||||
| 436 | retu rn null; | |||||
| 437 | } | |||||
| 438 | ||||||
| 439 | var gfn_ar guments = null; | |||||
| 440 | function _ PopupMenu_ Invoke(fn_ arguments) | |||||
| 441 | { | |||||
| 442 | gf n_argument s = fn_arg uments; | |||||
| 443 | if (gbBsOper a6&&gbBsMa c) | |||||
| 444 | { | |||||
| 445 | var wndOldPopu pLinks= wi ndow.open( document.l ocation.hr ef, "popup links"); | |||||
| 446 | wndO ldPopupLin ks.close() ; | |||||
| 447 | setT imeout("_P opupMenu_I nvoke_2(); ",100); | |||||
| 448 | } | |||||
| 449 | el se | |||||
| 450 | { | |||||
| 451 | _Pop upMenu_Inv oke_2(); | |||||
| 452 | } | |||||
| 453 | } | |||||
| 454 | ||||||
| 455 | function G etXOffset( el) { | |||||
| 456 | var of fX = 0; | |||||
| 457 | while (el && typ eof (el.of fsetLeft) != 'undefi ned' && ty peof (el.o ffsetParen t) != 'und efined') | |||||
| 458 | { | |||||
| 459 | of fX = offX + el.offse tLeft; | |||||
| 460 | el = el.offs etParent; | |||||
| 461 | } | |||||
| 462 | return offX; | |||||
| 463 | } | |||||
| 464 | ||||||
| 465 | function G etYOffset( el) | |||||
| 466 | { | |||||
| 467 | var of fY = 0; | |||||
| 468 | while (el && typ eof (el.of fsetTop) ! = 'undefin ed' && typ eof (el.of fsetParent ) != 'unde fined') | |||||
| 469 | { | |||||
| 470 | of fY = offY + el.offse tTop; | |||||
| 471 | el = el.offs etParent; | |||||
| 472 | } | |||||
| 473 | return offY; | |||||
| 474 | } | |||||
| 475 | ||||||
| 476 | function _ PopupMenu_ Invoke_2() | |||||
| 477 | { | |||||
| 478 | va r fn_argum ents = gfn _arguments ; | |||||
| 479 | gf n_argument s = null; | |||||
| 480 | ||||||
| 481 | // Make sure we have r easonable arguments | |||||
| 482 | va r argLen = fn_argume nts.length ; | |||||
| 483 | if (argLen < 3) { | |||||
| 484 | retu rn false; | |||||
| 485 | } | |||||
| 486 | ||||||
| 487 | // Check to see if we only have one target | |||||
| 488 | va r strTarge t = ""; | |||||
| 489 | va r targetDo c = null; | |||||
| 490 | if (fn_argum ents[1] == '') { | |||||
| 491 | if ( BSSCPopup_ IsPopup()) { | |||||
| 492 | target Doc = pare nt; | |||||
| 493 | strTar get = "TAR GET= _pare nt"; | |||||
| 494 | } | |||||
| 495 | else | |||||
| 496 | target Doc = wind ow.documen t; | |||||
| 497 | } else { | |||||
| 498 | targ etDoc = _G etFrameByN ame( paren t, fn_argu ments[1] ) ; | |||||
| 499 | ||||||
| 500 | strT arget = "T ARGET='" + fn_argume nts[1] + " '"; | |||||
| 501 | } | |||||
| 502 | ||||||
| 503 | if ((!gbBsIE 4 && !gbBs NS4 && !gb BsOpera7 & & !gbBsKon queror3 && !gbBsSafar i) || ((gb BsMac) && (gbBsIE4) && (window .event.src Element.ta gName == " AREA"))) { | |||||
| 504 | ||||||
| 505 | var argLen = fn_arg uments.len gth; | |||||
| 506 | ||||||
| 507 | // C reate the window tha t the hype rlinks wil l go into | |||||
| 508 | var nHeight = argLen * 1 5; | |||||
| 509 | var nWidth = 4 00; | |||||
| 510 | var strParam = "titlebar =no,toolba r=no,statu s=no,locat ion=no,men ubar=no,re sizable=ye s,scrollba rs=auto"; | |||||
| 511 | strP aram += ", height=" + nHeight + ",width=2 00"; | |||||
| 512 | strP aram += ", resizable" ; | |||||
| 513 | ||||||
| 514 | var wndTemp=nu ll; | |||||
| 515 | // C reate a te mporary wi ndow first to ensure the real popup come s up on to p | |||||
| 516 | if ( !gbBsOpera ) | |||||
| 517 | wndTem p = window .open("", "temp", st rParam); | |||||
| 518 | ||||||
| 519 | // C reate the real popup window | |||||
| 520 | var wndPopupLi nks=null; | |||||
| 521 | if ( gbBsOpera& &gbBsMac) | |||||
| 522 | { | |||||
| 523 | wndTem p = window .open(docu ment.locat ion.href, "temp", st rParam); | |||||
| 524 | wndPop upLinks= w indow.open (document. location.h ref, "popu plinks", s trParam); | |||||
| 525 | } | |||||
| 526 | else | |||||
| 527 | wndPop upLinks= w indow.open ("", "popu plinks", s trParam); | |||||
| 528 | wndP opupLinks. document.o pen("text/ html"); | |||||
| 529 | ||||||
| 530 | // C lose the t emporary | |||||
| 531 | if ( wndTemp) | |||||
| 532 | wndTem p.close(); | |||||
| 533 | ||||||
| 534 | var sHTML="<ht ml><head>" ; | |||||
| 535 | sHTM L += "<"; | |||||
| 536 | sHTM L += "/hea d>"; | |||||
| 537 | sHTM L+="<body onBlur=\'s elf.focus( );\'>"; | |||||
| 538 | var strParaLin e = ""; | |||||
| 539 | for (var i = 0 ; i < (arg Len - 2) / 2; i++) { | |||||
| 540 | strPar aLine = "" ; | |||||
| 541 | strPar aLine += " <a href=\" javascript :"; | |||||
| 542 | if (gb BsIE) { | |||||
| 543 | strParaL ine += "on Blur=null; "; | |||||
| 544 | } | |||||
| 545 | strPar aLine += " opener.loc ation=\'"; | |||||
| 546 | strPar aLine += f n_argument s[2 * i + 3]; | |||||
| 547 | strPar aLine += " \';close() ;\""; | |||||
| 548 | strPar aLine += s trTarget; | |||||
| 549 | ||||||
| 550 | strPar aLine += " >"; | |||||
| 551 | strPar aLine += f n_argument s[2 * i + 2]; | |||||
| 552 | strPar aLine += " </a>"; | |||||
| 553 | strPar aLine += " <br>"; | |||||
| 554 | sHTML+ =strParaLi ne; | |||||
| 555 | } | |||||
| 556 | sHTM L+="</body ></html>"; | |||||
| 557 | wndP opupLinks. document.w rite(sHTML ); | |||||
| 558 | wndP opupLinks. document.c lose(); | |||||
| 559 | wind ow.gbInPop upMenu = t rue; | |||||
| 560 | if ( !gbBsIE) { | |||||
| 561 | wndPop upLinks.fo cus(); | |||||
| 562 | } | |||||
| 563 | retu rn false; | |||||
| 564 | } | |||||
| 565 | ||||||
| 566 | if (((argLen < 5) && ( (isNaN(fn_ arguments[ 2])) || (g bPopupMenu TopicList == null))) || | |||||
| 567 | ((ar gLen < 4) && ((!isNa N(fn_argum ents[2])) && (gbPopu pMenuTopic List != nu ll)))) { | |||||
| 568 | // G et the pla ce that we will be p utting the topic int o | |||||
| 569 | var strURL = " "; | |||||
| 570 | if ( isNaN(fn_a rguments[2 ]) || (gb PopupMenuT opicList = = null)) { | |||||
| 571 | strURL = fn_argu ments[3]; | |||||
| 572 | } | |||||
| 573 | else { | |||||
| 574 | strURL = gbPopup MenuTopicL ist[fn_arg uments[2]] .strURL; | |||||
| 575 | } | |||||
| 576 | ||||||
| 577 | if ( targetDoc != null) { | |||||
| 578 | target Doc.locati on.href = strURL; | |||||
| 579 | } | |||||
| 580 | else { | |||||
| 581 | if (fn _arguments [1] != nul l && typeo f(fn_argum ents[1]) ! = "undefin ed") | |||||
| 582 | window.o pen(strURL , fn_argum ents[1]); | |||||
| 583 | else | |||||
| 584 | window.o pen(strURL ); | |||||
| 585 | } | |||||
| 586 | wind ow.gbInPop upMenu = t rue; | |||||
| 587 | retu rn false; | |||||
| 588 | } | |||||
| 589 | ||||||
| 590 | va r strMenu = ""; | |||||
| 591 | if (gbBsNS4& &!gbBsNS6) { | |||||
| 592 | strM enu = '<TA BLE BORDER ="1" CELLS PACING=0 C ELLPADDING =3 BGCOLOR ="#c0c0c0" >'; | |||||
| 593 | } else { | |||||
| 594 | strM enu = '<TA BLE STYLE= "border:2p x outset w hite;" CEL LSPACING=0 '; | |||||
| 595 | if ( gbBsMac) { | |||||
| 596 | strMen u += ' CEL LPADDING=4 '; | |||||
| 597 | } el se { | |||||
| 598 | strMen u += ' CEL LPADDING=2 '; | |||||
| 599 | } | |||||
| 600 | strM enu += ' B GCOLOR=#c0 c0c0>'; | |||||
| 601 | } | |||||
| 602 | // Add each of the ite ms | |||||
| 603 | va r i = 2; | |||||
| 604 | wh ile (i <= argLen - 1 ) { | |||||
| 605 | strM enu += '<T R><TD><NOB R>' | |||||
| 606 | // I f the dest ination is a number then look it up in t he topic l ist | |||||
| 607 | if ( isNaN(fn_a rguments[i ]) || (gb PopupMenuT opicList = = null)) { | |||||
| 608 | strMen u += '<DIV class="Po pupNotOver " STYLE="p adding-lef t:3pt; pad ding-right :3pt;"><A HREF="' + fn_argumen ts[i + 1] + '"' + st rTarget; | |||||
| 609 | } el se { | |||||
| 610 | strMen u += '<DIV class="Po pupNotOver " STYLE="p adding-lef t:3pt; pad ding-right :3pt;"><A HREF="' + gbPopupMen uTopicList [fn_argume nts[i]].st rURL + '"' + strTarg et; | |||||
| 611 | } | |||||
| 612 | strM enu += ' o nclick="Po pupMenu_Ha ndleClick( event);"'; | |||||
| 613 | strM enu += ' o nmouseover ="PopupMen u_Over(eve nt);"'; | |||||
| 614 | strM enu += ' o nmouseout= "PopupMenu _Out(event );"'; | |||||
| 615 | strM enu += '>' ; | |||||
| 616 | if ( isNaN(fn_a rguments[i ]) || (gbP opupMenuTo picList == null)) { | |||||
| 617 | strMen u += '<SPA N CLASS="P opupNotOve r">' + fn_ arguments[ i] + '</SP AN>'; | |||||
| 618 | } el se { | |||||
| 619 | strMen u += '<SPA N CLASS="P opupNotOve r">' + gbP opupMenuTo picList[fn _arguments [i]].strTi tle + '</S PAN>'; | |||||
| 620 | } | |||||
| 621 | strM enu += '</ A></DIV></ NOBR></TD> </TR>'; | |||||
| 622 | ||||||
| 623 | if ( isNaN(fn_a rguments[i ]) || (gbP opupMenuTo picList == null)) { | |||||
| 624 | i += 2 ; | |||||
| 625 | } el se { | |||||
| 626 | i += 1 ; | |||||
| 627 | } | |||||
| 628 | } | |||||
| 629 | st rMenu += " </TABLE>"; | |||||
| 630 | ||||||
| 631 | if (gbBsMac) { | |||||
| 632 | // totally h ack. becau se ie5 in mac need s omething. </TABLE> i s one of t hem. mac i s mad. | |||||
| 633 | strM enu +="<TA BLE></TABL E>"; | |||||
| 634 | } | |||||
| 635 | ||||||
| 636 | va r layerPop up = null; | |||||
| 637 | va r stylePop up = null; | |||||
| 638 | va r nEventX = 0; | |||||
| 639 | va r nEventY = 0; | |||||
| 640 | va r nWindowW idth = 0; | |||||
| 641 | ||||||
| 642 | va r nPopupHe ight = 0; | |||||
| 643 | va r nPopupWi dth = 0; | |||||
| 644 | ||||||
| 645 | va r e = fn_a rguments[0 ]; | |||||
| 646 | if (typeof ( window.eve nt) != 'un defined' & & typeof ( window.eve nt.clientX ) != 'unde fined' && typeof (wi ndow.event .clientX) == 'number ') | |||||
| 647 | { | |||||
| 648 | nEventX = window.e vent.clien tX; | |||||
| 649 | nEventY = window.e vent.clien tY; | |||||
| 650 | } | |||||
| 651 | el se | |||||
| 652 | { | |||||
| 653 | if (typeof ( e.clientX) != 'undef ined') | |||||
| 654 | { | |||||
| 655 | nEve ntX = e.cl ientX; | |||||
| 656 | nEve ntY = e.cl ientY; | |||||
| 657 | } | |||||
| 658 | else if (typeof (e .pageX) != 'undefine d') | |||||
| 659 | { | |||||
| 660 | nEve ntX = e.pa geX; | |||||
| 661 | nEve ntY = e.pa geY; | |||||
| 662 | ||||||
| 663 | nEve ntX -= get ScrollLeft (); | |||||
| 664 | nEve ntY -= get ScrollTop( ); | |||||
| 665 | ||||||
| 666 | } | |||||
| 667 | } | |||||
| 668 | ||||||
| 669 | _B SPSGetClie ntSize(); | |||||
| 670 | ||||||
| 671 | va r bFoundBr owser = tr ue; | |||||
| 672 | if (gbBsIE4 || gbBsOpe ra7) | |||||
| 673 | { | |||||
| 674 | layerPop up = getEl ement("Pop upMenu"); | |||||
| 675 | laye rPopup.inn erHTML = s trMenu; | |||||
| 676 | styl ePopup = l ayerPopup. style; | |||||
| 677 | nPopupHe ight = lay erPopup.sc rollHeight ; | |||||
| 678 | nPopupWi dth = laye rPopup.scr ollWidth; | |||||
| 679 | if (gbBs Mac) | |||||
| 680 | { | |||||
| 681 | nPop upWidth = 80; // we have no id ea how to get the dy namic widt h of the p opup. | |||||
| 682 | } | |||||
| 683 | } | |||||
| 684 | el se if (gbB sNS6 || gb BsKonquero r3 || gbBs Safari) | |||||
| 685 | { | |||||
| 686 | layerPop up = getEl ement("Pop upMenu"); | |||||
| 687 | laye rPopup.sty le.visibil ity = "hid den"; | |||||
| 688 | laye rPopup.inn erHTML = s trMenu; | |||||
| 689 | nPopupHe ight = lay erPopup.of fsetHeight ; | |||||
| 690 | nPopupWi dth = laye rPopup.off setWidth; | |||||
| 691 | } | |||||
| 692 | el se if (gbB sNS4) | |||||
| 693 | { | |||||
| 694 | layerPop up = docum ent.layers .PopupMenu ; | |||||
| 695 | layerPop up.visibil ity = "hid e"; | |||||
| 696 | stylePop up = layer Popup.docu ment; | |||||
| 697 | stylePop up.write(s trMenu); | |||||
| 698 | stylePop up.close() ; | |||||
| 699 | ||||||
| 700 | nPopupHe ight = lay erPopup.cl ip.height; | |||||
| 701 | nPopupWi dth = laye rPopup.cli p.width; | |||||
| 702 | } | |||||
| 703 | el se | |||||
| 704 | bFoundBr owser = fa lse; | |||||
| 705 | ||||||
| 706 | if (bFoundBr owser) | |||||
| 707 | { | |||||
| 708 | if (nEve ntY + nPop upHeight + 20 < gBsC lientHeigh t) | |||||
| 709 | { | |||||
| 710 | nEve ntY += 20; | |||||
| 711 | } | |||||
| 712 | else | |||||
| 713 | { | |||||
| 714 | nEventY = gBsClien tHeight - nPopupHeig ht - 20; | |||||
| 715 | } | |||||
| 716 | ||||||
| 717 | if (nEventX + nPopupWi dth + 20 < gBsClient Width) | |||||
| 718 | { | |||||
| 719 | nEventX += 20; | |||||
| 720 | } | |||||
| 721 | el se | |||||
| 722 | { | |||||
| 723 | nEventX = gBsClien tWidth - n PopupWidth - 20; | |||||
| 724 | } | |||||
| 725 | ||||||
| 726 | va r par = la yerPopup.o ffsetParen t; | |||||
| 727 | va r offX = 0 , offY = 0 ; | |||||
| 728 | if (typeof(p ar) != 'un defined' & & par) | |||||
| 729 | { | |||||
| 730 | offX = G etXOffset( par); | |||||
| 731 | offY = G etYOffset( par); | |||||
| 732 | } | |||||
| 733 | ||||||
| 734 | nE ventX += g etScrollLe ftElement( par); | |||||
| 735 | nE ventX -= o ffX; | |||||
| 736 | nE ventY += g etScrollTo pElement(p ar); | |||||
| 737 | nE ventY -= o ffY; | |||||
| 738 | } | |||||
| 739 | ||||||
| 740 | if (gbBsIE4 || gbBsOpe ra7) | |||||
| 741 | { | |||||
| 742 | stylePop up.top = n EventY; | |||||
| 743 | if (type of (styleP opup.top) != 'number ' ) | |||||
| 744 | { | |||||
| 745 | styl ePopup.top = nEventY + "px"; | |||||
| 746 | } | |||||
| 747 | stylePop up.left = nEventX; | |||||
| 748 | if (type of (styleP opup.left) != 'numbe r' ) | |||||
| 749 | { | |||||
| 750 | styl ePopup.lef t = nEvent X + "px"; | |||||
| 751 | } | |||||
| 752 | ||||||
| 753 | stylePop up.visibil ity = "vis ible"; | |||||
| 754 | if (!gOl ddocumentC lick && do cument.onc lick) | |||||
| 755 | gOld documentCl ick = docu ment.oncli ck; | |||||
| 756 | document .onclick = PopupMenu _HandleCli ck; | |||||
| 757 | } | |||||
| 758 | el se if (gbB sNS6 || gb BsKonquero r3 || gbBs Safari) | |||||
| 759 | { | |||||
| 760 | if (gbBs NS6 || gbC hrome || g bSafari3) | |||||
| 761 | laye rPopup.sty le.top = n EventY + " px"; | |||||
| 762 | else | |||||
| 763 | laye rPopup.sty le.top = n EventY; | |||||
| 764 | if (gbBs NS6 || gbC hrome || g bSafari3) | |||||
| 765 | laye rPopup.sty le.left = nEventX + "px"; | |||||
| 766 | else | |||||
| 767 | laye rPopup.sty le.left = nEventX; | |||||
| 768 | // set a gain to av oid the st upid frash in netsca pe 6. | |||||
| 769 | layerPop up.innerHT ML = strMe nu; | |||||
| 770 | layerPop up.style.v isibility = "visible "; | |||||
| 771 | //window .captureEv ents(Event .MOUSEDOWN ); | |||||
| 772 | if (!gOl ddocumentC lick && do cument.onc lick) | |||||
| 773 | gOld documentCl ick = docu ment.oncli ck; | |||||
| 774 | window.o nclick = P opupMenu_H andleClick ; | |||||
| 775 | } | |||||
| 776 | el se if (gbB sNS4) | |||||
| 777 | { | |||||
| 778 | layerPop up.left = nEventX; | |||||
| 779 | layerPop up.top = n EventY; | |||||
| 780 | layerPop up.visibil ity = "vis ible"; | |||||
| 781 | window.c aptureEven ts(Event.M OUSEDOWN); | |||||
| 782 | if (!gOl ddocumentC lick && do cument.onm ousedown) | |||||
| 783 | gOld documentCl ick = docu ment.onmou sedown; | |||||
| 784 | window.o nmousedown = PopupMe nu_HandleC lick; | |||||
| 785 | } | |||||
| 786 | ||||||
| 787 | if (window.ad dEventList ener) | |||||
| 788 | { | |||||
| 789 | var popupDivEl em = getEl ement("Pop upMenu"); | |||||
| 790 | if(t ypeof(popu pDivElem) != 'undefi ned') | |||||
| 791 | popupD ivElem.add EventListe ner("touch start", on PopupDivTo uched, fal se); | |||||
| 792 | ||||||
| 793 | wind ow.documen t.addEvent Listener(" touchstart ", onPopup ParentTouc hed, false ); | |||||
| 794 | } | |||||
| 795 | ||||||
| 796 | ||||||
| 797 | wi ndow.gbInP opupMenu = true; | |||||
| 798 | wi ndow.gbPop upMenuTime outExpired = false; | |||||
| 799 | se tTimeout(" PopupMenu_ Timeout(); ", 100); | |||||
| 800 | re turn false ; | |||||
| 801 | } | |||||
| 802 | ||||||
| 803 | function P opupMenu_T imeout() | |||||
| 804 | { | |||||
| 805 | wi ndow.gbPop upMenuTime outExpired = true; | |||||
| 806 | } | |||||
| 807 | ||||||
| 808 | function P opupMenu_O ver(e) | |||||
| 809 | { | |||||
| 810 | if (gb BsIE4||gbB sOpera7) | |||||
| 811 | e.sr cElement.c lassName = "PopupOve r"; | |||||
| 812 | else i f (gbBsNS6 ) | |||||
| 813 | e.ta rget.paren tNode.clas sName = "P opupOver"; | |||||
| 814 | re turn; | |||||
| 815 | } | |||||
| 816 | ||||||
| 817 | function P opupMenu_O ut(e) | |||||
| 818 | { | |||||
| 819 | if (gb BsIE4||gbB sOpera7) | |||||
| 820 | e.sr cElement.c lassName = "PopupNot Over"; | |||||
| 821 | else i f (gbBsNS6 ) | |||||
| 822 | e.ta rget.paren tNode.clas sName = "P opupNotOve r"; | |||||
| 823 | re turn; | |||||
| 824 | } | |||||
| 825 | function o nPopupDivT ouched(e) | |||||
| 826 | { | |||||
| 827 | if (typeof(e) != 'undef ined' && e ) | |||||
| 828 | e.st opPropagat ion(); | |||||
| 829 | } | |||||
| 830 | ||||||
| 831 | function o nPopupPare ntTouched( e) | |||||
| 832 | { | |||||
| 833 | if (window.re moveEventL istener) | |||||
| 834 | { | |||||
| 835 | var popupDivEl em = getEl ement("Pop upMenu"); | |||||
| 836 | if(t ypeof(popu pDivElem) != 'undefi ned') | |||||
| 837 | popupD ivElem.rem oveEventLi stener("to uchstart", onPopupDi vTouched, false); | |||||
| 838 | wind ow.removeE ventListen er("touchs tart", onP opupParent Touched, f alse); | |||||
| 839 | } | |||||
| 840 | ||||||
| 841 | Po pupMenu_Ha ndleClick( e); | |||||
| 842 | } | |||||
| 843 | ||||||
| 844 | function P opupMenu_H andleClick (e) | |||||
| 845 | { | |||||
| 846 | if (window.g bPopupMenu TimeoutExp ired) { | |||||
| 847 | wind ow.gbInPop upMenu = f alse; | |||||
| 848 | if ( gbBsNS4 && !gbBsNS6) { | |||||
| 849 | window .releaseEv ents(Event .MOUSEDOWN ); | |||||
| 850 | } | |||||
| 851 | ||||||
| 852 | var layerPopup = null; | |||||
| 853 | if ( gbBsNS4&&! gbBsNS6) { | |||||
| 854 | layerP opup = doc ument.laye rs.PopupMe nu; | |||||
| 855 | layerP opup.visib ility = "h ide"; | |||||
| 856 | } el se { | |||||
| 857 | layerP opup = get Element("P opupMenu") ; | |||||
| 858 | layerP opup.style .visibilit y = "hidde n"; | |||||
| 859 | } | |||||
| 860 | ||||||
| 861 | if ( gOlddocume ntClick) | |||||
| 862 | { | |||||
| 863 | if (gb BsNS4 && ! gbBsNS6) | |||||
| 864 | document .onmousedo wn = gOldd ocumentCli ck; | |||||
| 865 | else | |||||
| 866 | document .onclick = gOlddocum entClick; | |||||
| 867 | } | |||||
| 868 | } | |||||
| 869 | re turn; | |||||
| 870 | } | |||||
| 871 | ||||||
| 872 | function B SSCPopup_C lickMac() | |||||
| 873 | { | |||||
| 874 | if ((!DHTMLP opupSuppor t()) && (g bBsIE4 || gbBsOpera7 )) | |||||
| 875 | { | |||||
| 876 | var bClickOnAn chor = fal se; | |||||
| 877 | var el; | |||||
| 878 | if ( (window.ev ent != nul l) && | |||||
| 879 | (window.ev ent.srcEle ment != nu ll)) | |||||
| 880 | { | |||||
| 881 | el = windo w.event.sr cElement; | |||||
| 882 | while (el != nul l) | |||||
| 883 | { | |||||
| 884 | if ((el. tagName == "A") || ( el.tagName == "AREA" )) { | |||||
| 885 | bClickOnAn chor = tru e; | |||||
| 886 | break; | |||||
| 887 | } | |||||
| 888 | if (el.t agName == "BODY") { | |||||
| 889 | break; | |||||
| 890 | } | |||||
| 891 | el = get ParentNode (el); | |||||
| 892 | } | |||||
| 893 | } | |||||
| 894 | if ( BSSCPopup_ IsPopup()) | |||||
| 895 | { | |||||
| 896 | if (!b ClickOnAnc hor) { | |||||
| 897 | parent.w indow.gPop upWindow = null; | |||||
| 898 | self.clo se(); | |||||
| 899 | } | |||||
| 900 | } | |||||
| 901 | else | |||||
| 902 | { | |||||
| 903 | bClose PopupWindo w = true; | |||||
| 904 | if ((b ClickOnAnc hor) && | |||||
| 905 | (el.href ) && | |||||
| 906 | (( el.href.in dexOf("jav ascript:BS SCPopup") != -1) || (el.href.i ndexOf("ja vascript:n ull") != - 1) || (el. href.index Of("javasc ript:void( 0)") != -1 ))) | |||||
| 907 | { | |||||
| 908 | bClosePo pupWindow = false; | |||||
| 909 | } | |||||
| 910 | if (bC losePopupW indow) | |||||
| 911 | { | |||||
| 912 | if (wind ow.gPopupW indow != n ull && !wi ndow.gPopu pWindow.cl osed ) | |||||
| 913 | { | |||||
| 914 | window.gPo pupWindow. close(); | |||||
| 915 | } | |||||
| 916 | } | |||||
| 917 | } | |||||
| 918 | } | |||||
| 919 | } | |||||
| 920 | ||||||
| 921 | function B sPopupOnCl ick() | |||||
| 922 | { | |||||
| 923 | if (!gbBsIE4 && !gbBsO pera7) | |||||
| 924 | retu rn; | |||||
| 925 | ||||||
| 926 | BS SCPopup_Cl ickMac(); | |||||
| 927 | } | |||||
| 928 | ||||||
| 929 | function _ BSSCOnErro r(message) | |||||
| 930 | { | |||||
| 931 | if (-1 != mes sage.index Of("denied ") | |||||
| 932 | || - 1 != messa ge.indexOf ("Object r equired")) | |||||
| 933 | r eturn true ; | |||||
| 934 | } | |||||
| 935 | ||||||
| 936 | //End to s upport pre vious rela tive topic s | |||||
| 937 | ||||||
| 938 | /// Sectio n End - Ge neral and relative t opics (Jav aScript 1. 0) | |||||
| 939 | ||||||
| 940 | /// Sectio n Begin - Popup (Ja vaScript 1 .0) | |||||
| 941 | //Begin to support p revious po pup functi ons | |||||
| 942 | ||||||
| 943 | //variable s used to isolate th e browser type | |||||
| 944 | var gBsSty VisShow = null ; | |||||
| 945 | var gBsSty VisHide = null ; | |||||
| 946 | var gBsCli entWidth = 640; | |||||
| 947 | var gBsCli entHeight = 480; | |||||
| 948 | ||||||
| 949 | // here is the varib le for jud ge popup w indows siz e. these p arameter i s for IE5. 0, it may need adjus t for othe rs. | |||||
| 950 | var gBRate H_W = 0.61 8; // 1.61 8 Golden c ut. | |||||
| 951 | var gBMaxX OfParent = 0.8; | |||||
| 952 | var gBMaxY OfParent = 0.8; | |||||
| 953 | var gBscro llHeight = 16; | |||||
| 954 | var gBscro llWidth = 16; | |||||
| 955 | var gBperm itXDelta = 3; | |||||
| 956 | var gBperm itYDelta = 3; | |||||
| 957 | ||||||
| 958 | ||||||
| 959 | var arrayP opupURL = new Array( ); | |||||
| 960 | var arrayA bsPopupURL = new Arr ay(); | |||||
| 961 | var arrayI ntervalId = new Arra y(); | |||||
| 962 | ||||||
| 963 | var arrayD irty = new Array(); | |||||
| 964 | ||||||
| 965 | function g etBRateH_W () | |||||
| 966 | { | |||||
| 967 | re turn 0.618 ; | |||||
| 968 | } | |||||
| 969 | ||||||
| 970 | function g etBscrollW idth() | |||||
| 971 | { | |||||
| 972 | re turn 16 ; | |||||
| 973 | } | |||||
| 974 | ||||||
| 975 | function g etBscrollH eight() | |||||
| 976 | { | |||||
| 977 | re turn 16 ; | |||||
| 978 | } | |||||
| 979 | ||||||
| 980 | function g etBMaxXOfP arent() | |||||
| 981 | { | |||||
| 982 | re turn 0.8 ; | |||||
| 983 | } | |||||
| 984 | ||||||
| 985 | function g etBMaxYOfP arent() | |||||
| 986 | { | |||||
| 987 | re turn 0.8 ; | |||||
| 988 | } | |||||
| 989 | ||||||
| 990 | function s etInterval ID(nIndex, id) | |||||
| 991 | { | |||||
| 992 | arrayI ntervalId[ nIndex] = id; | |||||
| 993 | } | |||||
| 994 | ||||||
| 995 | function g etInterval ID(nIndex) | |||||
| 996 | { | |||||
| 997 | if (nIndex = = -1 || ar rayInterva lId.length <= nIndex ) | |||||
| 998 | return - 1; | |||||
| 999 | el se | |||||
| 1000 | re turn array IntervalId [nIndex]; | |||||
| 1001 | } | |||||
| 1002 | ||||||
| 1003 | function s etAbsPopup URL(nIndex , strURL) | |||||
| 1004 | { | |||||
| 1005 | ar rayAbsPopu pURL[nInde x] = strUR L; | |||||
| 1006 | } | |||||
| 1007 | ||||||
| 1008 | function g etAbsPopup URL(nIndex ) | |||||
| 1009 | { | |||||
| 1010 | if (nIndex = = -1 || ar rayAbsPopu pURL.lengt h <= nInde x) return null; | |||||
| 1011 | el se | |||||
| 1012 | retu rn arrayAb sPopupURL[ nIndex]; | |||||
| 1013 | } | |||||
| 1014 | ||||||
| 1015 | function g etPopupURL (nIndex) | |||||
| 1016 | { | |||||
| 1017 | if (nIndex = = -1 || ar rayPopupUR L.length < = nIndex) return nul l; | |||||
| 1018 | el se | |||||
| 1019 | retu rn arrayPo pupURL[nIn dex]; | |||||
| 1020 | } | |||||
| 1021 | ||||||
| 1022 | function g etPopupID( nIndex) | |||||
| 1023 | { | |||||
| 1024 | re turn gstrP opupID + n Index; | |||||
| 1025 | } | |||||
| 1026 | ||||||
| 1027 | function g etPopupSha dowID(nInd ex) | |||||
| 1028 | { | |||||
| 1029 | re turn gstrP opupShadow ID + nInde x; | |||||
| 1030 | } | |||||
| 1031 | ||||||
| 1032 | function g etPopupTop icID(nInde x) | |||||
| 1033 | { | |||||
| 1034 | re turn gstrP opupTopicI D + nIndex ; | |||||
| 1035 | } | |||||
| 1036 | ||||||
| 1037 | function g etPopupIFr ameID(nInd ex) | |||||
| 1038 | { | |||||
| 1039 | re turn gstrP opupIFrame ID + nInde x; | |||||
| 1040 | } | |||||
| 1041 | ||||||
| 1042 | function g etPopupIFr ameName(nI ndex) | |||||
| 1043 | { | |||||
| 1044 | re turn gstrP opupIFrame Name + nIn dex; | |||||
| 1045 | } | |||||
| 1046 | ||||||
| 1047 | ||||||
| 1048 | function g etPopupTop icStyle(nI ndex) | |||||
| 1049 | { | |||||
| 1050 | re turn getEl ement(getP opupTopicI D(nIndex)) .style; | |||||
| 1051 | } | |||||
| 1052 | ||||||
| 1053 | function g etPopupSha dowStyle(n Index) | |||||
| 1054 | { | |||||
| 1055 | re turn getEl ement(getP opupShadow ID(nIndex) ).style; | |||||
| 1056 | } | |||||
| 1057 | ||||||
| 1058 | function g etPopupIFr ame(nIndex ) | |||||
| 1059 | { | |||||
| 1060 | if (gbAIR) | |||||
| 1061 | { | |||||
| 1062 | retu rn window. frames[get PopupIFram eName(nInd ex)]; | |||||
| 1063 | } | |||||
| 1064 | el se | |||||
| 1065 | { | |||||
| 1066 | if ( gbBsNS6||g bSafari3) | |||||
| 1067 | return eval("win dow.frames ['" + getP opupIFrame Name(nInde x) + "']") ; | |||||
| 1068 | else | |||||
| 1069 | return eval("doc ument.fram es['" + ge tPopupIFra meName(nIn dex) + "'] "); | |||||
| 1070 | } | |||||
| 1071 | } | |||||
| 1072 | ||||||
| 1073 | function g etPopupDiv Style(nInd ex) | |||||
| 1074 | { | |||||
| 1075 | re turn getEl ement(getP opupID(nIn dex)).styl e; | |||||
| 1076 | } | |||||
| 1077 | ||||||
| 1078 | function g etPopupIFr ameStyle(n Index) | |||||
| 1079 | { | |||||
| 1080 | re turn getEl ement(getP opupIFrame ID(nIndex) ).style; | |||||
| 1081 | } | |||||
| 1082 | ||||||
| 1083 | ||||||
| 1084 | function f indDiv(str URL) | |||||
| 1085 | { | |||||
| 1086 | fo r (var i = 0; i < ar rayPopupUR L.length; i ++ ) { | |||||
| 1087 | if ( arrayPopup URL[i] == strURL) { | |||||
| 1088 | return i; | |||||
| 1089 | } | |||||
| 1090 | } | |||||
| 1091 | re turn -1; | |||||
| 1092 | } | |||||
| 1093 | ||||||
| 1094 | var gnToke n = -1; | |||||
| 1095 | function t akeToken() | |||||
| 1096 | { | |||||
| 1097 | gn Token ++; | |||||
| 1098 | if (gnToken > 10000) g nToken = 0 ; | |||||
| 1099 | re turn gnTok en; | |||||
| 1100 | } | |||||
| 1101 | ||||||
| 1102 | function I sValidToke n(nToken) | |||||
| 1103 | { | |||||
| 1104 | re turn (gnTo ken == nTo ken); | |||||
| 1105 | } | |||||
| 1106 | ||||||
| 1107 | function a ddDiv(strU RL) | |||||
| 1108 | { | |||||
| 1109 | fo r (var i = 0; i < ar rayPopupUR L.length; i ++) { | |||||
| 1110 | if ( arrayPopup URL[i] == null) { | |||||
| 1111 | arrayP opupURL[i] = strURL; | |||||
| 1112 | return i; | |||||
| 1113 | } | |||||
| 1114 | } | |||||
| 1115 | ar rayPopupUR L[i] = str URL; | |||||
| 1116 | ar rayDirty[i ] = true; | |||||
| 1117 | re turn i; | |||||
| 1118 | } | |||||
| 1119 | ||||||
| 1120 | function s etDirty() | |||||
| 1121 | { | |||||
| 1122 | fo r (var i = 0; i < ar rayPopupUR L.length; i ++ ) | |||||
| 1123 | arra yDirty[i] = true; | |||||
| 1124 | } | |||||
| 1125 | ||||||
| 1126 | function I sDirty(nIn dex) | |||||
| 1127 | { | |||||
| 1128 | if (nIndex = = -1) | |||||
| 1129 | retu rn true; | |||||
| 1130 | el se | |||||
| 1131 | if ( arrayDirty .length > nIndex) | |||||
| 1132 | return arrayDirt y[nIndex]; | |||||
| 1133 | else | |||||
| 1134 | return true; | |||||
| 1135 | } | |||||
| 1136 | ||||||
| 1137 | function h ideAll() | |||||
| 1138 | { | |||||
| 1139 | fo r (var i = 0; i < ar rayPopupUR L.length; i ++ ) | |||||
| 1140 | { | |||||
| 1141 | getP opupDivSty le(i).visi bility = g BsStyVisHi de; | |||||
| 1142 | getP opupIFrame Style(i).v isibility = gBsStyVi sHide; | |||||
| 1143 | if(g bBsIE) | |||||
| 1144 | removeThis (document. all(getPop upID(i))); | |||||
| 1145 | } | |||||
| 1146 | if (gbBsIE) | |||||
| 1147 | arra yPopupURL. length = 0 ; | |||||
| 1148 | } | |||||
| 1149 | ||||||
| 1150 | function g etCurrentP opupIFrame () | |||||
| 1151 | { | |||||
| 1152 | fo r (var i = 0; i < ar rayPopupUR L.length; i ++) | |||||
| 1153 | if ( getPopupDi vStyle(i). visibility == gBsSty VisShow) | |||||
| 1154 | return getPopupI Frame(i); | |||||
| 1155 | re turn null; | |||||
| 1156 | } | |||||
| 1157 | ||||||
| 1158 | function s etClear(nI ndex) | |||||
| 1159 | { | |||||
| 1160 | if (nIndex ! = -1) | |||||
| 1161 | arra yDirty[nIn dex] = fal se; | |||||
| 1162 | } | |||||
| 1163 | ||||||
| 1164 | function _ BSSCCreate PopupDiv(s trURL) | |||||
| 1165 | { | |||||
| 1166 | va r nIndex = findDiv(s trURL); | |||||
| 1167 | if (nIndex = = -1 ) { | |||||
| 1168 | nInd ex = addDi v(strURL); | |||||
| 1169 | BsPo pup_Create Div(nIndex ); | |||||
| 1170 | } | |||||
| 1171 | el se { | |||||
| 1172 | if ( IsDirty(nI ndex)) { | |||||
| 1173 | if("ob ject" == t ypeof(getP opupIFrame (nIndex).d ocument)) | |||||
| 1174 | getPopup IFrame(nIn dex).docum ent.locati on.href = strURL; | |||||
| 1175 | } | |||||
| 1176 | } | |||||
| 1177 | re turn nInde x; | |||||
| 1178 | } | |||||
| 1179 | ||||||
| 1180 | //Here is the browse r type | |||||
| 1181 | function _ BSPSGetBro wserInfo() | |||||
| 1182 | { | |||||
| 1183 | if (gbBsNS4& &!gbBsNS6) | |||||
| 1184 | { | |||||
| 1185 | gBsS tyVisShow = "show" ; | |||||
| 1186 | gBsS tyVisHide = "hide" ; | |||||
| 1187 | } | |||||
| 1188 | el se | |||||
| 1189 | { | |||||
| 1190 | gBsS tyVisShow = "visib le"; | |||||
| 1191 | gBsS tyVisHide = "hidde n"; | |||||
| 1192 | } | |||||
| 1193 | } | |||||
| 1194 | ||||||
| 1195 | _BSPSGetBr owserInfo( ); | |||||
| 1196 | ||||||
| 1197 | //Get clie nt size in fo | |||||
| 1198 | function _ BSPSGetCli entSize() | |||||
| 1199 | { | |||||
| 1200 | if ( typeof( window.inn erWidth ) == 'number ' ) | |||||
| 1201 | { | |||||
| 1202 | gBsC lientWidth = innerW idth; | |||||
| 1203 | gBsC lientHeigh t = innerH eight; | |||||
| 1204 | } | |||||
| 1205 | el se if( doc ument.docu mentElemen t && ( doc ument.docu mentElemen t.clientWi dth || doc ument.docu mentElemen t.clientHe ight ) ) | |||||
| 1206 | { | |||||
| 1207 | gBsC lientWidth = documen t.document Element.cl ientWidth; | |||||
| 1208 | gBsC lientHeigh t = docume nt.documen tElement.c lientHeigh t; | |||||
| 1209 | } | |||||
| 1210 | el se if( doc ument.body && ( docu ment.body. clientWidt h || docum ent.body.c lientHeigh t ) ) | |||||
| 1211 | { | |||||
| 1212 | gBsC lientWidth = documen t.body.cli entWidth; | |||||
| 1213 | gBsC lientHeigh t = docume nt.body.cl ientHeight ; | |||||
| 1214 | } | |||||
| 1215 | } | |||||
| 1216 | ||||||
| 1217 | var gstrPo pupID = 'B SSCPopup'; | |||||
| 1218 | var gstrPo pupShadowI D = 'BSSCP opupShadow '; | |||||
| 1219 | var gstrPo pupTopicID = 'BSSCPo pupTopic'; | |||||
| 1220 | var gstrPo pupIFrameI D = 'BSSCP opupIFrame '; | |||||
| 1221 | var gstrPo pupIFrameN ame = 'BSS CPopupIFra meName'; | |||||
| 1222 | ||||||
| 1223 | var gstrPo pupSecondW indowName = 'BSSCPop up'; | |||||
| 1224 | ||||||
| 1225 | var gPopup Window = n ull; | |||||
| 1226 | var gnPopu pClickX = 0; | |||||
| 1227 | var gnPopu pClickY = 0; | |||||
| 1228 | ||||||
| 1229 | var gnPopu pScreenCli ckX = 0; | |||||
| 1230 | var gnPopu pScreenCli ckY = 0; | |||||
| 1231 | ||||||
| 1232 | var gbPopu pTimeoutEx pired = fa lse; | |||||
| 1233 | ||||||
| 1234 | function D HTMLPopupS upport() | |||||
| 1235 | { | |||||
| 1236 | if (((gbBsIE 4) && (!gb BsMac))||g bBsOpera7| | gbBsNS7 || gbSafar i3||gbAIR) { | |||||
| 1237 | retu rn true; | |||||
| 1238 | } | |||||
| 1239 | re turn false ; | |||||
| 1240 | } | |||||
| 1241 | ||||||
| 1242 | function B SSCPopup_I sPopup() | |||||
| 1243 | { | |||||
| 1244 | if (DHTMLPop upSupport( ) && (this .name.inde xOf(gstrPo pupIFrameN ame) != -1 )) { | |||||
| 1245 | retu rn true; | |||||
| 1246 | } else if (( gbBsNS4 || gbBsIE4 | | gbBsOper a7) && (th is.name.in dexOf(gstr PopupID) ! = -1)) { | |||||
| 1247 | retu rn true; | |||||
| 1248 | } else { | |||||
| 1249 | retu rn false; | |||||
| 1250 | } | |||||
| 1251 | } | |||||
| 1252 | ||||||
| 1253 | // If ther e is a hyp erlink in a popup wi ndow, disp lay the hy perlink in | |||||
| 1254 | // the ori ginal wind ow. (bsscr ight) | |||||
| 1255 | //commenti ng this as we are op ening popu p links in its paren t | |||||
| 1256 | //also in multiscree n bsscrigh t is not t he the nam e of topic frame, re levant onl y in webhe lp | |||||
| 1257 | /*if (BSSC Popup_IsPo pup() && ! gbBsIE4 && !gbBsOper a7) { | |||||
| 1258 | document.w rite("<bas e target=\ "bsscright \">"); | |||||
| 1259 | }*/ | |||||
| 1260 | ||||||
| 1261 | // Local f unctions. | |||||
| 1262 | function B sPopup_Cre ateDiv(nIn dex) | |||||
| 1263 | { | |||||
| 1264 | if (!DHTMLPop upSupport( )) | |||||
| 1265 | retu rn; | |||||
| 1266 | // DO NOT SE T Width an d height f or the div , otherwiz e it will make IE4 p opup do no t work whe n view the topic alo ne. | |||||
| 1267 | va r strPopup Div = "<DI V ID='" + getPopupID (nIndex) + "' STYLE= 'position: absolute; top:-100; left:0; z- index:600; visibilit y:hidden;' >"; | |||||
| 1268 | st rPopupDiv += "<DIV I D='" + get PopupShado wID(nIndex ) + "' STY LE=\"posit ion:absolu te;top:0; left:0; b ackground- color:#C0C 0C0;\"></D IV>"; | |||||
| 1269 | st rPopupDiv += "<DIV I D='" + get PopupTopic ID(nIndex) + "' STYL E=\"positi on:absolut e;top:0; l eft:0; ba ckground-c olor:#FFFF FF;border: 1px #00000 0 outset;\ ">"; | |||||
| 1270 | st rPopupDiv += "<IFRAM E title=\" Popup Wind ow\" ID='" + getPopu pIFrameID( nIndex) + "' name='" + getPopu pIFrameNam e(nIndex) + "' src = '" + getP opupURL(nI ndex) + "' framebord er=0 scrol ling=auto> </IFRAME>" ; | |||||
| 1271 | st rPopupDiv += "</DIV> </DIV>"; | |||||
| 1272 | ||||||
| 1273 | va r objBody = getEleme ntsByTag(d ocument, " BODY")[0]; | |||||
| 1274 | if ( typeof(o bjBody) != "object" ) | |||||
| 1275 | retu rn; | |||||
| 1276 | ||||||
| 1277 | in sertAdjace ntHTML(obj Body, "bef oreEnd", s trPopupDiv ); | |||||
| 1278 | } | |||||
| 1279 | ||||||
| 1280 | function h andleLoadN S() | |||||
| 1281 | { | |||||
| 1282 | if (this.id) | |||||
| 1283 | { | |||||
| 1284 | var nIndex = p arseInt(th is.id.subs tring(gstr PopupIFram eID.length )); | |||||
| 1285 | BSSC Popup_Post Work(nInde x); | |||||
| 1286 | } | |||||
| 1287 | } | |||||
| 1288 | ||||||
| 1289 | function B SSCPopup_P ostWork(nI ndex) | |||||
| 1290 | { | |||||
| 1291 | ge tPopupDivS tyle(nInde x).visibil ity = gBsS tyVisShow; | |||||
| 1292 | ge tPopupIFra meStyle(nI ndex).visi bility =gB sStyVisSho w; | |||||
| 1293 | ||||||
| 1294 | se tClear(nIn dex); | |||||
| 1295 | wi ndow.gbPop upTimeoutE xpired = t rue; | |||||
| 1296 | ||||||
| 1297 | tr y{ | |||||
| 1298 | BSSC Popup_Chan geTargetto Parent(get PopupIFram e(nIndex). document); | |||||
| 1299 | if ( gbBsNS6) | |||||
| 1300 | getPop upIFrame(n Index).doc ument.body .addEventL istener("c lick",BSSC PopupClick ed,false); | |||||
| 1301 | else | |||||
| 1302 | getPop upIFrame(n Index).doc ument.body .onclick = BSSCPopup Clicked; | |||||
| 1303 | }c atch(e){} | |||||
| 1304 | ||||||
| 1305 | if (!gbOrign alOnMouseD own && doc ument.onmo usedown) | |||||
| 1306 | gbOr ignalOnMou seDown = d ocument.on mousedown; | |||||
| 1307 | ||||||
| 1308 | if (gbChrome || gbBsNS 6) | |||||
| 1309 | docu ment.addEv entListene r("mousedo wn", BSSCP opupParent Clicked,fa lse); | |||||
| 1310 | el se | |||||
| 1311 | docu ment.onmou sedown = B SSCPopupPa rentClicke d; | |||||
| 1312 | } | |||||
| 1313 | ||||||
| 1314 | function B SSCPopup_T imeout(nIn dex, nToke n) | |||||
| 1315 | { | |||||
| 1316 | if (!I sValidToke n(nToken)) return; | |||||
| 1317 | ||||||
| 1318 | if (gbBsNS6| |((getPopu pIFrame(nI ndex).docu ment.ready State == " complete") && | |||||
| 1319 | (get PopupIFram e(nIndex). document.b ody != nul l))) { | |||||
| 1320 | BSSC Popup_Post Work(nInde x); | |||||
| 1321 | } else { | |||||
| 1322 | setT imeout("BS SCPopup_Ti meout(" + nIndex + " ," + nToke n + ")", 1 00); | |||||
| 1323 | } | |||||
| 1324 | } | |||||
| 1325 | ||||||
| 1326 | // VH 08/1 0/00 | |||||
| 1327 | // do not change tar get to par ent if the href is u sing javas cript | |||||
| 1328 | function B SSCPopup_C hangeTarge ttoParent( tagsObject ) | |||||
| 1329 | { | |||||
| 1330 | va r collA = getElement sByTag(tag sObject, " A"); | |||||
| 1331 | BS SCPopup_Ch angeTarget toParent2( collA); | |||||
| 1332 | ||||||
| 1333 | va r collIMG = getEleme ntsByTag(t agsObject, "IMG"); | |||||
| 1334 | BS SCPopup_Ch angeTarget toParent2( collIMG); | |||||
| 1335 | } | |||||
| 1336 | ||||||
| 1337 | function B SSCPopup_C hangeTarge ttoParent2 (colls) | |||||
| 1338 | { | |||||
| 1339 | if (colls != null) { | |||||
| 1340 | for (var j = 0 ; j < coll s.length; j ++ ) | |||||
| 1341 | { | |||||
| 1342 | var st rtemp = co lls[j].hre f; | |||||
| 1343 | if (st rtemp) | |||||
| 1344 | { | |||||
| 1345 | strtemp = strtemp. toLowerCas e(); | |||||
| 1346 | if (strt emp.indexO f("javascr ipt:") == -1) | |||||
| 1347 | if (coll s[j].targe t == "") | |||||
| 1348 | colls[j].t arget = "_ parent"; | |||||
| 1349 | } | |||||
| 1350 | } | |||||
| 1351 | } | |||||
| 1352 | } | |||||
| 1353 | ||||||
| 1354 | function B SPSPopupTo picWinHelp (strURL) | |||||
| 1355 | { | |||||
| 1356 | _B SSCPopup(s trURL); | |||||
| 1357 | re turn; | |||||
| 1358 | } | |||||
| 1359 | ||||||
| 1360 | function D elayBSSCPo pup_AfterL oad(nIndex ,nToken , cuswidth , cusheight ) | |||||
| 1361 | { | |||||
| 1362 | //before d oing any t hing clear the inter val functi on | |||||
| 1363 | var in tervalID = getInterv alID(nInde x); | |||||
| 1364 | if(int ervalID!=- 1) | |||||
| 1365 | cl earInterva l(interval ID); | |||||
| 1366 | ||||||
| 1367 | BSSCPo pup_AfterL oad(nIndex ,nToken , cuswidth , cusheight ); | |||||
| 1368 | } | |||||
| 1369 | ||||||
| 1370 | function _ BSSCPopup( strURL, wi dth, heigh t) | |||||
| 1371 | { | |||||
| 1372 | va r cuswidth = 0; | |||||
| 1373 | va r cusheigh t = 0; | |||||
| 1374 | if ("undefin ed" != typ eof(width) && "undef ined" != t ypeof(heig ht)) { | |||||
| 1375 | cusw idth = wid th; | |||||
| 1376 | cush eight= hei ght; | |||||
| 1377 | } | |||||
| 1378 | ||||||
| 1379 | if (DHTMLPop upSupport( )) { | |||||
| 1380 | if(! gbAIR && ! gbInsideCH M) | |||||
| 1381 | rhPopu pEx.create Popup(strU RL, width, height); | |||||
| 1382 | else | |||||
| 1383 | { | |||||
| 1384 | var nT oken = tak eToken(); // take t oken first . | |||||
| 1385 | var nI ndex = _BS SCCreatePo pupDiv(str URL, nToke n, cuswidt h, cusheig ht); | |||||
| 1386 | window .gbPopupTi meoutExpir ed = false ; | |||||
| 1387 | var nt Width = gB sClientWid th; | |||||
| 1388 | var nt Height = g BsClientHe ight; | |||||
| 1389 | _BSPSG etClientSi ze(); | |||||
| 1390 | if (nt Width != g BsClientWi dth || ntH eight != g BsClientHe ight) { | |||||
| 1391 | setDirty (); | |||||
| 1392 | } | |||||
| 1393 | ||||||
| 1394 | if (Is Dirty(nInd ex)) | |||||
| 1395 | { | |||||
| 1396 | if(gbAIR ) | |||||
| 1397 | { | |||||
| 1398 | var tempappTim er = setIn terval(fun ction(){De layBSSCPop up_AfterLo ad(nIndex ,nToken ,c uswidth ,c usheight ) }, 400); | |||||
| 1399 | setI ntervalID( nIndex,tem pappTimer) ; | |||||
| 1400 | } | |||||
| 1401 | else | |||||
| 1402 | { | |||||
| 1403 | if (gbBsMa c) { | |||||
| 1404 | se tTimeout(" BSSCPopup_ AfterLoad( " + nIndex + "," + n Token + ", " + cuswid th + "," + cusheight +")", 40 0); | |||||
| 1405 | } else { | |||||
| 1406 | se tTimeout(" BSSCPopup_ AfterLoad( " + nIndex + "," + n Token + ", " + cuswid th + "," + cusheight + ")", 10 0); | |||||
| 1407 | } | |||||
| 1408 | } | |||||
| 1409 | } | |||||
| 1410 | else { | |||||
| 1411 | MoveDivA ndShow(nIn dex ,nToke n, cuswidt h, cusheig ht); | |||||
| 1412 | } | |||||
| 1413 | } | |||||
| 1414 | } else { | |||||
| 1415 | _BSS CPopup2(st rURL, cusw idth, cush eight); | |||||
| 1416 | } | |||||
| 1417 | re turn; | |||||
| 1418 | } | |||||
| 1419 | ||||||
| 1420 | if (gbBsIE 55) | |||||
| 1421 | { | |||||
| 1422 | va r ehlpdhtm _fOldBefur eUnload = window.onb eforeunloa d; | |||||
| 1423 | va r gnBsUnlo ad=0; | |||||
| 1424 | wi ndow.onbef oreunload = window_B Unload; | |||||
| 1425 | } | |||||
| 1426 | ||||||
| 1427 | function w indow_BUnl oad() | |||||
| 1428 | { | |||||
| 1429 | gn BsUnload++ ; | |||||
| 1430 | if (gnBsUnlo ad>1) | |||||
| 1431 | retu rn; | |||||
| 1432 | fo r (var i = 0; i < ar rayPopupUR L.length; i ++) | |||||
| 1433 | remo veThis(doc ument.all( getPopupID (i))); | |||||
| 1434 | ar rayPopupUR L.length = 0; | |||||
| 1435 | if (ehlpdhtm _fOldBefur eUnload) | |||||
| 1436 | ehlp dhtm_fOldB efureUnloa d(); | |||||
| 1437 | } | |||||
| 1438 | ||||||
| 1439 | function _ BSSCPopup2 (strURL, w idth, heig ht) | |||||
| 1440 | { | |||||
| 1441 | if (gbBsOper a6&&gbBsMa c) | |||||
| 1442 | { | |||||
| 1443 | var wmTemp = w indow.open (document. location.h ref, gstrP opupSecond WindowName ); | |||||
| 1444 | wmTe mp.close() ; | |||||
| 1445 | setT imeout("_B SSCPopup3( \""+strURL +"\","+wid th+","+hei ght+");",1 00); | |||||
| 1446 | } | |||||
| 1447 | el se | |||||
| 1448 | _BSS CPopup3(st rURL, widt h, height) ; | |||||
| 1449 | } | |||||
| 1450 | ||||||
| 1451 | function _ BSSCPopup3 (strURL, w idth, heig ht) | |||||
| 1452 | { | |||||
| 1453 | if (window.n ame == gst rPopupSeco ndWindowNa me) { | |||||
| 1454 | wind ow.locatio n = strURL ; | |||||
| 1455 | } else { | |||||
| 1456 | if ( !gbBsMac | | !gbBsNS4 ) { | |||||
| 1457 | BSSCHi dePopupWin dow(); | |||||
| 1458 | } | |||||
| 1459 | var nX = 0; | |||||
| 1460 | var nY = 0; | |||||
| 1461 | var nHeight = 300; | |||||
| 1462 | var nWidth = 4 00; | |||||
| 1463 | if ( width > 0 && height > 0) { | |||||
| 1464 | nHeigh t = height ; | |||||
| 1465 | nWidth = width; | |||||
| 1466 | } | |||||
| 1467 | _BSP SGetClient Size(); | |||||
| 1468 | ||||||
| 1469 | nX = window.gn PopupScree nClickX; | |||||
| 1470 | nY = window.gn PopupScree nClickY; | |||||
| 1471 | ||||||
| 1472 | if ( nY + nHeig ht + 40 > screen.ava ilHeight) { | |||||
| 1473 | nY = s creen.avai lHeight - nHeight - 40; | |||||
| 1474 | } | |||||
| 1475 | if ( nX + nWidt h + 40 > s creen.avai lWidth) { | |||||
| 1476 | nX = s creen.avai lWidth - n Width - 40 ; | |||||
| 1477 | } | |||||
| 1478 | ||||||
| 1479 | // L aunch a se parate win dow | |||||
| 1480 | var strParam=" titlebar=n o,toolbar= no,status= no,locatio n=no,menub ar=no,resi zable=yes, scrollbars =yes"; | |||||
| 1481 | if ( gbBsNS) { | |||||
| 1482 | if (gb BsNS6) { | |||||
| 1483 | strParam += ",Heig ht=" + nHe ight + "px ,Width=" + nWidth+"p x"; | |||||
| 1484 | strParam += ",scre enX=" + nX + ",scree nY=" + nY; | |||||
| 1485 | strParam += ",depe ndent=yes" ; | |||||
| 1486 | } | |||||
| 1487 | else { | |||||
| 1488 | strParam += ",Oute rHeight=" + nHeight + ",OuterW idth=" + n Width; | |||||
| 1489 | strParam += ",scre enX=" + nX + ",scree nY=" + nY; | |||||
| 1490 | strParam += ",depe ndent=yes" ; | |||||
| 1491 | } | |||||
| 1492 | } | |||||
| 1493 | else { | |||||
| 1494 | strPar am += ",he ight=" + n Height + " ,width=" + nWidth; | |||||
| 1495 | strPar am += ",le ft=" + nX + ",top=" + nY; | |||||
| 1496 | } | |||||
| 1497 | if ( gbBsSafari ) | |||||
| 1498 | { | |||||
| 1499 | if (wi ndow.gPopu pWindow) | |||||
| 1500 | window.g PopupWindo w.close(); | |||||
| 1501 | window .gPopupWin dow = wind ow.open(st rURL, "", strParam); | |||||
| 1502 | window .gPopupWin dow.name = gstrPopup SecondWind owName; | |||||
| 1503 | window .gPopupWin dow.moveTo (nX, nY); | |||||
| 1504 | window .gPopupWin dow.docume nt.locatio n.reload() ; | |||||
| 1505 | } | |||||
| 1506 | else | |||||
| 1507 | { | |||||
| 1508 | var wm Temp=null; | |||||
| 1509 | if (gb BsKonquero r3) | |||||
| 1510 | { | |||||
| 1511 | if (wind ow.gPopupW indow) | |||||
| 1512 | window.gPo pupWindow. close(); | |||||
| 1513 | } | |||||
| 1514 | if (gb BsOpera&&g bBsMac) | |||||
| 1515 | { | |||||
| 1516 | wmTemp= window.ope n(document .location. href, "Tem p", strPar am); | |||||
| 1517 | } | |||||
| 1518 | window .gPopupWin dow = wind ow.open(st rURL, gstr PopupSecon dWindowNam e, strPara m); | |||||
| 1519 | if (!g bBsIE) | |||||
| 1520 | window.g PopupWindo w.focus(); | |||||
| 1521 | ||||||
| 1522 | if (wm Temp) | |||||
| 1523 | wmTemp.c lose(); | |||||
| 1524 | } | |||||
| 1525 | ||||||
| 1526 | if ( gbBsNS4) | |||||
| 1527 | setEve ntHandle() ; | |||||
| 1528 | else if (gbBsI E4 || gbBs Opera7||gb BsKonquero r3) | |||||
| 1529 | setTim eout("setP opupFocus( );", 100); | |||||
| 1530 | } | |||||
| 1531 | re turn; | |||||
| 1532 | } | |||||
| 1533 | ||||||
| 1534 | function s etEventHan dle() | |||||
| 1535 | { | |||||
| 1536 | wi ndow.gPopu pWindow.ca ptureEvent s(Event.CL ICK | Even t.BLUR); | |||||
| 1537 | wi ndow.gPopu pWindow.on click = No nIEPopup_H andleClick ; | |||||
| 1538 | wi ndow.gPopu pWindow.on blur = Non IEPopup_Ha ndleBlur; | |||||
| 1539 | } | |||||
| 1540 | ||||||
| 1541 | function s etPopupFoc us() | |||||
| 1542 | { | |||||
| 1543 | wi ndow.gPopu pWindow.fo cus(); | |||||
| 1544 | } | |||||
| 1545 | ||||||
| 1546 | function N onIEPopup_ HandleBlur (e) | |||||
| 1547 | { | |||||
| 1548 | wi ndow.gPopu pWindow.fo cus(); | |||||
| 1549 | } | |||||
| 1550 | ||||||
| 1551 | function N onIEPopup_ HandleClic k(e) | |||||
| 1552 | { | |||||
| 1553 | // Because n avigator w ill give t he event t o the hand ler before the hyper link, let' s | |||||
| 1554 | // first rou te the eve nt to see if we are clicking o n a Popup menu in a popup. | |||||
| 1555 | do cument.rou teEvent(e) ; | |||||
| 1556 | ||||||
| 1557 | // If a popu p menu is active the n don't do anything with the c lick | |||||
| 1558 | if (window.g PopupWindo w.gbInPopu pMenu) { | |||||
| 1559 | wind ow.gPopupW indow.capt ureEvents( Event.CLIC K); | |||||
| 1560 | wind ow.gPopupW indow.oncl ick = NonI EPopup_Han dleClick; | |||||
| 1561 | retu rn false; | |||||
| 1562 | } | |||||
| 1563 | ||||||
| 1564 | // Close the popup win dow | |||||
| 1565 | if (e.target. href) | |||||
| 1566 | { | |||||
| 1567 | if(e .target.hr ef.indexOf ("javascri pt:")==-1) | |||||
| 1568 | { | |||||
| 1569 | if (e. target.tar get=="") | |||||
| 1570 | window.l ocation.hr ef = e.tar get.href; | |||||
| 1571 | else | |||||
| 1572 | window.o pen(e.targ et.href, e .target.ta rget); | |||||
| 1573 | this.c lose(); | |||||
| 1574 | } | |||||
| 1575 | } | |||||
| 1576 | el se | |||||
| 1577 | this .close(); | |||||
| 1578 | re turn false ; | |||||
| 1579 | } | |||||
| 1580 | ||||||
| 1581 | function B SSCPopup_A fterLoad(n Index, nTo ken, cuswi dth, cushe ight) | |||||
| 1582 | { | |||||
| 1583 | if (!window. getPopupIF rame(nInde x).documen t) { | |||||
| 1584 | _BSS CPopup2(ge tPopupURL( nIndex), c uswidth, c usheight); | |||||
| 1585 | retu rn; | |||||
| 1586 | } | |||||
| 1587 | ||||||
| 1588 | if (!I sValidToke n(nToken)) return; | |||||
| 1589 | ||||||
| 1590 | if (gbSafari 3||gbAIR) | |||||
| 1591 | { | |||||
| 1592 | setAbs PopupURL(n Index, win dow.getPop upIFrame(n Index).doc ument.loca tion.href) ; // chang e URL to a bs url. | |||||
| 1593 | BSSC Popup_Resi zeAfterLoa d(nIndex, nToken, cu swidth, cu sheight); | |||||
| 1594 | retu rn; | |||||
| 1595 | } | |||||
| 1596 | ||||||
| 1597 | if (gbBsNS6) | |||||
| 1598 | { | |||||
| 1599 | setA bsPopupURL (nIndex, w indow.getP opupIFrame (nIndex).d ocument.lo cation.hre f); // cha nge URL to abs url. | |||||
| 1600 | setT imeout("BS SCPopup_Re sizeAfterL oad(" + nI ndex + "," + nToken + "," + cu swidth + " ," + cushe ight + ")" , 200); | |||||
| 1601 | retu rn; | |||||
| 1602 | } | |||||
| 1603 | ||||||
| 1604 | if ((window. getPopupIF rame(nInde x).documen t.readySta te == "com plete") && | |||||
| 1605 | (win dow.getPop upIFrame(n Index).doc ument.body != null)) { | |||||
| 1606 | if (wi ndow.getPo pupIFrame( nIndex).do cument.loc ation.href .indexOf(" about:blan k") != -1) { // add this check . IE will use about: blank" as the defaul t vaule fo r Iframe. | |||||
| 1607 | window.g etPopupIFr ame(nIndex ).document .location = getPopup URL(nIndex ); | |||||
| 1608 | setTimeo ut("BSSCPo pup_AfterL oad(" + nI ndex + "," + nToken + "," + cu swidth + " ," + cushe ight + ")" , 200); | |||||
| 1609 | } | |||||
| 1610 | else | |||||
| 1611 | { | |||||
| 1612 | setAbsPopu pURL(nInde x, window. getPopupIF rame(nInde x).documen t.location .href); // change UR L to abs u rl. | |||||
| 1613 | BSSCPopup_ ResizeAfte rLoad(nInd ex, nToken , cuswidth , cusheigh t); | |||||
| 1614 | } | |||||
| 1615 | } else { | |||||
| 1616 | setT imeout("BS SCPopup_Af terLoad(" + nIndex + "," + nTo ken + "," + cuswidth + "," + c usheight + ")", 200) ; | |||||
| 1617 | } | |||||
| 1618 | } | |||||
| 1619 | ||||||
| 1620 | function B SSCPopup_R esizeAfter Load(nInde x, nToken, cuswidth, cusheight ) | |||||
| 1621 | { | |||||
| 1622 | if (window.g bPopupTime outExpired ) return; | |||||
| 1623 | ||||||
| 1624 | if (!I sValidToke n(nToken)) return; | |||||
| 1625 | ||||||
| 1626 | ge tPopupDivS tyle(nInde x).visibil ity = gBsS tyVisHide; | |||||
| 1627 | ge tPopupIFra meStyle(nI ndex).visi bility = g BsStyVisHi de; | |||||
| 1628 | if (gbBsIE) | |||||
| 1629 | { | |||||
| 1630 | //fix fo r Popup Bl ank issue | |||||
| 1631 | getPopup IFrameStyl e(nIndex). visibility = gBsStyV isShow; | |||||
| 1632 | getP opupDivSty le(nIndex) .visibilit y = gBsSty VisShow; | |||||
| 1633 | } | |||||
| 1634 | ||||||
| 1635 | // Determine the width and heigh t for the window | |||||
| 1636 | _B SPSGetClie ntSize(); | |||||
| 1637 | ||||||
| 1638 | va r size = n ew BSSCSiz e(0, 0); | |||||
| 1639 | ||||||
| 1640 | if (cuswidth <= 0 || c usheight < = 0) | |||||
| 1641 | BSSCGetC ontentSize (window.ge tPopupIFra me(nIndex) , size); | |||||
| 1642 | else { | |||||
| 1643 | size .x = cuswi dth; | |||||
| 1644 | size .y = cushe ight; | |||||
| 1645 | } | |||||
| 1646 | ||||||
| 1647 | // Determine the width and heigh t for the window | |||||
| 1648 | va r nWidth = size.x; | |||||
| 1649 | va r nHeight = size.y; | |||||
| 1650 | ||||||
| 1651 | // for small popup siz e, we shou ld allow a ny size. | |||||
| 1652 | // The popup size shou ld be ok i f bigger t han 0 | |||||
| 1653 | if (nWidth < 0 || nHei ght < 0) r eturn; // there mus t be somet hing terri bly wrong. | |||||
| 1654 | ||||||
| 1655 | // make the w idth and h eight same for all t he browser s now | |||||
| 1656 | nW idth = nWi dth + 22; | |||||
| 1657 | nH eight = nH eight + 10 ; | |||||
| 1658 | ||||||
| 1659 | ge tPopupDivS tyle(nInde x).width = nWidth+ " px" ; | |||||
| 1660 | ge tPopupDivS tyle(nInde x).height = nHeight+ "px" ; | |||||
| 1661 | ||||||
| 1662 | ge tPopupShad owStyle(nI ndex).widt h = nWidth + "px" ; | |||||
| 1663 | ge tPopupShad owStyle(nI ndex).heig ht = nHeig ht + "px" ; | |||||
| 1664 | ||||||
| 1665 | ||||||
| 1666 | ge tPopupTopi cStyle(nIn dex).width = nWidth + "px" ; | |||||
| 1667 | ge tPopupTopi cStyle(nIn dex).heigh t = nHeigh t + "px" ; | |||||
| 1668 | ||||||
| 1669 | ge tPopupIFra meStyle(nI ndex).widt h = nWidth + "px" ; | |||||
| 1670 | ge tPopupIFra meStyle(nI ndex).heig ht = nHeig ht + "px" ; | |||||
| 1671 | ||||||
| 1672 | if (gbBsIE55 || gbBsNS 6 || gbSaf ari3||gbAI R) | |||||
| 1673 | { | |||||
| 1674 | getP opupIFrame Style(nInd ex).top = 0; | |||||
| 1675 | getP opupIFrame Style(nInd ex).left = 0; | |||||
| 1676 | } | |||||
| 1677 | ||||||
| 1678 | va r strURL = getPopupU RL(nIndex) ; | |||||
| 1679 | if (strURL.i ndexOf("#" ) != -1&&g bBsNS6) | |||||
| 1680 | getP opupIFrame (nIndex).l ocation.re load(); | |||||
| 1681 | el se if (str URL.indexO f("#") != -1||gbBsNS 6) | |||||
| 1682 | getP opupIFrame (nIndex).l ocation.hr ef = strUR L; // rel oad again, this will fix the b ookmark mi sunderstan d in IE5. | |||||
| 1683 | ||||||
| 1684 | Mo veDivAndSh ow(nIndex, nToken, c uswidth, c usheight); | |||||
| 1685 | } | |||||
| 1686 | ||||||
| 1687 | function g etScrollLe ft() | |||||
| 1688 | { | |||||
| 1689 | if ( typeof( window.pag eXOffset) == 'number ' ) | |||||
| 1690 | retu rn window. pageXOffse t ; | |||||
| 1691 | el se if( doc ument.body && ( docu ment.body. scrollLeft || docume nt.body.sc rollTop ) ) | |||||
| 1692 | retu rn documen t.body.scr ollLeft ; | |||||
| 1693 | el se if( doc ument.docu mentElemen t && docum ent.docume ntElement. scrollLeft ) | |||||
| 1694 | retu rn documen t.document Element.sc rollLeft; | |||||
| 1695 | el se | |||||
| 1696 | retu rn 0 ; | |||||
| 1697 | } | |||||
| 1698 | ||||||
| 1699 | function g etScrollTo p() | |||||
| 1700 | { | |||||
| 1701 | if ( typeof( window.pag eYOffset) == 'number ' ) | |||||
| 1702 | retu rn window. pageYOffse t ; | |||||
| 1703 | el se if( doc ument.body && docume nt.body.sc rollTop ) | |||||
| 1704 | retu rn documen t.body.scr ollTop ; | |||||
| 1705 | el se if( doc ument.docu mentElemen t && docum ent.docume ntElement. scrollTop ) | |||||
| 1706 | retu rn documen t.document Element.sc rollTop; | |||||
| 1707 | el se | |||||
| 1708 | retu rn 0 ; | |||||
| 1709 | } | |||||
| 1710 | ||||||
| 1711 | function g etScrollLe ftElement( el) | |||||
| 1712 | { | |||||
| 1713 | var x = 0; | |||||
| 1714 | while (el && typ eof (el.sc rollLeft) == 'number ') | |||||
| 1715 | { | |||||
| 1716 | if (el == do cument.bod y) | |||||
| 1717 | { | |||||
| 1718 | var top = document .body.scro llLeft || document.d ocumentEle ment.scrol lLeft; | |||||
| 1719 | x += top ; | |||||
| 1720 | } | |||||
| 1721 | el se | |||||
| 1722 | x += el. scrollLeft ; | |||||
| 1723 | el = el.offs etParent; | |||||
| 1724 | } | |||||
| 1725 | return x; | |||||
| 1726 | } | |||||
| 1727 | ||||||
| 1728 | function g etScrollTo pElement(e l) | |||||
| 1729 | { | |||||
| 1730 | var x = 0; | |||||
| 1731 | while (el && typ eof (el.sc rollTop) = = 'number' ) | |||||
| 1732 | { | |||||
| 1733 | if (el == do cument.bod y) | |||||
| 1734 | { | |||||
| 1735 | var top = document .body.scro llTop || d ocument.do cumentElem ent.scroll Top; | |||||
| 1736 | x += top ; | |||||
| 1737 | } | |||||
| 1738 | el se | |||||
| 1739 | x += el. scrollTop; | |||||
| 1740 | el = el.offs etParent; | |||||
| 1741 | } | |||||
| 1742 | return x; | |||||
| 1743 | } | |||||
| 1744 | ||||||
| 1745 | ||||||
| 1746 | function M oveDivAndS how(nIndex , nToken, cuswidth, cusheight) | |||||
| 1747 | { | |||||
| 1748 | if (window.g etPopupIFr ame(nIndex ).document .location. href != ge tAbsPopupU RL(nIndex) ) { // if redirect, reload aga in. | |||||
| 1749 | window .getPopupI Frame(nInd ex).docume nt.locatio n = getPop upURL(nInd ex); | |||||
| 1750 | if(gbA IR) | |||||
| 1751 | { | |||||
| 1752 | BSSCPopu p_AfterLoa d(nIndex , nToken ,cu swidth ,cu sheight ); | |||||
| 1753 | } | |||||
| 1754 | else | |||||
| 1755 | setTimeo ut("BSSCPo pup_AfterL oad(" + nI ndex + "," + nToken + "," + cu swidth + " ," + cushe ight + ")" , 200); | |||||
| 1756 | return ; | |||||
| 1757 | } | |||||
| 1758 | ||||||
| 1759 | // Determine the posit ion of the window | |||||
| 1760 | va r nClickX = window.g nPopupClic kX; | |||||
| 1761 | va r nClickY = window.g nPopupClic kY; | |||||
| 1762 | va r nTop = 0 ; | |||||
| 1763 | va r nLeft = 0; | |||||
| 1764 | ||||||
| 1765 | va r nWidth = parseInt( getPopupDi vStyle(nIn dex).width ); | |||||
| 1766 | va r nHeight = parseInt (getPopupD ivStyle(nI ndex).heig ht); | |||||
| 1767 | ||||||
| 1768 | if (nClickY + nHeight + 20 < gBs ClientHeig ht + getSc rollTop()) { | |||||
| 1769 | nTop = nClickY + 10; | |||||
| 1770 | } else { | |||||
| 1771 | nTop = (getScr ollTop() + gBsClient Height) - nHeight - 20; | |||||
| 1772 | } | |||||
| 1773 | if (nClickX + nWidth < gBsClient Width + ge tScrollLef t()) { | |||||
| 1774 | nLef t = nClick X; | |||||
| 1775 | } else { | |||||
| 1776 | nLef t = (getSc rollLeft() + gBsClie ntWidth) - nWidth - 20; | |||||
| 1777 | } | |||||
| 1778 | ||||||
| 1779 | if (!gbBsIE55 ) | |||||
| 1780 | { | |||||
| 1781 | if ( nTop < get ScrollTop( )) nTop = getScroll Top() + nT op; | |||||
| 1782 | if ( nLeft< get ScrollLeft ()) nLeft = getScro llLeft() + nLeft; | |||||
| 1783 | ||||||
| 1784 | if(n Top+nHeigh t>gBsClien tHeight + getScrollT op()) | |||||
| 1785 | { | |||||
| 1786 | nTop = (getScrol lTop() + g BsClientHe ight) - nH eight - 20 ; | |||||
| 1787 | } | |||||
| 1788 | } | |||||
| 1789 | ||||||
| 1790 | if (isNaN(nL eft)) | |||||
| 1791 | getP opupDivSty le(nIndex) .left = nC lickX + "p x"; | |||||
| 1792 | el se | |||||
| 1793 | getP opupDivSty le(nIndex) .left = nL eft+ "px"; | |||||
| 1794 | ||||||
| 1795 | if (isNaN(nT op)) | |||||
| 1796 | getP opupDivSty le(nIndex) .top = nCl ickY + "p x"; | |||||
| 1797 | el se | |||||
| 1798 | getP opupDivSty le(nIndex) .top = nTo p + "px"; | |||||
| 1799 | ||||||
| 1800 | // Set the l ocation of the backg round bloc ks | |||||
| 1801 | ge tPopupShad owStyle(nI ndex).left = 6 + "px "; | |||||
| 1802 | ge tPopupShad owStyle(nI ndex).top = 6 + "px" ; | |||||
| 1803 | if (gbBsIE55 ) | |||||
| 1804 | { | |||||
| 1805 | getP opupShadow Style(nInd ex).left = 4; | |||||
| 1806 | getP opupShadow Style(nInd ex).top = 4; | |||||
| 1807 | } | |||||
| 1808 | ||||||
| 1809 | if (gbBsMac& &gbBsIE4) { | |||||
| 1810 | // T otal hack on the iMa c to get t he IFrame to positio n properly | |||||
| 1811 | getP opupIFrame Style(nInd ex).pixelL eft = 100; | |||||
| 1812 | getP opupIFrame Style(nInd ex).pixelL eft = 0; | |||||
| 1813 | // E xplicitly call BSSCO nLoad beca use the Ma c doesn't seem to do it | |||||
| 1814 | getP opupIFrame (nIndex).w indow.BSSC OnLoad(); | |||||
| 1815 | } | |||||
| 1816 | ||||||
| 1817 | if (gbChrome) | |||||
| 1818 | { | |||||
| 1819 | BSSC Popup_Post Work(nInde x); | |||||
| 1820 | } | |||||
| 1821 | el se if (gbB sNS6&&IsDi rty(nIndex )) | |||||
| 1822 | getE lement(get PopupIFram eID(nIndex )).addEven tListener( "load", ha ndleLoadNS , false); | |||||
| 1823 | el se | |||||
| 1824 | BSSC Popup_Time out(nIndex , nToken ); | |||||
| 1825 | re turn; | |||||
| 1826 | } | |||||
| 1827 | ||||||
| 1828 | function BSSC Size(x, y) | |||||
| 1829 | { | |||||
| 1830 | th is.x = x; | |||||
| 1831 | th is.y = y; | |||||
| 1832 | } | |||||
| 1833 | ||||||
| 1834 | function B SSCGetCont entSize(th isWindow, size) | |||||
| 1835 | { | |||||
| 1836 | if (!gbBsIE4 && !gbBsO pera7 && ! gbBsNS4 && !gbSafari 3 && !gbAI R) | |||||
| 1837 | retu rn; | |||||
| 1838 | ||||||
| 1839 | ||||||
| 1840 | if ((gbBsMac &&gbBsIE4) ||gbBsOper a7) { | |||||
| 1841 | size .x = 320; | |||||
| 1842 | size .y = 180; | |||||
| 1843 | retu rn; | |||||
| 1844 | } | |||||
| 1845 | ||||||
| 1846 | // Resize th e width un til it is wide enoug h to handl e the cont ent | |||||
| 1847 | // The trick is to sta rt wide an d determin e when the scrollHei ght change s | |||||
| 1848 | // because t hen we kno w a scroll bar is nec essary. We can then go back | |||||
| 1849 | // to the ne xt widest size (for no scrollb ar) | |||||
| 1850 | ||||||
| 1851 | va r ClientRa te = gBsCl ientHeight / gBsClie ntWidth; | |||||
| 1852 | ||||||
| 1853 | ||||||
| 1854 | va r GoldenSi ze = new B SSCSize(0, 0); | |||||
| 1855 | Go ldenSize.x = gBsClie ntWidth * getBMaxXOf Parent(); | |||||
| 1856 | Go ldenSize.y = gBsClie ntHeight * getBMaxYOf Parent() ; | |||||
| 1857 | ||||||
| 1858 | if (ClientRa te > gBRat eH_W) { | |||||
| 1859 | Gold enSize.y = GoldenSiz e.x * gBRa teH_W; | |||||
| 1860 | } | |||||
| 1861 | el se { | |||||
| 1862 | Gold enSize.x = GoldenSiz e.y / gBRa teH_W; | |||||
| 1863 | } | |||||
| 1864 | ||||||
| 1865 | // Try to us ing parent specified max x. | |||||
| 1866 | va r x = 0; | |||||
| 1867 | va r maxgoldx = GoldenS ize.x; | |||||
| 1868 | va r maxx = g BsClientWi dth * getB MaxXOfPare nt(); | |||||
| 1869 | ||||||
| 1870 | // This doub le resize causes the document to re-rend er (and we need it t o) | |||||
| 1871 | if (!gbBsIE5 && !gbChr ome && !gb AIR) | |||||
| 1872 | this Window.mov eTo(10000, 10000); // this is u sed to fix the flash on IE4. | |||||
| 1873 | if (!gbAIR) | |||||
| 1874 | { | |||||
| 1875 | th isWindow.r esizeTo(1, 1); | |||||
| 1876 | th isWindow.r esizeTo(ma xgoldx, ge tScrollHei ght(thisWi ndow) + ge tBscrollHe ight()); | |||||
| 1877 | } | |||||
| 1878 | ||||||
| 1879 | va r miny = g etScrollHe ight(thisW indow) + g etBscrollH eight(); | |||||
| 1880 | ||||||
| 1881 | if (miny > G oldenSize. y) // the popup does not fix i n the pare nt wanted golden are a. so try to expand itself as large as i t can | |||||
| 1882 | { | |||||
| 1883 | if(g bBsIE55) | |||||
| 1884 | { | |||||
| 1885 | thisWi ndow.resiz eTo(maxx , getScroll Height(thi sWindow) + getBscrol lHeight()) ; | |||||
| 1886 | } | |||||
| 1887 | ||||||
| 1888 | miny = getScr ollHeight( thisWindow ) + getBsc rollHeight (); | |||||
| 1889 | maxy = gBsClie ntHeight * getBMaxYO fParent(); | |||||
| 1890 | ||||||
| 1891 | if ( miny > max y) { // th e popup mu st have a scroll, OK let it be . | |||||
| 1892 | miny = maxy; | |||||
| 1893 | size.x = maxx; | |||||
| 1894 | size.y = maxy; | |||||
| 1895 | thisWi ndow.docum ent.body.s croll = 'y es'; // At this time we do wan t to show scroll any more. so it will lo oks better a little. | |||||
| 1896 | } | |||||
| 1897 | else { // popu p still ca n fit in t he parent area by so meway. now we choose the same h/w rate a s parent. | |||||
| 1898 | size.y = miny; | |||||
| 1899 | ||||||
| 1900 | // do wnsize fro m maxx , n ow I try t o using bi nary divid e. | |||||
| 1901 | x = ma xx; | |||||
| 1902 | deltax = -maxx/2 ; | |||||
| 1903 | //j = 0; | |||||
| 1904 | while (true) { | |||||
| 1905 | x = x + deltax; | |||||
| 1906 | if(!gbAI R) | |||||
| 1907 | thisWind ow.resizeT o(x, miny) ; | |||||
| 1908 | diffy = getScrollH eight(this Window) + getBscroll Height() - x * Clien tRate; | |||||
| 1909 | if (diff y > gBper mitYDelta ) // it is higher th an wanted, so x need to be wid e a little bitter | |||||
| 1910 | deltax = M ath.abs(de ltax) /2; | |||||
| 1911 | else if (diffy < -gBpermitY Delta) // it is shor ter than w anted, so x need to be narrow a little b itter | |||||
| 1912 | deltax = - Math.abs(d eltax) /2; | |||||
| 1913 | else | |||||
| 1914 | // the y i s close en ough to wa nted. | |||||
| 1915 | break; | |||||
| 1916 | if (Math .abs(delta x) < gBper mitXDelta) // the ne xt change is too sli ght and it can be ig nore. | |||||
| 1917 | break; | |||||
| 1918 | } | |||||
| 1919 | size.x = getScro llWidth(th isWindow); //+ gBscr ollWidth; | |||||
| 1920 | size.y = getScro llHeight(t hisWindow) ;// + gBsc rollHeight ; | |||||
| 1921 | thisWi ndow.docum ent.body.s croll = 'n o'; | |||||
| 1922 | } | |||||
| 1923 | } | |||||
| 1924 | el se { | |||||
| 1925 | if ( getScrollW idth(thisW indow) > m axgoldx) { | |||||
| 1926 | size.x = maxx; | |||||
| 1927 | size.y = miny; | |||||
| 1928 | thisWi ndow.docum ent.body.s croll = 'y es'; | |||||
| 1929 | } | |||||
| 1930 | else { | |||||
| 1931 | // do wnsize fro m maxgoldx , now I t ry to usin g binary d ivide. | |||||
| 1932 | x = ma xgoldx; | |||||
| 1933 | deltax = -maxgol dx/2; | |||||
| 1934 | while (true) { | |||||
| 1935 | x = x + deltax; | |||||
| 1936 | if(!gbAI R) | |||||
| 1937 | thisWind ow.resizeT o(x, miny) ; | |||||
| 1938 | diffy = getScrollH eight(this Window) + getBscroll Height() - x * getBR ateH_W(); | |||||
| 1939 | if (diff y > gBper mitYDelta ) // it is higher th an wanted, so x need to be wid e a little bitter | |||||
| 1940 | deltax = M ath.abs(de ltax) /2; | |||||
| 1941 | else if (diffy < -gBpermitY Delta) // it is shor ter than w anted, so x need to be narrow a little b itter | |||||
| 1942 | deltax = - Math.abs(d eltax) /2; | |||||
| 1943 | else | |||||
| 1944 | // the y i s close en ough to wa nted. | |||||
| 1945 | break; | |||||
| 1946 | if (Math .abs(delta x) < gBper mitXDelta) // the ne xt change is too sli ght and it can be ig nore. | |||||
| 1947 | break; | |||||
| 1948 | } | |||||
| 1949 | size.x = getScro llWidth(th isWindow); | |||||
| 1950 | size.y = getScro llHeight(t hisWindow) ; | |||||
| 1951 | thisWi ndow.docum ent.body.s croll = 'n o'; // At this time we do not want to sh ow scroll any more. so it will looks bet ter a litt le. | |||||
| 1952 | ||||||
| 1953 | } | |||||
| 1954 | } | |||||
| 1955 | if (gbBsNS6) | |||||
| 1956 | size .y = size. y + 20 ; | |||||
| 1957 | ||||||
| 1958 | if (!gbAIR) | |||||
| 1959 | th isWindow.r esizeTo(si ze.x, size .y); | |||||
| 1960 | re turn; | |||||
| 1961 | } | |||||
| 1962 | ||||||
| 1963 | function g etScrollWi dth(thisWi ndow) | |||||
| 1964 | { | |||||
| 1965 | var w = thisWind ow.documen t.body.scr ollWidth ? thisWindo w.document .body.scro llWidth : thisWindow .window.pa geXOffset ; | |||||
| 1966 | return w ? w : 0; | |||||
| 1967 | } | |||||
| 1968 | ||||||
| 1969 | function g etScrollHe ight(thisW indow) | |||||
| 1970 | { | |||||
| 1971 | var h = thisWindo w.document .body.scro llHeight ? thisWindo w.document .body.scro llHeight : thisWindo w.window.p ageYOffset ; | |||||
| 1972 | return h ? h : 0; | |||||
| 1973 | } | |||||
| 1974 | ||||||
| 1975 | ||||||
| 1976 | function B SSCPopupPa rentClicke d() | |||||
| 1977 | { | |||||
| 1978 | if (!window. gbPopupTim eoutExpire d) { | |||||
| 1979 | retu rn false; | |||||
| 1980 | } | |||||
| 1981 | ||||||
| 1982 | do cument.onm ousedown = gbOrignal OnMouseDow n; | |||||
| 1983 | ||||||
| 1984 | // Simply hi de the pop up | |||||
| 1985 | hi deAll(); | |||||
| 1986 | ||||||
| 1987 | wi ndow.gbPop upTimeoutE xpired = f alse; | |||||
| 1988 | ||||||
| 1989 | re turn true; | |||||
| 1990 | } | |||||
| 1991 | ||||||
| 1992 | function i sInsideHyp erLink(obj ) | |||||
| 1993 | { | |||||
| 1994 | if (obj&&obj !=getParen tNode(obj) ) | |||||
| 1995 | { | |||||
| 1996 | if ( obj.tagNam e=="A"||ob j.tagName= ="IMG" || obj.tagNam e=="VIDEO" ) | |||||
| 1997 | return true; | |||||
| 1998 | else | |||||
| 1999 | return isInsideH yperLink(g etParentNo de(obj)); | |||||
| 2000 | } | |||||
| 2001 | el se | |||||
| 2002 | retu rn false; | |||||
| 2003 | } | |||||
| 2004 | ||||||
| 2005 | function B SSCPopupCl icked(e) | |||||
| 2006 | { | |||||
| 2007 | if (!window. gbPopupTim eoutExpire d) { | |||||
| 2008 | retu rn false; | |||||
| 2009 | } | |||||
| 2010 | ||||||
| 2011 | va r popupIFr ame = getC urrentPopu pIFrame(); | |||||
| 2012 | if (popupIFr ame == nul l) { | |||||
| 2013 | retu rn true; | |||||
| 2014 | } | |||||
| 2015 | ||||||
| 2016 | if (gbBsIE4 && (!((pop upIFrame.w indow.even t != null) && | |||||
| 2017 | (pop upIFrame.w indow.even t.srcEleme nt != null ) && | |||||
| 2018 | isIn sideHyperL ink(popupI Frame.wind ow.event.s rcElement) ))) { | |||||
| 2019 | docu ment.onmou sedown = g bOrignalOn MouseDown; | |||||
| 2020 | ||||||
| 2021 | // S imply hide the popup | |||||
| 2022 | hide All(); | |||||
| 2023 | wind ow.gbPopup TimeoutExp ired = fal se; | |||||
| 2024 | retu rn true; | |||||
| 2025 | } | |||||
| 2026 | el se if (!gb AIR && (gb BsNS6 || g bChrome) & & (!((e != null) && | |||||
| 2027 | (e.tar get!= null ) && isIns ideHyperLi nk(e.targe t)))) | |||||
| 2028 | { | |||||
| 2029 | document .removeEve ntListener ("mousedow n", BSSCPo pupParentC licked,fal se); | |||||
| 2030 | if(gbOri gnalOnMous eDown) | |||||
| 2031 | document.a ddEventLis tener("mou sedown", g bOrignalOn MouseDown, false); | |||||
| 2032 | // S imply hide the popup | |||||
| 2033 | hide All(); | |||||
| 2034 | wind ow.gbPopup TimeoutExp ired = fal se; | |||||
| 2035 | retu rn true; | |||||
| 2036 | } | |||||
| 2037 | } | |||||
| 2038 | ||||||
| 2039 | //trace th e mouse ov er's posit ion for ho tspot | |||||
| 2040 | function BSPSPopupO nMouseOver (event) | |||||
| 2041 | { | |||||
| 2042 | rh PopupEx.se tClickPosi tion(event .clientX, event.clie ntY); | |||||
| 2043 | if (gbBsIE4 || gbBsOpe ra7||gbBsK onqueror3) { | |||||
| 2044 | wind ow.gnPopup ClickX = e vent.clien tX + getSc rollLeft() ; | |||||
| 2045 | wind ow.gnPopup ClickY = e vent.clien tY + getSc rollTop(); | |||||
| 2046 | wind ow.gnPopup ScreenClic kX = event .screenX; | |||||
| 2047 | wind ow.gnPopup ScreenClic kY = event .screenY; | |||||
| 2048 | } else if (g bBsSafari) { | |||||
| 2049 | wind ow.gnPopup ClickX = e vent.clien tX + getSc rollLeft() ; | |||||
| 2050 | wind ow.gnPopup ClickY = e vent.clien tY + getSc rollTop(); | |||||
| 2051 | wind ow.gnPopup ScreenClic kX = event .screenX + window.sc reenX; | |||||
| 2052 | wind ow.gnPopup ScreenClic kY = event .screenY + window.sc reenY; | |||||
| 2053 | } else if (g bBsNS4) { | |||||
| 2054 | wind ow.gnPopup ClickX = e vent.pageX - window. pageXOffse t; | |||||
| 2055 | wind ow.gnPopup ClickY = e vent.pageY - window. pageYOffse t; | |||||
| 2056 | wind ow.gnPopup ScreenClic kX = event .screenX - window.pa geXOffset; | |||||
| 2057 | wind ow.gnPopup ScreenClic kY = event .screenY - window.pa geYOffset; | |||||
| 2058 | } | |||||
| 2059 | } | |||||
| 2060 | ||||||
| 2061 | function B SSCHidePop upWindow() | |||||
| 2062 | { | |||||
| 2063 | if (window.g PopupWindo w != null) { | |||||
| 2064 | if ( gbBsNS4) { | |||||
| 2065 | if ((t ypeof wind ow.gPopupW indow != " undefined" ) && (!win dow.gPopup Window.clo sed)) { | |||||
| 2066 | window.g PopupWindo w.close(); | |||||
| 2067 | window.g PopupWindo w = null; | |||||
| 2068 | } | |||||
| 2069 | } | |||||
| 2070 | } | |||||
| 2071 | re turn; | |||||
| 2072 | } | |||||
| 2073 | ||||||
| 2074 | // Add the PopupOnCl ick to the onclick a rray. | |||||
| 2075 | if (typeof (BsscRegis terOnClick ) != "unde fined") | |||||
| 2076 | { | |||||
| 2077 | Bs scRegister OnClick(Bs PopupOnCli ck); | |||||
| 2078 | } | |||||
| 2079 | //End to s upport pre vious popu p function s | |||||
| 2080 | ||||||
| 2081 | /// Sectio n End - P opup (Java Script 1.0 ) | |||||
| 2082 | ||||||
| 2083 | /// Sectio n Begin - Embedded S tub (JavaS cript 1.0) | |||||
| 2084 | ||||||
| 2085 | function B SSCCreateP opupDiv() | |||||
| 2086 | { | |||||
| 2087 | re turn; | |||||
| 2088 | } | |||||
| 2089 | ||||||
| 2090 | function W ritePopupM enuLayer() | |||||
| 2091 | { | |||||
| 2092 | if (BsscHasE xtJs()) {_ WritePopup MenuLayer( );} | |||||
| 2093 | } | |||||
| 2094 | ||||||
| 2095 | function B SSCPopup(s trURL, wid th, height ) | |||||
| 2096 | { | |||||
| 2097 | va r re = new RegExp("' ", 'g'); | |||||
| 2098 | st rURL = str URL.replac e(re, "%27 "); | |||||
| 2099 | ||||||
| 2100 | if (BsscHasE xtJs()) { | |||||
| 2101 | _BSS CPopup(str URL, width , height); | |||||
| 2102 | }e lse{ | |||||
| 2103 | //Cr eate a tem porary win dow first to ensure the real p opup comes up on top | |||||
| 2104 | var wndTemp = null; | |||||
| 2105 | if ( !gbBsNS3) { | |||||
| 2106 | wndTem p = window .open("", "temp", "t itlebar=no ,toolbar=n o,status=n o,location =no,menuba r=no,resiz able=yes,s crollbars= yes,height =3,width=4 "); | |||||
| 2107 | } | |||||
| 2108 | // C reate the real popup window | |||||
| 2109 | var wndPopup = window.op en(strURL, "BSSCPopu p", "title bar=no,too lbar=no,st atus=no,lo cation=no, menubar=no ,resizable =yes,scrol lbars=yes, height=300 ,width=400 "); | |||||
| 2110 | // C lose the t emporary | |||||
| 2111 | if ( !gbBsNS3) { | |||||
| 2112 | wndTem p.close(); | |||||
| 2113 | } el se { | |||||
| 2114 | wndPop up.focus() ; | |||||
| 2115 | } | |||||
| 2116 | } | |||||
| 2117 | } | |||||
| 2118 | ||||||
| 2119 | var gbWndT emp = null , gbWndPop upLinks = null; | |||||
| 2120 | var gbstrP araTotal = ""; | |||||
| 2121 | ||||||
| 2122 | function P opupMenu_I nvoke() | |||||
| 2123 | { | |||||
| 2124 | if (typeof(w fRelatedTo pic) == 'f unction' & & typeof(I sFlashSupp orted) == 'function' ) | |||||
| 2125 | { | |||||
| 2126 | if ( Number(gsS kinVersion ) > 2 && I sFlashSupp orted()) | |||||
| 2127 | { | |||||
| 2128 | return wfRelated Topic(Popu pMenu_Invo ke.argumen ts); | |||||
| 2129 | } | |||||
| 2130 | } | |||||
| 2131 | if (BsscHasE xtJs()) { | |||||
| 2132 | retu rn _PopupM enu_Invoke (PopupMenu _Invoke.ar guments); | |||||
| 2133 | } | |||||
| 2134 | if (gbBsNS3B efore || g bBsIE3Befo re ) { | |||||
| 2135 | var argLen = PopupM enu_Invoke .arguments .length; | |||||
| 2136 | if ( argLen < 5 ) { | |||||
| 2137 | window .document. location.h ref = Popu pMenu_Invo ke.argumen ts[3]; | |||||
| 2138 | return false; | |||||
| 2139 | } | |||||
| 2140 | gbWn dTemp = nu ll; | |||||
| 2141 | gbWn dPopupLink s = null; | |||||
| 2142 | gbst rParaTotal = ""; | |||||
| 2143 | for (var i = 0 ; i < (arg Len - 2) / 2; i++) { | |||||
| 2144 | var st rParaLine = ""; | |||||
| 2145 | if (gb BsNS2){ | |||||
| 2146 | strParaL ine += "<a href=\""; | |||||
| 2147 | strParaL ine += Pop upMenu_Inv oke.argume nts[2 * i + 3]; | |||||
| 2148 | strParaL ine += "\" >" | |||||
| 2149 | strParaL ine += Pop upMenu_Inv oke.argume nts[2 * i + 2]; | |||||
| 2150 | strParaL ine += "</ a>"; | |||||
| 2151 | } else { | |||||
| 2152 | strParaL ine += "<a href=\"ja vascript:" ; | |||||
| 2153 | strParaL ine += "go toUrl(\'"; | |||||
| 2154 | strParaL ine += Pop upMenu_Inv oke.argume nts[2 * i + 3]; | |||||
| 2155 | strParaL ine += "\' );\""; | |||||
| 2156 | if (Popu pMenu_Invo ke.argumen ts[1] != ' ') { | |||||
| 2157 | strParaLin e += " TAR GET='" + P opupMenu_I nvoke.argu ments[1] + "'"; | |||||
| 2158 | } | |||||
| 2159 | strParaL ine += ">" ; | |||||
| 2160 | strParaL ine += Pop upMenu_Inv oke.argume nts[2 * i + 2]; | |||||
| 2161 | strParaL ine += "</ a>"; | |||||
| 2162 | } | |||||
| 2163 | strPar aLine += " <br>"; | |||||
| 2164 | gbstrP araTotal + = strParaL ine; | |||||
| 2165 | } | |||||
| 2166 | var nHeight = argLen * 1 5; | |||||
| 2167 | var nWidth = 4 00; | |||||
| 2168 | var strParam = "titlebar =no,toolba r=no,statu s=no,locat ion=no,men ubar=no,re sizable=ye s,scrollba rs=auto"; | |||||
| 2169 | strP aram += ", height=" + nHeight + ",width=2 00,resizab le"; | |||||
| 2170 | ||||||
| 2171 | //Cr eate a tem porary win dow first to ensure the real p opup comes up on top | |||||
| 2172 | //va r wndTemp = null; | |||||
| 2173 | if ( !gbBsNS3) { | |||||
| 2174 | gbWndT emp = wind ow.open("" , "temp", "titlebar= no,toolbar =no,status =no,locati on=no,menu bar=no,res izable=yes ,scrollbar s=yes,heig ht=3,width =4"); | |||||
| 2175 | } | |||||
| 2176 | gbWn dPopupLink s = window .open("", "popuplink s", strPar am); | |||||
| 2177 | ||||||
| 2178 | setT imeout("Wa it_PopupMe nuReady()" , 100); | |||||
| 2179 | } | |||||
| 2180 | re turn true; | |||||
| 2181 | } | |||||
| 2182 | ||||||
| 2183 | function W ait_PopupM enuReady() | |||||
| 2184 | { | |||||
| 2185 | if (gbWndPop upLinks != null && " object" == typeof(gb WndPopupLi nks.docume nt)) { | |||||
| 2186 | Popu pMenu_Invo keReady(); | |||||
| 2187 | } | |||||
| 2188 | el se | |||||
| 2189 | setT imeout("Wa it_PopupMe nuReady()" , 100); | |||||
| 2190 | } | |||||
| 2191 | ||||||
| 2192 | function P opupMenu_I nvokeReady () | |||||
| 2193 | { | |||||
| 2194 | if (gbWndPop upLinks != null) { | |||||
| 2195 | gbWn dPopupLink s.document .open("tex t/html"); | |||||
| 2196 | gbWn dPopupLink s.document .write("<h tml><head> "); | |||||
| 2197 | if ( gbBsNS2) { | |||||
| 2198 | gbWndP opupLinks. document.w rite("<bas e href=\"" + locatio n +"\">"); | |||||
| 2199 | } el se { | |||||
| 2200 | //YJ: IE301,302 and NS3.x works fine | |||||
| 2201 | gbWndP opupLinks. document.w rite("<"); | |||||
| 2202 | gbWndP opupLinks. document.w rite("scri pt>"); | |||||
| 2203 | gbWndP opupLinks. document.w rite("func tion gotoU rl(aUrl) { opener.win dow.locati on=aUrl; c lose();}") ; | |||||
| 2204 | gbWndP opupLinks. document.w rite("<"); | |||||
| 2205 | gbWndP opupLinks. document.w rite("/scr ipt>"); | |||||
| 2206 | } | |||||
| 2207 | gbWn dPopupLink s.document .write("<" ); | |||||
| 2208 | gbWn dPopupLink s.document .write("/h ead>"); | |||||
| 2209 | gbWn dPopupLink s.document .write("<b ody onBlur =\'self.fo cus();\'>" ); | |||||
| 2210 | gbWn dPopupLink s.document .write(gbs trParaTota l); | |||||
| 2211 | gbWn dPopupLink s.document .write("</ body></htm l>"); | |||||
| 2212 | gbWn dPopupLink s.document .close(); | |||||
| 2213 | ||||||
| 2214 | // C lose the t emporary | |||||
| 2215 | if ( !gbBsNS3 & & gbWndTem p != null) { | |||||
| 2216 | gbWndT emp.close( ); | |||||
| 2217 | }els e { | |||||
| 2218 | gbWndP opupLinks. focus(); | |||||
| 2219 | } | |||||
| 2220 | ||||||
| 2221 | retu rn true; | |||||
| 2222 | } | |||||
| 2223 | re turn false ; | |||||
| 2224 | } | |||||
| 2225 | ||||||
| 2226 | /// Sectio n End - Em bedded Stu b (JavaScr ipt 1.0) | |||||
| 2227 | ||||||
| 2228 | //// Segme nt End -- (JavaScrip t 1.0) | |||||
| 2229 | ||||||
| 2230 | //// Segme nt Begin - - (JavaScr ipt 1.2) | |||||
| 2231 | /// Sectio n Begin - DHTM (Jav aScript 1. 2) | |||||
| 2232 | ||||||
| 2233 | //Begin to support e xtended an d dropdown text effe cts. | |||||
| 2234 | function I sParagraph (el) | |||||
| 2235 | { | |||||
| 2236 | re turn( el.t agName == "P" || el. tagName.in dexOf("H") == 0 ) ? true : fal se; | |||||
| 2237 | } | |||||
| 2238 | ||||||
| 2239 | //Begin to support e xtended an d dropdown text effe cts. | |||||
| 2240 | function k adovIsPara graph(el) | |||||
| 2241 | { | |||||
| 2242 | re turn IsPar agraph(el) ; | |||||
| 2243 | } | |||||
| 2244 | ||||||
| 2245 | ||||||
| 2246 | function I nitEachChi ld(el) | |||||
| 2247 | { | |||||
| 2248 | fo r(var i=0; i<getChil dNodes(el) .length; i ++) | |||||
| 2249 | { | |||||
| 2250 | var child = ge tChildNode s(el)[i]; | |||||
| 2251 | if( child.tagN ame == "SC RIPT" || c hild.tagNa me == "!" ) | |||||
| 2252 | contin ue; | |||||
| 2253 | ||||||
| 2254 | if( child.id ! = "" ) | |||||
| 2255 | { | |||||
| 2256 | // to wipe out t he onload effects | |||||
| 2257 | if (gb BsIE4&&!gb BsMac) | |||||
| 2258 | { | |||||
| 2259 | var onLo adEffect = getAttrib ute(child. style, "x- on-pageloa d" ); | |||||
| 2260 | if( (onL oadEffect != null) & & (onLoadE ffect > "" ) ) | |||||
| 2261 | setAttribu te(child.s tyle, "x-o n-pageload ", "" ); | |||||
| 2262 | } | |||||
| 2263 | ||||||
| 2264 | var hr ef = getAt tribute(ch ild,"href" ); | |||||
| 2265 | if( hr ef != null && href > "" && hre f.indexOf( "BSSCPopu p" ) >= 0 ) | |||||
| 2266 | FilePopu pInit(chil d.id); // Init for P opup | |||||
| 2267 | else i f( child.c lassName = = "dropspo t" || chil d.classNam e == "expa ndspot" || | |||||
| 2268 | child.cla ssName == "glossterm " ) | |||||
| 2269 | TextPopu pInit(chil d.id);// I nit for Ex panding/Gl ossary or DropDown t ext | |||||
| 2270 | else i f( child.c lassName = = "trigger ") | |||||
| 2271 | InitTrig ger(child. id);// Ini t for Trig ger | |||||
| 2272 | else | |||||
| 2273 | { | |||||
| 2274 | InitEffe cts(child. id);// Ini t for DHTM L effects | |||||
| 2275 | CEngine. SetOneTarg etInitialS tate( chil d.id ); | |||||
| 2276 | } | |||||
| 2277 | } | |||||
| 2278 | ||||||
| 2279 | if( (child.tag Name == "I MG") && (g etAttribut e(child,"d ynsrc") > "") ) | |||||
| 2280 | child. start = "m ouseover"; // to star t a AVI fi le. fileop en doesn't work | |||||
| 2281 | ||||||
| 2282 | Init EachChild( child); | |||||
| 2283 | } | |||||
| 2284 | } | |||||
| 2285 | ||||||
| 2286 | function k adovInitEa chChild(el ) | |||||
| 2287 | { | |||||
| 2288 | In itEachChil d(el); | |||||
| 2289 | } | |||||
| 2290 | ||||||
| 2291 | function R etrieveTex tInner(el) | |||||
| 2292 | { | |||||
| 2293 | va r x = ""; | |||||
| 2294 | if ( (!el) || (el.tagNa me == "!") || (el.ta gName == " SCRIPT" )) | |||||
| 2295 | retu rn x; | |||||
| 2296 | ||||||
| 2297 | if ( IsParagr aph(el) ) | |||||
| 2298 | { | |||||
| 2299 | var strNewID = " "; | |||||
| 2300 | if( el.id != " " ) | |||||
| 2301 | strNew ID += "id= " + el.id + "_NewSpa n "; | |||||
| 2302 | x = "<span" + strNewID + "style='" + el.styl e.cssText + "'>" + e l.innerHTM L + "</spa n>"; | |||||
| 2303 | } | |||||
| 2304 | el se | |||||
| 2305 | { | |||||
| 2306 | for( var i=0; i <getChildN odes(el).l ength; i++ ) | |||||
| 2307 | x += R etrieveTex tInner( ge tChildNode s(el)[i] ) ; | |||||
| 2308 | } | |||||
| 2309 | re turn x; | |||||
| 2310 | } | |||||
| 2311 | ||||||
| 2312 | function k adovRetrie veTextInne r(el) | |||||
| 2313 | { | |||||
| 2314 | re turn Retr ieveTextIn ner(el); | |||||
| 2315 | } | |||||
| 2316 | ||||||
| 2317 | function R etrieveCle anHTML( st rRawHTML, strTagOpen , strTagCl ose, nDist ance ) | |||||
| 2318 | { | |||||
| 2319 | va r nTagOpen = strRawH TML.indexO f( strTagO pen, 0 ); | |||||
| 2320 | if ( nTagOpen < 0 ) | |||||
| 2321 | retu rn strRawH TML; | |||||
| 2322 | ||||||
| 2323 | va r nTagClos e = strRaw HTML.index Of( strTag Close, nTa gOpen); | |||||
| 2324 | if ( nTagClos e < nTagOp en ) | |||||
| 2325 | retu rn strRawH TML; | |||||
| 2326 | ||||||
| 2327 | if ( typeof(n Distance) == "number " && nDist ance > 0 ) | |||||
| 2328 | if( (nTagClose - nTagOpe n) != nDis tance ) | |||||
| 2329 | return strRawHTM L; | |||||
| 2330 | ||||||
| 2331 | va r strClean Once = str RawHTML.su bstring(0, nTagOpen) + strRawH TML.substr (nTagClose + strTagC lose.lengt h) ; | |||||
| 2332 | re turn Retr ieveCleanH TML( strCl eanOnce, s trTagOpen, strTagClo se ); | |||||
| 2333 | } | |||||
| 2334 | ||||||
| 2335 | function k adovRetrie veCleanHTM L( strRawH TML, strTa gOpen, str TagClose, nDistance ) | |||||
| 2336 | { | |||||
| 2337 | re turn Retri eveCleanHT ML( strRaw HTML, strT agOpen, st rTagClose, nDistance ); | |||||
| 2338 | } | |||||
| 2339 | ||||||
| 2340 | function A djustObjec tTag(strRa wHTML, nSt artPos) | |||||
| 2341 | {// adjust object ta g for rela ted topics HTML cont rol, becau se innerHT ML misses out the it em setting s | |||||
| 2342 | ||||||
| 2343 | // Is there a ny DTC? | |||||
| 2344 | va r strDTCTa gOpen = '< !--Metadat a type="De signerCont rol" start span'; | |||||
| 2345 | va r strDTCTa gClose = ' <!--Metada ta type="D esignerCon trol" ends pan-->'; | |||||
| 2346 | va r nDTCTagO pen = strR awHTML.ind exOf( strD TCTagOpen, nStartPos ); | |||||
| 2347 | if ( nDTCTagO pen < 0 ) | |||||
| 2348 | retu rn strRawH TML; | |||||
| 2349 | va r nDTCTagC lose = str RawHTML.in dexOf( str DTCTagClos e, nDTCTag Open ); | |||||
| 2350 | if ( nDTCTagC lose < nDT CTagOpen) | |||||
| 2351 | retu rn strRawH TML; // no Design Ti me Control s; | |||||
| 2352 | ||||||
| 2353 | // Is the DTC HTML Help Control? | |||||
| 2354 | va r strRTObj TagOpen = 'classid=c lsid:ADB88 0A6-D8FF-1 1CF-9377-0 0AA003B7A1 1'; | |||||
| 2355 | va r strRTObj TagClose = '</OBJECT >'; | |||||
| 2356 | va r nRTObjTa gOpen = st rRawHTML.i ndexOf( st rRTObjTagO pen, nDTCT agOpen ); | |||||
| 2357 | if ( nRTObjTa gOpen < nD TCTagOpen ) | |||||
| 2358 | retu rn strRawH TML; | |||||
| 2359 | va r nRTObjTa gClose = s trRawHTML. indexOf( s trRTObjTag Close, nRT ObjTagOpen ); | |||||
| 2360 | if ( nRTObjTa gClose < n RTObjTagOp en ) | |||||
| 2361 | retu rn strRawH TML; // is not a HTM L help con trol | |||||
| 2362 | ||||||
| 2363 | // Is it a r elated Top ics html h elp contro l? | |||||
| 2364 | va r strRTObj Label = '< PARAM NAME =\"Command \" VALUE=\ "Related T opics'; | |||||
| 2365 | if ( strRawHT ML.indexOf (strRTObjL abel, nRTO bjTagOpen) < 0 ) | |||||
| 2366 | retu rn strRawH TML; | |||||
| 2367 | ||||||
| 2368 | // does the commented object tag contain a items par ameters | |||||
| 2369 | va r strRTIte msOpen = ' <param nam e="Items" value="'; | |||||
| 2370 | va r strRTIte msClose = '$$**$$" > '; | |||||
| 2371 | va r strRTIte msClose2 = '$$**$$"> '; | |||||
| 2372 | ||||||
| 2373 | va r nRTItems Open = str RawHTML.in dexOf(strR TItemsOpen , nDTCTagO pen); | |||||
| 2374 | if ( nRTItems Open < nDT CTagOpen ) | |||||
| 2375 | retu rn strRawH TML; | |||||
| 2376 | va r nRTItems Close = st rRawHTML.i ndexOf(str RTItemsClo se, nRTIte msOpen); | |||||
| 2377 | if (nRTItems Close == - 1) | |||||
| 2378 | nRTI temsClose = strRawHT ML.indexOf (strRTItem sClose2, n RTItemsOpe n); | |||||
| 2379 | if ( nRTItems Close < nR TItemsOpen ) | |||||
| 2380 | retu rn strRawH TML; | |||||
| 2381 | ||||||
| 2382 | // found a i tems strin g | |||||
| 2383 | va r strItems = strRawH TML.substr ing( nRTIt emsOpen + strRTItems Open.lengt h, nRTItem sClose); | |||||
| 2384 | if ( strItems .length < 1 ) | |||||
| 2385 | retu rn strRawH TML; | |||||
| 2386 | ||||||
| 2387 | // to recons truct the item(s) pa ram tag(s) | |||||
| 2388 | va r strItems Array = st rItems.spl it('$$**$$ '); | |||||
| 2389 | if ( strItems Array.leng th < 1 ) | |||||
| 2390 | retu rn strRawH TML; | |||||
| 2391 | va r strRunTi meItemPara m = ""; | |||||
| 2392 | fo r( var i = 0; i < st rItemsArra y.length; i++ ) | |||||
| 2393 | { | |||||
| 2394 | strR unTimeItem Param += ' <PARAM NA ME="Item' + (i+1); | |||||
| 2395 | strR unTimeItem Param += ' "' + ' VA LUE="'; | |||||
| 2396 | strR unTimeItem Param += s trItemsArr ay[i]; | |||||
| 2397 | strR unTimeItem Param += ' ">'; | |||||
| 2398 | } | |||||
| 2399 | ||||||
| 2400 | // to insert the recon structed i tem params into runt ime object tag | |||||
| 2401 | va r strAdjus tedHTML = strRawHTML .substring (0,nRTObjT agClose) + strRunTim eItemParam + strRawH TML.substr ing(nRTObj TagClose, strRawHTML .length); | |||||
| 2402 | re turn Adjus tObjectTag (strAdjust edHTML, nD TCTagClose + strDTCT agClose.le ngth); | |||||
| 2403 | } | |||||
| 2404 | ||||||
| 2405 | function k adovAdjust ObjectTag( strRawHTML , nStartPo s) | |||||
| 2406 | {// adjust object ta g for rela ted topics HTML cont rol, becau se innerHT ML misses out the it em setting s | |||||
| 2407 | return Ad justObject Tag(strRaw HTML, nSta rtPos); | |||||
| 2408 | } | |||||
| 2409 | ||||||
| 2410 | function T extPopupOn Load( el ) | |||||
| 2411 | { | |||||
| 2412 | if ( typeof(e l) == "str ing" ) | |||||
| 2413 | el = getElemen t(el); | |||||
| 2414 | va r src = nu ll; | |||||
| 2415 | if (el.id) | |||||
| 2416 | { | |||||
| 2417 | for (var i=0;i <gPopupDat a.length;i ++) | |||||
| 2418 | if (gP opupData[i ].el==el.i d) | |||||
| 2419 | { | |||||
| 2420 | src=gPop upData[i]. popupId; | |||||
| 2421 | break; | |||||
| 2422 | } | |||||
| 2423 | } | |||||
| 2424 | if (!src) | |||||
| 2425 | retu rn 0; | |||||
| 2426 | ||||||
| 2427 | va r name = s rc; | |||||
| 2428 | if ( src.subs tr(0,1) == "#" ) | |||||
| 2429 | name = src.sub str(1, src .length-1) ; | |||||
| 2430 | va r srcDiv = getElemen t(name); | |||||
| 2431 | if ( !srcDiv ) | |||||
| 2432 | retu rn 1; | |||||
| 2433 | ||||||
| 2434 | // srcDiv.sty le.display = "none"; | |||||
| 2435 | re turn 0; | |||||
| 2436 | } | |||||
| 2437 | function k adovTextPo pupOnLoad( el ) | |||||
| 2438 | { | |||||
| 2439 | re turn TextP opupOnLoad ( el ); | |||||
| 2440 | } | |||||
| 2441 | function g etElements ByTag(obj, sTagName) | |||||
| 2442 | { | |||||
| 2443 | if (obj.getEl ementsByTa gName) | |||||
| 2444 | retu rn obj.get ElementsBy TagName(sT agName); | |||||
| 2445 | el se if(obj. all) | |||||
| 2446 | retu rn obj.all .tags(sTag Name); | |||||
| 2447 | re turn null; | |||||
| 2448 | } | |||||
| 2449 | ||||||
| 2450 | function g etElement( sID) | |||||
| 2451 | { | |||||
| 2452 | if (document. getElement ById) | |||||
| 2453 | retu rn documen t.getEleme ntById(sID ); | |||||
| 2454 | el se if(docu ment.all) | |||||
| 2455 | retu rn documen t.all(sID) ; | |||||
| 2456 | re turn null; | |||||
| 2457 | } | |||||
| 2458 | ||||||
| 2459 | function g etParentNo de(obj) | |||||
| 2460 | { | |||||
| 2461 | if (obj.paren tNode) | |||||
| 2462 | retu rn obj.par entNode; | |||||
| 2463 | el se if(obj. parentElem ent) | |||||
| 2464 | retu rn obj.par entElement ; | |||||
| 2465 | re turn null; | |||||
| 2466 | } | |||||
| 2467 | ||||||
| 2468 | function g etChildNod es(obj) | |||||
| 2469 | { | |||||
| 2470 | if (obj.child Nodes) | |||||
| 2471 | { | |||||
| 2472 | var children = new Array (); | |||||
| 2473 | for (var i = 0 ; i < obj. childNodes .length; i ++) | |||||
| 2474 | { | |||||
| 2475 | if (ob j.childNod es[i].node Type == 1) | |||||
| 2476 | children [children. length] = obj.childN odes[i]; | |||||
| 2477 | } | |||||
| 2478 | retu rn childre n; | |||||
| 2479 | } | |||||
| 2480 | el se if(obj. children) | |||||
| 2481 | retu rn obj.chi ldren; | |||||
| 2482 | re turn null; | |||||
| 2483 | } | |||||
| 2484 | ||||||
| 2485 | function r emoveThis( obj) | |||||
| 2486 | { | |||||
| 2487 | if (obj.paren tNode) | |||||
| 2488 | obj. parentNode .removeChi ld(obj); | |||||
| 2489 | el se | |||||
| 2490 | obj. outerHTML= ""; | |||||
| 2491 | } | |||||
| 2492 | ||||||
| 2493 | function T extPopup( el ) | |||||
| 2494 | { | |||||
| 2495 | if (!gbBsIE4 && !gbBsO pera7 && ! gbBsSafari && !gbBsN S6 && !gbB sKonqueror 3 ) | |||||
| 2496 | retu rn; | |||||
| 2497 | ||||||
| 2498 | if (window.e vent) | |||||
| 2499 | wind ow.event.c ancelBubbl e = true; | |||||
| 2500 | ||||||
| 2501 | if ( typeof(e l) == "str ing" ) | |||||
| 2502 | el = getElemen t(el); | |||||
| 2503 | ||||||
| 2504 | if (!el||el= =window) | |||||
| 2505 | retu rn; | |||||
| 2506 | ||||||
| 2507 | fo r(var i=0; i<getChil dNodes(el) .length; i ++) | |||||
| 2508 | { | |||||
| 2509 | var child = ge tChildNode s(el)[i]; | |||||
| 2510 | if( child && ( child.tagN ame == "IM G") ) | |||||
| 2511 | { | |||||
| 2512 | if(chi ld.classNa me == "Twi sties") | |||||
| 2513 | { | |||||
| 2514 | if( chil d.style && (child.st yle.displa y == "") ) | |||||
| 2515 | child.styl e.display = "none"; | |||||
| 2516 | else if( child.styl e) | |||||
| 2517 | child.styl e.display = ""; | |||||
| 2518 | } | |||||
| 2519 | } | |||||
| 2520 | ||||||
| 2521 | if( child && ( child.tagN ame == "SP AN") ) | |||||
| 2522 | { | |||||
| 2523 | if(chi ld.classNa me == "MTT ext") | |||||
| 2524 | { | |||||
| 2525 | if( chil d.style && (child.st yle.displa y == "") ) | |||||
| 2526 | child.styl e.display = "none"; | |||||
| 2527 | else if( child.styl e) | |||||
| 2528 | child.styl e.display = ""; | |||||
| 2529 | } | |||||
| 2530 | } | |||||
| 2531 | } | |||||
| 2532 | ||||||
| 2533 | va r src = nu ll; | |||||
| 2534 | if (!src&&el. id) | |||||
| 2535 | { | |||||
| 2536 | for (var i=0;i <gPopupDat a.length;i ++) | |||||
| 2537 | if (gP opupData[i ].el==el.i d) | |||||
| 2538 | { | |||||
| 2539 | src=gPop upData[i]. popupId; | |||||
| 2540 | break; | |||||
| 2541 | } | |||||
| 2542 | } | |||||
| 2543 | if (!src) | |||||
| 2544 | retu rn; | |||||
| 2545 | ||||||
| 2546 | va r name = s rc; | |||||
| 2547 | if ( src.subs tr(0,1) == "#" ) | |||||
| 2548 | na me = src.s ubstr(1, s rc.length- 1); | |||||
| 2549 | ||||||
| 2550 | va r srcDiv = getElemen t(name); | |||||
| 2551 | if ( !srcDiv ) | |||||
| 2552 | retu rn; | |||||
| 2553 | ||||||
| 2554 | if ( srcDiv ) | |||||
| 2555 | { | |||||
| 2556 | if( srcDiv.sty le.display == "" ) | |||||
| 2557 | srcDiv .style.dis play = "no ne"; | |||||
| 2558 | else | |||||
| 2559 | { | |||||
| 2560 | if(src Div.classN ame == "ex pandtext") | |||||
| 2561 | { | |||||
| 2562 | var inne r = Retrie veTextInne r(srcDiv); | |||||
| 2563 | if( inne r == "" ) | |||||
| 2564 | inner = sr cDiv.inner HTML; | |||||
| 2565 | if(inner .indexOf(" ") ! = 0 && inn er.indexOf (" ") != 0 && inner. indexOf("& #160;")) | |||||
| 2566 | { | |||||
| 2567 | //insertAd jacentHTML (srcDiv, ' afterBegin ', " " ); | |||||
| 2568 | try | |||||
| 2569 | { | |||||
| 2570 | if (srcDiv.ch ildNodes) | |||||
| 2571 | { | |||||
| 2572 | var firstChild = srcDiv. childNodes [0]; | |||||
| 2573 | var newText = document.c reateTextN ode(" "); | |||||
| 2574 | srcD iv.insertB efore(newT ext, first Child); | |||||
| 2575 | } | |||||
| 2576 | } | |||||
| 2577 | catch(e) | |||||
| 2578 | { | |||||
| 2579 | } | |||||
| 2580 | } | |||||
| 2581 | } | |||||
| 2582 | ||||||
| 2583 | srcDiv .style.dis play = ""; | |||||
| 2584 | } | |||||
| 2585 | } | |||||
| 2586 | if (gbBsIE4) | |||||
| 2587 | even t.returnVa lue=false; | |||||
| 2588 | re turn; | |||||
| 2589 | } | |||||
| 2590 | ||||||
| 2591 | function k adovTextPo pup( el ) | |||||
| 2592 | { | |||||
| 2593 | Te xtPopup( e l ); | |||||
| 2594 | } | |||||
| 2595 | ||||||
| 2596 | function F indParentP aragraph( el ) | |||||
| 2597 | { | |||||
| 2598 | if ( typeof(e l) == "str ing" ) | |||||
| 2599 | el = getElemen t(el); | |||||
| 2600 | if ( (!el) || el.tagNam e == "BODY " ) | |||||
| 2601 | retu rn null; | |||||
| 2602 | if ( IsParagr aph(getPar entNode(el )) ) | |||||
| 2603 | retu rn getPare ntNode(el) ; | |||||
| 2604 | el se | |||||
| 2605 | retu rn FindPar entParagra ph( getPar entNode(el ) ); | |||||
| 2606 | } | |||||
| 2607 | ||||||
| 2608 | function k adovFindPa rentParagr aph( el ) | |||||
| 2609 | { | |||||
| 2610 | re turn FindP arentParag raph( el ) ; | |||||
| 2611 | } | |||||
| 2612 | ||||||
| 2613 | //Begin HT ML code in voked func tion | |||||
| 2614 | function R egisterEve ntHandler( obj, strE vent, strE ventHandle r ) | |||||
| 2615 | { | |||||
| 2616 | CC SSP.Regist erEventHan dler( obj, strEvent, strEventH andler ); | |||||
| 2617 | } | |||||
| 2618 | ||||||
| 2619 | function k adovRegist erEventHan dler( obj, strEvent, strEventH andler ) | |||||
| 2620 | { | |||||
| 2621 | RegisterE ventHandle r( obj, st rEvent, st rEventHand ler ); | |||||
| 2622 | } | |||||
| 2623 | ||||||
| 2624 | ||||||
| 2625 | function t extPopupDa ta(el, pop upId) | |||||
| 2626 | { | |||||
| 2627 | th is.el = el ; | |||||
| 2628 | th is.popupId = "#"+pop upId; | |||||
| 2629 | } | |||||
| 2630 | ||||||
| 2631 | var gPopup Data = new Array(); | |||||
| 2632 | ||||||
| 2633 | function T extPopupIn it( el, po pupId) | |||||
| 2634 | { | |||||
| 2635 | if (!gbBsIE4 && !gbBsO pera7 && ! gbBsSafari && !gbBsN S6 && !gbB sKonqueror 3) | |||||
| 2636 | retu rn; | |||||
| 2637 | ||||||
| 2638 | if ( typeof(e l) == "str ing" ) | |||||
| 2639 | { | |||||
| 2640 | if ( popupId) | |||||
| 2641 | { | |||||
| 2642 | gPopup Data[gPopu pData.leng th]=new te xtPopupDat a(el, popu pId); | |||||
| 2643 | } | |||||
| 2644 | el = getElemen t(el); | |||||
| 2645 | } | |||||
| 2646 | ||||||
| 2647 | if ( el != nu ll ) | |||||
| 2648 | { | |||||
| 2649 | CCSS P.Register EventHandl er( el, "o nclick", " TextPopup( \"" + el.i d +"\");" ); | |||||
| 2650 | CCSS P.Register EventHandl er( window , "onload" , "TextPop upOnLoad(\ "" + el.id +"\");" ) ; | |||||
| 2651 | } | |||||
| 2652 | } | |||||
| 2653 | ||||||
| 2654 | function k adovTextPo pupInit( e l, popupId ) | |||||
| 2655 | { | |||||
| 2656 | re turn TextP opupInit( el, popupI d); | |||||
| 2657 | } | |||||
| 2658 | //End HTML code invo ked functi on | |||||
| 2659 | ||||||
| 2660 | //End to s upport ext ended and dropdown t ext effect s. | |||||
| 2661 | ||||||
| 2662 | //Begin to convert i Write form at to Robo Editor For mat for DH TML effect s | |||||
| 2663 | function I nitTrigger sInHead( ) | |||||
| 2664 | { | |||||
| 2665 | if( Obje ct.xDelaye dInitEleme nts ) | |||||
| 2666 | { | |||||
| 2667 | var x = Object. xDelayedIn itElements ; | |||||
| 2668 | for(i =0; i<x.le ngth; i++) | |||||
| 2669 | In itTrigger( x[i] ); | |||||
| 2670 | } | |||||
| 2671 | } | |||||
| 2672 | ||||||
| 2673 | function k adovInitTr iggersInHe ad( ) | |||||
| 2674 | { | |||||
| 2675 | In itTriggers InHead( ); | |||||
| 2676 | } | |||||
| 2677 | ||||||
| 2678 | //Begin HT ML code in voked func tion | |||||
| 2679 | function F ilePopupIn it( el ) | |||||
| 2680 | { | |||||
| 2681 | if ( typeof(e l) == "str ing" ) | |||||
| 2682 | el = getElemen t(el); | |||||
| 2683 | ||||||
| 2684 | if ( el != nu ll ) | |||||
| 2685 | CCSS P.Register EventHandl er( el, "o nmouseover ", "BSPSPo pupOnMouse Over(event );" ); | |||||
| 2686 | } | |||||
| 2687 | function k adovFilePo pupInit( e l ) | |||||
| 2688 | { | |||||
| 2689 | Fi lePopupIni t( el ); | |||||
| 2690 | } | |||||
| 2691 | ||||||
| 2692 | function I nitTrigger ( element, a_targets ) | |||||
| 2693 | { | |||||
| 2694 | // if ( !gbBsIE4 ) | |||||
| 2695 | // retu rn; | |||||
| 2696 | va r srcEleme nt = eleme nt; | |||||
| 2697 | if ( typeof(s rcElement) == "strin g" ) | |||||
| 2698 | { | |||||
| 2699 | srcE lement = g etElement( element,0) ; | |||||
| 2700 | if(s rcElement == null) | |||||
| 2701 | return ; | |||||
| 2702 | } | |||||
| 2703 | ||||||
| 2704 | // if( !IsPar entVisible (srcElemen t) ) | |||||
| 2705 | // retu rn; | |||||
| 2706 | ||||||
| 2707 | va r targets = null; | |||||
| 2708 | if (typeof(a_ targets) ! = "undefin ed") | |||||
| 2709 | targ ets = a_ta rgets; | |||||
| 2710 | if (!targets) | |||||
| 2711 | targ ets = getA ttribute(s rcElement, "x-target s" ); | |||||
| 2712 | if (!targets ) | |||||
| 2713 | targ ets = getA ttribute(s rcElement. style,"x-t argets"); | |||||
| 2714 | if (!targets ) | |||||
| 2715 | retu rn; | |||||
| 2716 | va r arrOneTa rget = tar gets.split ( "," ); | |||||
| 2717 | fo r( var i = 0; i < ar rOneTarget .length; i ++ ) | |||||
| 2718 | bssc FXInit( el ement, arr OneTarget[ i], null, null, null , null ); | |||||
| 2719 | } | |||||
| 2720 | ||||||
| 2721 | function k adovInitTr igger( ele ment ) | |||||
| 2722 | { | |||||
| 2723 | In itTrigger( element ) | |||||
| 2724 | } | |||||
| 2725 | ||||||
| 2726 | function I sParentVis ible( el ) | |||||
| 2727 | { | |||||
| 2728 | if ( typeof(e l) == "str ing" ) | |||||
| 2729 | el = getElemen t(el); | |||||
| 2730 | if ( (!el) || el.tagNam e == "BODY " ) | |||||
| 2731 | retu rn true; | |||||
| 2732 | if ( el.style .display = = 'none' ) //el.visi bility == 'hidden' | | | |||||
| 2733 | retu rn false; | |||||
| 2734 | el se | |||||
| 2735 | retu rn IsParen tVisible( getParentN ode(el) ); | |||||
| 2736 | } | |||||
| 2737 | ||||||
| 2738 | function k adovIsPare ntVisible( el ) | |||||
| 2739 | { | |||||
| 2740 | re turn IsPar entVisible ( el ); | |||||
| 2741 | } | |||||
| 2742 | function I nitEffects ( element, effectsLi st ) | |||||
| 2743 | { | |||||
| 2744 | // if( !gbBsI E4 ) | |||||
| 2745 | // retu rn; | |||||
| 2746 | va r srcEleme nt = eleme nt; | |||||
| 2747 | if ( typeof(s rcElement) == "strin g" ) | |||||
| 2748 | { | |||||
| 2749 | srcE lement = g etElement( element,0) ; | |||||
| 2750 | if(s rcElement == null) | |||||
| 2751 | return ; | |||||
| 2752 | } | |||||
| 2753 | ||||||
| 2754 | // if( !IsPar entVisible (srcElemen t) ) | |||||
| 2755 | // retu rn; | |||||
| 2756 | ||||||
| 2757 | if (effectsLi st) | |||||
| 2758 | { | |||||
| 2759 | //sr cElement.s etAttribut e("style", effectsLi st); | |||||
| 2760 | var str = effe ctsList; | |||||
| 2761 | var nStart = 0 ; | |||||
| 2762 | var indx = str .indexOf(" :", nStart ); | |||||
| 2763 | var effect = n ull; | |||||
| 2764 | var value = nu ll; | |||||
| 2765 | whil e(nStart > = 0 && ind x > 0 && i ndx < str. length) | |||||
| 2766 | { | |||||
| 2767 | effect = effects List.subst r(nStart, indx-nStar t); | |||||
| 2768 | var in dx2 = str. indexOf("; ", nStart) ; | |||||
| 2769 | if(ind x2 == -1) | |||||
| 2770 | indx2 = str.length ; | |||||
| 2771 | value = effectsL ist.substr (indx+1, i ndx2); | |||||
| 2772 | if(eff ect && val ue) | |||||
| 2773 | se tAttribute (srcElemen t,effect, value); | |||||
| 2774 | nStart = effects List.index Of("x-on", indx2+1); | |||||
| 2775 | indx = str.index Of(":", nS tart); | |||||
| 2776 | } | |||||
| 2777 | ||||||
| 2778 | } | |||||
| 2779 | ||||||
| 2780 | In itEffect( srcElement , "x-on-ho ver" ); | |||||
| 2781 | In itEffect( srcElement , "x-on-pa geclick" ) ; | |||||
| 2782 | In itEffect( srcElement , "x-on-pa geload" ); | |||||
| 2783 | In itEffect( srcElement , "x-on-tr igger-1" ) ; | |||||
| 2784 | In itEffect( srcElement , "x-on-tr igger-2" ) ; | |||||
| 2785 | } | |||||
| 2786 | ||||||
| 2787 | function k adovInitEf fects( ele ment ) | |||||
| 2788 | { | |||||
| 2789 | In itEffects( element ) ; | |||||
| 2790 | } | |||||
| 2791 | //End HTML code invo ked functi on | |||||
| 2792 | ||||||
| 2793 | function I nitEffect( element, prop ) | |||||
| 2794 | { | |||||
| 2795 | va r values = null; | |||||
| 2796 | if ( getAttri bute(eleme nt,prop)) | |||||
| 2797 | valu es = getAt tribute(el ement, pro p ); | |||||
| 2798 | el se if( get Attribute( element, "currentSt yle" ) && element.c urrentStyl e.getAttri bute) | |||||
| 2799 | valu es = eleme nt.current Style.getA ttribute( prop ); | |||||
| 2800 | el se if (el ement.styl e.getAttri bute) | |||||
| 2801 | valu es = eleme nt.style.g etAttribut e( prop ); | |||||
| 2802 | ||||||
| 2803 | if ( !values ) | |||||
| 2804 | retu rn; | |||||
| 2805 | ||||||
| 2806 | va r function s = new Ar ray(); | |||||
| 2807 | va r nIdx = 0 , nStart = 0; | |||||
| 2808 | va r nNext = values.ind exOf( "\)" , 0); | |||||
| 2809 | wh ile( nNext >= 0 && n Next < val ues.length ) | |||||
| 2810 | { | |||||
| 2811 | func tions[nIdx ] = values .substr( n Start, nNe xt-nStart+ 1); | |||||
| 2812 | nSta rt = nNext + 1; | |||||
| 2813 | nIdx ++; | |||||
| 2814 | nNex t = values .indexOf( "\)", nSta rt); | |||||
| 2815 | } | |||||
| 2816 | ||||||
| 2817 | fo r( var i=0 ; i<functi ons.length ; i++) | |||||
| 2818 | { | |||||
| 2819 | var id = getAt tribute(el ement, "id " ); | |||||
| 2820 | var translated Prop = Tra nslateProp (prop); | |||||
| 2821 | ||||||
| 2822 | var lp = funct ions[i].in dexOf( "(" ); | |||||
| 2823 | var fnname = f unctions[i ].substrin g(0, lp); | |||||
| 2824 | var srcargs = functions[ i].substri ng(lp+1, f unctions[i ].length-1 ); | |||||
| 2825 | ||||||
| 2826 | var nClickTime s = 1; | |||||
| 2827 | var arrForClic kCount = s rcargs.spl it( "," ); | |||||
| 2828 | for( var j = 0 ; j < arrF orClickCou nt.length; j++ ) | |||||
| 2829 | {// to locate and get th e "clicks= 99" settin gs | |||||
| 2830 | var nP ageClick = arrForCli ckCount[j] .indexOf(" clicks"); | |||||
| 2831 | if( nP ageClick > = 0 ) | |||||
| 2832 | { | |||||
| 2833 | nPageCli ck = arrFo rClickCoun t[j].index Of("="); | |||||
| 2834 | if( nPag eClick > 0 ) | |||||
| 2835 | { | |||||
| 2836 | nClickTime s = arrFor ClickCount [j].substr ing( nPage Click + 1, arrForCli ckCount[j] .length) * 1; | |||||
| 2837 | break; | |||||
| 2838 | } | |||||
| 2839 | } | |||||
| 2840 | } | |||||
| 2841 | var args = src args; | |||||
| 2842 | if( j < arrFor ClickCount .length ) | |||||
| 2843 | {// to strip o ut the "cl icks=99" f rom the ar guments st ring | |||||
| 2844 | args = ""; | |||||
| 2845 | for( v ar k = 0; k < arrFor ClickCount .length; k ++ ) | |||||
| 2846 | { | |||||
| 2847 | if( k != j ) | |||||
| 2848 | { | |||||
| 2849 | args += ar rForClickC ount[k]; | |||||
| 2850 | if( k < ar rForClickC ount.lengt h - 1 ) | |||||
| 2851 | ar gs += ","; | |||||
| 2852 | } | |||||
| 2853 | } | |||||
| 2854 | } | |||||
| 2855 | bssc FXInit( nu ll, id, tr anslatedPr op, fnname , args, nC lickTimes ); | |||||
| 2856 | } | |||||
| 2857 | } | |||||
| 2858 | ||||||
| 2859 | function k adovInitEf fect( elem ent, prop ) | |||||
| 2860 | { | |||||
| 2861 | In itEffect( element, p rop ); | |||||
| 2862 | } | |||||
| 2863 | ||||||
| 2864 | function T ranslatePr op( prop ) | |||||
| 2865 | { | |||||
| 2866 | sw itch( prop ) | |||||
| 2867 | { | |||||
| 2868 | ca se "x-on-h over" : return " bsschover" ; | |||||
| 2869 | ca se "x-on-p ageclick" : return " bsscpagecl ick"; | |||||
| 2870 | ca se "x-on-p ageload" : return " bsscpagelo ad"; | |||||
| 2871 | ca se "x-on-t rigger-1" : return " bssctrigge r1"; | |||||
| 2872 | ca se "x-on-t rigger-2" : return " bssctrigge r2"; | |||||
| 2873 | } | |||||
| 2874 | re turn null; | |||||
| 2875 | } | |||||
| 2876 | ||||||
| 2877 | function k adovTransl ateProp( p rop ) | |||||
| 2878 | { | |||||
| 2879 | re turn Trans lateProp( prop ); | |||||
| 2880 | } | |||||
| 2881 | ||||||
| 2882 | //End to c onvert iWr ite format to RoboEd itor Forma t for DHTM L effects | |||||
| 2883 | ||||||
| 2884 | //Begin th e definiti on of one entry to D HTML effec ts | |||||
| 2885 | function b sscFXInit( trigger_I D, target_ ID, event_ type, | |||||
| 2886 | ac tion_type, action_se tting, eve nt_addiona l ) | |||||
| 2887 | { | |||||
| 2888 | // if( typeof (target_ID ) != "stri ng" )//MUS T have a t arget_ID | |||||
| 2889 | // retu rn; // we don't supp ort Naviga tor yet | |||||
| 2890 | ||||||
| 2891 | if ( typeof(e vent_type) == "strin g" ) | |||||
| 2892 | even t_type = e vent_type. toLowerCas e(); | |||||
| 2893 | if ( typeof(a ction_type ) == "stri ng" ) | |||||
| 2894 | acti on_type = action_typ e.toLowerC ase(); | |||||
| 2895 | if ( typeof(a ction_sett ing) == "s tring" ) | |||||
| 2896 | act ion_settin g = action _setting.t oLowerCase (); | |||||
| 2897 | ||||||
| 2898 | // to get th e target e lement the n add it t o the targ et list | |||||
| 2899 | va r eleTarge t = CCSSP. GetObject( target_ID ); | |||||
| 2900 | if ( (eleTarg et != null ) && (even t_type != null) && ( action_typ e != null) ) | |||||
| 2901 | { | |||||
| 2902 | ||||||
| 2903 | CEng ine.AddOne Target( ta rget_ID, e leTarget ) ; | |||||
| 2904 | CEng ine.BuildT argetObjec t(target_I D, event_t ype, actio n_type, ac tion_setti ng, event_ addional); | |||||
| 2905 | } | |||||
| 2906 | ||||||
| 2907 | // to valida te the tri gger_ID pa rameter | |||||
| 2908 | if ( typeof(t rigger_ID) == "strin g" && trig ger_ID != "" ) | |||||
| 2909 | CEng ine.BuildT riggerObje ct( trigge r_ID, targ et_ID ); | |||||
| 2910 | } | |||||
| 2911 | //End the definition of one en try to DHT ML effects | |||||
| 2912 | ||||||
| 2913 | /// Sectio n End - D HTM (JavaS cript 1.2) | |||||
| 2914 | ||||||
| 2915 | /// Sectio n Begin - CCSSP DHT M (JavaScr ipt 1.2) | |||||
| 2916 | ||||||
| 2917 | //Begin Ja vaScript l ibary for cross-plat form posit ioning obj ect. | |||||
| 2918 | function C CSSP(){} / / construc tor of CCS SP class | |||||
| 2919 | ||||||
| 2920 | CCSSP.GetO bject = fu nction( ob j ) | |||||
| 2921 | {//convert object na me string or referen ce into a valid obje ct referen ce | |||||
| 2922 | if ( typeof(o bj) == "ob ject" ) | |||||
| 2923 | retu rn obj; | |||||
| 2924 | el se if( typ eof(obj) = = "string" && obj != "") | |||||
| 2925 | { | |||||
| 2926 | if ( gbBsNS6) | |||||
| 2927 | return get Element(ob j); | |||||
| 2928 | else if( gbBsN S4 ) | |||||
| 2929 | return eval("doc ument." + obj); | |||||
| 2930 | else | |||||
| 2931 | return eval("doc ument.all( \"" + obj + "\")"); | |||||
| 2932 | } | |||||
| 2933 | el se | |||||
| 2934 | retu rn null; | |||||
| 2935 | } | |||||
| 2936 | ||||||
| 2937 | CCSSP.Move ObjectTo = function( obj, x, y) | |||||
| 2938 | {//positio ning an ob ject at a specific p ixel coord inate | |||||
| 2939 | if ( gbBsNS4 && !gbBsNS 6) | |||||
| 2940 | obj. moveTo(x,y ); | |||||
| 2941 | el se | |||||
| 2942 | { | |||||
| 2943 | if ( x == '') | |||||
| 2944 | x = 0 ; | |||||
| 2945 | if (y == '') | |||||
| 2946 | y = 0 ; | |||||
| 2947 | obj.styl e.left = p arseInt(x) + 'px'; | |||||
| 2948 | obj.styl e.top = pa rseInt(y) + 'px'; | |||||
| 2949 | } | |||||
| 2950 | } | |||||
| 2951 | ||||||
| 2952 | CCSSP.SetT imer = fun ction(obj, timeout) | |||||
| 2953 | { | |||||
| 2954 | if ( obj.time r == null ) | |||||
| 2955 | { | |||||
| 2956 | if(g bAIR) | |||||
| 2957 | { | |||||
| 2958 | obj.ti mer = setI nterval(fu nction(){C Engine.Per formAnimat ion( obj.a niIndex)}, timeout ) ; | |||||
| 2959 | } | |||||
| 2960 | else | |||||
| 2961 | obj.ti mer = setI nterval("C Engine.Per formAnimat ion(" + ob j.aniIndex + ")", ti meout ); | |||||
| 2962 | } | |||||
| 2963 | } | |||||
| 2964 | ||||||
| 2965 | ||||||
| 2966 | CCSSP.Move ObjectBy = function( obj, dx, d y) | |||||
| 2967 | {//moveing a object by x and/o r y pixel | |||||
| 2968 | if (gbBsNS6) | |||||
| 2969 | { | |||||
| 2970 | var left = parseIn t(obj.styl e.left); | |||||
| 2971 | obj.styl e.setPrope rty('left' ,(left + d x ) + 'px' ,0) ; | |||||
| 2972 | var top = parseIn t(obj.styl e.top); | |||||
| 2973 | obj.styl e.setPrope rty('top' , (top + d y) + 'px' ,0); | |||||
| 2974 | } | |||||
| 2975 | el se if( gbB sNS4 ) | |||||
| 2976 | obj. moveBy(dx, dy); | |||||
| 2977 | el se | |||||
| 2978 | { | |||||
| 2979 | obj. style.pixe lLeft += d x; | |||||
| 2980 | obj. style.pixe lTop += dy ; | |||||
| 2981 | } | |||||
| 2982 | } | |||||
| 2983 | ||||||
| 2984 | CCSSP.SetO bjectBGCol or = funct ion(obj, c olor) | |||||
| 2985 | {//set the backgroun d color of an object | |||||
| 2986 | if (gbBsNS6 ) | |||||
| 2987 | obj.styl e.setPrope rty( "back ground-col or" , colo r , 0); | |||||
| 2988 | el se if( gbB sNS4 ) | |||||
| 2989 | obj. bgColor = color; | |||||
| 2990 | el se | |||||
| 2991 | obj. style.back groundColo r = color; | |||||
| 2992 | } | |||||
| 2993 | ||||||
| 2994 | CCSSP.Show Object = f unction(ob j, bShow) | |||||
| 2995 | {// set th e object t o be visib le or invi sible | |||||
| 2996 | if (gbBsNS6) | |||||
| 2997 | obj.styl e.setPrope rty('visib ility', (b Show == tr ue) ? 'vis ible' : 'h idden',nul l); | |||||
| 2998 | el se if( gbB sNS4 ) | |||||
| 2999 | obj. visibility = (bShow == true) ? 'show' : 'hide'; | |||||
| 3000 | el se | |||||
| 3001 | obj. style.visi bility = ( bShow == t rue) ? 'vi sible' : ' hidden';// when hidd en, it sti ll occupy some space . | |||||
| 3002 | } | |||||
| 3003 | ||||||
| 3004 | CCSSP.GetO bjectLeft = function (obj) | |||||
| 3005 | {// retrie ve the x c oordinate of a posio nable obje ct | |||||
| 3006 | if (gbBsNS6) | |||||
| 3007 | return o bj.style.l eft ; | |||||
| 3008 | el se if( gbB sNS4 ) | |||||
| 3009 | retu rn obj.lef t; | |||||
| 3010 | el se | |||||
| 3011 | retu rn obj.sty le.pixelLe ft; | |||||
| 3012 | } | |||||
| 3013 | ||||||
| 3014 | CCSSP.GetO bjectTop = function( obj) | |||||
| 3015 | {// retrie ve the y c oordinate of a posio nable obje ct | |||||
| 3016 | if (gbBsNS6) | |||||
| 3017 | return o bj.style.t op ; | |||||
| 3018 | el se if( gbB sNS4 ) | |||||
| 3019 | retu rn obj.top ; | |||||
| 3020 | el se | |||||
| 3021 | retu rn obj.sty le.pixelTo p; | |||||
| 3022 | } | |||||
| 3023 | ||||||
| 3024 | CCSSP.GetO bjectConta inLeft = f unction(ob j) | |||||
| 3025 | {// retrie ve the x c oordinate of a posio nable obje ct relativ e to it's parent ele ment | |||||
| 3026 | if ( typeof(o bj.pageX) != 'undefi ned') | |||||
| 3027 | retu rn obj.pag eX; | |||||
| 3028 | el se if( typ eof(obj.cl ientLeft) != 'undefi ned' ) | |||||
| 3029 | retu rn obj.cli entLeft; | |||||
| 3030 | el se | |||||
| 3031 | return o bj.offsetL eft; | |||||
| 3032 | } | |||||
| 3033 | ||||||
| 3034 | CCSSP.GetO bjectWindo wLeft = fu nction(obj ) | |||||
| 3035 | {// retrie ve the x c oordinate of a posio nable obje ct relativ e to brows er window | |||||
| 3036 | if ( gbBsNS4 && !gbBsNS 6) | |||||
| 3037 | retu rn obj.pag eX; | |||||
| 3038 | el se | |||||
| 3039 | { | |||||
| 3040 | var nOffsetWin dowLeft = 0; | |||||
| 3041 | for( var elemen t = obj; e lement; el ement = el ement.offs etParent) | |||||
| 3042 | nOffse tWindowLef t += CCSSP .GetObject ContainLef t(element) ; | |||||
| 3043 | retu rn nOffset WindowLeft ; | |||||
| 3044 | } | |||||
| 3045 | } | |||||
| 3046 | ||||||
| 3047 | CCSSP.GetO bjectConta inTop = fu nction(obj ) | |||||
| 3048 | {// retrie ve the y c oordinate of a posio nable obje ct relativ e to it's parent ele ment | |||||
| 3049 | if ( typeof(o bj.pageY) != 'undefi ned') | |||||
| 3050 | retu rn obj.pag eY; | |||||
| 3051 | el se if( typ eof(obj.cl ientTop) ! = 'undefin ed' && obj == docume nt.body) | |||||
| 3052 | retu rn obj.cli entTop; | |||||
| 3053 | el se | |||||
| 3054 | retu rn obj.off setTop; | |||||
| 3055 | } | |||||
| 3056 | ||||||
| 3057 | CCSSP.GetO bjectWindo wTop = fun ction(obj) | |||||
| 3058 | {// retrie ve the y c oordinate of a posio nable obje ct relativ e to brows er window | |||||
| 3059 | if ( gbBsNS4 && !gbBsNS 6) | |||||
| 3060 | retu rn obj.pag eY; | |||||
| 3061 | el se | |||||
| 3062 | { | |||||
| 3063 | var nOffsetWin dowTop = 0 ; | |||||
| 3064 | for( var elemen t = obj; e lement; el ement = el ement.offs etParent) | |||||
| 3065 | nOffse tWindowTop += CCSSP. GetObjectC ontainTop( element); | |||||
| 3066 | retu rn nOffset WindowTop; | |||||
| 3067 | } | |||||
| 3068 | } | |||||
| 3069 | ||||||
| 3070 | CCSSP.GetO bjectHeigh t = functi on(obj) | |||||
| 3071 | {// retrie ve the hei ght of a p osionable object | |||||
| 3072 | if ( gbBsNS4 && !gbBsNS 6) | |||||
| 3073 | retu rn obj.cli p.height; | |||||
| 3074 | el se | |||||
| 3075 | retu rn obj.off setHeight; | |||||
| 3076 | } | |||||
| 3077 | ||||||
| 3078 | CCSSP.GetO bjectWidth = functio n(obj) | |||||
| 3079 | {// retrie ve the wid th of a po sionable o bject | |||||
| 3080 | if ( gbBsNS4 && !gbBsNS 6) | |||||
| 3081 | retu rn obj.cli p.width; | |||||
| 3082 | el se | |||||
| 3083 | retu rn obj.off setWidth; | |||||
| 3084 | } | |||||
| 3085 | ||||||
| 3086 | CCSSP.Regi sterEventH andler = f unction( s rcObj, raw EventName, funcHandl er ) | |||||
| 3087 | { // to ad d the "fun cHandler" as the "ra wEventName " 's handl er to the "srcObj" o bject,the original e vent handl er will be combined | |||||
| 3088 | ||||||
| 3089 | if ( srcObj = = window & & rawEvent Name == 'o nload' ) | |||||
| 3090 | { | |||||
| 3091 | var bSet = fal se; | |||||
| 3092 | if( window.add EventListe ner ) | |||||
| 3093 | { | |||||
| 3094 | window .addEventL istener( ' load', new Function( "event", f uncHandler ),false); | |||||
| 3095 | bSet = true; | |||||
| 3096 | } | |||||
| 3097 | else if( windo w.attachEv ent ) | |||||
| 3098 | { | |||||
| 3099 | window .attachEve nt('onload ', new Fun ction("eve nt", funcH andler ), false); | |||||
| 3100 | bSet = true; | |||||
| 3101 | } | |||||
| 3102 | ||||||
| 3103 | if( bSet ) | |||||
| 3104 | return ; | |||||
| 3105 | } | |||||
| 3106 | ||||||
| 3107 | if (gbBsNS4 && !gbBsNS 6) | |||||
| 3108 | retu rn ; | |||||
| 3109 | ||||||
| 3110 | va r oldHandl er = ""; | |||||
| 3111 | ||||||
| 3112 | if (gbBsMac &&gbBsIE4& &!gbBsIE5) | |||||
| 3113 | { | |||||
| 3114 | if ( typeof(src Obj[rawEve ntName.toL owerCase() ])=="unkno wn") | |||||
| 3115 | { // search for <SCRIPT> tag which define the event han dler | |||||
| 3116 | for( v ar i = 0; i < docume nt.scripts .length; i ++ ) | |||||
| 3117 | { | |||||
| 3118 | var scri pt = docum ent.script s[i]; | |||||
| 3119 | if( (scr ipt.htmlFo r == srcOb j.id || sc ript.htmlF or == srcO bj ) && sc ript.event == rawEve ntName ) | |||||
| 3120 | { | |||||
| 3121 | oldHandler = script. innerHTML; | |||||
| 3122 | break; | |||||
| 3123 | } | |||||
| 3124 | } | |||||
| 3125 | } | |||||
| 3126 | } | |||||
| 3127 | el se | |||||
| 3128 | { | |||||
| 3129 | var oldInlineH andler = s rcObj[rawE ventName.t oLowerCase ()]; | |||||
| 3130 | if( oldInlineH andler != null && ty peof(oldIn lineHandle r) != "und efined") | |||||
| 3131 | { | |||||
| 3132 | var fu nctionDefi nition = o ldInlineHa ndler.toSt ring(); | |||||
| 3133 | var bo dyStart = functionDe finition.i ndexOf( "{ " ); | |||||
| 3134 | var bo dyEnd = fu nctionDefi nition.las tIndexOf( "}" ); | |||||
| 3135 | if( bo dyStart > 0 || bodyE nd > bodyS tart ) | |||||
| 3136 | oldHandl er = funct ionDefinit ion.substr ( bodyStar t + 1, bod yEnd - bod yStart - 2 ); | |||||
| 3137 | } | |||||
| 3138 | else if( gbBsI E4 ) | |||||
| 3139 | { // search for <SCRIPT> tag which define the event han dler | |||||
| 3140 | for( v ar i = 0; i < docume nt.scripts .length; i ++ ) | |||||
| 3141 | { | |||||
| 3142 | var scri pt = docum ent.script s[i]; | |||||
| 3143 | if( (scr ipt.htmlFo r == srcOb j.id || sc ript.htmlF or == srcO bj ) && sc ript.event == rawEve ntName ) | |||||
| 3144 | { | |||||
| 3145 | oldHandler = script. innerHTML; | |||||
| 3146 | break; | |||||
| 3147 | } | |||||
| 3148 | } | |||||
| 3149 | } | |||||
| 3150 | } | |||||
| 3151 | if ( oldHandl er.indexOf (funcHandl er) >= 0 ) | |||||
| 3152 | retu rn;// to p revent reg ister the funtion tw ice. | |||||
| 3153 | ||||||
| 3154 | if ( gbBsNS4 ) // only "onload, o nresize, o nfocus" ap ply to win dow | |||||
| 3155 | {/ / other ra w events w ill apply to layer | |||||
| 3156 | var noOn = raw EventName. substring( 2, rawEven tName.leng th); | |||||
| 3157 | if( typeof(noO n) == "str ing" && no On.length > 3 ) { | |||||
| 3158 | if (sr cObj.captu reEvents) | |||||
| 3159 | srcObj.c aptureEven ts( Event[ noOn.toUpp erCase()] ); | |||||
| 3160 | } | |||||
| 3161 | } | |||||
| 3162 | ||||||
| 3163 | va r newHandl er = oldHa ndler; | |||||
| 3164 | if ( newHandl er.length == 0 ) | |||||
| 3165 | newH andler = f uncHandler ; | |||||
| 3166 | el se | |||||
| 3167 | newH andler += "; " + fun cHandler; | |||||
| 3168 | if ((gbBsNS6 )&&(srcObj .addEventL istener)) | |||||
| 3169 | srcObj.a ddEventLis tener( noO n.toLowerC ase(), new Function( "event", n ewHandler ),false); | |||||
| 3170 | el se | |||||
| 3171 | srcObj[r awEventNam e.toLowerC ase()] = n ew Functio n( newHand ler ); | |||||
| 3172 | } | |||||
| 3173 | ||||||
| 3174 | CCSSP.GetW indowHeigh t = functi on() | |||||
| 3175 | {// retrie ve the hei ght of ava ilable con tent in br owser wind ow | |||||
| 3176 | if ( gbBsNS4 ) | |||||
| 3177 | retu rn window. innerHeigh t; | |||||
| 3178 | el se | |||||
| 3179 | retu rn documen t.body.cli entHeight; | |||||
| 3180 | } | |||||
| 3181 | ||||||
| 3182 | CCSSP.GetW indowBotto m = functi on() | |||||
| 3183 | {// retrie ve the bot tom postio n of brows er window | |||||
| 3184 | if ( gbBsNS4 ) | |||||
| 3185 | retu rn window. outerHeigh t + window .pageYOffs et; | |||||
| 3186 | el se | |||||
| 3187 | retu rn documen t.body.cli entHeight + getScrol lTop(); | |||||
| 3188 | } | |||||
| 3189 | ||||||
| 3190 | CCSSP.GetW indowWidth = functio n() | |||||
| 3191 | {// retrie ve the wid th of avai lable cont ent in bro wser windo w | |||||
| 3192 | if ( gbBsNS4 ) | |||||
| 3193 | retu rn window. innerWidth ; | |||||
| 3194 | el se | |||||
| 3195 | retu rn documen t.body.cli entWidth; | |||||
| 3196 | } | |||||
| 3197 | ||||||
| 3198 | CCSSP.GetW indowRight = functio n() | |||||
| 3199 | {// retrie ve the rig ht postion of browse r window | |||||
| 3200 | if ( gbBsNS4 ) | |||||
| 3201 | retu rn window. outerWidth + window. pageXOffse t; | |||||
| 3202 | el se | |||||
| 3203 | retu rn documen t.body.cli entWidth + getScroll Left(); | |||||
| 3204 | } | |||||
| 3205 | ||||||
| 3206 | CCSSP.Trim String = f unction( o bjString, subtrim ) | |||||
| 3207 | {// to tri m the "sub trim" in t he beginni ng and end ing of a s tring obje ct | |||||
| 3208 | if ( typeof(s ubtrim) != "string" || subtrim == null ) | |||||
| 3209 | retu rn objStri ng; | |||||
| 3210 | va r strHead = objStrin g.substrin g(0, 1); | |||||
| 3211 | va r strRear = objStrin g.substrin g(objStrin g.length-1 , objStrin g.length); | |||||
| 3212 | if ( strHead != subtrim && strRea r != subtr im ) | |||||
| 3213 | retu rn objStri ng; | |||||
| 3214 | ||||||
| 3215 | va r spacePos = objStri ng.indexOf (subtrim); | |||||
| 3216 | if ( spacePos < 0 ) | |||||
| 3217 | retu rn objStri ng; | |||||
| 3218 | el se if( spa cePos == o bjString.l ength - 1 ) | |||||
| 3219 | retu rn objStri ng.substri ng(0, spac ePos); | |||||
| 3220 | el se | |||||
| 3221 | { | |||||
| 3222 | var newString = objStrin g.substrin g( spacePo s + 1, obj String.len gth); | |||||
| 3223 | retu rn CCSSP.T rimString( newString , subtrim ); | |||||
| 3224 | } | |||||
| 3225 | } | |||||
| 3226 | ||||||
| 3227 | CCSSP.Trim Space = fu nction( ob jString ) | |||||
| 3228 | { | |||||
| 3229 | va r Trim1 = CCSSP.Trim String( ob jString, " "); | |||||
| 3230 | if ( typeof(T rim1) != " string" || Trim1 == null ) | |||||
| 3231 | return T rim1; | |||||
| 3232 | va r strHead = Trim1.su bstring(0, 1); | |||||
| 3233 | if (strHead = = "\"") | |||||
| 3234 | return C CSSP.TrimS tring( Tri m1, "\""); | |||||
| 3235 | re turn CCSSP .TrimStrin g( Trim1, "\'"); | |||||
| 3236 | } | |||||
| 3237 | ||||||
| 3238 | CCSSP.GetE ventElemen t = functi on( navEve ntObject ) | |||||
| 3239 | {// to get the eleme nt who fir ed the cur rent event | |||||
| 3240 | if (gbBsNS4) | |||||
| 3241 | retu rn navEven tObject.ta rget; | |||||
| 3242 | el se | |||||
| 3243 | retu rn event.s rcElement; | |||||
| 3244 | } | |||||
| 3245 | ||||||
| 3246 | CCSSP.Prep areFilter = function ( Obj ) | |||||
| 3247 | {//to prep are for ma king the f ilter work | |||||
| 3248 | Ob j.style.fi lter = ""; | |||||
| 3249 | if (Obj.style .position == "absolu te" ) | |||||
| 3250 | retu rn; | |||||
| 3251 | if (gbBsIE7) | |||||
| 3252 | { | |||||
| 3253 | if( Obj.style. zoom != "" ) | |||||
| 3254 | return ; | |||||
| 3255 | Obj. style.zoom = 1; | |||||
| 3256 | } | |||||
| 3257 | el se | |||||
| 3258 | { | |||||
| 3259 | if(O bj.style.w idth != "" || Obj.st yle.height != "") | |||||
| 3260 | return ; | |||||
| 3261 | Obj. style.heig ht = CCSSP .GetObject Height(Obj ); | |||||
| 3262 | } | |||||
| 3263 | } | |||||
| 3264 | ||||||
| 3265 | CCSSP.IsDe scendant = function( progenito r, progeny ) | |||||
| 3266 | { | |||||
| 3267 | if ( typeof(p rogeny) == "undefine d" || prog eny == nul l ) | |||||
| 3268 | retu rn false; | |||||
| 3269 | el se if( pro geny == pr ogenitor ) | |||||
| 3270 | retu rn true; | |||||
| 3271 | el se if( pro geny.id == progenito r.id ) | |||||
| 3272 | retu rn true; | |||||
| 3273 | el se if( get ParentNode (progeny) == getPare ntNode(pro genitor)) | |||||
| 3274 | retu rn false; | |||||
| 3275 | el se | |||||
| 3276 | retu rn CCSSP.I sDescendan t( progeni tor, getPa rentNode(p rogeny)); | |||||
| 3277 | } | |||||
| 3278 | ||||||
| 3279 | CCSSP.IsTe xtTag = fu nction( Ob j ) | |||||
| 3280 | { | |||||
| 3281 | if ( typeof( Obj.tagNam e ) == "un defined" ) | |||||
| 3282 | retu rn false; | |||||
| 3283 | re turn( Obj. tagName.in dexOf("H") == 0 || O bj.tagName == "P" || | |||||
| 3284 | Obj.ta gName == " FONT" || O bj.tagName == "SPAN" ); | |||||
| 3285 | } | |||||
| 3286 | ||||||
| 3287 | //End Java Script lib ary for cr oss-platfo rm positio ning objec t. | |||||
| 3288 | ||||||
| 3289 | /// Sectio n End - C CSSP DHTM (JavaScrip t 1.2) | |||||
| 3290 | ||||||
| 3291 | /// Sectio n Begin - CCSSP DHT M 1 (JavaS cript 1.2) | |||||
| 3292 | ||||||
| 3293 | //Begin th e definiti on of clas s CTrigger | |||||
| 3294 | function C Trigger( T riggerElem ent ) | |||||
| 3295 | { | |||||
| 3296 | // object : the trigge r element. Never be null. | |||||
| 3297 | th is.eleTrig ger = Trig gerElement ; | |||||
| 3298 | ||||||
| 3299 | // number : the click counter nu mber: only 3 values: 0,1,2; | |||||
| 3300 | th is.nCounte r = 0; | |||||
| 3301 | ||||||
| 3302 | // object as associativ e array of string: | |||||
| 3303 | // the assoc iate targe t ID strin gs; one el ement at l east. | |||||
| 3304 | th is.objStrT arget = ne w Object() ; | |||||
| 3305 | th is.eleTrig ger.style. cursor = " pointer"; | |||||
| 3306 | if ( this.ele Trigger.ta gName == " AREA" && g etAttribut e(this.ele Trigger,"h ref") == " " ) | |||||
| 3307 | setA ttribute(t his.eleTri gger , "hr ef", "#"); // to mak e a hand c ursor for image map | |||||
| 3308 | } | |||||
| 3309 | ||||||
| 3310 | CTrigger.p rototype.A ddTargetID = functio n( strTarg etID ) | |||||
| 3311 | {// add on e target I D string t o the objS trTarget | |||||
| 3312 | if ( typeof(s trTargetID ) != "stri ng" ) | |||||
| 3313 | retu rn ; | |||||
| 3314 | if ( typeof(t his.objStr Target[str TargetID]) != "strin g" ) | |||||
| 3315 | this .objStrTar get[strTar getID] = s trTargetID ; | |||||
| 3316 | } | |||||
| 3317 | ||||||
| 3318 | CTrigger.p rototype.O nTriggerCl ick = func tion(event ) | |||||
| 3319 | {// to act ivate all asociated target | |||||
| 3320 | va r strEvent Type = ( ( this.nCoun ter++)% 2 == 0 ) ? | |||||
| 3321 | "bss ctrigger1" : "bssctr igger2"; | |||||
| 3322 | ||||||
| 3323 | // to enumer ate associ ative targ et element 's ID stri ng | |||||
| 3324 | fo r( var str TargetID i n this.obj StrTarget ) | |||||
| 3325 | CEng ine.SendEv entToOneTa rget( strT argetID, s trEventTyp e ,event); | |||||
| 3326 | } | |||||
| 3327 | //End the definition of class CTrigger | |||||
| 3328 | ||||||
| 3329 | //Begin th e definiti on of clas s CTarget | |||||
| 3330 | function C Target( Ta rgetElemen t ) | |||||
| 3331 | { | |||||
| 3332 | // object : the target element. Never be n ull. | |||||
| 3333 | th is.eleTarg et = Targe tElement; | |||||
| 3334 | th is.objMana ger = new Object(); // object: the event manager | |||||
| 3335 | } | |||||
| 3336 | ||||||
| 3337 | CTarget.nP ageClickCo unter = 0; // static class prop erty. | |||||
| 3338 | ||||||
| 3339 | CTarget.pr ototype.Ge tAgencyObj ect = func tion(str_a ction_type ,action_se tting ) | |||||
| 3340 | {// return the actio n agency ( effect )o bject's re fernece | |||||
| 3341 | sw itch( str_ action_typ e ) | |||||
| 3342 | { | |||||
| 3343 | ca se "show": return new CAgencySh ow( this.e leTarget, true ) ; | |||||
| 3344 | ca se "hide": return new CAgencySh ow( this.e leTarget, false ) ; | |||||
| 3345 | ||||||
| 3346 | case " flyin" : | |||||
| 3347 | re turn new C AgencyFly( this.eleTa rget, acti on_setting , true); | |||||
| 3348 | case " flyout" : | |||||
| 3349 | re turn new C AgencyFly( this.eleTa rget, acti on_setting , false); | |||||
| 3350 | case " spiralin" : | |||||
| 3351 | re turn new C AgencySpir al(this.el eTarget, a ction_sett ing, true) ; | |||||
| 3352 | case " spiralout" : | |||||
| 3353 | re turn new C AgencySpir al(this.el eTarget, a ction_sett ing, false ); | |||||
| 3354 | case " zoomin" : | |||||
| 3355 | re turn new C AgencyZoom (this.eleT arget, act ion_settin g, true); | |||||
| 3356 | case " zoomout" : | |||||
| 3357 | re turn new C AgencyZoom (this.eleT arget, act ion_settin g, false); | |||||
| 3358 | case " elastic" : | |||||
| 3359 | retu rn new CAg encyElasti c(this.ele Target, ac tion_setti ng); | |||||
| 3360 | ||||||
| 3361 | case " fadein" : | |||||
| 3362 | re turn new C AgencyAlph a(this.ele Target, ac tion_setti ng, true) ; | |||||
| 3363 | case " fadeout" : | |||||
| 3364 | re turn new C AgencyAlph a(this.ele Target, ac tion_setti ng, false) ; | |||||
| 3365 | case " rockrollst atic" : | |||||
| 3366 | case " rockroll" : | |||||
| 3367 | re turn new CAgencyWav e(this.ele Target, ac tion_setti ng, false) ; | |||||
| 3368 | ||||||
| 3369 | case " glow": | |||||
| 3370 | re turn new CAgencyGlo w(this.ele Target,act ion_settin g); | |||||
| 3371 | case " dropshadow ": | |||||
| 3372 | re turn new C AgencyDrop Shadow(thi s.eleTarge t,action_s etting); | |||||
| 3373 | case " transition " : | |||||
| 3374 | re turn new C AgencyReve alTrans(th is.eleTarg et,action_ setting) ; | |||||
| 3375 | case " blur" : | |||||
| 3376 | re turn new CAgencyBlu r(this.ele Target,act ion_settin g) ; | |||||
| 3377 | ||||||
| 3378 | case " fliph" : / / all thes e 4 do NOT need any parameters | |||||
| 3379 | case " flipv" : | |||||
| 3380 | case " invert": | |||||
| 3381 | case " gray" : | |||||
| 3382 | re turn new C AgencyChan geFilter(t his.eleTar get, str_a ction_type ) ; | |||||
| 3383 | ||||||
| 3384 | case " fontchange ": // the effects be low change the style on the fl y, so won' t work in Navigator | |||||
| 3385 | re turn new C AgencyFont Change(thi s.eleTarge t,action_s etting) ; | |||||
| 3386 | case " boderchang e": | |||||
| 3387 | case " stylechang e": | |||||
| 3388 | re turn new C AgencyChan geStyle(th is.eleTarg et,action_ setting); | |||||
| 3389 | ||||||
| 3390 | de fault: ret urn null; | |||||
| 3391 | } | |||||
| 3392 | } | |||||
| 3393 | ||||||
| 3394 | CTarget.pr ototype.Se tEventMana ger = func tion( | |||||
| 3395 | on e_event_ty pe,str_act ion_type,a ction_sett ing,event_ additional ) | |||||
| 3396 | {// to set the event manager w ith specif ied action | |||||
| 3397 | if ( typeof( one_event_ type ) != "string" | | | |||||
| 3398 | type of( str_ac tion_type ) != "stri ng"|| | |||||
| 3399 | type of( action _setting ) != "strin g" ) | |||||
| 3400 | retu rn false; | |||||
| 3401 | if ( typeof(t his.objMan ager[one_e vent_type] ) == "unde fined" ) | |||||
| 3402 | { | |||||
| 3403 | this .objManage r[one_even t_type] = new Object (); | |||||
| 3404 | this .objManage r[one_even t_type].le ngth = 0; | |||||
| 3405 | } | |||||
| 3406 | ||||||
| 3407 | va r eventAge ncy = this .GetAgency Object(str _action_ty pe,action_ setting); | |||||
| 3408 | if ( eventAge ncy != nul l ) | |||||
| 3409 | { | |||||
| 3410 | var ct = this. objManager [one_event _type].len gth ++; | |||||
| 3411 | this .objManage r[one_even t_type][ct ] = eventA gency; | |||||
| 3412 | ||||||
| 3413 | if( one_event_ type == "b sscpagecli ck" ) | |||||
| 3414 | {// to deal wi th the "nu mber of pa geclick" s tuff | |||||
| 3415 | if( ty peof(event _additiona l) == "num ber" ) | |||||
| 3416 | this.obj Manager[on e_event_ty pe][ct].nP ageClick = event_add itional; | |||||
| 3417 | else / / set the default nu mber | |||||
| 3418 | this.obj Manager[on e_event_ty pe][ct].nP ageClick = 1; | |||||
| 3419 | ||||||
| 3420 | if( (t ypeof(this .objManage r.nMinPage ClickIndex ) == "unde fined") || | |||||
| 3421 | (t his.objMan ager[one_e vent_type] [ct].nPage Click < | |||||
| 3422 | this.objMa nager[one_ event_type ][this.obj Manager.nM inPageClic kIndex].nP ageClick) ) | |||||
| 3423 | this.obj Manager.nM inPageClic kIndex = c t; | |||||
| 3424 | } | |||||
| 3425 | ||||||
| 3426 | //hi de the obj ect blindl y,SetState function will take care of th e final co rrect stat e | |||||
| 3427 | if( ((one_even t_type == "bsscpagec lick") && | |||||
| 3428 | (this .objManage r[one_even t_type][ct ].nPageCli ck == 1)) || | |||||
| 3429 | one_ev ent_type = = "bsscpag eload" || | |||||
| 3430 | one_ev ent_type = = "bssctri gger1" ) | |||||
| 3431 | CCSSP. ShowObject ( this.ele Target, fa lse ); | |||||
| 3432 | ||||||
| 3433 | if( one_event_ type == "b ssctrigger 1" || one_ event_type == "bssct rigger2" ) | |||||
| 3434 | if( ty peof( this .strTrigge rEvent ) = = "undefin ed" ) | |||||
| 3435 | this.str TriggerEve nt = ( one _event_typ e == "bssc trigger1" ) ? "bssct rigger2" : "bssctrig ger1"; | |||||
| 3436 | ||||||
| 3437 | retu rn true; | |||||
| 3438 | } | |||||
| 3439 | re turn false ; | |||||
| 3440 | } | |||||
| 3441 | ||||||
| 3442 | CTarget.pr ototype.On Event = fu nction( st rBsscEvent ,event ) | |||||
| 3443 | {// respon se to the event ( bs sc format ) | |||||
| 3444 | if ( typeof(t his.objMan ager[strBs scEvent]) == "object " ) | |||||
| 3445 | { // to get the event agency fro m the even t manager | |||||
| 3446 | var eventAgenc y = this.o bjManager[ strBsscEve nt]; | |||||
| 3447 | for( var i = 0 ; i < even tAgency.le ngth; i++ ) | |||||
| 3448 | { | |||||
| 3449 | if( st rBsscEvent == "bsscp ageclick" && | |||||
| 3450 | eventAge ncy[i].nPa geClick != CTarget.n PageClickC ounter ) | |||||
| 3451 | continu e; | |||||
| 3452 | else i f( strBssc Event == " bsschover" && event. type == "m ouseout" ) | |||||
| 3453 | eventAge ncy[i].End Effect(); | |||||
| 3454 | else / / to invok e the unif ied functi on in effe ct object | |||||
| 3455 | eventAge ncy[i].Upd ateEffect( ); | |||||
| 3456 | } | |||||
| 3457 | } | |||||
| 3458 | } | |||||
| 3459 | ||||||
| 3460 | CTarget.pr ototype.Se tState = f unction( s trBsscEven t ) | |||||
| 3461 | { | |||||
| 3462 | if ( typeof(t his.objMan ager[strBs scEvent]) != "object " ) | |||||
| 3463 | retu rn false; | |||||
| 3464 | ||||||
| 3465 | // to get th e event ag ency from the event manager | |||||
| 3466 | va r eventAge ncy = this .objManage r[strBsscE vent]; | |||||
| 3467 | ||||||
| 3468 | if ( strBsscE vent == "b sscpagecli ck" ) | |||||
| 3469 | {/ / we only set the in itial stat e for the minium num ber of pag eclick | |||||
| 3470 | if ( this.objMa nager.nMin PageClickI ndex == 'u ndefined') | |||||
| 3471 | this.objMa nager.nMin PageClickI ndex = 0 ; | |||||
| 3472 | even tAgency[th is.objMana ger.nMinPa geClickInd ex].Prepar eEffect(); | |||||
| 3473 | retu rn true; | |||||
| 3474 | } | |||||
| 3475 | el se | |||||
| 3476 | { | |||||
| 3477 | for( var i = 0 ; i < even tAgency.le ngth; i++ ) | |||||
| 3478 | eventA gency[i].P repareEffe ct(); // t o invoke t he unified function in effect object | |||||
| 3479 | if( i > 0 ) | |||||
| 3480 | return true; | |||||
| 3481 | else | |||||
| 3482 | return false; | |||||
| 3483 | } | |||||
| 3484 | } | |||||
| 3485 | //End the definition of class CTarget | |||||
| 3486 | ||||||
| 3487 | //Begin th e definiti on of CEng ine class | |||||
| 3488 | function C Engine(){} // all pro perities a re going b e "class" properitie s | |||||
| 3489 | ||||||
| 3490 | // object : as assoc iative arr ay of trig ger object s | |||||
| 3491 | CEngine.ob jTrigger = new Objec t(); | |||||
| 3492 | // object : as assoc iative arr ay of targ et objects | |||||
| 3493 | CEngine.ob jTarget = new Object (); | |||||
| 3494 | ||||||
| 3495 | // Array : each elem ent is a C AgencyXXX animation object | |||||
| 3496 | CEngine.ar rAnimation = new Arr ay(); | |||||
| 3497 | CEngine.Pe rformAnima tion = fun ction( nIn dex ) | |||||
| 3498 | {// animat ion : upda te effects function | |||||
| 3499 | CE ngine.arrA nimation[n Index].Upd ateEffect( ); | |||||
| 3500 | } | |||||
| 3501 | ||||||
| 3502 | CEngine.Ad dOneTrigge r = functi on(Trigger ID,Trigger Element) | |||||
| 3503 | {// add on e Trigger object int o the trig ger array | |||||
| 3504 | if ( typeof(T riggerID) != "string " || Trigg erElement == null || | |||||
| 3505 | typeof(T riggerElem ent) != "o bject" ) | |||||
| 3506 | retu rn; | |||||
| 3507 | if ( typeof(C Engine.obj Trigger[Tr iggerID] ) != "objec t" ) | |||||
| 3508 | CEng ine.objTri gger[Trigg erID] = ne w CTrigger (TriggerEl ement); | |||||
| 3509 | } | |||||
| 3510 | ||||||
| 3511 | CEngine.Ad dOneTarget = functio n(TargetID , TargetEl ement) | |||||
| 3512 | {// add on e Target o bject into the targe t array | |||||
| 3513 | if ( typeof(T argetID) ! = "string" || Target Element == null || | |||||
| 3514 | type of(TargetE lement) != "object" ) | |||||
| 3515 | retu rn; | |||||
| 3516 | if ( typeof(C Engine.obj Target[Tar getID]) != "object" ) | |||||
| 3517 | CEng ine.objTar get[Target ID] = new CTarget( T argetEleme nt ); | |||||
| 3518 | } | |||||
| 3519 | ||||||
| 3520 | CEngine.Se ndEventToO neTarget = function( strTargetI D, strBssc Event,even t ) | |||||
| 3521 | {// to act ivate one target obj ect | |||||
| 3522 | if ( typeof(C Engine.obj Target[str TargetID]) == "objec t" ) | |||||
| 3523 | { | |||||
| 3524 | if( strBsscEve nt == "bss ctrigger1" || strBss cEvent == "bssctrigg er2" ) | |||||
| 3525 | {//n ow, the "b ssctrigger 1" and "bs sctrigger2 " work lik e a toggle | |||||
| 3526 | if( st rBsscEvent == CEngin e.objTarge t[strTarge tID].strTr iggerEvent ) | |||||
| 3527 | strBsscE vent = (st rBsscEvent == "bssct rigger1") ? "bssctri gger2" : " bssctrigge r1"; | |||||
| 3528 | CEngin e.objTarge t[strTarge tID].strTr iggerEvent = strBssc Event; | |||||
| 3529 | } | |||||
| 3530 | CEng ine.objTar get[strTar getID].OnE vent( strB sscEvent,e vent ); | |||||
| 3531 | } | |||||
| 3532 | } | |||||
| 3533 | ||||||
| 3534 | CEngine.Se ndEventToA llTarget = function( strBsscEv ent,event ) | |||||
| 3535 | { //to act ivate all target ass ociative t o the BSSC event | |||||
| 3536 | fo r( var str TargetID i n CEngine. objTarget ) //to enu merate all target | |||||
| 3537 | CEng ine.SendEv entToOneTa rget( strT argetID, s trBsscEven t,event ); | |||||
| 3538 | } | |||||
| 3539 | ||||||
| 3540 | CEngine.Se tOneTarget InitialSta te = funct ion( strTa rgetID ) | |||||
| 3541 | {// only i nvoked aft er ALL eff ects for t he target have been set | |||||
| 3542 | if ( typeof(C Engine.obj Target[str TargetID]) == "objec t" ) | |||||
| 3543 | {/ / to get t arget obje ct | |||||
| 3544 | var objTarget = CEngine. objTarget[ strTargetI D]; | |||||
| 3545 | if( objTarget. SetState( "bsscpagel oad" ) == false ) | |||||
| 3546 | { | |||||
| 3547 | objTar get.SetSta te( "bsscp ageclick" ); | |||||
| 3548 | objTar get.SetSta te( "bssct rigger1" ) ; | |||||
| 3549 | } | |||||
| 3550 | } | |||||
| 3551 | } | |||||
| 3552 | ||||||
| 3553 | CEngine.Ad justPageCl ickCounter = functio n() | |||||
| 3554 | { | |||||
| 3555 | va r nAdjuste dClickCoun ter = CTar get.nPageC lickCounte r; | |||||
| 3556 | va r bAdjuste d = false; | |||||
| 3557 | fo r( var str TargetID i n CEngine. objTarget ) //to enu merate all target | |||||
| 3558 | {/ / try to f ind the mi num pageCl iclConter greater th an CTarget .nPageClic kCounter | |||||
| 3559 | var objEventPa geClick = CEngine.ob jTarget[st rTargetID] .objManage r.bsscpage click; | |||||
| 3560 | if( objEventPa geClick != null ) | |||||
| 3561 | { | |||||
| 3562 | for( v ar i = 0; i < objEve ntPageClic k.length; i++ ) | |||||
| 3563 | { | |||||
| 3564 | var nOth erPageClic k = objEve ntPageClic k[i].nPage Click; | |||||
| 3565 | if( nOth erPageClic k == CTarg et.nPageCl ickCounter ) | |||||
| 3566 | return; | |||||
| 3567 | if( nOth erPageClic k > CTarge t.nPageCli ckCounter ) | |||||
| 3568 | { | |||||
| 3569 | if( !bAdju sted ) | |||||
| 3570 | { | |||||
| 3571 | nA djustedCli ckCounter = nOtherPa geClick; | |||||
| 3572 | bA djusted = true; | |||||
| 3573 | } | |||||
| 3574 | else if( n OtherPageC lick < nAd justedClic kCounter ) | |||||
| 3575 | nA djustedCli ckCounter = nOtherPa geClick; | |||||
| 3576 | } | |||||
| 3577 | } | |||||
| 3578 | } | |||||
| 3579 | } | |||||
| 3580 | CT arget.nPag eClickCoun ter = nAdj ustedClick Counter; | |||||
| 3581 | } | |||||
| 3582 | ||||||
| 3583 | CEngine.On PageLoad = function( event) | |||||
| 3584 | { | |||||
| 3585 | // first, to set all t arget's in itial stat e | |||||
| 3586 | fo r( var str TargetID i n CEngine. objTarget ) | |||||
| 3587 | CEng ine.SetOne TargetInit ialState( strTargetI D ); | |||||
| 3588 | ||||||
| 3589 | // to invoke all targe t's onpage load handl er | |||||
| 3590 | CE ngine.Send EventToAll Target( "b sscpageloa d",event ) ; | |||||
| 3591 | } | |||||
| 3592 | ||||||
| 3593 | CEngine.On PageClick = function (event) | |||||
| 3594 | { // to in voke all t arget's on pageclick handler | |||||
| 3595 | va r src = CC SSP.GetEve ntElement( arguments [0] ); | |||||
| 3596 | if ( src == n ull ) | |||||
| 3597 | retu rn; | |||||
| 3598 | ||||||
| 3599 | va r objClick edTrigger = null; | |||||
| 3600 | fo r( var str TriggerID in CEngine .objTrigge r ) | |||||
| 3601 | { // to dete ct which t rigger is clicked | |||||
| 3602 | if( CCSSP.IsDe scendant( CEngine.ob jTrigger[s trTriggerI D].eleTrig ger,src) ) | |||||
| 3603 | { | |||||
| 3604 | objCli ckedTrigge r = CEngin e.objTrigg er[strTrig gerID]; | |||||
| 3605 | break; | |||||
| 3606 | } | |||||
| 3607 | } | |||||
| 3608 | ||||||
| 3609 | if ( objClick edTrigger != null) / / the clic ked trigge r found | |||||
| 3610 | objC lickedTrig ger.OnTrig gerClick(e vent); | |||||
| 3611 | el se // no t rigger is clicked | |||||
| 3612 | { // to send PageClick event to all target | |||||
| 3613 | CTar get.nPageC lickCounte r++; | |||||
| 3614 | CEng ine.Adjust PageClickC ounter(); | |||||
| 3615 | CEng ine.SendEv entToAllTa rget( "bss cpageclick " ,event); | |||||
| 3616 | } | |||||
| 3617 | } | |||||
| 3618 | ||||||
| 3619 | CEngine.On MouseOver = function (event) | |||||
| 3620 | { // to in voke all t arget's on pageload h andler | |||||
| 3621 | va r src = CC SSP.GetEve ntElement( arguments [0] ); | |||||
| 3622 | if ( src == n ull ) | |||||
| 3623 | retu rn; | |||||
| 3624 | ||||||
| 3625 | va r strHover edTargetID = null; | |||||
| 3626 | fo r( var str TargetID i n CEngine. objTarget ) | |||||
| 3627 | { // to dete ct which T arget is h overing on | |||||
| 3628 | if( CCSSP.IsDe scendant( CEngine.ob jTarget[st rTargetID] .eleTarget , src ) ) | |||||
| 3629 | { | |||||
| 3630 | strHov eredTarget ID = strTa rgetID; | |||||
| 3631 | break; | |||||
| 3632 | } | |||||
| 3633 | } | |||||
| 3634 | ||||||
| 3635 | if ( strHover edTargetID != null ) // the ho vered targ et found | |||||
| 3636 | CEng ine.SendEv entToOneTa rget( strH overedTarg etID, "bss chover",ev ent ); | |||||
| 3637 | } | |||||
| 3638 | ||||||
| 3639 | CEngine.Bu ildTargetO bject = fu nction(tar get_ID,eve nt_type,ac tion_type, | |||||
| 3640 | action _setting, event_addi tional) | |||||
| 3641 | {// to bui ld target object | |||||
| 3642 | // to get th e target o bject | |||||
| 3643 | if ( typeof( CEngine.ob jTarget[ta rget_ID] ) != "objec t" ) | |||||
| 3644 | retu rn false;/ / the engi ne's AddOn eTarget fu nction mig ht have fa iled. | |||||
| 3645 | va r TargetOb ject = CEn gine.objTa rget[targe t_ID]; | |||||
| 3646 | ||||||
| 3647 | // to prepar e the para meters for the event manager | |||||
| 3648 | va r arrEvent = event_t ype.split( "|"); // t o split th e combined event_typ e string | |||||
| 3649 | va r arrActio n = action _type.spli t("|");//t o split th e combined action_ty pe string | |||||
| 3650 | fo r( var tri m = 0; tri m < arrEve nt.length; trim++ ) | |||||
| 3651 | arrE vent[trim] = CCSSP.T rimSpace(a rrEvent[tr im]); | |||||
| 3652 | ||||||
| 3653 | fo r( trim = 0; trim < arrAction. length; tr im++ ) | |||||
| 3654 | arrA ction[trim ] = CCSSP. TrimSpace( arrAction[ trim]); | |||||
| 3655 | ||||||
| 3656 | va r arrSetti ng = new A rray(); | |||||
| 3657 | if ( typeof(a ction_sett ing) == "s tring" ) | |||||
| 3658 | arrS etting = a ction_sett ing.split( "|");// to split the combined action_set ting strin g | |||||
| 3659 | // to calibr ate the ar rays | |||||
| 3660 | fo r( var i = arrSettin g.length; i < arrAct ion.length ; i++ ) | |||||
| 3661 | { | |||||
| 3662 | if( typeof(arr Setting[i] ) != "stri ng" ) | |||||
| 3663 | arrSe tting[i] = ""; | |||||
| 3664 | } | |||||
| 3665 | ||||||
| 3666 | // to prepar e for deal ing with t he absolut e posionin g element | |||||
| 3667 | Ta rgetObject .eleTarget .ABSX = CC SSP.GetObj ectLeft( T argetObjec t.eleTarge t ); | |||||
| 3668 | Ta rgetObject .eleTarget .ABSY = CC SSP.GetObj ectTop( Ta rgetObject .eleTarget ); | |||||
| 3669 | ||||||
| 3670 | if ( arrEvent .length > 1 ) | |||||
| 3671 | {/ / if event is combin ed, it mus t be : "bs sctrigger1 | bssctri gger2" | |||||
| 3672 | if( arrAction. length != 2 ) | |||||
| 3673 | return false; // if event is combine d, there m ust be 2 a ctions | |||||
| 3674 | for( i = 0 ; i < 2; i++ ) | |||||
| 3675 | { | |||||
| 3676 | if( Ta rgetObject .SetEventM anager(arr Event[i], arrAction[ i], | |||||
| 3677 | arrSetti ng[i], eve nt_additio nal) == fa lse ) | |||||
| 3678 | return f alse; // t he event m anager has not been set up | |||||
| 3679 | } | |||||
| 3680 | } | |||||
| 3681 | el se // the event_type string is not combi ned | |||||
| 3682 | { | |||||
| 3683 | for( i = 0 ; i < arrActi on.length; i++ ) | |||||
| 3684 | { | |||||
| 3685 | Target Object.Set EventManag er(event_t ype, arrAc tion[i], a rrSetting[ i], event_ additional ); | |||||
| 3686 | // to validate t he event m anager | |||||
| 3687 | if( ty peof(Targe tObject.ob jManager[e vent_type] ) != "obje ct" || | |||||
| 3688 | typeof(Tar getObject. objManager [event_typ e][i]) != "object" ) | |||||
| 3689 | return f alse; // t he event m anager has not been set up | |||||
| 3690 | } | |||||
| 3691 | } | |||||
| 3692 | re turn true; | |||||
| 3693 | } | |||||
| 3694 | ||||||
| 3695 | CEngine.Bu ildTrigger Object = f unction(tr igger_ID, target_ID) | |||||
| 3696 | {// to bui ld the tri gger objec t | |||||
| 3697 | va r arrTrigg er = trigg er_ID.spli t("|"); // to split the combin ed trigger _ID string | |||||
| 3698 | fo r( var i = 0; i < ar rTrigger.l ength; i + + ) | |||||
| 3699 | {/ / to get t he trigger element t hen add it to the tr igger list | |||||
| 3700 | arrT rigger[i] = CCSSP.Tr imSpace( a rrTrigger[ i] ); | |||||
| 3701 | var eleTrigger = CCSSP.G etObject( arrTrigger [i] ); | |||||
| 3702 | if( eleTrigger == null ) | |||||
| 3703 | contin ue; // the trigger_I D string i n the HTML code mayb e wrong | |||||
| 3704 | CEng ine.AddOne Trigger( a rrTrigger[ i], eleTri gger ); | |||||
| 3705 | ||||||
| 3706 | // t o get the target obj ect | |||||
| 3707 | if( typeof( th is.objTrig ger[arrTri gger[i]] ) != "objec t" ) | |||||
| 3708 | contin ue;// the engine's A ddOneTarge t function might hav e failed. | |||||
| 3709 | CEng ine.objTri gger[arrTr igger[i]]. AddTargetI D( target_ ID ); | |||||
| 3710 | } | |||||
| 3711 | } | |||||
| 3712 | //End the definition of CEngin e class | |||||
| 3713 | ||||||
| 3714 | /// Sectio n End - C CSSP DHTM 1 (JavaScr ipt 1.2) | |||||
| 3715 | ||||||
| 3716 | /// Sectio n Begin - CCSSP DHT M 2 (JavaS cript 1.2) | |||||
| 3717 | ||||||
| 3718 | //Begin th e definiti on of CAge ncyXXXX cl asses | |||||
| 3719 | ||||||
| 3720 | //Begin of the CAgen cyShow def inition | |||||
| 3721 | function C AgencyShow ( element, bIsShow ) | |||||
| 3722 | { | |||||
| 3723 | th is.ele = e lement; | |||||
| 3724 | th is.bIsShow = bIsShow ; | |||||
| 3725 | } | |||||
| 3726 | ||||||
| 3727 | CAgencySho w.prototyp e.PrepareE ffect = fu nction() | |||||
| 3728 | { | |||||
| 3729 | CC SSP.ShowOb ject( this .ele, !thi s.bIsShow ); | |||||
| 3730 | } | |||||
| 3731 | ||||||
| 3732 | CAgencySho w.prototyp e.UpdateEf fect = fun ction() | |||||
| 3733 | { | |||||
| 3734 | CC SSP.ShowOb ject( this .ele, this .bIsShow ) ; | |||||
| 3735 | } | |||||
| 3736 | ||||||
| 3737 | CAgencySho w.prototyp e.EndEffec t = functi on() | |||||
| 3738 | { | |||||
| 3739 | CC SSP.ShowOb ject( this .ele, !thi s.bIsShow ); | |||||
| 3740 | } | |||||
| 3741 | // End of the CAgenc yShow defi nition | |||||
| 3742 | ||||||
| 3743 | // Begin o f CAgencyF ly definit ion | |||||
| 3744 | function C AgencyFly( element, settings, bIsIn ) | |||||
| 3745 | { | |||||
| 3746 | th is.ele = e lement; | |||||
| 3747 | th is.bIsIn = bIsIn; | |||||
| 3748 | th is.duratio n = 1000; // default | |||||
| 3749 | th is.directi on = "righ t"; | |||||
| 3750 | ||||||
| 3751 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 3752 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 3753 | {/ / to retri eve the se tting | |||||
| 3754 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 3755 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 3756 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 3757 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 3758 | swit ch( arrOne Set[0] ) | |||||
| 3759 | { | |||||
| 3760 | case "speed" : this.dura tion = 100 000/arrOne Set[1]; br eak; | |||||
| 3761 | case "directio n" : this. direction = arrOneSe t[1]; brea k; | |||||
| 3762 | } | |||||
| 3763 | } | |||||
| 3764 | ||||||
| 3765 | if ( this.ele .style.pos ition != " absolute" ) | |||||
| 3766 | this .ele.style .position = "relativ e"; | |||||
| 3767 | th is.timer = null; | |||||
| 3768 | th is.aniInde x = CEngin e.arrAnima tion.lengt h; | |||||
| 3769 | CE ngine.arrA nimation[t his.aniInd ex] = this ; | |||||
| 3770 | } | |||||
| 3771 | ||||||
| 3772 | CAgencyFly .prototype .PrepareEf fect = fun ction() | |||||
| 3773 | { | |||||
| 3774 | CC SSP.ShowOb ject(this. ele, !this .bIsIn ); | |||||
| 3775 | } | |||||
| 3776 | ||||||
| 3777 | CAgencyFly .prototype .UpdateEff ect = func tion() | |||||
| 3778 | { | |||||
| 3779 | if ( this.tim er == null ) | |||||
| 3780 | this .ResetPara meters(); | |||||
| 3781 | ||||||
| 3782 | va r percent = ((new Da te()).getT ime() - th is.startTi me)/this.d uration; | |||||
| 3783 | if ( percent >= 1.0 ) | |||||
| 3784 | this .EndEffect (); | |||||
| 3785 | el se | |||||
| 3786 | { | |||||
| 3787 | var newX = thi s.startX*( 1.0-percen t) + this .finalX*pe rcent; | |||||
| 3788 | var newY = thi s.startY*( 1.0-percen t) + this .finalY*pe rcent; | |||||
| 3789 | CCSS P.MoveObje ctTo(this. ele, newX, newY); | |||||
| 3790 | CCSS P.SetTimer (this,20); | |||||
| 3791 | } | |||||
| 3792 | } | |||||
| 3793 | ||||||
| 3794 | CAgencyFly .prototype .EndEffect = functio n() | |||||
| 3795 | { | |||||
| 3796 | cl earInterva l( this.ti mer ); | |||||
| 3797 | th is.timer = null; | |||||
| 3798 | ||||||
| 3799 | if ( this.bIs In ) // Fl yIn | |||||
| 3800 | CCSS P.MoveObje ctTo(this. ele, this. finalX, th is.finalY) ; | |||||
| 3801 | el se // FlyO ut | |||||
| 3802 | CCSS P.MoveObje ctTo(this. ele, this. startX, th is.startY) ; | |||||
| 3803 | CC SSP.ShowOb ject(this. ele, this. bIsIn ); | |||||
| 3804 | } | |||||
| 3805 | ||||||
| 3806 | CAgencyFly .prototype .ResetPara meters = f unction() | |||||
| 3807 | { | |||||
| 3808 | th is.Prepare Effect(); | |||||
| 3809 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 3810 | ||||||
| 3811 | th is.startX = 0; | |||||
| 3812 | th is.startY = 0; | |||||
| 3813 | th is.finalX = 0; | |||||
| 3814 | th is.finalY = 0; | |||||
| 3815 | ||||||
| 3816 | va r offsetLe ft = CCSSP .GetObject WindowLeft (this.ele) + this.el e.offsetWi dth; | |||||
| 3817 | va r offsetTo p = CCSSP. GetObjectW indowTop(t his.ele) + this.ele. offsetHeig ht; | |||||
| 3818 | va r offsetRi ght = CCSS P.GetWindo wRight(); | |||||
| 3819 | va r offsetBo ttom = CCS SP.GetWind owBottom() ; | |||||
| 3820 | ||||||
| 3821 | if ( this.bIs In ) | |||||
| 3822 | { // FlyIn | |||||
| 3823 | this .finalX = this.ele.A BSX; | |||||
| 3824 | this .finalY = this.ele.A BSY; | |||||
| 3825 | ||||||
| 3826 | swit ch( this.d irection ) | |||||
| 3827 | { | |||||
| 3828 | case "right": this.start X = offset Right; thi s.startY = this.fina lY; break; | |||||
| 3829 | case "left": t his.startX = -offset Left; thi s.startY = this.fina lY; break; | |||||
| 3830 | case "down": t his.startY = offsetB ottom; thi s.startX = this.fina lX; break; | |||||
| 3831 | case "up": th is.startY = -offsetT op; thi s.startX = this.fina lX; break; | |||||
| 3832 | case "downrigh t": | |||||
| 3833 | this.s tartX = ( offsetBott om < offse tRight) ? offsetBott om : offse tRight; | |||||
| 3834 | this.s tartY = th is.startX; break; | |||||
| 3835 | case "upright" : | |||||
| 3836 | this.s tartX = (o ffsetTop < offsetRig ht)? offse tTop : off setRight; | |||||
| 3837 | this.s tartY = -t his.startX ; break; | |||||
| 3838 | case "upleft": | |||||
| 3839 | this.s tartX = -( (offsetTop < offsetR ight)? off setTop : o ffsetRight ); | |||||
| 3840 | this.s tartY = th is.startX; break; | |||||
| 3841 | case "downleft ": | |||||
| 3842 | this.s tartX = -( ( offsetBo ttom < off setRight) ? offsetBo ttom : off setRight); | |||||
| 3843 | this.s tartY = -t his.startX ; brea k; | |||||
| 3844 | } | |||||
| 3845 | } | |||||
| 3846 | el se | |||||
| 3847 | { // FlyOut | |||||
| 3848 | this .startX = this.ele.A BSX; | |||||
| 3849 | this .startY = this.ele.A BSY; | |||||
| 3850 | ||||||
| 3851 | swit ch( this.d irection ) | |||||
| 3852 | { | |||||
| 3853 | case "right": this.final X = offset Right; th is.finalY = this.sta rtY; break ; | |||||
| 3854 | case "left": t his.finalX = -offset Left; th is.finalY = this.sta rtY; brea k; | |||||
| 3855 | case "down": t his.finalY = offsetB ottom; th is.finalX = this.sta rtX; break ; | |||||
| 3856 | case "up": th is.finalY = -offsetT op; th is.finalX = this.sta rtX; break ; | |||||
| 3857 | case "downrigh t": | |||||
| 3858 | this.f inalX = ( offsetBott om < offse tRight) ? offsetBott om : offse tRight; | |||||
| 3859 | this.f inalY = th is.finalX; break; | |||||
| 3860 | case "upright" : | |||||
| 3861 | this.f inalX = (o ffsetTop < offsetRig ht)? offse tTop : off setRight; | |||||
| 3862 | this.f inalY = -t his.finalX ; break; | |||||
| 3863 | case "upleft": | |||||
| 3864 | this.f inalX = -( (offsetTop < offsetR ight)? off setTop : o ffsetRight ); | |||||
| 3865 | this.f inalY = th is.finalX; break; | |||||
| 3866 | case "downleft ": | |||||
| 3867 | this.f inalX = -( ( offsetBo ttom < off setRight) ? offsetBo ttom : off setRight); | |||||
| 3868 | this.f inalY = -t his.finalX ; brea k; | |||||
| 3869 | } | |||||
| 3870 | } | |||||
| 3871 | CC SSP.MoveOb jectTo(thi s.ele, thi s.startX, this.start Y); | |||||
| 3872 | th is.startTi me = (new Date()).ge tTime(); | |||||
| 3873 | } | |||||
| 3874 | // End of the CAgenc yFly defin ition | |||||
| 3875 | ||||||
| 3876 | // Begin o f CAgencyS piral | |||||
| 3877 | function C AgencySpir al( elemen t, setting s, bIsIn ) | |||||
| 3878 | { | |||||
| 3879 | th is.ele = e lement; | |||||
| 3880 | th is.bIsIn = bIsIn; | |||||
| 3881 | th is.duratio n = 1000; // default | |||||
| 3882 | ||||||
| 3883 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 3884 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 3885 | {/ / to retri eve the se tting | |||||
| 3886 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 3887 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 3888 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 3889 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 3890 | swit ch( arrOne Set[0] ) | |||||
| 3891 | { | |||||
| 3892 | case "speed" : this.dura tion = 100 000/arrOne Set[1]; br eak; | |||||
| 3893 | } | |||||
| 3894 | } | |||||
| 3895 | ||||||
| 3896 | if ( this.ele .style.pos ition != " absolute" ) | |||||
| 3897 | this .ele.style .position = "relativ e"; | |||||
| 3898 | th is.timer = null; | |||||
| 3899 | th is.aniInde x = CEngin e.arrAnima tion.lengt h; | |||||
| 3900 | CE ngine.arrA nimation[t his.aniInd ex] = this ; | |||||
| 3901 | } | |||||
| 3902 | ||||||
| 3903 | CAgencySpi ral.protot ype.Prepar eEffect = function() | |||||
| 3904 | { | |||||
| 3905 | CC SSP.ShowOb ject(this. ele, !this .bIsIn ); | |||||
| 3906 | } | |||||
| 3907 | ||||||
| 3908 | CAgencySpi ral.protot ype.Update Effect = f unction() | |||||
| 3909 | { | |||||
| 3910 | if ( this.tim er == null ) | |||||
| 3911 | this .ResetPara meters(); | |||||
| 3912 | ||||||
| 3913 | va r percent = ((new Da te()).getT ime() - th is.startTi me)/this.d uration; | |||||
| 3914 | if ( percent >= 1.0 ) | |||||
| 3915 | this .EndEffect (); | |||||
| 3916 | el se | |||||
| 3917 | { | |||||
| 3918 | var rf = (this .bIsIn)? ( 1.0 - perc ent) : per cent; | |||||
| 3919 | var t = (1.0-r f) * 4.0 * Math.PI | |||||
| 3920 | var rxP = (thi s.bIsIn)? this.start X : this.f inalX; | |||||
| 3921 | var ryP = (thi s.bIsIn)? this.start Y : this.f inalY; | |||||
| 3922 | var rx = (Math .abs(rxP) < 200) ? M ath.abs(rx P) : 200; | |||||
| 3923 | var ry = (Math .abs(ryP) < 200) ? M ath.abs(ry P) : 200; | |||||
| 3924 | ||||||
| 3925 | var newX = Mat h.ceil(-rf *Math.cos( t)*rx) + t his.ele.AB SX; | |||||
| 3926 | var newY = Mat h.ceil(-rf *Math.sin( t)*ry) + t his.ele.AB SY; | |||||
| 3927 | CCSS P.MoveObje ctTo(this. ele, newX, newY); | |||||
| 3928 | CCSS P.SetTimer (this,20); | |||||
| 3929 | } | |||||
| 3930 | } | |||||
| 3931 | ||||||
| 3932 | CAgencySpi ral.protot ype.EndEff ect = func tion() | |||||
| 3933 | { | |||||
| 3934 | cl earInterva l( this.ti mer ); | |||||
| 3935 | th is.timer = null; | |||||
| 3936 | ||||||
| 3937 | if ( this.bIs In ) // In | |||||
| 3938 | CCSS P.MoveObje ctTo(this. ele, this. finalX, th is.finalY) ; | |||||
| 3939 | el se // Out | |||||
| 3940 | CCSS P.MoveObje ctTo(this. ele, this. startX, th is.startY) ; | |||||
| 3941 | CC SSP.ShowOb ject(this. ele, this. bIsIn ); | |||||
| 3942 | } | |||||
| 3943 | ||||||
| 3944 | CAgencySpi ral.protot ype.ResetP arameters = function () | |||||
| 3945 | { | |||||
| 3946 | th is.Prepare Effect(); | |||||
| 3947 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 3948 | th is.startX = (this.bI sIn)? CCSS P.GetWindo wRight() : this.ele. ABSX; | |||||
| 3949 | th is.startY = (this.bI sIn)? CCSS P.GetWindo wBottom() : this.ele .ABSY; | |||||
| 3950 | th is.finalX = (this.bI sIn)? this .ele.ABSX : CCSSP.Ge tWindowRig ht(); | |||||
| 3951 | th is.finalY = (this.bI sIn)? this .ele.ABSY : CCSSP.Ge tWindowBot tom(); | |||||
| 3952 | ||||||
| 3953 | CC SSP.MoveOb jectTo(thi s.ele, thi s.startX, this.start Y); | |||||
| 3954 | th is.startTi me = (new Date()).ge tTime(); | |||||
| 3955 | } | |||||
| 3956 | // End of CAgencySpi ral | |||||
| 3957 | ||||||
| 3958 | // Begin o f CAgencyE lastic | |||||
| 3959 | function C AgencyElas tic( eleme nt, settin gs) | |||||
| 3960 | { | |||||
| 3961 | th is.ele = e lement; | |||||
| 3962 | th is.duratio n = 1000; // default | |||||
| 3963 | th is.directi on = "righ t"; | |||||
| 3964 | ||||||
| 3965 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 3966 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 3967 | {/ / to retri eve the se tting | |||||
| 3968 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 3969 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 3970 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 3971 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 3972 | swit ch( arrOne Set[0] ) | |||||
| 3973 | { | |||||
| 3974 | case "speed" : this.dura tion = 100 000/arrOne Set[1]; br eak; | |||||
| 3975 | case "directio n" : this. direction = arrOneSe t[1]; brea k; | |||||
| 3976 | } | |||||
| 3977 | } | |||||
| 3978 | ||||||
| 3979 | if ( this.ele .style.pos ition != " absolute" ) | |||||
| 3980 | this .ele.style .position = "relativ e"; | |||||
| 3981 | th is.timer = null; | |||||
| 3982 | th is.aniInde x = CEngin e.arrAnima tion.lengt h; | |||||
| 3983 | CE ngine.arrA nimation[t his.aniInd ex] = this ; | |||||
| 3984 | } | |||||
| 3985 | ||||||
| 3986 | CAgencyEla stic.proto type.Prepa reEffect = function( ) | |||||
| 3987 | { | |||||
| 3988 | CC SSP.ShowOb ject(this. ele, false ); | |||||
| 3989 | } | |||||
| 3990 | ||||||
| 3991 | CAgencyEla stic.proto type.Updat eEffect = function() | |||||
| 3992 | { | |||||
| 3993 | if ( this.tim er == null ) | |||||
| 3994 | this .ResetPara meters(); | |||||
| 3995 | ||||||
| 3996 | va r percent = ((new Da te()).getT ime() - th is.startTi me)/this.d uration; | |||||
| 3997 | if ( percent >= 1.0 ) | |||||
| 3998 | this .EndEffect (); | |||||
| 3999 | el se | |||||
| 4000 | { | |||||
| 4001 | var newX = thi s.startX; | |||||
| 4002 | var newY = thi s.startY; | |||||
| 4003 | var rf = Math. exp(-perce nt*3); | |||||
| 4004 | var t = percen t * 1.5 * Math.PI | |||||
| 4005 | var rx = (Math .abs(this. startX) > Math.abs(t his.startY )) ? this. startX : t his.startY ; | |||||
| 4006 | swit ch (this.d irection ) | |||||
| 4007 | { | |||||
| 4008 | case "left": | |||||
| 4009 | case "right" : newX = rf *Math.cos( t)*rx + th is.ele.ABS X; break; | |||||
| 4010 | case "up": | |||||
| 4011 | case "down" : newY = rf *Math.cos( t)*rx + th is.ele.ABS X; break; | |||||
| 4012 | } | |||||
| 4013 | CCSS P.MoveObje ctTo(this. ele, newX, newY); | |||||
| 4014 | CCSS P.SetTimer (this,20); | |||||
| 4015 | } | |||||
| 4016 | } | |||||
| 4017 | ||||||
| 4018 | CAgencyEla stic.proto type.EndEf fect = fun ction() | |||||
| 4019 | { | |||||
| 4020 | CC SSP.MoveOb jectTo(thi s.ele, thi s.finalX, this.final Y); | |||||
| 4021 | cl earInterva l( this.ti mer ); | |||||
| 4022 | th is.timer = null; | |||||
| 4023 | } | |||||
| 4024 | ||||||
| 4025 | CAgencyEla stic.proto type.Reset Parameters = functio n() | |||||
| 4026 | { | |||||
| 4027 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4028 | th is.startX = this.ele .ABSX; | |||||
| 4029 | th is.finalX = this.ele .ABSX; | |||||
| 4030 | th is.startY = this.ele .ABSY; | |||||
| 4031 | th is.finalY = this.ele .ABSY; | |||||
| 4032 | ||||||
| 4033 | sw itch (this .direction ) | |||||
| 4034 | { | |||||
| 4035 | ca se "left": this.sta rtX = -thi s.ele.offs etWidth; b reak; | |||||
| 4036 | ca se "right" : this.sta rtX = this .ele.offse tWidth; b reak; | |||||
| 4037 | ca se "up": this.sta rtY = -thi s.ele.offs etHeight;b reak; | |||||
| 4038 | ca se "down": this.sta rtY = this .ele.offse tHeight; b reak; | |||||
| 4039 | } | |||||
| 4040 | CC SSP.MoveOb jectTo(thi s.ele, thi s.startX, this.start Y); | |||||
| 4041 | th is.startTi me = (new Date()).ge tTime(); | |||||
| 4042 | } | |||||
| 4043 | // End of CAgencyEla stic | |||||
| 4044 | ||||||
| 4045 | // Begin o f CAgencyZ oom | |||||
| 4046 | function C AgencyZoom ( element, settings, bIsIn) | |||||
| 4047 | { | |||||
| 4048 | th is.ele = e lement; | |||||
| 4049 | th is.duratio n = 1000; // default | |||||
| 4050 | ||||||
| 4051 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4052 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4053 | {/ / to retri eve the se tting | |||||
| 4054 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4055 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4056 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4057 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4058 | swit ch( arrOne Set[0] ) | |||||
| 4059 | { | |||||
| 4060 | case "speed" : this.dura tion = 100 000/arrOne Set[1]; br eak; | |||||
| 4061 | } | |||||
| 4062 | } | |||||
| 4063 | ||||||
| 4064 | th is.bIsIn = bIsIn; | |||||
| 4065 | th is.timer = null; | |||||
| 4066 | th is.aniInde x = CEngin e.arrAnima tion.lengt h; | |||||
| 4067 | CE ngine.arrA nimation[t his.aniInd ex] = this ; | |||||
| 4068 | } | |||||
| 4069 | ||||||
| 4070 | CAgencyZoo m.prototyp e.PrepareE ffect = fu nction() | |||||
| 4071 | { | |||||
| 4072 | CC SSP.ShowOb ject(this. ele, false ); | |||||
| 4073 | } | |||||
| 4074 | ||||||
| 4075 | CAgencyZoo m.prototyp e.UpdateEf fect = fun ction() | |||||
| 4076 | { | |||||
| 4077 | if ( this.tim er == null ) | |||||
| 4078 | this .ResetPara meters(); | |||||
| 4079 | ||||||
| 4080 | va r percent = ((new Da te()).getT ime() - th is.startTi me)/this.d uration; | |||||
| 4081 | if ( percent >= 1.0 ) | |||||
| 4082 | this .EndEffect (); | |||||
| 4083 | el se | |||||
| 4084 | { | |||||
| 4085 | var nFactorIn = Math.cei l(50+50*pe rcent); | |||||
| 4086 | var nFactorOut = Math.ce il(100+200 *(1-percen t)); | |||||
| 4087 | var AlterFonts ize = ((th is.bIsIn)? nFactorIn : nFactor Out) + "%" ; | |||||
| 4088 | var AlterFacto r = ((this .bIsIn)? n FactorIn : nFactorOu t) / 100; | |||||
| 4089 | ||||||
| 4090 | this .UpdateEff ectAllChil dren(this. ele, Alter Fontsize, AlterFacto r); | |||||
| 4091 | var arr ; | |||||
| 4092 | if ( this.ele.a ll) | |||||
| 4093 | arr = this .ele.all ; | |||||
| 4094 | else | |||||
| 4095 | arr = this .ele.getEl ementsByTa gName ('*' ); | |||||
| 4096 | for( var index = 0; index < arr.len gth; index ++) | |||||
| 4097 | this.U pdateEffec tAllChildr en(arr[ind ex], Alter Fontsize, AlterFacto r); | |||||
| 4098 | ||||||
| 4099 | CCSS P.SetTimer (this,20); | |||||
| 4100 | } | |||||
| 4101 | } | |||||
| 4102 | ||||||
| 4103 | CAgencyZoo m.prototyp e.UpdateEf fectAllChi ldren = fu nction(chi ld, FontSi ze, Factor ) | |||||
| 4104 | { | |||||
| 4105 | if ( CCSSP.Is TextTag(ch ild) ) | |||||
| 4106 | chil d.style.fo ntSize = F ontSize; | |||||
| 4107 | el se | |||||
| 4108 | { | |||||
| 4109 | if( typeof(chi ld.orgWidt h) == "num ber" ) | |||||
| 4110 | child. style.widt h = Factor * child.o rgWidth; | |||||
| 4111 | if( typeof(chi ld.orgHeig ht) == "nu mber" ) | |||||
| 4112 | child. style.heig ht = Facto r * child. orgHeight; | |||||
| 4113 | } | |||||
| 4114 | } | |||||
| 4115 | ||||||
| 4116 | CAgencyZoo m.prototyp e.EndEffec t = functi on() | |||||
| 4117 | { | |||||
| 4118 | th is.EndEffe ctAllChild ren(this.e le); | |||||
| 4119 | va r arr ; | |||||
| 4120 | if (this.ele. all) | |||||
| 4121 | arr = th is.ele.all ; | |||||
| 4122 | el se | |||||
| 4123 | arr = th is.ele.get ElementsBy TagName('* '); | |||||
| 4124 | fo r(var inde x = 0; ind ex < arr.l ength; ind ex++) | |||||
| 4125 | this .EndEffect AllChildre n(arr[inde x]); | |||||
| 4126 | ||||||
| 4127 | cl earInterva l( this.ti mer ); | |||||
| 4128 | th is.timer = null; | |||||
| 4129 | } | |||||
| 4130 | ||||||
| 4131 | CAgencyZoo m.prototyp e.EndEffec tAllChildr en = funct ion( child ) | |||||
| 4132 | { | |||||
| 4133 | if ( CCSSP.Is TextTag(ch ild) ) | |||||
| 4134 | chil d.style.fo ntSize = c hild.orgFo ntSize; | |||||
| 4135 | el se | |||||
| 4136 | { | |||||
| 4137 | if( typeof(chi ld.intactW idth) != " undefined" ) | |||||
| 4138 | { | |||||
| 4139 | child. width = ch ild.intact Width; | |||||
| 4140 | child. height = c hild.intac tHeight; | |||||
| 4141 | } | |||||
| 4142 | else if( typeo f(child.st yle.intact PixelWidth ) != "unde fined" ) | |||||
| 4143 | { | |||||
| 4144 | child. style.pixe lWidth = c hild.style .intactPix elWidth; | |||||
| 4145 | child. style.pixe lHeight = child.styl e.intactPi xelHeight; | |||||
| 4146 | } | |||||
| 4147 | } | |||||
| 4148 | } | |||||
| 4149 | ||||||
| 4150 | CAgencyZoo m.prototyp e.ResetPar ameters = function() | |||||
| 4151 | { | |||||
| 4152 | th is.Prepare Effect(); | |||||
| 4153 | th is.ResetPa rametersAl lChildren( this.ele ); | |||||
| 4154 | va r arr ; | |||||
| 4155 | if (this.ele .all) | |||||
| 4156 | arr = th is.ele.all ; | |||||
| 4157 | el se | |||||
| 4158 | arr = th is.ele.get ElementsBy TagName('* '); | |||||
| 4159 | fo r(var inde x = 0; ind ex < arr.l ength; ind ex++) | |||||
| 4160 | this .ResetPara metersAllC hildren(ar r[index]); | |||||
| 4161 | ||||||
| 4162 | th is.startTi me = (new Date()).ge tTime(); | |||||
| 4163 | } | |||||
| 4164 | ||||||
| 4165 | CAgencyZoo m.prototyp e.ResetPar ametersAll Children = function( child ) | |||||
| 4166 | { | |||||
| 4167 | CC SSP.ShowOb ject(child , true ); | |||||
| 4168 | if ( (child.t agName == "DIV") && (getParent Node(child ).tagName == "TD") ) | |||||
| 4169 | chil d.width = "100%";// if the div is inside a cell of table, we need the this hack | |||||
| 4170 | ||||||
| 4171 | if ( CCSSP.Is TextTag(ch ild) ) | |||||
| 4172 | chil d.orgFontS ize = chil d.style.fo ntSize; | |||||
| 4173 | el se | |||||
| 4174 | { | |||||
| 4175 | if( child.widt h > "" || child.heig ht > "" ) | |||||
| 4176 | { | |||||
| 4177 | child. orgWidth = child.int actWidth = child.wid th; | |||||
| 4178 | child. orgHeight = child.in tactHeight = child.h eight; | |||||
| 4179 | } | |||||
| 4180 | else if( ( typ eof(child. orgWidth) != "number " ) && (ty peof(child .orgHeight ) != "numb er") ) | |||||
| 4181 | { | |||||
| 4182 | child. orgWidth = child.sty le.intactP ixelWidth = child.st yle.pixelW idth; | |||||
| 4183 | child. orgHeight = child.st yle.intact PixelHeigh t = child. style.pixe lHeight; | |||||
| 4184 | } | |||||
| 4185 | } | |||||
| 4186 | } | |||||
| 4187 | // End of CAgencyZoo m | |||||
| 4188 | ||||||
| 4189 | //// the f ollowing e ffects wil l use IE's exclusive "filter" function / /// | |||||
| 4190 | // Begin o f CAgencyA lpha defin ition | |||||
| 4191 | function C AgencyAlph a( element , settings , bIsIn ) | |||||
| 4192 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4193 | th is.ele = e lement; | |||||
| 4194 | th is.bIsIn = bIsIn; | |||||
| 4195 | ||||||
| 4196 | // to set th e default value | |||||
| 4197 | th is.startOp acity = (t his.bIsIn) ? 0 : 100 ; | |||||
| 4198 | th is.endOpac ity = (thi s.bIsIn) ? 100 : 0; | |||||
| 4199 | ||||||
| 4200 | th is.duratio n = 1000; // default | |||||
| 4201 | ||||||
| 4202 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4203 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4204 | {/ / to retri eve the se tting | |||||
| 4205 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4206 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4207 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4208 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4209 | swit ch( arrOne Set[0] ) | |||||
| 4210 | { | |||||
| 4211 | case "speed" : this.dura tion = 100 000/arrOne Set[1]; br eak; | |||||
| 4212 | } | |||||
| 4213 | } | |||||
| 4214 | ||||||
| 4215 | th is.timer = null; | |||||
| 4216 | th is.aniInde x = CEngin e.arrAnima tion.lengt h; | |||||
| 4217 | CE ngine.arrA nimation[t his.aniInd ex] = this ; | |||||
| 4218 | } | |||||
| 4219 | ||||||
| 4220 | CAgencyAlp ha.prototy pe.Prepare Effect = f unction() | |||||
| 4221 | {// to set the visua l filter f unction | |||||
| 4222 | // the visua l filter O NLY work w hen set by "Width an d Height" or | |||||
| 4223 | // absolute position f or DIV, SP AN and nor mal tag ( such as p ) | |||||
| 4224 | // but, "abs olute" cau se the fol lowing ele ments over lap, so: | |||||
| 4225 | CC SSP.Prepar eFilter( t his.ele ); | |||||
| 4226 | CC SSP.ShowOb ject(this. ele, !this .bIsIn ); | |||||
| 4227 | } | |||||
| 4228 | ||||||
| 4229 | CAgencyAlp ha.prototy pe.UpdateE ffect = fu nction() | |||||
| 4230 | {// to set the visua l filter f unction | |||||
| 4231 | if ( this.tim er == null ) | |||||
| 4232 | this .ResetPara meters(); | |||||
| 4233 | if ( typeof(t his.ele.fi lters.alph a) != "obj ect" ) | |||||
| 4234 | { | |||||
| 4235 | this .EndEffect (); | |||||
| 4236 | retu rn; | |||||
| 4237 | } | |||||
| 4238 | ||||||
| 4239 | va r percent = ((new Da te()).getT ime() - th is.startTi me)/this.d uration; | |||||
| 4240 | if ( percent >= 1.0 ) | |||||
| 4241 | this .EndEffect (); | |||||
| 4242 | el se if( typ eof(this.e le.filters .alpha) == "object" ) | |||||
| 4243 | { | |||||
| 4244 | this .ele.filte rs.alpha.o pacity = t his.startO pacity*(1. 0-percent) + this.en dOpacity*p ercent; | |||||
| 4245 | CCSS P.SetTimer (this,20); | |||||
| 4246 | } | |||||
| 4247 | } | |||||
| 4248 | ||||||
| 4249 | CAgencyAlp ha.prototy pe.EndEffe ct = funct ion() | |||||
| 4250 | {// to rem ove the vi sual filte r function | |||||
| 4251 | cl earInterva l( this.ti mer ); | |||||
| 4252 | th is.timer = null; | |||||
| 4253 | th is.ele.sty le.filter = ""; | |||||
| 4254 | CC SSP.ShowOb ject(this. ele, this. bIsIn ); | |||||
| 4255 | } | |||||
| 4256 | ||||||
| 4257 | CAgencyAlp ha.prototy pe.ResetPa rameters = function( ) | |||||
| 4258 | { | |||||
| 4259 | th is.Prepare Effect(); | |||||
| 4260 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4261 | th is.ele.sty le.filter = "alpha(o pacity=" + this.star tOpacity + ")"; | |||||
| 4262 | th is.startTi me = (new Date()).ge tTime(); | |||||
| 4263 | } | |||||
| 4264 | // End of the CAgenc yAlpha def inition | |||||
| 4265 | ||||||
| 4266 | // Begin o f CAgencyW ave defini tion | |||||
| 4267 | function C AgencyWave ( element, settings ) | |||||
| 4268 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4269 | th is.ele = e lement; | |||||
| 4270 | ||||||
| 4271 | th is.duratio n = 0; // default | |||||
| 4272 | th is.strengt h = 10; | |||||
| 4273 | th is.freq = 1; | |||||
| 4274 | th is.lightst rength = 1 ; | |||||
| 4275 | ||||||
| 4276 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4277 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4278 | {/ / to retri eve the se tting | |||||
| 4279 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4280 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4281 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4282 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4283 | swit ch( arrOne Set[0] ) | |||||
| 4284 | { | |||||
| 4285 | case "duration " : this.d uration = 100000/arr OneSet[1]; break; | |||||
| 4286 | case "strength " : this.s trength = arrOneSet[ 1]; break; | |||||
| 4287 | case "freq" : this.freq = arrOneSe t[1]; brea k; | |||||
| 4288 | case "lightstr ength" : t his.lights trength = arrOneSet[ 1]; break; | |||||
| 4289 | } | |||||
| 4290 | } | |||||
| 4291 | ||||||
| 4292 | th is.timer = null; | |||||
| 4293 | th is.aniInde x = CEngin e.arrAnima tion.lengt h; | |||||
| 4294 | CE ngine.arrA nimation[t his.aniInd ex] = this ; | |||||
| 4295 | } | |||||
| 4296 | ||||||
| 4297 | CAgencyWav e.prototyp e.PrepareE ffect = fu nction() | |||||
| 4298 | {// to set the visua l filter f unction | |||||
| 4299 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4300 | ||||||
| 4301 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4302 | } | |||||
| 4303 | ||||||
| 4304 | CAgencyWav e.prototyp e.UpdateEf fect = fun ction() | |||||
| 4305 | {// to set the visua l filter f unction | |||||
| 4306 | if ( this.tim er == null ) | |||||
| 4307 | this .ResetPara meters(); | |||||
| 4308 | if ( (typeof( this.ele.f ilters) == "undefine d") || (ty peof(this. ele.filter s.wave) != "object" ) ) | |||||
| 4309 | { | |||||
| 4310 | this .EndEffect (); | |||||
| 4311 | retu rn; | |||||
| 4312 | } | |||||
| 4313 | ||||||
| 4314 | if ( this.dur ation > 0 ) | |||||
| 4315 | { | |||||
| 4316 | var percent = ((new Date ()).getTim e() - this .startTime )/this.dur ation; | |||||
| 4317 | if( percent >= 1.0 ) | |||||
| 4318 | { | |||||
| 4319 | this.E ndEffect() ; | |||||
| 4320 | return ; | |||||
| 4321 | } | |||||
| 4322 | } | |||||
| 4323 | ||||||
| 4324 | th is.ele.fil ters.wave. phase += 5 ; | |||||
| 4325 | th is.ele.fil ters.wave. phase %= 1 00; | |||||
| 4326 | CC SSP.SetTim er(this,50 ); | |||||
| 4327 | } | |||||
| 4328 | ||||||
| 4329 | CAgencyWav e.prototyp e.EndEffec t = functi on() | |||||
| 4330 | {// to rem ove the vi sual filte r function | |||||
| 4331 | th is.ele.sty le.filter = ""; | |||||
| 4332 | cl earInterva l( this.ti mer ); | |||||
| 4333 | th is.timer = null; | |||||
| 4334 | } | |||||
| 4335 | ||||||
| 4336 | CAgencyWav e.prototyp e.ResetPar ameters = function() | |||||
| 4337 | { | |||||
| 4338 | th is.Prepare Effect(); | |||||
| 4339 | th is.ele.sty le.filter = "wave(st rength=" + this.stre ngth + ",f req=" + | |||||
| 4340 | t his.freq + ", lightst rength=" + this.ligh tstrength +",phase=0 );"; | |||||
| 4341 | th is.startTi me = (new Date()).ge tTime(); | |||||
| 4342 | } | |||||
| 4343 | // End of the CAgenc yWave defi nition | |||||
| 4344 | ||||||
| 4345 | // Begin o f CAgencyG low defini tion | |||||
| 4346 | function C AgencyGlow ( element, settings ) | |||||
| 4347 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4348 | th is.ele = e lement; | |||||
| 4349 | ||||||
| 4350 | // to set th e default value | |||||
| 4351 | th is.glowCol or = "gree n"; | |||||
| 4352 | th is.glowStr ength = "3 "; | |||||
| 4353 | ||||||
| 4354 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4355 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4356 | { | |||||
| 4357 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4358 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4359 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4360 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4361 | swit ch( arrOne Set[0] ) | |||||
| 4362 | { | |||||
| 4363 | case "color" : this.glow Color = ar rOneSet[1] ; break; | |||||
| 4364 | case "strength " : this.g lowStrengt h = arrOne Set[1]; br eak; | |||||
| 4365 | } | |||||
| 4366 | } | |||||
| 4367 | } | |||||
| 4368 | ||||||
| 4369 | CAgencyGlo w.prototyp e.PrepareE ffect = fu nction() | |||||
| 4370 | { | |||||
| 4371 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4372 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4373 | if ( this.ele .style.bac kgroundCol or != "" ) | |||||
| 4374 | {/ /style.bac kgroundCol or somehow stop the visual fil ter | |||||
| 4375 | this .ele.intac tBackgroun dColor = t his.ele.st yle.backgr oundColor; | |||||
| 4376 | this .ele.style .backgroun dColor = " "; | |||||
| 4377 | } | |||||
| 4378 | } | |||||
| 4379 | ||||||
| 4380 | CAgencyGlo w.prototyp e.UpdateEf fect = fun ction() | |||||
| 4381 | {// to set the visua l filter f unction | |||||
| 4382 | th is.Prepare Effect(); | |||||
| 4383 | th is.ele.sty le.filter = "glow(Co lor=" + th is.glowCol or + ", St rength=" + | |||||
| 4384 | this .glowStren gth + ", e nabled=tru e" +")"; | |||||
| 4385 | } | |||||
| 4386 | ||||||
| 4387 | CAgencyGlo w.prototyp e.EndEffec t = functi on() | |||||
| 4388 | {// to rem ove the vi sual filte r function | |||||
| 4389 | th is.ele.sty le.filter = ""; | |||||
| 4390 | if ( typeof(t his.ele.in tactBackgr oundColor) != "undef ined" ) | |||||
| 4391 | this .ele.style .backgroun dColor = t his.ele.in tactBackgr oundColor; | |||||
| 4392 | } | |||||
| 4393 | // End of the CAgenc yGlow defi nition | |||||
| 4394 | ||||||
| 4395 | // Begin o f CAgencyD ropShadow definition | |||||
| 4396 | function C AgencyDrop Shadow( el ement, set tings ) | |||||
| 4397 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4398 | th is.ele = e lement; | |||||
| 4399 | ||||||
| 4400 | // to set th e default value | |||||
| 4401 | th is.shadowC olor = "bl ack"; | |||||
| 4402 | th is.shadowO ffx = "1"; | |||||
| 4403 | th is.shadowO ffy = "1"; | |||||
| 4404 | ||||||
| 4405 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4406 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4407 | { | |||||
| 4408 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4409 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4410 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4411 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4412 | swit ch( arrOne Set[0] ) | |||||
| 4413 | { | |||||
| 4414 | case "color" : this.shad owColor = arrOneSet[ 1]; break; | |||||
| 4415 | case "offx" : this.shado wOffx = ar rOneSet[1] ; break; | |||||
| 4416 | case "offy" : this.shado wOffy = ar rOneSet[1] ; break; | |||||
| 4417 | } | |||||
| 4418 | } | |||||
| 4419 | } | |||||
| 4420 | ||||||
| 4421 | CAgencyDro pShadow.pr ototype.Pr epareEffec t = functi on() | |||||
| 4422 | { | |||||
| 4423 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4424 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4425 | ||||||
| 4426 | if ( this.ele .style.bac kgroundCol or != "" ) | |||||
| 4427 | {/ /style.bac kgroundCol or somehow stop the visual fil ter | |||||
| 4428 | this .ele.intac tBackgroun dColor = t his.ele.st yle.backgr oundColor; | |||||
| 4429 | this .ele.style .backgroun dColor = " "; | |||||
| 4430 | } | |||||
| 4431 | } | |||||
| 4432 | ||||||
| 4433 | CAgencyDro pShadow.pr ototype.Up dateEffect = functio n() | |||||
| 4434 | {// to set the visua l filter f unction | |||||
| 4435 | th is.Prepare Effect(); | |||||
| 4436 | th is.ele.sty le.filter = "dropsha dow(color= " + this.s hadowColor + ", offx =" + | |||||
| 4437 | this .shadowOff x + ", off y=" + this .shadowOff y + ")"; | |||||
| 4438 | } | |||||
| 4439 | ||||||
| 4440 | CAgencyDro pShadow.pr ototype.En dEffect = function() | |||||
| 4441 | {// to rem ove the vi sual filte r function | |||||
| 4442 | th is.ele.sty le.filter = ""; | |||||
| 4443 | if ( typeof(t his.ele.in tactBackgr oundColor) != "undef ined" ) | |||||
| 4444 | this .ele.style .backgroun dColor = t his.ele.in tactBackgr oundColor; | |||||
| 4445 | } | |||||
| 4446 | // End of the CAgenc yDropShado w definiti on | |||||
| 4447 | ||||||
| 4448 | // Begin o f CAgencyR evealTrans definitio n | |||||
| 4449 | function C AgencyReve alTrans( e lement, se ttings ) | |||||
| 4450 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4451 | th is.ele = e lement; | |||||
| 4452 | ||||||
| 4453 | // to set th e default value | |||||
| 4454 | th is.duratio n = 1.0; / /The value is specif ied in sec onds.milli seconds fo rmat (0.00 00). | |||||
| 4455 | th is.transit ion = 0; | |||||
| 4456 | ||||||
| 4457 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4458 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4459 | { | |||||
| 4460 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4461 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4462 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4463 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4464 | swit ch( arrOne Set[0] ) | |||||
| 4465 | { | |||||
| 4466 | case "type" : this.trans ition = ar rOneSet[1] ; break; | |||||
| 4467 | case "duration " : this.d uration = 100/arrOne Set[1]; break; | |||||
| 4468 | } | |||||
| 4469 | } | |||||
| 4470 | } | |||||
| 4471 | ||||||
| 4472 | CAgencyRev ealTrans.p rototype.P repareEffe ct = funct ion() | |||||
| 4473 | { | |||||
| 4474 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4475 | CC SSP.ShowOb ject( this .ele, fals e); | |||||
| 4476 | } | |||||
| 4477 | ||||||
| 4478 | CAgencyRev ealTrans.p rototype.U pdateEffec t = functi on() | |||||
| 4479 | {// to set the visua l filter f unction | |||||
| 4480 | if ( typeof( this.ele.f ilters.Rev ealTrans ) == "objec t" ) | |||||
| 4481 | { | |||||
| 4482 | if( this.ele.f ilters.Rev ealTrans.s tatus == 2 ) | |||||
| 4483 | this.e le.filters .RevealTra ns.stop(); | |||||
| 4484 | } | |||||
| 4485 | ||||||
| 4486 | th is.Prepare Effect(); | |||||
| 4487 | ||||||
| 4488 | th is.ele.sty le.filter = "RevealT rans(durat ion=" + th is.duratio n + | |||||
| 4489 | ", t ransition= " + this.t ransition + ")"; | |||||
| 4490 | ||||||
| 4491 | if( ty peof( this .ele.filte rs.RevealT rans ) == "object" ) | |||||
| 4492 | { | |||||
| 4493 | this .ele.filte rs.RevealT rans.apply (); | |||||
| 4494 | CCSS P.ShowObje ct( this.e le, true); | |||||
| 4495 | this .ele.filte rs.RevealT rans.play( ); | |||||
| 4496 | } | |||||
| 4497 | el se | |||||
| 4498 | CCSS P.ShowObje ct( this.e le, true); | |||||
| 4499 | } | |||||
| 4500 | ||||||
| 4501 | CAgencyRev ealTrans.p rototype.E ndEffect = function( ) | |||||
| 4502 | { | |||||
| 4503 | if( ty peof( this .ele.filte rs.RevealT rans ) == "object" ) | |||||
| 4504 | this .ele.filte rs.RevealT rans.stop( ); | |||||
| 4505 | th is.ele.sty le.filter = ""; | |||||
| 4506 | } | |||||
| 4507 | // End of the CAgenc yRevealTra ns definit ion | |||||
| 4508 | ||||||
| 4509 | // Begin o f CAgencyB lur defini tion | |||||
| 4510 | function C AgencyBlur ( element, settings ) | |||||
| 4511 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4512 | th is.ele = e lement; | |||||
| 4513 | ||||||
| 4514 | // to set th e default value | |||||
| 4515 | th is.strengt h = "5"; | |||||
| 4516 | th is.directi on = "90"; | |||||
| 4517 | ||||||
| 4518 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4519 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4520 | { | |||||
| 4521 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4522 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4523 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4524 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4525 | swit ch( arrOne Set[0] ) | |||||
| 4526 | { | |||||
| 4527 | case "strength " : this.s trength = arrOneSet[ 1]; break; | |||||
| 4528 | case "directio n" : this. direction = arrOneSe t[1]; brea k; | |||||
| 4529 | } | |||||
| 4530 | } | |||||
| 4531 | } | |||||
| 4532 | ||||||
| 4533 | CAgencyBlu r.prototyp e.PrepareE ffect = fu nction() | |||||
| 4534 | { | |||||
| 4535 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4536 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4537 | } | |||||
| 4538 | ||||||
| 4539 | CAgencyBlu r.prototyp e.UpdateEf fect = fun ction() | |||||
| 4540 | {// to set the visua l filter f unction | |||||
| 4541 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4542 | th is.ele.sty le.filter = "blur(st rength=" + this.stre ngth + | |||||
| 4543 | ", d irection=" + this.di rection + ")"; | |||||
| 4544 | } | |||||
| 4545 | ||||||
| 4546 | CAgencyBlu r.prototyp e.EndEffec t = functi on() | |||||
| 4547 | {// to rem ove the vi sual filte r function | |||||
| 4548 | th is.ele.sty le.filter = ""; | |||||
| 4549 | } | |||||
| 4550 | // End of the CAgenc yBlur defi nition | |||||
| 4551 | ||||||
| 4552 | // Begin o f CAgencyC hangeFilte r definiti on | |||||
| 4553 | function C AgencyChan geFilter( element, s ettings ) // flipH, flipV, inv ert, grey, | |||||
| 4554 | {// becaus e of "visu al filter" style, th is won't w ork in Nav igator | |||||
| 4555 | th is.ele = e lement; | |||||
| 4556 | ||||||
| 4557 | // to set th e default value | |||||
| 4558 | th is.filterF unction = settings; | |||||
| 4559 | } | |||||
| 4560 | ||||||
| 4561 | CAgencyCha ngeFilter. prototype. PrepareEff ect = func tion() | |||||
| 4562 | { | |||||
| 4563 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4564 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4565 | } | |||||
| 4566 | ||||||
| 4567 | CAgencyCha ngeFilter. prototype. UpdateEffe ct = funct ion() | |||||
| 4568 | {// to set the visua l filter f unction | |||||
| 4569 | CC SSP.Prepar eFilter(th is.ele); | |||||
| 4570 | th is.ele.sty le.filter = this.fil terFunctio n; | |||||
| 4571 | } | |||||
| 4572 | ||||||
| 4573 | CAgencyCha ngeFilter. prototype. EndEffect = function () | |||||
| 4574 | {// to rem ove the vi sual filte r function | |||||
| 4575 | th is.ele.sty le.filter = ""; | |||||
| 4576 | } | |||||
| 4577 | // End of the CAgenc yChangeFil ter defini tion | |||||
| 4578 | ||||||
| 4579 | // The eff ects below change th e style on the fly, so they wo n't work i n Navigato r | |||||
| 4580 | ||||||
| 4581 | // Begin o f CAgencyF ontChange definition , | |||||
| 4582 | function C AgencyFont Change( el ement, set tings ) | |||||
| 4583 | {//this cl ass can be replace b y CAgencyC hangeStyle ,provided the "setti ngs" is st andard CSS string. | |||||
| 4584 | th is.ele = e lement; | |||||
| 4585 | ||||||
| 4586 | // to retrie ve the ori ginal font style | |||||
| 4587 | th is.Retriev eOldFont( this.ele ) ; | |||||
| 4588 | ||||||
| 4589 | // to set th e default font to ch ange | |||||
| 4590 | th is.newfont Family = t his.ele.ol dFontFamil y; | |||||
| 4591 | th is.newfCol or = this. ele.oldCol or; | |||||
| 4592 | th is.newtext Decoration = this.el e.oldTextD ecoration; | |||||
| 4593 | th is.newfont Weight = t his.ele.ol dFontWeigh t; | |||||
| 4594 | th is.newfont Style = th is.ele.old FontStyle; | |||||
| 4595 | th is.newfont Size = thi s.ele.oldF ontSize; | |||||
| 4596 | th is.newBack groundColo r = this.e le.oldBack groundColo r; | |||||
| 4597 | ||||||
| 4598 | va r arrAllSe t = settin gs.split(" ,"); | |||||
| 4599 | fo r( var i = 0; i < ar rAllSet.le ngth; i ++ ) | |||||
| 4600 | {/ / to retri eve the se tting | |||||
| 4601 | arrA llSet[i] = CCSSP.Tri mSpace(arr AllSet[i]) ; | |||||
| 4602 | var arrOneSet = arrAllSe t[i].split ("="); | |||||
| 4603 | for( var j = 0 ; j < arrO neSet.leng th; j++ ) | |||||
| 4604 | arrOne Set[j] = C CSSP.TrimS pace(arrOn eSet[j]); | |||||
| 4605 | swit ch( arrOne Set[0] ) | |||||
| 4606 | { | |||||
| 4607 | case "font-fam ily" : thi s.newfontF amily = ar rOneSet[1] ; break; | |||||
| 4608 | case "color" : this.newf Color = ar rOneSet[1] ; break; | |||||
| 4609 | case "underlin e" : this. newtextDec oration = (arrOneSet [1]=="on") ? "underli ne" : "non e"; break; | |||||
| 4610 | case "bold" : this.newfo ntWeight = (arrOneSe t[1]=="on" )? "bold" : "normal" ; break; | |||||
| 4611 | case "italic" : this.new fontStyle = (arrOneS et[1]=="on ")? "itali c" : "norm al"; break ; | |||||
| 4612 | case "size" : this.newfo ntSize = a rrOneSet[1 ]; break; | |||||
| 4613 | case "backgrou nd-color" : this.new Background Color = ar rOneSet[1] ; break; | |||||
| 4614 | } | |||||
| 4615 | } | |||||
| 4616 | } | |||||
| 4617 | ||||||
| 4618 | CAgencyFon tChange.pr ototype.Re trieveOldF ont = func tion(objCh ild) | |||||
| 4619 | { | |||||
| 4620 | if ( typeof(o bjChild.ol dFontFamil y) == "und efined" ) | |||||
| 4621 | objC hild.oldFo ntFamily = objChild. style.font Family; | |||||
| 4622 | if ( typeof(o bjChild.ol dColor) == "undefine d" ) | |||||
| 4623 | objC hild.oldCo lor = objC hild.style .color; | |||||
| 4624 | if ( typeof(o bjChild.ol dTextDecor ation) == "undefined " ) | |||||
| 4625 | objC hild.oldTe xtDecorati on = objCh ild.style. textDecora tion; | |||||
| 4626 | if ( typeof(o bjChild.ol dFontWeigh t) == "und efined" ) | |||||
| 4627 | objC hild.oldFo ntWeight = objChild. style.font Weight; | |||||
| 4628 | if ( typeof(o bjChild.ol dFontStyle ) == "unde fined" ) | |||||
| 4629 | objC hild.oldFo ntStyle = objChild.s tyle.fontS tyle; | |||||
| 4630 | if ( typeof(o bjChild.ol dFontSize) == "undef ined" ) | |||||
| 4631 | objC hild.oldFo ntSize = o bjChild.st yle.fontSi ze; | |||||
| 4632 | if ( typeof(o bjChild.ol dBackgroun dColor) == "undefine d" ) | |||||
| 4633 | objC hild.oldBa ckgroundCo lor = objC hild.style .backgroun dColor; | |||||
| 4634 | } | |||||
| 4635 | ||||||
| 4636 | CAgencyFon tChange.pr ototype.Pr epareEffec t = functi on() | |||||
| 4637 | { | |||||
| 4638 | // as for ex panding te xt, the ch ild is cre ated after the const ructor cal led | |||||
| 4639 | va r arr = th is.ele.get ElementsBy TagName (' *'); | |||||
| 4640 | fo r(var inde x = 0; ind ex < arr.l ength; ind ex++) | |||||
| 4641 | this .RetrieveO ldFont(arr [index]); | |||||
| 4642 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4643 | } | |||||
| 4644 | ||||||
| 4645 | CAgencyFon tChange.pr ototype.Up dateEffect = functio n() | |||||
| 4646 | {// to cha nge the fo nt | |||||
| 4647 | th is.Prepare Effect(); | |||||
| 4648 | th is.UpdateE ffectAllCh ildren( th is.ele ); | |||||
| 4649 | va r arr = th is.ele.get ElementsBy TagName (' *'); | |||||
| 4650 | fo r( var ind ex = 0; in dex < arr. length; in dex++) | |||||
| 4651 | this .UpdateEff ectAllChil dren(arr[i ndex]); | |||||
| 4652 | } | |||||
| 4653 | ||||||
| 4654 | CAgencyFon tChange.pr ototype.Up dateEffect AllChildre n = functi on(objChil d) | |||||
| 4655 | { | |||||
| 4656 | ob jChild.sty le.fontFam ily = this .newfontFa mily; | |||||
| 4657 | ob jChild.sty le.color = this.newf Color; | |||||
| 4658 | ob jChild.sty le.textDec oration = this.newte xtDecorati on; | |||||
| 4659 | ob jChild.sty le.fontWei ght = this .newfontWe ight; | |||||
| 4660 | ob jChild.sty le.fontSty le = this. newfontSty le; | |||||
| 4661 | ob jChild.sty le.fontSiz e = this.n ewfontSize ; | |||||
| 4662 | ob jChild.sty le.backgro undColor = this.newB ackgroundC olor; | |||||
| 4663 | } | |||||
| 4664 | ||||||
| 4665 | CAgencyFon tChange.pr ototype.En dEffect = function() | |||||
| 4666 | {// to rei nstate the original font style | |||||
| 4667 | th is.EndEffe ctAllChild ren( this. ele ); | |||||
| 4668 | va r arr = th is.ele.get ElementsBy TagName (' *'); | |||||
| 4669 | fo r( var ind ex = 0; in dex < arr. length; in dex++) | |||||
| 4670 | this .EndEffect AllChildre n(arr[inde x]); | |||||
| 4671 | } | |||||
| 4672 | ||||||
| 4673 | CAgencyFon tChange.pr ototype.En dEffectAll Children = function( objChild ) | |||||
| 4674 | { | |||||
| 4675 | if ( typeof(o bjChild.ol dFontFamil y) != "und efined" ) | |||||
| 4676 | objC hild.style .fontFamil y = objChi ld.oldFont Family; | |||||
| 4677 | if ( typeof(o bjChild.ol dColor) != "undefine d" ) | |||||
| 4678 | objC hild.style .color = o bjChild.ol dColor; | |||||
| 4679 | if ( typeof(o bjChild.ol dFontWeigh t) != "und efined" ) | |||||
| 4680 | objC hild.style .fontWeigh t = objChi ld.oldFont Weight; | |||||
| 4681 | if ( typeof(o bjChild.ol dFontStyle ) != "unde fined" ) | |||||
| 4682 | objC hild.style .fontStyle = objChil d.oldFontS tyle; | |||||
| 4683 | if ( typeof(o bjChild.ol dFontSize) != "undef ined" ) | |||||
| 4684 | objC hild.style .fontSize = objChild .oldFontSi ze; | |||||
| 4685 | if ( typeof(o bjChild.ol dTextDecor ation) != "undefined " ) | |||||
| 4686 | objC hild.style .textDecor ation = ob jChild.old TextDecora tion; | |||||
| 4687 | if ( typeof(o bjChild.ol dBackgroun dColor) != "undefine d" ) | |||||
| 4688 | objC hild.style .backgroun dColor = o bjChild.ol dBackgroun dColor; | |||||
| 4689 | } | |||||
| 4690 | // End of the CAgenc yFontChang e definiti on | |||||
| 4691 | ||||||
| 4692 | // Begin o f the CAge ncyChangeS tyle defin ition | |||||
| 4693 | function C AgencyChan geStyle( e lement, se ttings ) | |||||
| 4694 | {//this cl ass can be replace b y CAgencyC hangeStyle ,provided the "setti ngs" is st andard CSS string. | |||||
| 4695 | th is.ele = e lement; | |||||
| 4696 | ||||||
| 4697 | // to retrie ve the ori ginal styl e | |||||
| 4698 | th is.oldstyl e = this.e le.style.c ssText; | |||||
| 4699 | ||||||
| 4700 | // to set th e default style | |||||
| 4701 | th is.newStyl e = this.o ldstyle; | |||||
| 4702 | ||||||
| 4703 | if ( typeof(s ettings) = = "string" && settin gs.length > 1 ) | |||||
| 4704 | this .newStyle = this.old style + " " + settin gs; | |||||
| 4705 | } | |||||
| 4706 | ||||||
| 4707 | CAgencyCha ngeStyle.p rototype.P repareEffe ct = funct ion() | |||||
| 4708 | { | |||||
| 4709 | CC SSP.ShowOb ject(this. ele, true ); | |||||
| 4710 | } | |||||
| 4711 | ||||||
| 4712 | CAgencyCha ngeStyle.p rototype.U pdateEffec t = functi on() | |||||
| 4713 | {// to cha nge the st yle | |||||
| 4714 | th is.ele.sty le.cssText = this.ne wStyle; | |||||
| 4715 | } | |||||
| 4716 | ||||||
| 4717 | CAgencyCha ngeStyle.p rototype.E ndEffect = function( ) | |||||
| 4718 | {// to rei nstate the original style | |||||
| 4719 | th is.ele.sty le.cssText = this.ol dStyle; | |||||
| 4720 | } | |||||
| 4721 | // End of the CAgenc yChangeSty le definit ion | |||||
| 4722 | ||||||
| 4723 | //End the definition of CAgenc yXXXX clas ses | |||||
| 4724 | ||||||
| 4725 | //Begin to collabora te with ot her event handler se ttings | |||||
| 4726 | CCSSP.Regi sterEventH andler( wi ndow, "onl oad", "CEn gine.OnPag eLoad(even t);BSSCOnL oad(event) ;InitTrigg ersInHead( event);"); | |||||
| 4727 | CCSSP.Regi sterEventH andler( do cument, "o nclick", " CEngine.On PageClick( event);BSS COnClick(e vent);"); | |||||
| 4728 | CCSSP.Regi sterEventH andler( do cument, "o nmouseover ", "CEngin e.OnMouseO ver(event) ;BSSCOnMou seOver(eve nt);" ); | |||||
| 4729 | CCSSP.Regi sterEventH andler( do cument, "o nmouseout" , "CEngine .OnMouseOv er(event); BSSCOnMous eOut(event );" ); | |||||
| 4730 | CCSSP.Regi sterEventH andler( wi ndow, "onu nload", "B SSCOnUnloa d();"); | |||||
| 4731 | ||||||
| 4732 | ||||||
| 4733 | ||||||
| 4734 | // functio n related to autosiz e popup, c ustom popu p and text only popup | |||||
| 4735 | var gMsgSe parator = "::"; | |||||
| 4736 | ||||||
| 4737 | function i sInsidePop up() | |||||
| 4738 | { | |||||
| 4739 | re turn (wind ow.name.in dexOf("BSS CPopup")!= -1); | |||||
| 4740 | } | |||||
| 4741 | ||||||
| 4742 | if(isLocal && (gbChr ome || gbB sNS6)) | |||||
| 4743 | { | |||||
| 4744 | if (window.ad dEventList ener) | |||||
| 4745 | wind ow.addEven tListener( "message", onRcvCont entSizeMsg , false); | |||||
| 4746 | } | |||||
| 4747 | ||||||
| 4748 | function g etDocHeigh t(D) { | |||||
| 4749 | return Math.max( | |||||
| 4750 | Ma th.max(D.b ody.scroll Height, D. documentEl ement.scro llHeight), | |||||
| 4751 | Ma th.max(D.b ody.offset Height, D. documentEl ement.offs etHeight), | |||||
| 4752 | Ma th.max(D.b ody.client Height, D. documentEl ement.clie ntHeight) | |||||
| 4753 | ); | |||||
| 4754 | } | |||||
| 4755 | ||||||
| 4756 | function g etDocWidth (D) { | |||||
| 4757 | return Math.max( | |||||
| 4758 | Ma th.max(D.b ody.scroll Width, D.d ocumentEle ment.scrol lWidth), | |||||
| 4759 | Ma th.max(D.b ody.offset Width, D.d ocumentEle ment.offse tWidth), | |||||
| 4760 | Ma th.max(D.b ody.client Width, D.d ocumentEle ment.clien tWidth) | |||||
| 4761 | ); | |||||
| 4762 | } | |||||
| 4763 | ||||||
| 4764 | function t rim(string ToTrim) { | |||||
| 4765 | re turn strin gToTrim.re place(/^\s +|\s+$/g," "); | |||||
| 4766 | } | |||||
| 4767 | ||||||
| 4768 | function p arseMsgDat a(strData) | |||||
| 4769 | { | |||||
| 4770 | va r nvPairs = strData. split(",") ; //get na me value p airs | |||||
| 4771 | if (nvPairs.l ength>0) | |||||
| 4772 | { | |||||
| 4773 | var obj = new Object(); | |||||
| 4774 | for( var i=0; i <nvPairs.l ength; i++ ) | |||||
| 4775 | { | |||||
| 4776 | trim(n vPairs[i]) ; | |||||
| 4777 | var nv Pair = nvP airs[i].sp lit(":"); | |||||
| 4778 | if(nvP air.length == 2) | |||||
| 4779 | { | |||||
| 4780 | obj[nvPa ir[0]] = n vPair[1]; | |||||
| 4781 | } | |||||
| 4782 | } | |||||
| 4783 | retu rn obj; | |||||
| 4784 | } | |||||
| 4785 | re turn null; | |||||
| 4786 | } | |||||
| 4787 | ||||||
| 4788 | ||||||
| 4789 | function r eplyConten tSize(targ etWnd) | |||||
| 4790 | { | |||||
| 4791 | ta rgetWnd.po stMessage( "sendConte ntSize" + gMsgSepara tor + ",he ight:" + g etDocHeigh t(document ) + ",widt h:" + getD ocWidth(do cument), " *"); | |||||
| 4792 | } | |||||
| 4793 | ||||||
| 4794 | ||||||
| 4795 | ||||||
| 4796 | var gL astHeight = 0; | |||||
| 4797 | var gL astWidth = 0; | |||||
| 4798 | function o nRcvConten tSizeMsg(e vent) | |||||
| 4799 | { | |||||
| 4800 | var ms g = event. data.split (gMsgSepar ator); | |||||
| 4801 | var ms gType = ms g[0]; | |||||
| 4802 | var ms gData = ms g[1]; | |||||
| 4803 | switch (msgType) | |||||
| 4804 | { | |||||
| 4805 | case " sendConten tSize": | |||||
| 4806 | { | |||||
| 4807 | var stepSize = 50; | |||||
| 4808 | ||||||
| 4809 | var ob j = parse MsgData(ms gData); | |||||
| 4810 | rhPopu pEx.setHei ght(parseI nt(obj.hei ght)); | |||||
| 4811 | rhPopu pEx.setWid th(parseIn t(obj.widt h)); | |||||
| 4812 | ||||||
| 4813 | if(typ eof(rhPopu pEx.gLastG oodHeight) == 'undef ined' || r hPopupEx.g LastGoodHe ight == 0) | |||||
| 4814 | { | |||||
| 4815 | rhPopupE x.gLastGoo dHeight = rhPopupEx. height; | |||||
| 4816 | rhPopupE x.gLastGoo dWidth = r hPopupEx.w idth; | |||||
| 4817 | } | |||||
| 4818 | else | |||||
| 4819 | { | |||||
| 4820 | if(rhPop upEx.heigh t < gLastH eight) | |||||
| 4821 | { | |||||
| 4822 | rhPopupEx. gLastGoodH eight = rh PopupEx.he ight; | |||||
| 4823 | rhPopupEx. gLastGoodW idth = rhP opupEx.wid th; | |||||
| 4824 | } | |||||
| 4825 | } | |||||
| 4826 | ||||||
| 4827 | if(rhP opupEx.can DoBetter() ) | |||||
| 4828 | { | |||||
| 4829 | gLastWid th = rhPop upEx.width ; | |||||
| 4830 | gLastHei ght = rhPo pupEx.heig ht; | |||||
| 4831 | ||||||
| 4832 | rhPopupE x.resizePo pup(rhPopu pEx.width+ stepSize, 1); | |||||
| 4833 | requestC ontentSize (event.sou rce); | |||||
| 4834 | ||||||
| 4835 | } | |||||
| 4836 | else{ | |||||
| 4837 | rhPopupE x.setHeigh t(rhPopupE x.gLastGoo dHeight); | |||||
| 4838 | rhPopupE x.setWidth (rhPopupEx .gLastGood Width); | |||||
| 4839 | rhPopupE x.gLastGoo dHeight = 0; | |||||
| 4840 | rhPopupE x.gLastGoo dWidth = 0 ; | |||||
| 4841 | gLastHei ght = 0; | |||||
| 4842 | gLastWid th = 0; | |||||
| 4843 | rhPopupE x.resizeMo veAndShowP opup(); | |||||
| 4844 | } | |||||
| 4845 | } | |||||
| 4846 | br eak; | |||||
| 4847 | case "getConten tSize": | |||||
| 4848 | re plyContent Size(event .source); | |||||
| 4849 | br eak; | |||||
| 4850 | case "updateLin ks": | |||||
| 4851 | BS SCPopup_Ch angeTarget toParent(d ocument); | |||||
| 4852 | br eak; | |||||
| 4853 | case "getCpHTML 5Size": | |||||
| 4854 | re plyCpHTML5 Size(event .source, m sgData); | |||||
| 4855 | br eak; | |||||
| 4856 | case "setCpHTML 5Size": | |||||
| 4857 | on GetReplyCp HTML5Size( event.sour ce, msgDat a); | |||||
| 4858 | br eak; | |||||
| 4859 | } | |||||
| 4860 | } | |||||
| 4861 | ||||||
| 4862 | function r equestCont entSize(ta rgetWnd) | |||||
| 4863 | { | |||||
| 4864 | if (targetWnd && target Wnd.postMe ssage) | |||||
| 4865 | targ etWnd.post Message("g etContentS ize" + gMs gSeparator + " ", "* "); | |||||
| 4866 | } | |||||
| 4867 | ||||||
| 4868 | function r equestUpda teLinks(ta rgetWnd) | |||||
| 4869 | { | |||||
| 4870 | if (targetWnd && target Wnd.postMe ssage) | |||||
| 4871 | targ etWnd.post Message("u pdateLinks " + gMsgSe parator + " ", "*"); | |||||
| 4872 | } | |||||
| 4873 | ||||||
| 4874 | function o nPopupClic ked(e) | |||||
| 4875 | { | |||||
| 4876 | va r target = null; | |||||
| 4877 | va r popupIFr ame = rhPo pupEx.getP opupIFrame (); | |||||
| 4878 | if (!e) | |||||
| 4879 | e = popupIFram e.contentW indow.even t; | |||||
| 4880 | if (e) | |||||
| 4881 | { | |||||
| 4882 | if(e .target) | |||||
| 4883 | target = e.targe t; | |||||
| 4884 | else | |||||
| 4885 | target = e.srcEl ement; | |||||
| 4886 | } | |||||
| 4887 | if (!gbAIR) | |||||
| 4888 | { | |||||
| 4889 | if(t arget && i sInsideHyp erLink(tar get)) | |||||
| 4890 | return ; | |||||
| 4891 | } | |||||
| 4892 | if (window.re moveEventL istener) | |||||
| 4893 | wind ow.removeE ventListen er("moused own", onPo pupParentC licked, fa lse); | |||||
| 4894 | el se if(wind ow.documen t.detachEv ent) | |||||
| 4895 | wind ow.documen t.detachEv ent('onmou sedown', o nPopupPare ntClicked) ; | |||||
| 4896 | rh PopupEx.re movePopup( ); | |||||
| 4897 | } | |||||
| 4898 | ||||||
| 4899 | function o nPopupPare ntClicked( e) | |||||
| 4900 | { | |||||
| 4901 | if (window.re moveEventL istener) | |||||
| 4902 | wind ow.removeE ventListen er("moused own", onPo pupParentC licked, fa lse); | |||||
| 4903 | el se if(wind ow.documen t.detachEv ent) | |||||
| 4904 | wind ow.documen t.detachEv ent('onmou sedown', o nPopupPare ntClicked) ; | |||||
| 4905 | rh PopupEx.re movePopup( ); | |||||
| 4906 | } | |||||
| 4907 | ||||||
| 4908 | var rhPopu pEx = new RHPopupEx; | |||||
| 4909 | function R HPopupEx() | |||||
| 4910 | { | |||||
| 4911 | th is.strPopu pID = 'BSS CPopup'; | |||||
| 4912 | th is.strPopu pShadowID = 'BSSCPop upShadow'; | |||||
| 4913 | th is.strPopu pTopicID = 'BSSCPopu pTopic'; | |||||
| 4914 | th is.strPopu pIFrameID = 'BSSCPop upIFrame'; | |||||
| 4915 | th is.strPopu pIFrameNam e = 'BSSCP opupIFrame Name'; | |||||
| 4916 | th is.strPopu pURL = ''; | |||||
| 4917 | th is.strBook mark = ''; | |||||
| 4918 | th is.width = 0; | |||||
| 4919 | th is.height = 0; | |||||
| 4920 | th is.clientW idth = 0; | |||||
| 4921 | th is.clientH eight = 0; | |||||
| 4922 | th is.gHeight = 0; | |||||
| 4923 | th is.gWidth = 0; | |||||
| 4924 | th is.bCustom Height = f alse; | |||||
| 4925 | ||||||
| 4926 | // scrollbar height and width | |||||
| 4927 | th is.scrollb arheight = 20; //can we ask th e browser for this i nfo | |||||
| 4928 | th is.scrollb arwidth = 20; | |||||
| 4929 | ||||||
| 4930 | th is.init = function() | |||||
| 4931 | { | |||||
| 4932 | this .getVisibi lityStyle( ); | |||||
| 4933 | this .strPopupU RL = ''; | |||||
| 4934 | this .strBookma rk = ''; | |||||
| 4935 | this .width = 0 ; | |||||
| 4936 | this .height = 0; | |||||
| 4937 | this .clientWid th = 0; | |||||
| 4938 | this .clientHei ght = 0; | |||||
| 4939 | this .gHeight = 0; | |||||
| 4940 | this .gWidth = 0; | |||||
| 4941 | this .removePop up(); | |||||
| 4942 | } | |||||
| 4943 | ||||||
| 4944 | th is.setPopu pURL = fun ction(strU RL) | |||||
| 4945 | { | |||||
| 4946 | var indx = str URL.indexO f("#"); | |||||
| 4947 | if(i ndx != -1) | |||||
| 4948 | { | |||||
| 4949 | this.s trPopupURL = strURL. substring( 0, indx); | |||||
| 4950 | this.s trBookmark = strURL. substring( indx); | |||||
| 4951 | } | |||||
| 4952 | else | |||||
| 4953 | this.s trPopupURL = strURL; | |||||
| 4954 | } | |||||
| 4955 | th is.setWidt h = functi on(width) | |||||
| 4956 | { | |||||
| 4957 | this .width = w idth; | |||||
| 4958 | } | |||||
| 4959 | th is.setHeig ht = funct ion(height ) | |||||
| 4960 | { | |||||
| 4961 | this .height = height; | |||||
| 4962 | } | |||||
| 4963 | th is.setClic kPosition= function( x, y) | |||||
| 4964 | { | |||||
| 4965 | this .clickX = x + getScr ollLeft(); | |||||
| 4966 | this .clickY = y + getScr ollTop(); | |||||
| 4967 | } | |||||
| 4968 | ||||||
| 4969 | th is.createP opup= func tion(strUR L, width, height) | |||||
| 4970 | { | |||||
| 4971 | this .init(); | |||||
| 4972 | if ( "undefined " != typeo f(width) & & "undefin ed" != typ eof(height )) { | |||||
| 4973 | this.s etWidth(wi dth); | |||||
| 4974 | this.s etHeight(h eight); | |||||
| 4975 | this.b CustomHeig ht = true; | |||||
| 4976 | } | |||||
| 4977 | if(t ypeof(strU RL) == 'un defined' | | strURL = = '') | |||||
| 4978 | return false; | |||||
| 4979 | this .setPopupU RL(strURL) ; | |||||
| 4980 | this .createPop upContaine r(); | |||||
| 4981 | } | |||||
| 4982 | ||||||
| 4983 | th is.createP opupContai ner = func tion() | |||||
| 4984 | { | |||||
| 4985 | // D O NOT SET Width and height for the div, otherwize it will ma ke IE4 pop up do not work when view the t opic alone . | |||||
| 4986 | var strPopupDi v = "<div id='" + th is.strPopu pID + "' s tyle='posi tion:absol ute; top:- 100; left: 0; z-index :600; visi bility:hid den;'>"; | |||||
| 4987 | strP opupDiv += "<div id= '" + this. strPopupSh adowID + " ' style=\" position:a bsolute;to p:0; left: 0; backgro und-color: #C0C0C0;\" ></div>"; | |||||
| 4988 | strP opupDiv += "<div id= '" + this. strPopupTo picID + "' style=\"p osition:ab solute;top :0; left:0 ; backgro und-color: #FFFFFF;bo rder:1px # 000000 out set;"; | |||||
| 4989 | if(g bSafari3 & & gbBsIsMo bile) | |||||
| 4990 | strPop upDiv += " overflow:a uto; -webk it-overflo w-scrollin g:touch;"; | |||||
| 4991 | strP opupDiv += "\">"; | |||||
| 4992 | strP opupDiv += "<iframe height=\"1 0px\" widt h=\"200px\ " title=\" Popup Wind ow\" id='" + this.st rPopupIFra meID + "' name='" + this.strPo pupIFrameN ame + "' s rc='" + th is.strPopu pURL + "' frameborde r=0 scroll ing=auto"; | |||||
| 4993 | strP opupDiv += " onload= \"rhPopupE x.OnLoadRH Popup();\" "; | |||||
| 4994 | strP opupDiv += "></ifram e></div>"; | |||||
| 4995 | strP opupDiv += "</div>"; | |||||
| 4996 | ||||||
| 4997 | var oBody = ge tElementsB yTag(docum ent, "body ")[0]; | |||||
| 4998 | if( typeof(oBo dy) != "ob ject" ) | |||||
| 4999 | return ; | |||||
| 5000 | ||||||
| 5001 | inse rtAdjacent HTML(oBody , "beforeE nd", strPo pupDiv); | |||||
| 5002 | } | |||||
| 5003 | ||||||
| 5004 | th is.removeP opup = fun ction() | |||||
| 5005 | { | |||||
| 5006 | var popup = th is.getPopu pContainer (); | |||||
| 5007 | if(p opup) | |||||
| 5008 | remove This(popup ); | |||||
| 5009 | } | |||||
| 5010 | ||||||
| 5011 | th is.getPopu pContainer = functio n() | |||||
| 5012 | { | |||||
| 5013 | var elem = do cument.get ElementByI d(this.str PopupID); | |||||
| 5014 | if(t ypeof(elem ) != 'unde fined' && elem != nu ll) | |||||
| 5015 | return elem; | |||||
| 5016 | retu rn null; | |||||
| 5017 | } | |||||
| 5018 | th is.getPopu pIFrame = function() | |||||
| 5019 | { | |||||
| 5020 | var elem = do cument.get ElementByI d(this.str PopupIFram eID); | |||||
| 5021 | if(t ypeof(elem ) != 'unde fined' && elem != nu ll) | |||||
| 5022 | return elem; | |||||
| 5023 | retu rn null; | |||||
| 5024 | } | |||||
| 5025 | th is.getPopu pShadow = function() | |||||
| 5026 | { | |||||
| 5027 | var elem = do cument.get ElementByI d(this.str PopupShado wID); | |||||
| 5028 | if(t ypeof(elem ) != 'unde fined' && elem != nu ll) | |||||
| 5029 | return elem; | |||||
| 5030 | retu rn null; | |||||
| 5031 | } | |||||
| 5032 | th is.getPopu pTopic = f unction() | |||||
| 5033 | { | |||||
| 5034 | var elem = do cument.get ElementByI d(this.str PopupTopic ID); | |||||
| 5035 | if(t ypeof(elem ) != 'unde fined' && elem != nu ll) | |||||
| 5036 | return elem; | |||||
| 5037 | retu rn null; | |||||
| 5038 | } | |||||
| 5039 | ||||||
| 5040 | th is.hidePop up = funct ion() | |||||
| 5041 | { | |||||
| 5042 | this .getPopupC ontainer() .style.vis ibility = this.strSt yVisHide; | |||||
| 5043 | this .getPopupI Frame().st yle.visibi lity = thi s.strStyVi sHide; | |||||
| 5044 | } | |||||
| 5045 | ||||||
| 5046 | th is.showPop up = funct ion() | |||||
| 5047 | { | |||||
| 5048 | this .getPopupC ontainer() .style.vis ibility = this.strSt yVisShow; | |||||
| 5049 | this .getPopupI Frame().st yle.visibi lity = thi s.strStyVi sShow; | |||||
| 5050 | } | |||||
| 5051 | ||||||
| 5052 | th is.getVisi bilityStyl e = functi on() | |||||
| 5053 | { | |||||
| 5054 | if ( gbBsNS4&&! gbBsNS6) | |||||
| 5055 | { | |||||
| 5056 | this.s trStyVisSh ow = "show"; | |||||
| 5057 | this.s trStyVisHi de = "hide"; | |||||
| 5058 | } | |||||
| 5059 | else | |||||
| 5060 | { | |||||
| 5061 | this.s trStyVisSh ow = "visible"; | |||||
| 5062 | this.s trStyVisHi de = "hidden"; | |||||
| 5063 | } | |||||
| 5064 | } | |||||
| 5065 | ||||||
| 5066 | th is.getClie ntWndSize = function () { | |||||
| 5067 | var view portwidth; | |||||
| 5068 | var view portheight ; | |||||
| 5069 | ||||||
| 5070 | // the m ore standa rds compli ant browse rs (mozill a/netscape /opera/IE7 ) use wind ow.innerWi dth and wi ndow.inner Height | |||||
| 5071 | if (type of window. innerWidth != 'undef ined') { | |||||
| 5072 | view portwidth = window.i nnerWidth; | |||||
| 5073 | view portheight = window. innerHeigh t; | |||||
| 5074 | } | |||||
| 5075 | // IE6 i n standard s complian t mode (i. e. with a valid doct ype as the first lin e in the d ocument) | |||||
| 5076 | else if (typeof do cument.doc umentEleme nt != 'und efined' | |||||
| 5077 | & & typeof d ocument.do cumentElem ent.client Width != ' undefined' && docume nt.documen tElement.c lientWidth != 0) { | |||||
| 5078 | view portwidth = document .documentE lement.cli entWidth; | |||||
| 5079 | view portheight = documen t.document Element.cl ientHeight ; | |||||
| 5080 | } | |||||
| 5081 | // older versions of IE | |||||
| 5082 | else { | |||||
| 5083 | view portwidth = document .getElemen tsByTagNam e('body')[ 0].clientW idth; | |||||
| 5084 | view portheight = documen t.getEleme ntsByTagNa me('body') [0].client Height; | |||||
| 5085 | } | |||||
| 5086 | this.cli entWidth = viewportw idth; | |||||
| 5087 | this.cli entHeight = viewport height; | |||||
| 5088 | //golden ratio | |||||
| 5089 | this.gHe ight = thi s.clientHe ight * 0.8 ; | |||||
| 5090 | this.gWi dth = this .clientWid th * 0.8; | |||||
| 5091 | ||||||
| 5092 | this.cli entWidth - = this.scr ollbarwidt h; | |||||
| 5093 | this.cli entHeight -= this.sc rollbarhei ght; | |||||
| 5094 | } | |||||
| 5095 | ||||||
| 5096 | th is.resizeP opup = fun ction(widt h, height) | |||||
| 5097 | { | |||||
| 5098 | //se t height a nd width | |||||
| 5099 | this .getPopupC ontainer() .style.wid th = width + "px" ; | |||||
| 5100 | this .getPopupC ontainer() .style.hei ght = heig ht + "px" ; | |||||
| 5101 | ||||||
| 5102 | this .getPopupS hadow().st yle.width = width + "px" ; | |||||
| 5103 | this .getPopupS hadow().st yle.height = height + "px" ; | |||||
| 5104 | ||||||
| 5105 | this .getPopupT opic().sty le.width = width + " px" ; | |||||
| 5106 | this .getPopupT opic().sty le.height = height + "px" ; | |||||
| 5107 | ||||||
| 5108 | this .getPopupI Frame().st yle.width = width + "px" ; | |||||
| 5109 | this .getPopupI Frame().st yle.height = height + "px" ; | |||||
| 5110 | } | |||||
| 5111 | ||||||
| 5112 | th is.getPopu pContentSi ze = funct ion() | |||||
| 5113 | { | |||||
| 5114 | var wnd = this .getPopupI Frame().co ntentWindo w; | |||||
| 5115 | this .setHeight (getDocHei ght(wnd.do cument)); | |||||
| 5116 | this .setWidth( getDocWidt h(wnd.docu ment)); | |||||
| 5117 | } | |||||
| 5118 | ||||||
| 5119 | th is.canDoBe tter = fun ction() | |||||
| 5120 | { | |||||
| 5121 | if(t his.width < this.gWi dth /*&& t his.height > this.gH eight*/) | |||||
| 5122 | return true; | |||||
| 5123 | } | |||||
| 5124 | ||||||
| 5125 | th is.compute PopupWndSi ze = funct ion() | |||||
| 5126 | { | |||||
| 5127 | if(! gbChromeLo cal) | |||||
| 5128 | { | |||||
| 5129 | try | |||||
| 5130 | { | |||||
| 5131 | this.get PopupConte ntSize(); | |||||
| 5132 | ||||||
| 5133 | //try to check i f we have available width, inc reasing th e width ma y decrease the heigh t for refl owable con tent | |||||
| 5134 | //when ever a cha nge is det ected we s ave that s ize | |||||
| 5135 | //incr easing wid th by an a mount does not alway s decrease height, b ut increas ing furthe r may decr ease it ba sed on the | |||||
| 5136 | //refl ow content | |||||
| 5137 | ||||||
| 5138 | var stepSize = 50; | |||||
| 5139 | var lastWidt h = 0; | |||||
| 5140 | var lastHeig ht = 0; | |||||
| 5141 | var la stGoodHeig ht = this. height; | |||||
| 5142 | var la stGoodWidt h = this.w idth; | |||||
| 5143 | ||||||
| 5144 | while( this.canDo Better()) | |||||
| 5145 | { | |||||
| 5146 | lastWidt h = this.w idth; | |||||
| 5147 | lastHeig ht = this. height; | |||||
| 5148 | this.res izePopup(t his.width+ stepSize, 1); | |||||
| 5149 | this.get PopupConte ntSize(); | |||||
| 5150 | //if no change in height det ected | |||||
| 5151 | if(this. height < l astHeight) //may be there is n o reflow c ontent to reduce hei ght on inc reasing wi dth | |||||
| 5152 | { | |||||
| 5153 | lastGoodHe ight = thi s.height; | |||||
| 5154 | lastGoodWi dth = this .width; | |||||
| 5155 | ||||||
| 5156 | } | |||||
| 5157 | //alert( "height = " + this.h eight + "w idth=" + t his.width) | |||||
| 5158 | } | |||||
| 5159 | ||||||
| 5160 | //addi ng extra 2 0 pixel in height to be sure n o scroll b ar comes e ven if con tent fits in size co mputed | |||||
| 5161 | lastGo odHeight + = 20; | |||||
| 5162 | //addi ng extra 5 pixel in width | |||||
| 5163 | lastGo odWidth += 5; | |||||
| 5164 | ||||||
| 5165 | this.s etHeight(l astGoodHei ght); | |||||
| 5166 | this.s etWidth(la stGoodWidt h); | |||||
| 5167 | ||||||
| 5168 | this.r esizeMoveA ndShowPopu p(); | |||||
| 5169 | } | |||||
| 5170 | catch( e) | |||||
| 5171 | { | |||||
| 5172 | requestC ontentSize (this.getP opupIFrame ().content Window); | |||||
| 5173 | } | |||||
| 5174 | } | |||||
| 5175 | else | |||||
| 5176 | reques tContentSi ze(this.ge tPopupIFra me().conte ntWindow); | |||||
| 5177 | } | |||||
| 5178 | ||||||
| 5179 | th is.resizeM oveAndShow Popup = fu nction() | |||||
| 5180 | { | |||||
| 5181 | var bNeedHScro ll = false ; | |||||
| 5182 | var bNeedVScro ll = false ; | |||||
| 5183 | ||||||
| 5184 | if(t his.height > this.gH eight) | |||||
| 5185 | { | |||||
| 5186 | this.s etHeight(t his.gHeigh t); | |||||
| 5187 | //need vertical scroll bar s | |||||
| 5188 | bNeedV Scroll = t rue; | |||||
| 5189 | this.s etWidth(th is.width+t his.scroll barwidth); | |||||
| 5190 | } | |||||
| 5191 | if(t his.width > this.gWi dth) | |||||
| 5192 | { | |||||
| 5193 | this.s etWidth(th is.gWidth) ; | |||||
| 5194 | //need horizonta l scroll b ars | |||||
| 5195 | bNeedH Scroll = t rue; | |||||
| 5196 | this.s etHeight(t his.height +this.scro llbarheigh t); | |||||
| 5197 | } | |||||
| 5198 | ||||||
| 5199 | var nClickX = this.click X; | |||||
| 5200 | var nClickY = this.click Y; | |||||
| 5201 | var nTop = 0; | |||||
| 5202 | var nLeft = 0; | |||||
| 5203 | var shadowpos = 5; //sha dow pos re lative to popup fram e | |||||
| 5204 | ||||||
| 5205 | var scrollTop = getScrol lTop(); | |||||
| 5206 | var scrollLeft = getScro llLeft(); | |||||
| 5207 | ||||||
| 5208 | if ( nClickY + this.heigh t + shadow pos < this .clientHei ght + scro llTop) { | |||||
| 5209 | nTop = nClickY; | |||||
| 5210 | } el se { | |||||
| 5211 | nTop = nClickY - this.heig ht - shado wpos; | |||||
| 5212 | if(nTo p < scroll Top) | |||||
| 5213 | { | |||||
| 5214 | nTop = ( scrollTop + this.cli entHeight) - this.he ight - sha dowpos; | |||||
| 5215 | if(nTop < scrollTo p) | |||||
| 5216 | { | |||||
| 5217 | nTop = scr ollTop; | |||||
| 5218 | this.heigh t = this.c lientHeigh t - shadow pos; | |||||
| 5219 | //need ver tical scro ll bars | |||||
| 5220 | if(bNeedVS croll == f alse) | |||||
| 5221 | { | |||||
| 5222 | bN eedVScroll = true; | |||||
| 5223 | th is.setWidt h(this.wid th+this.sc rollbarwid th); | |||||
| 5224 | } | |||||
| 5225 | } | |||||
| 5226 | } | |||||
| 5227 | } | |||||
| 5228 | if ( nClickX + this.width + shadowp os < this. clientWidt h + scroll Left) { | |||||
| 5229 | nLeft = nClickX; | |||||
| 5230 | } el se { | |||||
| 5231 | nLeft = nClickX - this.wid th - shado wpos; | |||||
| 5232 | if(nLe ft < scrol lLeft) | |||||
| 5233 | { | |||||
| 5234 | nLeft = (scrollLef t + this.c lientWidth ) - this.w idth - sha dowpos; | |||||
| 5235 | if(nLeft < scrollL eft) | |||||
| 5236 | { | |||||
| 5237 | nLeft = sc rollLeft; | |||||
| 5238 | this.width = this.cl ientWidth - shadowpo s; | |||||
| 5239 | //need hor izontal sc roll bars | |||||
| 5240 | if(bNeedHS croll == f alse) | |||||
| 5241 | { | |||||
| 5242 | bN eedHScroll = true; | |||||
| 5243 | th is.setHeig ht(this.he ight+this. scrollbarh eight); | |||||
| 5244 | } | |||||
| 5245 | } | |||||
| 5246 | } | |||||
| 5247 | } | |||||
| 5248 | ||||||
| 5249 | ||||||
| 5250 | //se t height a nd width | |||||
| 5251 | this .resizePop up(this.wi dth, this. height); | |||||
| 5252 | ||||||
| 5253 | //se t position | |||||
| 5254 | this .getPopupC ontainer() .style.lef t = nLeft + "px"; | |||||
| 5255 | this .getPopupC ontainer() .style.top = nTop + "px"; | |||||
| 5256 | ||||||
| 5257 | // S et the loc ation of t he backgro und blocks | |||||
| 5258 | this .getPopupS hadow().st yle.left = shadowpos + "px"; | |||||
| 5259 | this .getPopupS hadow().st yle.top = shadowpos + "px"; | |||||
| 5260 | ||||||
| 5261 | if(t his.strBoo kmark != ' ') | |||||
| 5262 | { | |||||
| 5263 | //aler t(this.str Bookmark); | |||||
| 5264 | this.g etPopupIFr ame().cont entWindow. location.h ref = this .strPopupU RL + this. strBookmar k; | |||||
| 5265 | } | |||||
| 5266 | ||||||
| 5267 | try{ | |||||
| 5268 | BSSCPo pup_Change TargettoPa rent(this. getPopupIF rame().con tentWindow .document) ; | |||||
| 5269 | }cat ch(e) | |||||
| 5270 | { | |||||
| 5271 | //come s here for chrome lo cal | |||||
| 5272 | reques tUpdateLin ks(this.ge tPopupIFra me().conte ntWindow); | |||||
| 5273 | } | |||||
| 5274 | this .showPopup (); | |||||
| 5275 | this .postWork( ); | |||||
| 5276 | } | |||||
| 5277 | ||||||
| 5278 | th is.postWor k = functi on() | |||||
| 5279 | { | |||||
| 5280 | try{ | |||||
| 5281 | if(gbB sIsMobile == false) | |||||
| 5282 | { | |||||
| 5283 | if (wind ow.addEven tListener) { | |||||
| 5284 | this.getPo pupIFrame( ).contentW indow.addE ventListen er('click' , onPopupC licked, fa lse); | |||||
| 5285 | } else i f (window. document.a ttachEvent ){ | |||||
| 5286 | this.getPo pupIFrame( ).contentW indow.docu ment.attac hEvent('on click', on PopupClick ed); | |||||
| 5287 | } | |||||
| 5288 | } | |||||
| 5289 | }cat ch(e) | |||||
| 5290 | { | |||||
| 5291 | //aler t popup do es not clo se on clic king on it , valid fo r chrome l ocal | |||||
| 5292 | } | |||||
| 5293 | ||||||
| 5294 | if(w indow.addE ventListen er) | |||||
| 5295 | { | |||||
| 5296 | window .addEventL istener("m ousedown", onPopupPa rentClicke d, false); | |||||
| 5297 | window .document. addEventLi stener("to uchstart", onPopupPa rentClicke d, false); | |||||
| 5298 | } | |||||
| 5299 | else if(window .document. attachEven t) | |||||
| 5300 | window .document. attachEven t('onmouse down', onP opupParent Clicked); | |||||
| 5301 | ||||||
| 5302 | } | |||||
| 5303 | ||||||
| 5304 | th is.OnLoadR HPopup = f unction() | |||||
| 5305 | { | |||||
| 5306 | rhPo pupEx.hide Popup(); | |||||
| 5307 | ||||||
| 5308 | if(g bBsIE4 && rhPopupEx. getPopupIF rame().con tentWindow .document. location.h ref.indexO f("about:b lank") != -1) | |||||
| 5309 | { | |||||
| 5310 | rhPopu pEx.getPop upIFrame() .contentWi ndow.docum ent.locati on.href = rhPopupEx. strPopupUR L; | |||||
| 5311 | return ; | |||||
| 5312 | } | |||||
| 5313 | ||||||
| 5314 | this .getClient WndSize(); | |||||
| 5315 | if ( rhPopupEx. width == 0 || rhPopu pEx.height == 0) | |||||
| 5316 | { | |||||
| 5317 | rhPopu pEx.comput ePopupWndS ize(); | |||||
| 5318 | } | |||||
| 5319 | else | |||||
| 5320 | rhPopu pEx.resize MoveAndSho wPopup(); | |||||
| 5321 | ||||||
| 5322 | } | |||||
| 5323 | } | |||||
| 5324 | ||||||
| 5325 | function s upports_vi deo() { | |||||
| 5326 | return ! !document. createElem ent('video ').canPlay Type; | |||||
| 5327 | } | |||||
| 5328 | ||||||
| 5329 | function s upports_mp 4_video() | |||||
| 5330 | { | |||||
| 5331 | if (!supports _video()) | |||||
| 5332 | retu rn false; | |||||
| 5333 | va r v = docu ment.creat eElement(" video"); | |||||
| 5334 | va r playType = v.canPl ayType('vi deo/mp4'); | |||||
| 5335 | // alert(play Type); | |||||
| 5336 | if (playType == "" || p layType == "no") | |||||
| 5337 | retu rn false; | |||||
| 5338 | el se | |||||
| 5339 | retu rn true; | |||||
| 5340 | } | |||||
| 5341 | ||||||
| 5342 | function g etUrlParam (paramName , url) | |||||
| 5343 | { | |||||
| 5344 | if(url = = null || url == 'un defined') | |||||
| 5345 | ur l = docume nt.locatio n.href; | |||||
| 5346 | paramNam e = paramN ame.replac e(/[\[]/," \\\[").rep lace(/[\]] /,"\\\]"); | |||||
| 5347 | var rege xS = "[\\? &]"+paramN ame+"=([^& #]*)"; | |||||
| 5348 | var rege x = new Re gExp(regex S); | |||||
| 5349 | var resu lts = rege x.exec(url ); | |||||
| 5350 | if( resu lts == nul l ) | |||||
| 5351 | return ""; | |||||
| 5352 | else | |||||
| 5353 | return results[1 ]; | |||||
| 5354 | } | |||||
| 5355 | ||||||
| 5356 | function s end_flv_co mmand(strM ultimediaF lvName, st rMultimedi aFlvComman d) | |||||
| 5357 | { | |||||
| 5358 | tr y | |||||
| 5359 | { | |||||
| 5360 | if(s trMultimed iaFlvName != null && typeof(st rMultimedi aFlvName) != undefin ed) | |||||
| 5361 | { | |||||
| 5362 | var fl ashMediaPl ayer = doc ument.getE lementById (strMultim ediaFlvNam e); | |||||
| 5363 | if(fla shMediaPla yer != nul l && typeo f(flashMed iaPlayer) != undefin ed) | |||||
| 5364 | { | |||||
| 5365 | if(strMu ltimediaFl vCommand ! = null && typeof(str Multimedia FlvCommand ) != undef ined) | |||||
| 5366 | { | |||||
| 5367 | flashMedia Player.Tak eMultimedi aAction(st rMultimedi aFlvComman d.replace( "%20", " " )); | |||||
| 5368 | } | |||||
| 5369 | } | |||||
| 5370 | } | |||||
| 5371 | } | |||||
| 5372 | ca tch(err) | |||||
| 5373 | { | |||||
| 5374 | //al ert(strMul timediaFlv Name + ' ' + strMult imediaFlvC ommand); | |||||
| 5375 | } | |||||
| 5376 | } | |||||
| 5377 | ||||||
| 5378 | function o nLoad_FLV_ Player(str Multimedia FlvName) | |||||
| 5379 | { | |||||
| 5380 | if (strMultim ediaFlvNam e != null && typeof( strMultime diaFlvName ) != undef ined) | |||||
| 5381 | { | |||||
| 5382 | var strMultime diaFlvName HRef = get UrlParam(' flv_name') ; | |||||
| 5383 | if(s trMultimed iaFlvNameH Ref != nul l && typeo f(strMulti mediaFlvNa meHRef) != undefined ) | |||||
| 5384 | { | |||||
| 5385 | if(str Multimedia FlvNameHRe f == strMu ltimediaFl vName) | |||||
| 5386 | { | |||||
| 5387 | var strM ultimediaF lvCommand = getUrlPa ram('flv_c md'); | |||||
| 5388 | send_flv _command(s trMultimed iaFlvName, strMultim ediaFlvCom mand); | |||||
| 5389 | } | |||||
| 5390 | } | |||||
| 5391 | } | |||||
| 5392 | } | |||||
| 5393 | ||||||
| 5394 | function r equestCpHT ML5Size(ta rgetWnd, i frameid) | |||||
| 5395 | { | |||||
| 5396 | if (targetWnd && target Wnd.postMe ssage) | |||||
| 5397 | targ etWnd.post Message("g etCpHTML5S ize" + gMs gSeparator + ",id:"+ iframeid, "*"); | |||||
| 5398 | } | |||||
| 5399 | ||||||
| 5400 | function r eplyCpHTML 5Size(targ etWnd, msg Data) | |||||
| 5401 | { | |||||
| 5402 | va r obj = p arseMsgDat a(msgData) ; | |||||
| 5403 | ||||||
| 5404 | va r pc = get ProjectCon tainer(); | |||||
| 5405 | ||||||
| 5406 | ||||||
| 5407 | ||||||
| 5408 | ta rgetWnd.po stMessage( "setCpHTML 5Size" + g MsgSeparat or + ",id: " + obj.id + ",heigh t:" + pars eFloat(pc. style.heig ht) + ",wi dth:" + pa rseFloat(p c.style.wi dth), "*") ; | |||||
| 5409 | } | |||||
| 5410 | ||||||
| 5411 | function o nGetReplyC pHTML5Size (targetWnd , msgData) | |||||
| 5412 | { | |||||
| 5413 | va r obj = p arseMsgDat a(msgData) ; | |||||
| 5414 | va r iframeel em = getEl ement(obj. id); | |||||
| 5415 | if (typeof if rameelem ! = 'undefin ed') | |||||
| 5416 | { | |||||
| 5417 | ifra meelem.sty le.width = obj.width + "px" ; | |||||
| 5418 | ifra meelem.sty le.height = obj.heig ht + "px" ; | |||||
| 5419 | } | |||||
| 5420 | } | |||||
| 5421 | ||||||
| 5422 | function o nHTML5Outp utLoad(id) | |||||
| 5423 | { | |||||
| 5424 | va r iframeel em = getEl ement(id); | |||||
| 5425 | if (typeof if rameelem ! = 'undefin ed') | |||||
| 5426 | { | |||||
| 5427 | var wnd = ifra meelem.con tentWindow ; | |||||
| 5428 | if(g bBsIE4) | |||||
| 5429 | { | |||||
| 5430 | try{ | |||||
| 5431 | var h = getDocHeig ht(wnd.doc ument); | |||||
| 5432 | var w = getDocWidt h(wnd.docu ment); | |||||
| 5433 | ||||||
| 5434 | iframeel em.style.w idth = w + "px" ; | |||||
| 5435 | iframeel em.style.h eight = h + "px" ; | |||||
| 5436 | } | |||||
| 5437 | catch( e) {} | |||||
| 5438 | } | |||||
| 5439 | else | |||||
| 5440 | { | |||||
| 5441 | reques tCpHTML5Si ze(wnd, id ); | |||||
| 5442 | } | |||||
| 5443 | } | |||||
| 5444 | } | |||||
| 5445 | ||||||
| 5446 | //End to c ollaborate with othe r event ha ndler sett ings | |||||
| 5447 | ||||||
| 5448 | /// Sectio n End - C CSSP DHTM 2 (JavaScr ipt 1.2) | |||||
| 5449 | ||||||
| 5450 | //// Segme nt End -- (JavaScrip t 1.2) |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.