1 2/* 3 ================================================ 4 PVII Mega Menu scripts 5 Copyright (c) 2013-2015 Project Seven Development 6 www.projectseven.com 7 Version: 1.2.1 -build 16 8 ================================================ 9 10*/ 11 12// define the image swap file naming convention 13 14// rollover image for any image in the normal state 15var p7MGMover='_over'; 16 17// image for any trigger that has an open sub menu -no rollover 18var p7MGMopen='_down'; 19 20var p7MGMctl=[],p7MGMi=false,p7MGMa=false,p7MGMadv=[],p7MGMdy=(1000/100),p7MGMkf=false,p7MGMclk=false; 21function P7_MGMset(){ 22 var i,h,sh,hd,x,v,ie=P7_MGMgetIEver(); 23 if(!document.getElementById || (ie>4 && ie<6)){ 24 return; 25 } 26 sh='div.p7MGM.p7MGMdesign-time .mgm-mega-menu {display: none;}\n'; 27 sh='.mgm-mega-menu {position:absolute; overflow:hidden; display:none; height:0px; top:100%; z-index:999;}\n'; 28 sh+='.mgm-mega-content {position: relative; display:block;}\n'; 29 sh+='.p7mgm-spcr {width:100%; display:none;}\n'; 30 sh+='.p7mgm-fixed {position:fixed !important;top:0;left:0;width:100%}\n'; 31 sh+='@media only screen and (min-width: 0px) and (max-width: 700px) {\n'; 32 sh+='.p7MGM.responsive {max-height: 700777px;}\n'; 33 sh+='.p7MGM.responsive ul a {max-height: 700777px;}\n'; 34 sh+='.p7MGM div.mgm-mega-menu {\n-webkit-transform: none !important; -webkit-transition: none !important;'; 35 sh+='transform: none !important; transition: none !important;'; 36 sh+='opacity:100 !important;}\n'; 37 sh+='}\n'; 38 sh+='@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {\n'; 39 sh+='body * {cursor: pointer;}\n}\n'; 40 P7_MGMaddSheet(sh); 41} 42P7_MGMset(); 43function P7_MGMop(){ 44 if(!document.getElementById){ 45 return; 46 } 47 p7MGMctl[p7MGMctl.length]=arguments; 48 if(arguments[1]>3){ 49 P7_MGMsetCSSanim(arguments); 50 } 51} 52function P7_MGMsetCSSanim(op){ 53 var i,pf,prf,sh=''; 54 prf=P7_MGMgetCSSPre(); 55 if(prf!='none'){ 56 if(op[1]==4){ 57 sh+='#'+op[0]+' div.mgm-mega-menu {\n'; 58 sh+='-webkit-transition: -webkit-transform '+op[2]+'ms, opacity '+op[2]+'ms;\n'; 59 sh+='transition: transform '+op[2]+'ms, opacity '+op[2]+'ms;\n'; 60 sh+='-webkit-transform: scale(0);\n'; 61 sh+='transform: scale(0);\n'; 62 sh+='opacity: 0;\n}\n'; 63 sh+='#'+op[0]+' div.mgm-mega-menu.sub-open {\n'; 64 sh+='-webkit-transform: scale(1);\n'; 65 sh+='transform: scale(1);\n'; 66 sh+='opacity: 1;\n}\n'; 67 } 68 else if(op[1]==5){ 69 sh+='#'+op[0]+' div.mgm-mega-menu {\n'; 70 sh+='-webkit-transition: -webkit-transform '+op[2]+'ms, opacity '+op[2]+'ms;\n'; 71 sh+='transition: transform '+op[2]+'ms, opacity '+op[2]+'ms;\n'; 72 sh+='-webkit-transform: scale(0,1);\n'; 73 sh+='transform: scale(0,1);\n'; 74 sh+='opacity: 0;\n}\n'; 75 sh+='#'+op[0]+' div.mgm-mega-menu.sub-open {\n'; 76 sh+='-webkit-transform: scale(1,1);\n'; 77 sh+='transform: scale(1,1);\n'; 78 sh+='opacity: 1;\n}\n'; 79 } 80 else if(op[1]==6){ 81 sh+='#'+op[0]+' div.mgm-mega-menu {\n'; 82 sh+='-webkit-transition: -webkit-transform '+op[2]+'ms, opacity '+op[2]+'ms;\n'; 83 sh+='transition: transform '+op[2]+'ms, opacity '+op[2]+'ms;\n'; 84 sh+='-webkit-transform: scale(1,0);\n'; 85 sh+='transform: scale(1,0);\n'; 86 sh+='opacity: 0;\n}\n'; 87 sh+='#'+op[0]+' div.mgm-mega-menu.sub-open {\n'; 88 sh+='-webkit-transform: scale(1,1);\n'; 89 sh+='transform: scale(1,1);\n'; 90 sh+='opacity: 1;\n}\n'; 91 } 92 P7_MGMaddSheet(sh); 93 } 94} 95function P7_MGMbb(){ 96 97 98 //P7_MGMshutall(); 99} 100function P7_MGMaddLoad(){ 101 var ie=P7_MGMgetIEver(); 102 if(!document.getElementById || (ie>4 && ie<6)){ 103 return; 104 } 105 if(window.addEventListener){ 106 document.addEventListener("DOMContentLoaded",P7_MGMinit,false); 107 window.addEventListener("load",P7_MGMinit,false); 108 window.addEventListener("unload",P7_MGMbb,false); 109 window.addEventListener("resize",P7_MGMrsz,false); 110 } 111 else if(window.attachEvent){ 112 document.write("<script id=p7ie_mgm defer src=\"//:\"><\/script>"); 113 document.getElementById("p7ie_mgm").onreadystatechange=function(){ 114 if (this.readyState=="complete"){ 115 if(p7MGMctl.length>0){ 116 P7_MGMinit(); 117 } 118 } 119 }; 120 window.attachEvent("onload",P7_MGMinit); 121 window.attachEvent("onunload",P7_MGMbb); 122 window.attachEvent("onresize",P7_MGMrsz); 123 } 124} 125P7_MGMaddLoad(); 126function P7_MGMinit(){ 127 var i,j,jj,x,k,pf,pp,tB,tU,tD,cl,cN,tA,d,fs,ls,tBR,iM,sD,sr,s1,s2,dv,wns; 128 if(p7MGMctl.length<1){ 129 return; 130 } 131 if(p7MGMi){ 132 return; 133 } 134 p7MGMi=true; 135 document.p7MGMpreload=[]; 136 pf=P7_MGMgetCSSPre(); 137 wns=false; 138 for(jj=0;jj<p7MGMctl.length;jj++){ 139 tB=document.getElementById(p7MGMctl[jj][0]); 140 if(tB){ 141 tB.p7opt=p7MGMctl[jj]; 142 P7_MGMremClass(tB,'p7MGMdesign-time'); 143 tB.mgmTrigs=[]; 144 tB.mgmSubs=[]; 145 tB.mgmSubCnt=[]; 146 tB.mgmDuration=tB.p7opt[2]; 147 tB.mgmAnimType='quad'; 148 if(tB.p7opt[1]>3){ 149 if(pf=='none'){ 150 tB.p7opt[1]=1; 151 } 152 } 153 tB.mgmDefLink=false; 154 dv=P7_MGMisMobile(); 155 if(dv=='touch'){ 156 if(P7_MGMgetStyle(tB,'maxHeight','max-height')!='700777px'){ 157 dv=false; 158 } 159 } 160 if(dv){ 161 tB.p7opt[6]=0; 162 } 163 if(tB.p7opt[3]==1){ 164 dv=document.createElement('div'); 165 dv.setAttribute('id',tB.id.replace('_','spcr_')); 166 dv.className=tB.className; 167 P7_MGMsetClass(dv,'p7mgm-spcr'); 168 tB.parentNode.insertBefore(dv, tB.nextSibling); 169 tB.mgmSpacer=dv; 170 dv.mgmMenu=tB; 171 if(!wns){ 172 wns=true; 173 if(window.addEventListener){ 174 window.addEventListener('scroll', P7_MGMfixed, false); 175 } 176 else if (window.attachEvent){ 177 window.attachEvent('onscroll', P7_MGMfixed); 178 } 179 } 180 } 181 if(tB.p7opt[6]===0 && !p7MGMclk){ 182 p7MGMclk=true; 183 if(window.addEventListener){ 184 document.addEventListener("click",P7_MGMbody,false); 185 } 186 else if(window.attachEvent){ 187 document.addEventListener("onclick",P7_MGMbody,false); 188 } 189 } 190 tB.style.position='relative'; 191 tB.style.zIndex=tB.p7opt[12]; 192 tU=document.getElementById(tB.id.replace('_','u_')); 193 tB.mgmUL=tU; 194 tU.mgmMenu=tB.id; 195 tB.mgmMouseTimer=null; 196 tB.mgmFixed=false; 197 pp=tB; 198 while(pp){ 199 if(P7_MGMgetStyle(pp,'position','position')=='fixed'){ 200 tB.mgmFixed=true; 201 break; 202 } 203 if(pp.nodeName=='BODY'){ 204 break; 205 } 206 pp=pp.parentNode; 207 } 208 tB.mgmToolbarClosed=false; 209 tBR=document.getElementById(tB.id.replace('_','tb_')); 210 if(tBR && tU){ 211 tBR.mgmMenu=tB.id; 212 tBR.mgmUL=tU; 213 cl=tBR.className; 214 if(cl && cl!=='' && cl.indexOf('opened')>-1){ 215 tU.mgmState='open'; 216 tBR.mgmState='open'; 217 P7_MGMsetClass(tU,'opened'); 218 } 219 else{ 220 P7_MGMremClass(tBR,'closed'); 221 P7_MGMremClass(tU,'closed'); 222 tB.mgmToolbarClosed=true; 223 tU.mgmState='closed'; 224 tBR.mgmState='closed'; 225 } 226 tBR.onclick= 227function(){ 228 var tBR=document.getElementById(this.mgmMenu.replace('_','tb_')); 229 var tU=this.mgmUL; 230 if(tU.mgmState=='open'){ 231 tBR.mgmState='closed'; 232 tU.mgmState='closed'; 233 P7_MGMchangeClass(tBR,'opened','closed'); 234 P7_MGMchangeClass(tU,'opened','closed'); 235 } 236 else{ 237 tBR.mgmState='open'; 238 tU.mgmState='open';
239 P7_MGMchangeClass(tBR,'closed','opened'); 240 P7_MGMchangeClass(tU,'closed','opened'); 241 } 242}; 243tA=tBR.getElementsByTagName('A'); 244if(tA && tA[0]){ 245 tA[0].onclick=function(){ 246 return false; 247 }; 248} 249} 250cN=tU.childNodes; 251fs=-1; 252ls=0; 253d=1; 254k=-1; 255if(cN){ 256for(j=0;j<cN.length;j++){ 257 if(cN[j].tagName&&cN[j].tagName=='LI'){ 258 ls++; 259 pp=cN[j].getElementsByTagName('A'); 260 if(pp && pp[0]){ 261 tA=pp[0]; 262 } 263 else{ 264 continue; 265 } 266 tA.parentNode.setAttribute('id',tA.id.replace('a','i')); 267 d++; 268 k++; 269 if(fs<0){ 270 P7_MGMsetClass(tA,'mgmfirst'); 271 P7_MGMsetClass(cN[j],'mgmfirst'); 272 } 273 fs=j; 274 tB.mgmTrigs[k]=tA; 275 tA.mgmTrigNum=k+1; 276 if(!tB.mgmFirstA){ 277 tB.mgmFirstA=tA; 278 } 279 tB.mgmSubs[k]=null; 280 tA.mgmDiv=tB.id; 281 tA.parentNode.mgmDiv=tB.id; 282 tA.mgmSub=false; 283 tB.mgmDefaultPanel=0; 284 tA.mgmState='closed'; 285 P7_MGMsetClass(tA,'closed'); 286 P7_MGMsetClass(tA.parentNode,'closed'); 287 tA.onclick=function(){ 288 return P7_MGMclick(this); 289 }; 290 P7_MGMsupTouch(tA); 291 P7_MGMbindPointer(tA); 292 if(tB.p7opt[6]==1){ 293 tA.onmouseover=function(){ 294 var tB=document.getElementById(this.mgmDiv); 295 if(tB.mgmMouseTimer){ 296 clearTimeout(tB.mgmMouseTimer); 297 } 298 if(this.mgmPointer){ 299 return; 300 } 301 if(P7_MGMgetStyle(this,'maxHeight','max-height')=='700777px'){ 302 return; 303 } 304 if(tB.p7opt[11]==1){ 305 tB.mgmMouseTimer=setTimeout("P7_MGMtrig('"+this.id+"')",160); 306 } 307 else{ 308 P7_MGMtrig(this.id); 309 } 310 }; 311 } 312 tA.hasImg=false; 313 iM=tA.getElementsByTagName("IMG"); 314 if(iM&&iM[0]){ 315 sr=iM[0].getAttribute("src"); 316 iM[0].mgmSwap=tB.p7opt[8]; 317 x=sr.lastIndexOf("."); 318 s1=sr.substring(0,x)+p7MGMover+'.'+sr.substring(x+1); 319 s2=sr.substring(0,x)+p7MGMopen+'.'+sr.substring(x+1); 320 if(iM[0].mgmSwap==1){ 321 iM[0].p7imgswap=[sr,s1,s1]; 322 P7_MGMpreloader(s1); 323 } 324 else if (iM[0].mgmSwap==2){ 325 iM[0].p7imgswap=[sr,s1,s2]; 326 P7_MGMpreloader(s1,s2); 327 } 328 else{ 329 iM[0].p7imgswap=[sr,sr,sr]; 330 } 331 iM[0].p7state='closed'; 332 iM[0].mark=false; 333 iM[0].rollover=tB.p7opt[9]; 334 if(iM[0].mgmSwap>0){ 335 tA.hasImg=true; 336 iM[0].onmouseover=function(){ 337 P7_MGMimovr(this); 338 }; 339 iM[0].onmouseout=function(){ 340 P7_MGMimout(this); 341 }; 342 tA.onfocus=function(){ 343 P7_MGMimovr(this.getElementsByTagName('IMG')[0]); 344 }; 345 tA.onblur=function(){ 346 P7_MGMimout(this.getElementsByTagName('IMG')[0]); 347 }; 348 } 349 } 350 sD=document.getElementById(tA.id.replace('a','s')); 351 if(sD){ 352 tA.parentNode.appendChild(sD); 353 tB.mgmSubs[k]=sD; 354 sD.mgmDiv=tB.id; 355 sD.mgmCnt=sD.getElementsByTagName('DIV')[0]; 356 tB.mgmSubCnt[k]=sD.mgmCnt; 357 sD.style.height='0px'; 358 sD.mgmCnt.style.top='0px'; 359 sD.mgmCnt.style.left='0px'; 360 sD.setAttribute('id',tB.id+'s'+tA.mgmTrigNum); 361 tA.mgmSub=sD.id; 362 sD.mgmTrig=tA.id; 363 P7_MGMsetClass(tA,'trig'); 364 sD.mgmState='closed'; 365 if(tB.p7opt[6]==1){ 366 sD.onmouseover=function(){ 367 var tB=document.getElementById(this.mgmDiv); 368 if(tB.mgmMouseTimer){ 369 clearTimeout(tB.mgmMouseTimer); 370 } 371 }; 372 } 373 } 374 } 375} 376} 377if(fs>0 && tA){ 378P7_MGMsetClass(tA.parentNode,'mgmlast'); 379P7_MGMsetClass(tA,'mgmlast'); 380} 381if(tB.p7opt[6]==1){ 382P7_MGMbindPointer(tB); 383tB.onmouseout=function(evt){ 384 var tg,pp,tA,tB,m=true; 385 if(P7_MGMgetStyle(this.mgmTrigs[0],'maxHeight','max-height')=='700777px'){ 386 return; 387 } 388 if(this.mgmPointer){ 389 m=false; 390 } 391 evt=(evt)?evt:event; 392 tg=(evt.toElement)?evt.toElement:evt.relatedTarget; 393 if(tg){ 394 pp=tg; 395 while(pp){ 396 if(pp==this){ 397 m=false; 398 break; 399 } 400 if(pp.nodeName && pp.nodeName=='BODY'){ 401 break; 402 } 403 pp=pp.parentNode; 404 } 405 } 406 if(m){ 407 if(this.mgmMouseTimer){ 408 clearTimeout(this.mgmMouseTimer); 409 } 410 this.mgmMouseTimer=setTimeout("P7_MGMtoggle('"+this.id+"')",250); 411 } 412}; 413} 414if(tB.mgmToolbarClosed){ 415P7_MGMsetClass(tBR,'closed'); 416P7_MGMsetClass(tU,'closed'); 417} 418if(tB.p7opt[4]==1){ 419P7_MGMcurrentMark(tB); 420} 421if(typeof(P7_TPMrsz)=='function'){ 422cN=tB.getElementsByTagName('DIV'); 423for(i=0;i<cN.length;i++){ 424 if(cN[i].id && cN[i].id.indexOf('p7TPM')>-1){ 425 tB.mgmTPM2=true; 426 break; 427 } 428} 429} 430} 431} 432p7PMGMa=true; 433} 434function P7_MGMshutall(bp){ 435 var i,tB; 436 if(p7MGMctl && p7MGMctl.length){ 437 for(i=0;i<p7MGMctl.length;i++){ 438 tB=document.getElementById(p7MGMctl[i][0]); 439 if(tB && (!bp || bp!=tB.id)){ 440 P7_MGMtoggle(tB.id,1); 441 } 442 } 443 } 444} 445function P7_MGMfixed(){ 446 var i,tB; 447 if(p7MGMctl && p7MGMctl.length){ 448 for(i=0;i<p7MGMctl.length;i++){ 449 tB=document.getElementById(p7MGMctl[i][0]); 450 if(tB && tB.mgmSpacer){ 451 if(P7_MGMgetStyle(tB.mgmFirstA,'maxHeight','max-height')=='700777px'){ 452 if(tB.mgmFixedOn){ 453 tB.mgmSpacer.style.display='none'; 454 P7_MGMremClass(tB,'p7mgm-fixed'); 455 tB.mgmFixedOn=false; 456 } 457 continue; 458 } 459 if(!tB.mgmFixedOn && tB.getBoundingClientRect().top<0){ 460 tB.mgmSpacer.style.height=tB.offsetHeight+'px'; 461 tB.mgmSpacer.style.display='block'; 462 P7_MGMsetClass(tB,'p7mgm-fixed'); 463 tB.mgmFixedOn=true; 464 } 465 else if(tB.mgmFixedOn && tB.mgmSpacer.getBoundingClientRect().top>=0){ 466 tB.mgmSpacer.style.display='none'; 467 P7_MGMremClass(tB,'p7mgm-fixed'); 468 tB.mgmFixedOn=false; 469 } 470 } 471 } 472 } 473} 474function P7_MGMrsz(){ 475 var i,tB; 476 if(p7MGMctl && p7MGMctl.length){ 477 for(i=0;i<p7MGMctl.length;i++){ 478 tB=document.getElementById(p7MGMctl[i][0]); 479 if(tB){ 480 if(tB.p7opt[6]==1){ 481 if(P7_MGMgetStyle(tB,'maxHeight','max-height')!='700777px'){ 482 P7_MGMtoggle(tB.id,1); 483 } 484 } 485 } 486 } 487 } 488} 489function P7_MGMpreloader(){ 490 var i,x; 491 for(i=0;i<arguments.length;i++){ 492 x=document.p7MGMpreload.length; 493 document.p7MGMpreload[x]=new Image(); 494 document.p7MGMpreload[x].src=arguments[i]; 495 } 496} 497function P7_MGMimovr(im){ 498 var m=true; 499 if(im.p7state=='open' && im.rollover===0){ 500 m=false; 501 }
502 if(m){ 503 im.src=im.p7imgswap[1]; 504 } 505} 506function P7_MGMimout(im){ 507 if(im.p7state=='open' || im.mark){ 508 im.src=im.p7imgswap[2]; 509 } 510 else{ 511 im.src=im.p7imgswap[0]; 512 } 513} 514function P7_MGMtrig(d){ 515 var i,a; 516 a=document.getElementById(d); 517 if(a){ 518 P7_MGMopen(a); 519 } 520} 521function P7_MGMclick(a){ 522 var wH,tB,m=false; 523 wH=window.location.href; 524 if(a.href!=wH&&a.href!=wH+'#'){ 525 if(a.href.toLowerCase().indexOf('javascript:')==-1){ 526 m=true; 527 } 528 } 529 if(m && a.mgmSub && a.mgmState=='closed'){ 530 tB=document.getElementById(a.mgmDiv); 531 if(tB.p7opt[6]===0){ 532 m=false; 533 } 534 } 535 if(a.mgmState=='closed'){ 536 P7_MGMopen(a); 537 } 538 else{ 539 P7_MGMclose(a); 540 } 541 if(m){ 542 P7_MGMshutall(); 543 } 544 return m; 545} 546function P7_MGMbody(evt){ 547 evt=(evt)?evt:event; 548 var m=true,pp=(evt.fromElement)?evt.fromElement:evt.target; 549 while(pp){ 550 if(pp && pp.id && typeof(pp.id)=='string' && pp.id.indexOf('p7MGM')===0){ 551 m=false; 552 break; 553 } 554 if(pp && pp.tagName && (pp.tagName=='BODY'||pp.tagName=='HTML')){ 555 break; 556 } 557 pp=pp.parentNode; 558 } 559 if(m){ 560 P7_MGMshutall(); 561 } 562} 563function P7_MGMopen(a,bp){ 564 var i,j,tB,sD,op,sC,iM; 565 if(a.mgmState=='open'){ 566 return; 567 } 568 tB=document.getElementById(a.mgmDiv); 569 op=tB.p7opt[1]; 570 if(P7_MGMgetStyle(a,'maxHeight','max-height')=='700777px'){ 571 if(op!==0){ 572 op=0; 573 } 574 } 575 a.mgmState='open'; 576 P7_MGMchangeClass(a,'closed','open'); 577 P7_MGMchangeClass(a.parentNode,'closed','open'); 578 if(!bp){ 579 P7_MGMtoggle(a); 580 } 581 if(a.hasImg){ 582 iM=a.getElementsByTagName("IMG")[0]; 583 iM.p7state='open'; 584 iM.src=iM.p7imgswap[2]; 585 } 586 if(a.mgmSub){ 587 sD=document.getElementById(a.mgmSub); 588 if(sD.mgmAnim){ 589 clearTimeout(sD.mgmAnim); 590 } 591 sD.mgmState='open'; 592 if(op==1){ 593 if(sD.p7MGMrunning){ 594 clearInterval(sD.p7MGMfade); 595 sD.p7MGMrunning=false; 596 } 597 tB.p7animType='quad'; 598 sD.mgmStartFade=0; 599 sD.mgmFinishFade=99; 600 sD.mgmCurrentFade=sD.mgmStartFade; 601 if(sD.filters){ 602 sD.style.filter='alpha(opacity='+sD.mgmCurrentFade+')'; 603 } 604 else{ 605 sD.style.opacity=sD.mgmCurrentFade/100; 606 } 607 sD.style.height='auto'; 608 sD.style.display='block'; 609 sD.mgmStartTime=P7_MGMgetTime(0); 610 sD.mgmDuration=tB.mgmDuration; 611 sD.p7MGMrunning=true; 612 sD.p7MGMfade=setInterval("P7_MGMfade('"+sD.id+"','"+tB.mgmAnimType+"')",p7MGMdy); 613 } 614 else if(op==2 || op==3){ 615 sC=sD.mgmCnt; 616 tB.p7animType='quad'; 617 tB.p7animProp='height'; 618 tB.p7animUnit='px'; 619 sD.style.display='block'; 620 for(j=0;j<tB.mgmTrigs.length;j++){ 621 if(tB.mgmSubs[j]){ 622 tB.mgmSubs[j].p7animStartVal=tB.mgmSubs[j].offsetHeight; 623 } 624 } 625 sD.p7animCurrentVal=sD.p7animStartVal; 626 sD.p7animFinishVal=sC.offsetHeight; 627 sD.style[tB.p7animProp]=sD.p7animCurrentVal+tB.p7animUnit; 628 tB.p7animStartTime=P7_MGMgetTime(0); 629 tB.p7animDuration=tB.mgmDuration; 630 if(!tB.p7MGMrunning){ 631 tB.p7MGMrunning=true; 632 tB.p7MGManim=setInterval("P7_MGManimator('"+tB.id+"',"+op+")",p7MGMdy); 633 } 634 } 635 else if(op>3 && op<99){ 636 sD.style.visibility='hidden'; 637 sD.style.display='block'; 638 sD.style.height='auto'; 639sD.mgmAnim=setTimeout(function(){ 640 P7_MGMsetClass(sD,'sub-open'); 641 sD.style.visibility='visible'; 642} 643,20); 644} 645else{ 646sD.style.display='block'; 647sD.style.height='auto'; 648} 649if(tB.mgmTPM2){ 650P7_TPMrsz(); 651} 652} 653} 654function P7_MGMclose(a,bp){ 655 var i,j,tB,sD,op,iM,sC; 656 if(a.mgmState=='closed'){ 657 return; 658 } 659 tB=document.getElementById(a.mgmDiv); 660 op=tB.p7opt[1]; 661 a.mgmState='closed'; 662 P7_MGMchangeClass(a,'open','closed'); 663 P7_MGMchangeClass(a.parentNode,'open','closed'); 664 if(P7_MGMgetStyle(a,'maxHeight','max-height')=='700777px'){ 665 if(op!==0){ 666 op=0; 667 } 668 } 669 if(a.hasImg){ 670 iM=a.getElementsByTagName("IMG")[0]; 671 iM.p7state='closed'; 672 iM.src=iM.p7imgswap[0]; 673 } 674 if(a.mgmSub){ 675 sD=document.getElementById(a.mgmSub); 676 sD.mgmState='closed'; 677 if(sD.mgmAnim){ 678 clearTimeout(sD.mgmAnim); 679 } 680 if(op==1 || op==3){ 681 if(sD.p7MGMrunning){ 682 clearInterval(sD.p7MGMfade); 683 sD.p7MGMrunning=false; 684 } 685 tB.p7animType='quad'; 686 sD.mgmStartFade=100; 687 sD.mgmFinishFade=0; 688 sD.mgmCurrentFade=sD.mgmStartFade; 689 if(sD.filters){ 690 sD.style.filter='alpha(opacity='+sD.mgmCurrentFade+')'; 691 } 692 else{ 693 sD.style.opacity=sD.mgmCurrentFade/100; 694 } 695 sD.style.height='auto'; 696 sD.style.display='block'; 697 sD.mgmStartTime=P7_MGMgetTime(0); 698 sD.mgmDuration=tB.mgmDuration; 699 sD.p7MGMrunning=true; 700 sD.p7MGMfade=setInterval("P7_MGMfade('"+sD.id+"','"+tB.mgmAnimType+"')",p7MGMdy); 701 } 702 else if(op==2){ 703 sC=sD.mgmCnt; 704 tB.p7animType='quad'; 705 tB.p7animProp='height';
706 tB.p7animUnit='px'; 707 sD.style.display='block'; 708 for(j=0;j<tB.mgmTrigs.length;j++){ 709 if(tB.mgmSubs[j]){ 710 tB.mgmSubs[j].p7animStartVal=tB.mgmSubs[j].offsetHeight; 711 } 712 } 713 sD.p7animCurrentVal=sD.p7animStartVal; 714 sD.p7animFinishVal=0; 715 sD.style[tB.p7animProp]=sD.p7animCurrentVal+tB.p7animUnit; 716 tB.p7animStartTime=P7_MGMgetTime(0); 717 tB.p7animDuration=tB.mgmDuration; 718 if(!tB.p7MGMrunning){ 719 tB.p7MGMrunning=true; 720 tB.p7MGManim=setInterval("P7_MGManimator('"+tB.id+"',"+op+")",p7MGMdy); 721 } 722 } 723 else if(op>3){ 724 P7_MGMremClass(sD,'sub-open'); 725setTimeout(function(){ 726 P7_MGMcloseAnim(sD); 727} 728,tB.mgmDuration); 729} 730else{ 731sD.style.display='none'; 732sD.style.height='0px'; 733} 734} 735} 736function P7_MGMcloseAnim(el){ 737 if(el.mgmState=='closed'){ 738 el.style.display='none'; 739 el.style.height='0px'; 740 } 741} 742function P7_MGMtoggle(a,bp){ 743 var i,tB; 744 if(typeof(a)=='object'){ 745 tB=document.getElementById(a.mgmDiv); 746 } 747 else if(typeof(a)=='string'){ 748 tB=document.getElementById(a); 749 } 750 else{ 751 return; 752 } 753 if(tB.mgmTrigs){ 754 for(i=0;i<tB.mgmTrigs.length;i++){ 755 if(tB.mgmTrigs[i]!=a || bp==1){ 756 if(tB.mgmTrigs[i].mgmState!='closed'){ 757 P7_MGMclose(tB.mgmTrigs[i]); 758 } 759 } 760 } 761 } 762} 763function P7_MGManimator(d,op){ 764 var i,tB,tA,tS,et,nv,m=false; 765 tB=document.getElementById(d); 766 et=P7_MGMgetTime(tB.p7animStartTime); 767 if(et>=tB.p7animDuration){ 768 et=tB.p7animDuration; 769 } 770 tA=tB.mgmTrigs; 771 tS=tB.mgmSubs; 772 for(i=0;i<tA.length;i++){ 773 if(tS[i]){ 774 if(tS[i].p7animCurrentVal!=tS[i].p7animFinishVal){ 775 nv=P7_MGManim(tB.p7animType,et,tS[i].p7animStartVal,tS[i].p7animFinishVal-tS[i].p7animStartVal,tB.p7animDuration); 776 tS[i].p7animCurrentVal=nv; 777 tS[i].style[tB.p7animProp]=nv+tB.p7animUnit; 778 if(tS[i].p7animCurrentVal==tS[i].p7animFinishVal){ 779 if(tA[i].mgmState=='closed'){ 780 tB.mgmSubs[i].style.display='none'; 781 tB.mgmSubs[i].style.height='0px'; 782 } 783 else{ 784 tB.mgmSubs[i].style.height='auto'; 785 } 786 } 787 else{ 788 m=true; 789 } 790 } 791 else{ 792 } 793 } 794 } 795 if(!m){ 796 tB.p7MGMrunning=false; 797 clearInterval(tB.p7MGManim); 798 } 799} 800function P7_MGMfade(d,tp){ 801 var i,el,tC,tA,op,et,cet,m=false; 802 el=document.getElementById(d); 803 et=P7_MGMgetTime(el.mgmStartTime); 804 if(et>=el.mgmDuration){ 805 et=el.mgmDuration; 806 m=true; 807 } 808 if(el.mgmCurrentFade!=el.mgmFinishFade){ 809 op=P7_MGManim(tp,et,el.mgmStartFade,el.mgmFinishFade-el.mgmStartFade,el.mgmDuration); 810 el.mgmCurrentFade=op; 811 if(el.filters){ 812 el.style.filter='alpha(opacity='+el.mgmCurrentFade+')'; 813 } 814 else{ 815 el.style.opacity=el.mgmCurrentFade/100; 816 } 817 } 818 if(m){ 819 el.p7MGMrunning=false; 820 clearInterval(el.p7MGMfade); 821 if(el.mgmFinishFade===0){ 822 el.style.height='0px'; 823 el.style.display='none'; 824 } 825 if(el.filters){ 826 el.style.filter=''; 827 } 828 else{ 829 el.style.opacity=1; 830 } 831 } 832} 833function P7_MGManim(tp,t,b,c,d){ 834 if(tp=='quad'){ 835 if((t/=d/2)<1){ 836 return c/2*t*t+b; 837 } 838 else{ 839 return -c/2*((--t)*(t-2)-1)+b; 840 } 841 } 842 else{ 843 return (c*(t/d))+b; 844 } 845} 846function P7_MGMgetTime(st){ 847 var d = new Date(); 848 return d.getTime() - st; 849} 850function P7_MGMbindPointer(el){ 851 if(el.ontouchstart !== undefined){ 852 el.addEventListener('touchstart',P7_MGMsetPointer,false); 853 } 854 else if(navigator.maxTouchPoints){ 855 el.addEventListener('pointerover',P7_MGMsetPointer,false); 856 el.addEventListener('mouseleave',P7_MGMsetPointer,false); 857 } 858 else if(navigator.msMaxTouchPoints){ 859 el.addEventListener('MSPointerOver',P7_MGMsetPointer,false); 860 el.addEventListener('mouseleave',P7_MGMsetPointer,false); 861 } 862} 863function P7_MGMsetPointer(evt){ 864 if(evt.touches && evt.touches.length && evt.touches.length>0){ 865 this.mgmPointer=true; 866 } 867 else if(evt.pointerType){ 868 if( evt.MSPOINTER_TYPE_TOUCH || evt.pointerType=='touch'){ 869 this.mgmPointer=true; 870 } 871 else if( evt.MSPOINTER_TYPE_PEN || evt.pointerType=='pen'){ 872 this.mgmPointer=true; 873 } 874 else{ 875 this.mgmPointer=false; 876 } 877 } 878 else{ 879 this.mgmPointer=false; 880 } 881} 882function P7_MGMmark(){ 883 p7MGMadv[p7MGMadv.length]=arguments; 884} 885function P7_MGMcurrentMark(el){ 886 var j,i,x,wH,cm=false,mt=['',1,'',''],op,r1,k,kk,tA,aU,pp,tr,aT,aP,d,pn,im; 887 wH=window.location.href; 888 if(el.p7opt[5]!=1){ 889 wH=wH.replace(window.location.search,''); 890 } 891 if(wH.charAt(wH.length-1)=='#'){ 892 wH=wH.substring(0,wH.length-1); 893 } 894 for(k=0;k<p7MGMadv.length;k++){ 895 if(p7MGMadv[k][0]&&p7MGMadv[k][0]==el.id){ 896 mt=p7MGMadv[k]; 897 cm=true; 898 break; 899 } 900 } 901 op=mt[1]; 902 if(op<1){ 903 return; 904 } 905 r1=/index\.[\S]*/i; 906 k=-1; 907 kk=-1; 908 tA=el.getElementsByTagName('A'); 909 for(j=0;j<tA.length;j++){ 910 aU=tA[j].href.replace(r1,''); 911 if(op>0){ 912 if(tA[j].href==wH || aU==wH){ 913 k=j; 914 kk=-1; 915 } 916 } 917 if(op==2){ 918 if(tA[j].firstChild){ 919 if(tA[j].firstChild.nodeValue==mt[2]){ 920 kk=j; 921 } 922 } 923 } 924 if(op==3&&tA[j].href.indexOf(mt[2])>-1){ 925 kk=j; 926 } 927 if(op==4){ 928 for(x=2;x<mt.length;x+=2){
929 if(wH.indexOf(mt[x])>-1){ 930 if(tA[j].firstChild&&tA[j].firstChild.nodeValue){ 931 if(tA[j].firstChild.nodeValue==mt[x+1]){ 932 kk=j; 933 } 934 } 935 } 936 } 937 } 938 } 939 k=(kk>k)?kk:k; 940 if(k>-1){ 941 if(tA[k].mgmDiv){ 942 tr=tA[k]; 943 } 944 else{ 945 P7_MGMsetClass(tA[k],'current_mark'); 946 pp=tA[k].parentNode; 947 while (pp){ 948 if(pp.mgmDiv && pp.id && pp.id.indexOf('p7MGMi')===0){ 949 if(pp.mgmDiv==el.id){ 950 tr=document.getElementById(pp.id.replace('i','a')); 951 if(tr){ 952 break; 953 } 954 } 955 } 956 pp=pp.parentNode; 957 } 958 } 959 if(tr){ 960 P7_MGMsetClass(tr,'current_mark'); 961 P7_MGMsetClass(tr.parentNode,'current_mark'); 962 if(tr.hasImg){ 963 im=tr.getElementsByTagName('IMG')[0]; 964 im.mark=true; 965 im.src=im.p7imgswap[2]; 966 } 967 if(tr.mgmTrigNum){ 968 el.mgmDefaultPanel=tr.mgmTrigNum; 969 } 970 } 971 } 972} 973function P7_MGMchangeClass(ob,clf,clt){ 974 if(ob){ 975 var cc,nc; 976 cc=ob.className; 977 if(cc&&cc.indexOf(clf>-1)){ 978 nc=cc.replace(clf,clt); 979 ob.className=nc; 980 } 981 else{ 982 P7_MGMsetClass(ob,clt); 983 } 984 } 985} 986function P7_MGMsetClass(ob,cl){ 987 if(ob){ 988 var cc,nc,r=/\s+/g; 989 cc=ob.className; 990 nc=cl; 991 if(cc&&cc.length>0){ 992 if(cc.indexOf(cl)==-1){ 993 nc=cc+' '+cl; 994 } 995 else{ 996 nc=cc; 997 } 998 } 999 nc=nc.replace(r,' '); 1000 ob.className=nc; 1001 } 1002} 1003function P7_MGMremClass(ob,cl){ 1004 if(ob){ 1005 var cc,nc; 1006 cc=ob.className; 1007 if(cc&&cc.indexOf(cl>-1)){ 1008 nc=cc.replace(cl,''); 1009 nc=nc.replace(/\s+/g,' '); 1010 nc=nc.replace(/\s$/,''); 1011 nc=nc.replace(/^\s/,''); 1012 ob.className=nc; 1013 } 1014 } 1015} 1016function P7_MGMgetStyle(el,s1,s2){ 1017 var s=''; 1018 if(el.currentStyle){ 1019 s=el.currentStyle[s1]; 1020 } 1021 else{ 1022 s=document.defaultView.getComputedStyle(el,"").getPropertyValue(s2); 1023 } 1024 return s; 1025} 1026function P7_MGMaddSheet(sh){ 1027 var h,hd; 1028 hd=document.head || document.getElementsByTagName('head')[0]; 1029 h=document.createElement('style'); 1030 h.type='text/css'; 1031 if(h.styleSheet){ 1032 h.styleSheet.cssText=sh; 1033 } 1034 else{ 1035 h.appendChild(document.createTextNode(sh)); 1036 } 1037 hd.appendChild(h); 1038} 1039function P7_MGMgetCSSPre(){ 1040 var i,dV,pre=['animationDuration','WebkitAnimationDuration']; 1041 var c='none',cssPre=['','-webkit-']; 1042 dV=document.createElement('div'); 1043 for(i=0;i<pre.length;i++){ 1044 if(dV.style[pre[i]]!==undefined){ 1045 c=cssPre[i]; 1046 break; 1047 } 1048 } 1049 return c; 1050} 1051function P7_MGMgetIEver(){ 1052 var j,v=-1,nv,m=false; 1053 nv=navigator.userAgent.toLowerCase(); 1054 j=nv.indexOf("msie"); 1055 if(j>-1){ 1056 v=parseFloat(nv.substring(j+4,j+8)); 1057 if(document.documentMode){ 1058 v=document.documentMode; 1059 } 1060 } 1061 return v; 1062} 1063function P7_MGMisMobile(){ 1064 var i,m=false,ua=navigator.userAgent.toLowerCase(); 1065 var dv=['iphone','ipad','ipod','touch','android','windows ce','iemobile','windowsce','blackberry','palm','symbian','series60', 1066 'armv','arm7tdmi','opera mobi','opera mini','polaris','kindle','midp','mmp/','portalmmm','smm-mms','sonyericsson']; 1067 for(i=0;i<dv.length;i++){ 1068 if(ua.search(dv[i])>-1){ 1069 m=dv[i]; 1070 break; 1071 } 1072 } 1073 return m; 1074} 1075function P7_MGMsupTouch(el){ 1076 if(el.addEventListener){ 1077el.addEventListener("selectstart", function(e){ 1078 e.preventDefault(); 1079} 1080, false); 1081el.addEventListener("MSHoldVisual", function(e){ 1082 e.preventDefault(); 1083} 1084, false); 1085el.addEventListener("contextmenu", function(e){ 1086 e.preventDefault(); 1087} 1088, false); 1089} 1090}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.