1 2/* 3 ================================================ 4 PVII Tab Panel Magic 3 scripts 5 Copyright (c) 2014 Project Seven Development 6 www.projectseven.com 7 Version: 3.2.2 -build 11 8 ================================================ 9 10*/ 11 12var p7TP3over='_over'; 13var p7TP3open='_down'; 14var p7TP3pp={ 15 pauseText: 'Pause', 16 playText: 'Play' 17}; 18var p7TP3ctl=[],p7TP3i=false,p7TP3a=false,p7TP3adv=[]; 19function P7_TP3set(){ 20 var h,sh='',hd,ie=P7_TP3getIEver(); 21 if (!document.getElementById){ 22 return; 23 } 24 sh+='body {overflow-y: scroll;}\n'; 25 if(ie>0&&ie<5.5){ 26 sh+='.p7TP3cwrapper, .p7TP3cwrapper div {overflow: visible; height: 1%;}\n'; 27 sh+='.p7TP3tabs {display: none;}\n'; 28 } 29 else{ 30 sh+='.p7TP3tabs_viewport {overflow:hidden;}\n'; 31 sh+='.p7TP3tabs_wrapper {position:relative;left:0px;}\n'; 32 sh+='.p7TP3_panel {width:100%;position:absolute;overflow:hidden;visibility:hidden;z-index:200;}\n'; 33 sh+='.p7TP3_vp {position:relative;overflow:hidden;padding:0;margin:0;}\n'; 34 sh+='.p7TP3_slide_panel_v {position:relative;}\n'; 35 sh+='.p7TP3_slide_panel_h {float:left;}\n'; 36 sh+='.p7TP3_slide_wrapper {position:relative;}\n'; 37 } 38 if(ie>5&&ie<7){ 39 sh+='.p7TP3tabs_viewport {float:left;}\n'; 40 } 41 if (document.styleSheets){ 42 h='\n<st' + 'yle type="text/css">\n' + sh + '\n</s' + 'tyle>'; 43 document.write(h); 44 } 45 else{ 46 h=document.createElement('style'); 47 h.type='text/css'; 48 h.appendChild(document.createTextNode(sh)); 49 hd=document.getElementsByTagName('head'); 50 hd[0].appendChild(h); 51 } 52} 53P7_TP3set(); 54function P7_opTP3(){ 55 if(!document.getElementById){ 56 return; 57 } 58 p7TP3ctl[p7TP3ctl.length]=arguments; 59} 60function P7_TP3addLoad(){ 61 var ie=P7_TP3getIEver(); 62 if(!document.getElementById || (ie>0&&ie<5.5)){ 63 return; 64 } 65 if(window.addEventListener){ 66 document.addEventListener("DOMContentLoaded",P7_initTP3,false); 67 window.addEventListener("load",P7_initTP3,false); 68 window.addEventListener("unload",P7_TP3rf,false); 69 window.addEventListener("resize",P7_TP3rsz,false); 70 } 71 else if(document.addEventListener){ 72 document.addEventListener("load",P7_initTP3,false); 73 } 74 else if(window.attachEvent){ 75 document.write("<script id=p7ie_tp3 defer src=\"//:\"><\/script>"); 76 document.getElementById("p7ie_tp3").onreadystatechange=function(){ 77 if(this.readyState=="complete"){ 78 if(p7TP3ctl.length>0){ 79 P7_initTP3(); 80 } 81 } 82 }; 83 window.attachEvent("onload",P7_initTP3); 84 window.attachEvent("onresize",P7_TP3rsz); 85 } 86 else if(typeof window.onload=='function'){ 87 var p7vloadit=onload; 88 window.onload=function(){ 89 p7vloadit(); 90 P7_initTP3(); 91 }; 92 } 93 else{ 94 window.onload=P7_initTP3; 95 } 96} 97P7_TP3addLoad(); 98function P7_TP3rf(){ 99 return; 100} 101function P7_initTP3(){ 102 var i,j,jj,k,x,tB,tD,tA,tW,tV,tU,tP,tC,el,p,cV,ob,lD,iM,tSL,tSR,sr,fnA,fnB,swp,s1,s2,s3,sP,tch; 103 if(p7TP3i){ 104 return; 105 } 106 p7TP3i=true; 107 document.p7TP3preload=[]; 108 tch = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch || (navigator.msMaxTouchPoints || navigator.maxTouchPoints)); 109 for(j=p7TP3ctl.length-1;j>-1;j--){ 110 tB=document.getElementById(p7TP3ctl[j][0]); 111 if(tB){ 112 tB.p7opt=p7TP3ctl[j]; 113 P7_TP3tblfix(tB); 114 cV=document.getElementById(tB.id.replace('_','cvp_')); 115 tB.tp3Tabs=[]; 116 tB.tp3Panels=[]; 117 tB.tp3CurrentPanel=-1; 118 tB.tp3TrigScroll=false; 119 if(tB.p7opt[5]==1){ 120 if(tB.p7opt[3]>2){ 121 tB.p7opt[3]=1; 122 } 123 } 124 if(tch){ 125 tB.p7opt[3]=2; 126 P7_TP3remClass(tB,'v-slide'); 127 } 128 if(tB.p7opt[3]==1){ 129 cV.style.height='0px'; 130 } 131 if(tB.p7opt[3]==1||tB.p7opt[3]==2){ 132 tB.tp3Slider=true; 133 sP=document.getElementById(tB.id.replace('_','pw_')); 134 sP.style.left='0px'; 135 sP.style.top='0px'; 136 sP.tp3VP=cV.id; 137 sP.tp3Div=tB.id; 138 for(i=0;i<sP.childNodes.length;i++){ 139 if(sP.childNodes[i].nodeType==1){ 140 if(tB.p7opt[3]==1){ 141 sP.childNodes[i].className='p7TP3_slide_panel_v'; 142 } 143 else{ 144 sP.childNodes[i].style.width=cV.offsetWidth+'px'; 145 sP.childNodes[i].className='p7TP3_slide_panel_h'; 146 } 147 lD=sP.childNodes[i]; 148 } 149 } 150 if(tB.p7opt[3]==2){ 151 sP.tp3LastChild=lD; 152 P7_TP3resetWidth(sP,sP.tp3LastChild); 153 } 154 } 155 tV=document.getElementById(tB.id.replace('_','tvp_')); 156 tW=document.getElementById(tB.id.replace('_','tgw_')); 157 tD=document.getElementById(tB.id.replace('_','tabs_')); 158 tU=tD.getElementsByTagName('UL')[0]; 159 tA=tU.getElementsByTagName('A'); 160 for(i=0;i<tA.length;i++){ 161 tB.tp3Tabs[i]=tA[i]; 162 tB.tp3Panels[i]=null; 163 tA[i].tp3Div=tB.id; 164 tA[i].tp3PanelNum=i+1; 165 tA[i].tp3Panel=false; 166 tA[i].tp3State='closed'; 167 iM=tA[i].getElementsByTagName("IMG"); 168 if(iM&&iM[0]){ 169 sr=iM[0].getAttribute("src"); 170 swp=tB.p7opt[7]; 171 iM[0].tp3Swap=swp; 172 x=sr.lastIndexOf("."); 173 fnA=sr.substring(0,x); 174 fnB='.'+sr.substring(x+1); 175 s1=fnA+p7TP3over+fnB; 176 s2=fnA+p7TP3open+fnB; 177 if(swp==1){ 178 iM[0].p7imgswap=[sr,s1,s1,s1]; 179 P7_TP3preloader(s1); 180 } 181 else if(swp==2){ 182 iM[0].p7imgswap=[sr,s1,s2,s2]; 183 P7_TP3preloader(s1,s2); 184 } 185 else{ 186 iM[0].p7imgswap=[sr,sr,sr,sr]; 187 } 188 iM[0].p7state='closed'; 189 iM[0].mark=false; 190 iM[0].rollover=tB.p7opt[8]; 191 if(swp>0){ 192 tA[i].hasImg=true; 193 iM[0].onmouseover=function(){ 194 P7_TP3imovr(this); 195 }; 196 iM[0].onmouseout=function(){ 197 P7_TP3imout(this); 198 }; 199 tA[i].onfocus=function(){ 200 P7_TP3imovr(this.getElementsByTagName('IMG')[0]); 201 }; 202 tA[i].onblur=function(){ 203 P7_TP3imout(this.getElementsByTagName('IMG')[0]); 204 }; 205 } 206 } 207 tA[i].onclick=function(){ 208 return P7_TP3click(this); 209 }; 210 if(tB.p7opt[5]==1){ 211 tA[i].onmouseover=function(){ 212 var tB=document.getElementById(this.tp3Div); 213 if(tB.tp3MouseTimer){ 214 clearTimeout(tB.tp3MouseTimer); 215 } 216 tB.tp3MouseTimer=setTimeout("P7_TP3trig('"+this.id+"')",150); 217 }; 218 } 219 tP=document.getElementById(tA[i].id.replace('tab','w')); 220 if(tP){ 221 tP.tp3Div=tB.id; 222 tP.tp3PanelNum=i+1; 223 tP.tp3VP=tB.id.replace('_','cvp_'); 224 tA[i].tp3Panel=tP.id; 225 tB.tp3Panels[i]=tP; 226 tP.tp3State='closed'; 227 if(tB.p7opt[5]==1){ 228 tP.onmouseover=function (){ 229 var tB=document.getElementById(this.tp3Div); 230 if(tB.tp3MouseTimer){ 231 clearTimeout(tB.tp3MouseTimer); 232 } 233 }; 234 } 235 } 236 } 237 tB.tp3ControlPanels=[]; 238 tD.tp3CurCtrlPanelNum=-1; 239 jj=0; 240 for(i=0;i<tB.tp3Panels.length;i++){ 241 if(tB.tp3Panels[i]){ 242 tB.tp3ControlPanels[jj]=tB.tp3Panels[i]; 243 tB.tp3Panels[i].tp3ControlNum=jj; 244 jj++; 245 } 246 } 247 if( (tB.p7opt.length>14&&tB.p7opt[14]>0) || (tB.p7opt.length<15&&tB.p7opt[1]!==0) ){ 248 tB.tp3TrigScroll=true; 249 P7_TP3setClass(cV.parentNode,'arrows_on');
250 tW.style.left='0px'; 251 P7_TP3resetWidth(tW,tA[tA.length-1].parentNode); 252 tSL=document.getElementById(tB.id.replace('_','tleft_')); 253 if(tSL){ 254 P7_TP3setClass(tSL,'off'); 255 tSL.tp3Div=tB.id; 256 if(tB.p7opt.length>14&&tB.p7opt[14]==2){ 257 tSL.onclick=function(){ 258 return P7_TP3trigScrollPanel(this.tp3Div,'left'); 259 }; 260 } 261 else{ 262 tSL.onclick=function(){ 263 return P7_TP3trigScroll(this.tp3Div,'left'); 264 }; 265 } 266 } 267 tSR=document.getElementById(tB.id.replace('_','tright_')); 268 if(tSR){ 269 tSR.tp3Div=tB.id; 270 if(tB.p7opt.length>14&&tB.p7opt[14]==2){ 271 tSR.onclick=function(){ 272 return P7_TP3trigScrollPanel(this.tp3Div,'right'); 273 }; 274 } 275 else{ 276 tSR.onclick=function(){ 277 return P7_TP3trigScroll(this.tp3Div,'right'); 278 }; 279 } 280 } 281 P7_TP3trigScroll(tB.id,'left'); 282 } 283 tB.tp3PanelNums=tB.tp3Panels.length; 284 tB.tp3ShowMode='pause'; 285 tB.tp3NumPlays=1; 286 tB.tp3Direction='right'; 287 tB.tp3Paginator=false; 288 tB.tp3Paginators=[]; 289 tC=document.getElementById(tB.id.replace('_','paginator_')); 290 if(tC){ 291 tB.tp3Paginator=true; 292 tA=tC.getElementsByTagName('A'); 293 if(tA){ 294 jj=0; 295 for(k=0;k<tA.length;k++){ 296 if(!tA[k].id && !/pgpp|pgbk/.test(tA[k].id)){ 297 jj++; 298 tA[k].tp3Div=tB.id; 299 tA[k].tp3PanelNum=jj; 300 tB.tp3Paginators[jj]=tA[k]; 301 tA[k].onclick=function(){ 302 return P7_TP3control(this.tp3Div, this.tp3PanelNum); 303 }; 304 } 305 } 306 } 307 } 308 tB.tp3Controls=[10]; 309 tB.tp3Controls[0]=P7_TP3setCC(tB.id,'bp_','prev'); 310 tB.tp3Controls[1]=P7_TP3setCC(tB.id,'bn_','next'); 311 tB.tp3Controls[2]=P7_TP3setCC(tB.id,'rf_','first'); 312 tB.tp3Controls[3]=P7_TP3setCC(tB.id,'rp_','prev'); 313 tB.tp3Controls[5]=P7_TP3setCC(tB.id,'rn_','next'); 314 tB.tp3Controls[6]=P7_TP3setCC(tB.id,'rl_','last'); 315 el=document.getElementById(tB.id.replace('_','rpp_')); 316 if(el){ 317 el.p7state='pause'; 318 el.tp3Div=tB.id; 319 tB.tp3Controls[4]=el; 320 el.onclick=function(){ 321 var ac=(this.p7state=='play')?'pause':'play'; 322 P7_TP3control(this.tp3Div,ac); 323 return false; 324 }; 325 el.tp3SetButtonState=function(st){ 326 var tx; 327 if(st=='play'){ 328 tx= p7TP3pp.pauseText; 329 P7_TP3remClass(this,'play'); 330 } 331 else{ 332 tx= p7TP3pp.playText; 333 P7_TP3setClass(this,'play'); 334 } 335 this.innerHTML=tx; 336 }; 337 } 338 if(tch){ 339 el=document.getElementById(tB.id.replace('_','cvp_')); 340 el.tp3Div=tB.id; 341 P7_TP3bindSwipe(el,function(dir){ 342 var tD=document.getElementById(this.tp3Div); 343 if(tD.p7opt[3]==1){ 344 if(dir=='down'){ 345 P7_TP3control(this.tp3Div,'next'); 346 } 347 else if(dir=='up'){ 348 P7_TP3control(this.tp3Div,'prev'); 349 } 350 } 351 else{ 352 if(dir=='left'){ 353 P7_TP3control(this.tp3Div,'next'); 354 } 355 else if(dir=='right'){ 356 P7_TP3control(this.tp3Div,'prev'); 357 } 358 } 359 } 360 ); 361 el=document.getElementById(tB.id.replace('_','tvp_')); 362 if(el){ 363 el.tp3Div=tB.id; 364 P7_TP3bindSwipe(el,function(dir){ 365 if(dir=='left'){ 366 P7_TP3trigScrollPanel(this.tp3Div,'right'); 367 } 368 else if(dir=='right'){ 369 P7_TP3trigScrollPanel(this.tp3Div,'left'); 370 } 371 } 372 ); 373 } 374 } 375 p=tB.p7opt[6]; 376 if(p==-1){ 377 p=Math.floor(Math.random()*tB.tp3Tabs.length+1); 378 } 379 p--; 380 if(p>=0&&p<=tB.tp3Tabs.length){ 381 P7_TP3open(tB.tp3Tabs[p],1); 382 } 383 if(tB.p7opt[9]==1){ 384 P7_TP3currentMark(tB); 385 } 386 P7_TP3url(tB.id); 387 P7_TP3pause(tB.id); 388 if(tB.p7opt[15]==1){ 389 tB.tp3ShowMode='play'; 390 if(tB.tp3Controls[4]){ 391 tB.tp3Controls[4].p7state='play'; 392 tB.tp3Controls[4].tp3SetButtonState('play'); 393 } 394 if(tB.tp3Controls[7]){ 395 tB.tp3Controls[7].p7state='play'; 396 tB.tp3Controls[7].tp3SetButtonState('play'); 397 } 398 if(tB.tp3ShowTimer){ 399 clearTimeout(tB.tp3ShowTimer); 400 } 401 tB.tp3ShowTimer=setTimeout("P7_TP3control('"+tB.id+"','next',2)",tB.p7opt[16]); 402 } 403 } 404 } 405 P7_TP3rsz(); 406 p7TP3a=true; 407} 408function P7_TP3trigScrollPanel(d,dr){ 409 var tB,tV,tW,min,max,mxL,dur,stp,lp,dy=10; 410 tB=document.getElementById(d); 411 tV=document.getElementById(tB.id.replace('_','tvp_')); 412 tW=document.getElementById(tB.id.replace('_','tgw_')); 413 min=0; 414 mxL=tB.tp3Tabs[tB.tp3Tabs.length-1].parentNode; 415 max=mxL.offsetLeft+mxL.offsetWidth-tV.offsetWidth; 416 if(dr=='right'){ 417 lp=tW.offsetLeft-tV.offsetWidth; 418 } 419 else{ 420 lp=tW.offsetLeft+tV.offsetWidth; 421 } 422 tB.tp3LastScrollDir=dr; 423 lp=(lp<=(max*-1))?max*-1:lp; 424 lp=(lp>0)?0:lp; 425 P7_TP3setArrowStates(tB.id,lp,min,max); 426 tB.tp3LastScrollTab=tB.tp3CurrentPanel; 427 if(tB.tp3TrigScroll && p7TP3a && tB.p7opt[3]>0){ 428 tW.tp3Delay=dy; 429 tW.tp3Time=0; 430 tW.tp3Begin=parseInt(tW.style.left,10); 431 tW.tp3Finish=lp; 432 dur=tB.p7opt[1]; 433 stp=dur/dy; 434 tW.tp3Duration=stp; 435 if(!tW.tp3ScrollGliderRunning){ 436 tW.tp3ScrollGliderRunning=true; 437 tW.tp3ScrollGlider=setInterval("P7_TP3scrollGlider('"+tW.id+"')",tW.tp3Delay); 438 } 439 } 440 else{ 441 if(tB.tp3TrigScroll){ 442 tW.style.left=lp+'px'; 443 } 444 } 445 return false;
446} 447function P7_TP3trigScroll(d,dr){ 448 var i,k,tB,tV,tW,tL,tg,c=0,rr,vr,ps='left'; 449 tB=document.getElementById(d); 450 if(tB){ 451 tV=document.getElementById(tB.id.replace('_','tvp_')); 452 tW=document.getElementById(tB.id.replace('_','tgw_')); 453 P7_TP3resetScroll(tW.parentNode); 454 P7_TP3resetWidth(tW,tB.tp3Tabs[tB.tp3Tabs.length-1].parentNode); 455 if(dr=='right'){ 456 tg=(tW.offsetLeft*-1)+tV.offsetWidth; 457 for(i=0;i<tB.tp3Tabs.length;i++){ 458 tL=tB.tp3Tabs[i].parentNode; 459 if((tL.offsetLeft+tL.offsetWidth)>=tg){ 460 c=i; 461 if(tL.offsetWidth>=tV.offsetWidth){ 462 if(i==tB.tp3Tabs.length-1){ 463 ps='right'; 464 } 465 else if(tL.offsetLeft==(tW.offsetLeft*-1)){ 466 c++; 467 } 468 } 469 break; 470 } 471 } 472 } 473 else{ 474 tg=tW.offsetLeft*-1; 475 for(i=0;i<tB.tp3Tabs.length;i++){ 476 tL=tB.tp3Tabs[i].parentNode; 477 if(tL.offsetWidth>=tV.offsetWidth){ 478 rr=tL.offsetLeft+tL.offsetWidth; 479 vr=tg+tV.offsetWidth; 480 if(tL.offsetLeft>=tg || rr>=vr){ 481 c=i-1; 482 ps='right'; 483 if(i===0){ 484 ps='left'; 485 } 486 break; 487 } 488 } 489 else{ 490 if(tL.offsetLeft>=tg ){ 491 if(tB.tp3Tabs[i].offsetWidth>=tV.offsetWidth){ 492 } 493 c=i-1; 494 ps='right'; 495 break; 496 } 497 } 498 } 499 } 500 c=(c<0)?0:c; 501 c++; 502 P7_TP3moveToTab(tB.id,c,ps); 503 } 504 return false; 505} 506function P7_TP3moveToTab(d,n,ag,rs){ 507 var i,tB,tV,tW,tL,tA,lp,min,max,mxL,dur,stp,dy=10; 508 tB=document.getElementById(d); 509 tV=document.getElementById(tB.id.replace('_','tvp_')); 510 tW=document.getElementById(tB.id.replace('_','tgw_')); 511 P7_TP3resetScroll(tW.parentNode); 512 P7_TP3resetWidth(tW,tB.tp3Tabs[tB.tp3Tabs.length-1].parentNode); 513 tA=tB.tp3Tabs[n-1]; 514 tL=tA.parentNode; 515 min=0; 516 mxL=tB.tp3Tabs[tB.tp3Tabs.length-1].parentNode; 517 max=mxL.offsetLeft+mxL.offsetWidth-tV.offsetWidth; 518 tB.tp3LastScrollTab=n; 519 tB.tp3LastScrollDir=ag; 520 if(ag=='right'){ 521 lp=tL.offsetLeft+tL.offsetWidth-tV.offsetWidth; 522 } 523 else{ 524 lp=tL.offsetLeft; 525 } 526 lp=(lp>=max)?max:lp; 527 lp=lp*-1; 528 lp=(lp>0)?0:lp; 529 P7_TP3setArrowStates(tB.id,lp,min,max); 530 if(!rs&&tB.tp3TrigScroll && p7TP3a && tB.p7opt[3]>0){ 531 tW.tp3Delay=dy; 532 tW.tp3Time=0; 533 tW.tp3Begin=parseInt(tW.style.left,10); 534 tW.tp3Finish=lp; 535 dur=tB.p7opt[1]; 536 stp=dur/dy; 537 tW.tp3Duration=stp; 538 if(!tW.tp3ScrollGliderRunning){ 539 tW.tp3ScrollGliderRunning=true; 540 tW.tp3ScrollGlider=setInterval("P7_TP3scrollGlider('"+tW.id+"')",tW.tp3Delay); 541 } 542 } 543 else{ 544 if(tB.tp3TrigScroll){ 545 tW.style.left=lp+'px'; 546 } 547 } 548} 549function P7_TP3click(a){ 550 var wH,m=false; 551 if(!a.tp3Panel){ 552 wH=window.location.href; 553 if(a.href!=wH&&a.href!=wH+'#'){ 554 if(a.href.toLowerCase().indexOf('javascript:')==-1){ 555 m=true; 556 return m; 557 } 558 } 559 } 560 P7_TP3open(a); 561 return m; 562} 563function P7_TP3trig(d){ 564 var i,a; 565 a=document.getElementById(d); 566 if(a){ 567 P7_TP3open(a); 568 } 569} 570function P7_TP3openPanel(d,n){ 571 var x=n-1,tB=document.getElementById(d); 572 if(tB&&tB.tp3Tabs){ 573 if(x>-1&&x<tB.tp3Tabs.length){ 574 P7_TP3open(tB.tp3Tabs[x]); 575 } 576 } 577} 578function P7_TP3open(a,au){ 579 var i,tB,tW,tV,pT,pW,sW,iM,pP,cP,op,oV,dur,stp,mv,dy=20; 580 if(a.tp3State=='open'){ 581 return; 582 } 583 tB=document.getElementById(a.tp3Div); 584 if(tB.tp3AnimRunning){ 585 return; 586 } 587 if(tB.tp3ShowTimer){ 588 clearTimeout(tB.tp3ShowTimer); 589 } 590 if(tB.p7opt[21]==1 && !au){ 591 P7_TP3pause(tB.id); 592 } 593 tB.tp3PrevPanel=tB.tp3CurrentPanel; 594 if(tB.tp3PrevPanel>0){ 595 pP=tB.tp3Panels[tB.tp3PrevPanel-1]; 596 pT=tB.tp3Tabs[tB.tp3PrevPanel-1]; 597 if(pT){ 598 pT.tp3State='closed'; 599 P7_TP3remClass(pT,'open'); 600 P7_TP3remClass(pT.parentNode,'open'); 601 if(pT.hasImg){ 602 iM=pT.getElementsByTagName("IMG")[0]; 603 iM.p7state='closed'; 604 if(iM.mark){ 605 iM.src=iM.p7imgswap[3]; 606 } 607 else{ 608 iM.src=iM.p7imgswap[0]; 609 } 610 } 611 } 612 } 613 tB.tp3CurrentPanel=a.tp3PanelNum; 614 tB.tp3CurrentPanelId=null; 615 op=tB.p7opt[3]; 616 if(!p7TP3a){ 617 op=0; 618 } 619 P7_TP3setClass(a,'open'); 620 P7_TP3setClass(a.parentNode,'open'); 621 a.tp3State='open'; 622 if(a.hasImg){ 623 iM=a.getElementsByTagName("IMG")[0]; 624 iM.p7state='open'; 625 iM.src=iM.p7imgswap[2]; 626 } 627 P7_TP3setControlStates(tB.id); 628 mv=(tB.tp3TrigScroll&&tB.tp3LastScrollDir)?true:false; 629 if(tB.p7opt.length>14&&tB.p7opt[14]==2){ 630 tB.tp3LastScrollTab=a.tp3PanelNum; 631 if(mv){ 632 mv=(au==1)?true:false; 633 } 634 } 635 if(mv){ 636 P7_TP3moveToTab(tB.id,a.tp3PanelNum,tB.tp3LastScrollDir,true); 637 } 638 if(!a.tp3Panel){ 639 if(op<1||op>2){ 640 P7_TP3close(tB.id,tB.tp3PrevPanel); 641 return; 642 } 643 } 644 tW=document.getElementById(a.tp3Panel); 645 tB.tp3CurrentPanelId=(tW)?tW.id:null; 646 if(tW){ 647 tB.tp3CurCtrlPanelNum=tW.tp3ControlNum; 648 } 649 tV=document.getElementById(tB.id.replace('_','cvp_')); 650 tV.tp3Div=tB.id; 651 if(!tB.tp3Slider){ 652 tW.style.width=tV.offsetWidth+'px'; 653 tV.style.width=tV.offsetWidth+'px'; 654 if(pP){ 655 pP.style.width=tV.offsetWidth+'px'; 656 tV.style.height=tV.offsetHeight+'px'; 657 pP.style.position='absolute'; 658 pP.style.zIndex=210; 659 } 660 } 661 cP=document.getElementById(tW.id.replace('w','c')); 662 P7_TP3setClass(cP,'current-panel'); 663 if(pP){ 664 cP=document.getElementById(pP.id.replace('w','c')); 665 P7_TP3remClass(cP,'current-panel'); 666 } 667 if(op==1||op==2){ 668 sW=document.getElementById(tB.id.replace('_','pw_')); 669 if(sW.tp3PanelResizeRunning){ 670 clearInterval(sW.tp3PanelResizer); 671 sW.tp3PanelResizeRunning=false; 672 } 673 sW.tp3Time=0; 674 sW.tp3Delay=dy; 675 tV.tp3VPbegin=tV.offsetHeight; 676 tV.tp3VPfinish=(tW)?tW.offsetHeight:0; 677 tV.tp3VPtime=0; 678 if(op==1){ 679 sW.tp3Lbegin=0; 680 sW.tp3Lfinish=0; 681 sW.tp3Tbegin=parseInt(sW.style.top,10); 682 sW.tp3Tfinish=(tW)?tW.offsetTop*-1:sW.tp3Tbegin; 683 } 684 else{ 685 sW.tp3Lbegin=parseInt(sW.style.left,10); 686 sW.tp3Lfinish=(tW)?tW.offsetLeft*-1:0; 687 sW.tp3Tbegin=0; 688 sW.tp3Tfinish=0; 689 } 690 dur=tB.p7opt[4]; 691 stp=dur/dy; 692 sW.tp3Duration=stp; 693 if(!sW.tp3PanelSliderRunning){ 694 sW.tp3PanelSliderRunning=true; 695 sW.tp3PanelSlider=setInterval("P7_TP3panelSlider('"+sW.id+"')",sW.tp3Delay); 696 } 697 } 698 else if(op==3){ 699 tW.style.width=tV.offsetWidth+'px'; 700 tW.style.height='auto'; 701 tW.style.position='absolute'; 702 tW.style.visibility='visible'; 703 tW.tp3Anim=op; 704 tW.tp3Delay=dy; 705 tW.tp3FOPdelay=20; 706 tV.tp3VPbegin=tV.offsetHeight; 707 tV.tp3VPfinish=tW.offsetHeight; 708 tV.tp3VPtime=0; 709 tW.tp3VPfirst=false; 710 tW.tp3VPlast=true; 711 tW.style.width=tV.offsetWidth+'px'; 712 if(pP){ 713 pP.style.zIndex=260; 714 pP.tp3FOPbegin=99; 715 pP.tp3FOPfinish=1; 716 pP.tp3FOPtime=0; 717 pP.tp3FOPdelay=tW.tp3FOPdelay; 718 dur=tB.p7opt[4]; 719 stp=dur/pP.tp3FOPdelay; 720 pP.tp3FOPduration=stp; 721 if(tW.offsetHeight < pP.offsetHeight){ 722 tW.tp3VPfirst=true; 723 tW.tp3VPlast=false; 724 } 725 if(pP.filters){ 726 pP.style.filter='alpha(opacity='+pP.tp3FOPbegin+')'; 727 } 728 else{ 729 pP.style.opacity=pP.tp3FOPbegin/100; 730 } 731 } 732 tW.style.zIndex=250; 733 tW.tp3FOPbegin=1; 734 tW.tp3FOPfinish=99; 735 tW.tp3FOPtime=0; 736 dur=tB.p7opt[4]; 737 stp=dur/tW.tp3FOPdelay; 738 tW.tp3FOPduration=stp; 739 if(tW.filters){ 740 tW.style.filter='alpha(opacity='+tW.tp3FOPbegin+')'; 741 } 742 else{ 743 tW.style.opacity=tW.tp3FOPbegin/100; 744 } 745 dur=tB.p7opt[4]; 746 stp=dur/dy; 747 tW.tp3Duration=stp; 748 tV.tp3VPduration=parseInt((tW.tp3Duration/2),10);
749 tW.style.left='0px'; 750 tW.style.top='0px'; 751 tW.style.height='auto'; 752 tW.style.visibility='visible'; 753 tB.tp3AnimRunning=true; 754 if(!tW.tp3PanelFaderRunning){ 755 tW.tp3PrevPanel=(pP)?pP.id:null; 756 tW.tp3PanelFaderRunning=true; 757 tW.tp3PanelFader=setInterval("P7_TP3panelCrossFader('"+tW.id+"')",tW.tp3FOPdelay); 758 } 759 } 760 else{ 761 if(tB.tp3Slider){ 762 sW=document.getElementById(tB.id.replace('_','pw_')); 763 if(tB.p7opt[3]==1){ 764 sW.style.top=(tW.offsetTop*-1)+'px'; 765 } 766 else if(tB.p7opt[3]==2){ 767 sW.style.left=(tW.offsetLeft*-1)+'px'; 768 } 769 tV.style.height=tW.offsetHeight+'px'; 770 if(!sW.tp3PanelResizeRunning){ 771 sW.tp3PanelResizeRunning=true; 772 sW.tp3PanelResizer=setInterval("P7_TP3panelResize('"+sW.id+"')",30); 773 } 774 } 775 else{ 776 tW.style.visibility='hidden'; 777 tW.style.height='auto'; 778 tW.style.zIndex=250; 779 tW.style.left='0px'; 780 tW.style.position='relative'; 781 tW.style.width='auto'; 782 tW.style.visibility='visible'; 783 tV.style.height='auto'; 784 tV.style.width='auto'; 785 P7_TP3close(tB.id,tB.tp3PrevPanel); 786 } 787 } 788 if(tB.tp3ShowMode=='play'){ 789 tB.tp3ShowTimer=setTimeout("P7_TP3control('"+tB.id+"','next',2)",tB.p7opt[17]); 790 } 791} 792function P7_TP3close(d,pn){ 793 var tB,tT,tC,iM,sW; 794 if(pn>0){ 795 tB=document.getElementById(d); 796 if(tB){ 797 pn--; 798 if(pn<tB.tp3Tabs.length){ 799 tT=tB.tp3Tabs[pn]; 800 tT.tp3State='closed'; 801 P7_TP3remClass(tT,'open'); 802 P7_TP3remClass(tT.parentNode,'open'); 803 if(tT.hasImg){ 804 iM=tT.getElementsByTagName("IMG")[0]; 805 iM.p7state='closed'; 806 if(iM.mark){ 807 iM.src=iM.p7imgswap[3]; 808 } 809 else{ 810 iM.src=iM.p7imgswap[0]; 811 } 812 } 813 if(tT.tp3Panel){ 814 tC=document.getElementById(tT.tp3Panel); 815 tC.style.position='absolute'; 816 tC.style.visibility='hidden'; 817 tC.style.left='-3000px'; 818 tC.style.zIndex=200; 819 } 820 } 821 } 822 } 823} 824function P7_TP3scrollGlider(d){ 825 var tD,nl; 826 tD=document.getElementById(d); 827 tD.tp3Time++; 828 nl=P7_TP3InOutQuad(tD.tp3Time,tD.tp3Begin,tD.tp3Finish-tD.tp3Begin,tD.tp3Duration); 829 tD.style.left=nl+'px'; 830 if(tD.tp3Time>=tD.tp3Duration){ 831 clearInterval(tD.tp3ScrollGlider); 832 tD.tp3ScrollGliderRunning=false; 833 } 834} 835function P7_TP3panelSlider(d){ 836 var tD,vP,vph,nl,nt; 837 tD=document.getElementById(d); 838 vP=document.getElementById(tD.tp3VP); 839 tD.tp3Time++; 840 if(vP.tp3VPbegin!=vP.tp3VPfinish){ 841 vph=P7_TP3InOutQuad(tD.tp3Time,vP.tp3VPbegin,vP.tp3VPfinish-vP.tp3VPbegin,tD.tp3Duration); 842 vP.style.height=vph+'px'; 843 } 844 if(tD.tp3Lbegin!=tD.tp3Lfinish){ 845 nl=P7_TP3InOutQuad(tD.tp3Time,tD.tp3Lbegin,tD.tp3Lfinish-tD.tp3Lbegin,tD.tp3Duration); 846 tD.style.left=nl+'px'; 847 } 848 if(tD.tp3Tbegin!=tD.tp3Tfinish){ 849 nt=P7_TP3InOutQuad(tD.tp3Time,tD.tp3Tbegin,tD.tp3Tfinish-tD.tp3Tbegin,tD.tp3Duration); 850 tD.style.top=nt+'px'; 851 } 852 if(tD.tp3Time>=tD.tp3Duration){ 853 clearInterval(tD.tp3PanelSlider); 854 tD.tp3PanelSliderRunning=false; 855 if(!tD.tp3PanelResizeRunning){ 856 tD.tp3PanelResizer=setInterval("P7_TP3panelResize('"+tD.id+"')",30); 857 tD.tp3PanelResizeRunning=true; 858 } 859 } 860} 861function P7_TP3panelResize(d){ 862 var wP,vP,tB,cP; 863 wP=document.getElementById(d); 864 if(!wP.tp3PanelSliderRunning){ 865 vP=document.getElementById(wP.tp3VP); 866 tB=document.getElementById(vP.tp3Div); 867 cP=document.getElementById(tB.tp3CurrentPanelId); 868 if(cP){ 869 if(cP.offsetHeight!=vP.offsetHeight){ 870 vP.style.height=cP.offsetHeight+'px'; 871 } 872 } 873 } 874 else{ 875 clearInterval(wP.tp3PanelResizer); 876 wP.tp3PanelResizeRunning=false; 877 } 878} 879function P7_TP3panelCrossFader(dIn){ 880 var cP,pP,vP,vph,tB,p; 881 cP=document.getElementById(dIn); 882 pP=document.getElementById(cP.tp3PrevPanel); 883 vP=document.getElementById(cP.tp3VP); 884 if(cP.tp3VPfirst){ 885 vP.tp3VPtime++; 886 vph=P7_TP3InOutQuad(vP.tp3VPtime,vP.tp3VPbegin,vP.tp3VPfinish-vP.tp3VPbegin,vP.tp3VPduration); 887 vP.style.height=vph+'px'; 888 if(vP.tp3VPtime>=vP.tp3VPduration){ 889 cP.tp3VPfirst=false; 890 vP.tp3VPbegin=vP.tp3VPfinish; 891 } 892 } 893 else if(cP.tp3FOPtime<=cP.tp3FOPduration){ 894 cP.tp3FOPtime++; 895 p=P7_TP3InOutQuad(cP.tp3FOPtime,cP.tp3FOPbegin,cP.tp3FOPfinish-cP.tp3FOPbegin,cP.tp3FOPduration); 896 if(cP.filters){ 897 cP.style.filter='alpha(opacity='+p+')'; 898 } 899 else{ 900 cP.style.opacity=p/100; 901 } 902 if(pP){ 903 pP.tp3FOPtime++; 904 p=P7_TP3InOutQuad(pP.tp3FOPtime,pP.tp3FOPbegin,pP.tp3FOPfinish-pP.tp3FOPbegin,pP.tp3FOPduration); 905 if(pP.filters){ 906 pP.style.filter='alpha(opacity='+p+')'; 907 } 908 else{ 909 pP.style.opacity=p/100; 910 } 911 } 912 } 913 else if(cP.tp3VPlast && (cP.tp3FOPtime>=cP.tp3FOPduration)){ 914 vP.tp3VPtime++; 915 vph=P7_TP3InOutQuad(vP.tp3VPtime,vP.tp3VPbegin,vP.tp3VPfinish-vP.tp3VPbegin,vP.tp3VPduration); 916 vP.style.height=vph+'px'; 917 if(vP.tp3VPtime>=vP.tp3VPduration){ 918 cP.tp3VPlast=false; 919 vP.tp3VPbegin=vP.tp3VPfinish; 920 } 921 } 922 if(!cP.tp3first && !cP.tp3VPlast && (cP.tp3FOPtime>=cP.tp3FOPduration)){ 923 clearInterval(cP.tp3PanelFader);
924 cP.tp3PanelFaderRunning=false; 925 tB=document.getElementById(cP.tp3Div); 926 cP.style.position='relative'; 927 cP.style.height='auto'; 928 cP.style.width='auto'; 929 tB.tp3AnimRunning=false; 930 if(pP){ 931 P7_TP3close(tB.id,pP.tp3PanelNum); 932 if(pP.filters){ 933 pP.style.filter=''; 934 } 935 else{ 936 pP.style.opacity=1; 937 } 938 } 939 if(cP.filters){ 940 cP.style.filter=''; 941 } 942 else{ 943 cP.style.opacity=1; 944 } 945 vP.style.height='auto'; 946 vP.style.width='auto'; 947 } 948} 949function P7_TP3InOutQuad(t,b,c,d){ 950 if((t/=d/2)<1){ 951 return c/2*t*t+b; 952 } 953 else{ 954 return -c/2*((--t)*(t-2)-1)+b; 955 } 956} 957function P7_TP3rsz(){ 958 var i,j,tB,wP,vP,cP; 959 for(j=p7TP3ctl.length-1;j>-1;j--){ 960 tB=document.getElementById(p7TP3ctl[j][0]); 961 if(tB){ 962 if(tB.tp3TrigScroll&&tB.tp3LastScrollDir){ 963 P7_TP3moveToTab(tB.id,tB.tp3LastScrollTab,tB.tp3LastScrollDir,true); 964 } 965 if(tB.tp3Slider){ 966 wP=document.getElementById(tB.id.replace('_','pw_')); 967 vP=document.getElementById(tB.id.replace('_','cvp_')); 968 cP=document.getElementById(tB.tp3CurrentPanelId); 969 if(!wP.tp3PanelSliderRunning){ 970 if(tB.p7opt[3]==1){ 971 if(cP){ 972 vP.style.height=cP.offsetHeight+'px'; 973 wP.style.top=(cP.offsetTop*-1)+'px'; 974 setTimeout("P7_TP3rsz2('"+vP.id+"','"+wP.id+"','"+cP.id+"')",20); 975 } 976 } 977 else{ 978 for(i=0;i<wP.childNodes.length;i++){ 979 if(wP.childNodes[i].nodeType==1){ 980 wP.childNodes[i].style.width=vP.offsetWidth+'px'; 981 } 982 } 983 if(wP.tp3LastChild){ 984 P7_TP3resetWidth(wP,wP.tp3LastChild); 985 } 986 if(cP){ 987 vP.style.height=cP.offsetHeight+'px'; 988 wP.style.left=(cP.offsetLeft*-1)+'px'; 989 } 990 } 991 } 992 } 993 } 994 } 995} 996function P7_TP3rsz2(v,w,c){ 997 var vP,wP,cP; 998 vP=document.getElementById(v); 999 wP=document.getElementById(w); 1000 cP=document.getElementById(c); 1001 if(cP && cP.offsetHeight){ 1002 vP.style.height=cP.offsetHeight+'px'; 1003 wP.style.top=(cP.offsetTop*-1)+'px'; 1004 } 1005} 1006function P7_TP3preloader(){ 1007 var i,x; 1008 for(i=0;i<arguments.length;i++){ 1009 x=document.p7TP3preload.length; 1010 document.p7TP3preload[x]=new Image(); 1011 document.p7TP3preload[x].src=arguments[i]; 1012 } 1013} 1014function P7_TP3imovr(im){ 1015 var m=false,r=im.rollover; 1016 if(im.mark){ 1017 m=(r>1)?true:false; 1018 } 1019 else if(im.p7state=='open'){ 1020 m=(r==1||r==3)?true:false; 1021 } 1022 else{ 1023 m=true; 1024 } 1025 if(m){ 1026 im.src=im.p7imgswap[1]; 1027 } 1028} 1029function P7_TP3imout(im){ 1030 var r=im.rollover; 1031 if(im.mark){ 1032 if(im.p7state=='open'){ 1033 im.src=im.p7imgswap[2]; 1034 } 1035 else{ 1036 im.src=im.p7imgswap[3]; 1037 } 1038 } 1039 else if(im.p7state=='open'){ 1040 if(r==1||r==3){ 1041 im.src=im.p7imgswap[2]; 1042 } 1043 } 1044 else{ 1045 im.src=im.p7imgswap[0]; 1046 } 1047} 1048function P7_TP3ctrl(dv,ac){ 1049 return P7_TP3control(dv,ac); 1050} 1051function P7_TP3control(dv,ac,bp){ 1052 var i,tD,cs,ts,op,sn,eI,eC,eD,tm=0,pauseOnAction=false,rs=false,m=false; 1053 tD=document.getElementById(dv); 1054 if(tD&&tD.tp3Panels){ 1055 if(tD.tp3ShowTimer){ 1056 clearTimeout(tD.tp3ShowTimer); 1057 } 1058 if(tD.p7opt[21]==1){ 1059 pauseOnAction=true; 1060 } 1061 cs=tD.tp3CurCtrlPanelNum; 1062 ts=tD.tp3ControlPanels.length-1; 1063 op=tD.p7opt; 1064 if(ac=='pause'){ 1065 P7_TP3pause(dv); 1066 return m; 1067 } 1068 if(!bp && pauseOnAction){ 1069 P7_TP3pause(dv); 1070 } 1071 if(ac=='play'){ 1072 tD.tp3ShowMode='play'; 1073 if(tD.tp3Controls[4]){ 1074 tD.tp3Controls[4].p7state='play'; 1075 tD.tp3Controls[4].tp3SetButtonState('play'); 1076 } 1077 if(tD.tp3Controls[7]){ 1078 tD.tp3Controls[7].p7state='play'; 1079 tD.tp3Controls[7].tp3SetButtonState('play'); 1080 } 1081 ac='next'; 1082 } 1083 if(ac=='first'){ 1084 sn=0; 1085 } 1086 else if(ac=='prev'){ 1087 sn=cs-1; 1088 if(sn<0){ 1089 sn=ts; 1090 } 1091 } 1092 else if(ac=='next'){ 1093 sn=cs+1; 1094 if(tD.tp3ShowMode=='play'){ 1095 if(tD.tp3Direction=='left'){ 1096 sn=cs-1; 1097 } 1098 if(sn>ts){ 1099 tD.tp3NumPlays++; 1100 if(tD.p7opt[19]>0 && tD.tp3NumPlays>tD.p7opt[19]){ 1101 tD.tp3NumPlays=0; 1102 sn=(tD.p7opt[20]==1)?0:tD.tp3ControlPanels.length-1; 1103 tD.tp3Direction='right'; 1104 P7_TP3pause(tD.id); 1105 } 1106 else{ 1107 if(tD.p7opt[18]===0){ 1108 sn=cs-1; 1109 tD.tp3Direction='left'; 1110 } 1111 else{ 1112 sn=0; 1113 } 1114 } 1115 } 1116 if(sn<0){ 1117 tD.numPlays++; 1118 tD.tp3Direction='right'; 1119 if(tD.p7opt[19]>0&&tD.numPlays>tD.p7opt[19]){ 1120 tD.tp3NumPlays=0; 1121 sn=(tD.p7opt[13]==1)?0:tD.tp3ControlPanels.length-1; 1122 P7_TP3pause(tD.id); 1123 } 1124 else{ 1125 sn=cs+1; 1126 } 1127 } 1128 } 1129 else{ 1130 if(sn>ts){ 1131 sn=0; 1132 } 1133 } 1134 } 1135 else if(ac=='last'){ 1136 sn=ts; 1137 } 1138 else{ 1139 sn=ac-1; 1140 } 1141 sn=(sn<0)?0:sn; 1142 sn=(sn>tD.tp3ControlPanels.length-1)?tD.tp3ControlPanels.length-1:sn; 1143 if(sn==tD.tp3CurCtrlPanelNum&&bp!=1){ 1144 return m; 1145 } 1146 sn=tD.tp3ControlPanels[sn].tp3PanelNum; 1147 P7_TP3open(tD.tp3Tabs[sn-1],1); 1148 } 1149 return false;
1150} 1151function P7_TP3setControlStates(dv){ 1152 var i,tD,sn,cl='off'; 1153 tD=document.getElementById(dv); 1154 sn=tD.tp3CurrentPanel; 1155 if(sn<=1){ 1156 P7_TP3setClass(tD.tp3Controls[0],cl); 1157 P7_TP3setClass(tD.tp3Controls[2],cl); 1158 } 1159 else{ 1160 P7_TP3remClass(tD.tp3Controls[0],cl); 1161 P7_TP3remClass(tD.tp3Controls[2],cl); 1162 } 1163 if(sn>=tD.tp3PanelNums){ 1164 P7_TP3setClass(tD.tp3Controls[1],cl); 1165 P7_TP3setClass(tD.tp3Controls[6],cl); 1166 } 1167 else{ 1168 P7_TP3remClass(tD.tp3Controls[1],cl); 1169 P7_TP3setClass(tD.tp3Controls[6],cl); 1170 } 1171 if(tD.tp3Paginator){ 1172 for(i=1;i<tD.tp3Paginators.length;i++){ 1173 if(i==sn){ 1174 P7_TP3setClass(tD.tp3Paginators[i],'down'); 1175 } 1176 else{ 1177 P7_TP3remClass(tD.tp3Paginators[i],'down'); 1178 } 1179 } 1180 } 1181} 1182function P7_TP3pause(d){ 1183 var cD,tD=document.getElementById(d); 1184 if(tD){ 1185 tD.tp3ShowMode='pause'; 1186 if(tD.tp3ShowTimer){ 1187 clearTimeout(tD.tp3ShowTimer); 1188 } 1189 if(tD.tp3Controls[4]){ 1190 tD.tp3Controls[4].p7state='pause'; 1191 tD.tp3Controls[4].tp3SetButtonState('pause'); 1192 } 1193 if(tD.tp3Controls[7]){ 1194 tD.tp3Controls[7].p7state='pause'; 1195 tD.tp3Controls[7].tp3SetButtonState('pause'); 1196 } 1197 } 1198} 1199var p7TP3tch={ 1200 el: null, 1201 fCnt: 0, 1202 startX: 0, 1203 startY: 0, 1204 curX: 0, 1205 curY: 0 1206}; 1207function P7_TP3tchStart(evt){ 1208 if(evt.pointerType){ 1209 p7TP3tch.fCnt=1; 1210 p7TP3tch.startX=evt.clientX; 1211 p7TP3tch.startY=evt.clientY; 1212 if(!p7TP3tch.el){ 1213 p7TP3tch.el=this; 1214 } 1215 } 1216 else if(evt.touches.length==1){ 1217 p7TP3tch.fCnt=evt.touches.length; 1218 p7TP3tch.startX=evt.touches[0].pageX; 1219 p7TP3tch.startY=evt.touches[0].pageY; 1220 if(!p7TP3tch.el){ 1221 p7TP3tch.el=this; 1222 } 1223 } 1224 else{ 1225 P7_TP3tchCancel(evt); 1226 } 1227} 1228function P7_TP3tchMove(evt){ 1229 var x; 1230 if(p7TP3tch.startX!==0){ 1231 if(evt.pointerType){ 1232 x=Math.abs(evt.clientX-p7TP3tch.startX); 1233 if(x>4 || navigator.maxTouchPoints || navigator.msMaxTouchPoints){ 1234 evt.stopPropagation(); 1235 evt.preventDefault(); 1236 p7TP3tch.curX=evt.clientX; 1237 p7TP3tch.curY=evt.clientY; 1238 } 1239 else{ 1240 P7_TP3tchCancel(evt); 1241 } 1242 } 1243 else if(evt.touches.length==1){ 1244 x=Math.abs(evt.touches[0].pageX-p7TP3tch.startX); 1245 if(x>4){ 1246 evt.stopPropagation(); 1247 evt.preventDefault(); 1248 p7TP3tch.curX=evt.touches[0].pageX; 1249 p7TP3tch.curY=evt.touches[0].pageY; 1250 } 1251 else{ 1252 P7_TP3tchCancel(evt); 1253 } 1254 } 1255 else{ 1256 P7_TP3tchCancel(evt); 1257 } 1258 } 1259 else{ 1260 P7_TP3tchCancel(evt); 1261 } 1262} 1263function P7_TP3tchEnd(evt){ 1264 var swl,swa,swd,x,y,z,r; 1265 if(p7TP3tch.fCnt==1 && p7TP3tch.curX!==0){ 1266 evt.preventDefault(); 1267 swl=Math.round(Math.sqrt(Math.pow(p7TP3tch.curX - p7TP3tch.startX,2) + Math.pow(p7TP3tch.curY - p7TP3tch.startY,2))); 1268 if(swl>=72){ 1269 x=p7TP3tch.startX-p7TP3tch.curX; 1270 y=p7TP3tch.curY-p7TP3tch.startY; 1271 r=Math.atan2(y,x); 1272 swa=Math.round(r*180/Math.PI); 1273 if(swa<0){ 1274 swa=360-Math.abs(swa); 1275 } 1276 if((swa<=45)&&(swa>=0)){ 1277 swd='left'; 1278 } 1279 else if((swa<=360)&&(swa>=315)){ 1280 swd='left'; 1281 } 1282 else if((swa>=135)&&(swa<=225)){ 1283 swd='right'; 1284 } 1285 else if((swa>45)&&(swa<135)){ 1286 swd='down'; 1287 } 1288 else{ 1289 swd='up'; 1290 } 1291 p7TP3tch.el.onSwiped(swd); 1292 P7_TP3tchCancel(evt); 1293 } 1294 else{ 1295 P7_TP3tchCancel(evt); 1296 } 1297 } 1298 else{ 1299 P7_TP3tchCancel(evt); 1300 } 1301} 1302function P7_TP3tchCancel(evt){ 1303 p7TP3tch.fCnt=0; 1304 p7TP3tch.startX=0; 1305 p7TP3tch.startY=0; 1306 p7TP3tch.curX=0; 1307 p7TP3tch.curY=0; 1308 p7TP3tch.el=null; 1309} 1310function P7_TP3bindSwipe(ob,fn){ 1311 ob.onSwiped=fn; 1312 if(navigator.maxTouchPoints){ 1313 ob.addEventListener('pointerdown',P7_TP3tchStart,false); 1314 ob.addEventListener('pointerup',P7_TP3tchEnd,false); 1315 ob.addEventListener('pointermove',P7_TP3tchMove,false); 1316 ob.setAttribute('style','touch-action: pan-y pinch-zoom;'); 1317 } 1318 else if(navigator.msMaxTouchPoints){ 1319 ob.addEventListener('MSPointerDown',P7_TP3tchStart,false); 1320 ob.addEventListener('MSPointerUp',P7_TP3tchEnd,false); 1321 ob.addEventListener('MSPointerMove',P7_TP3tchMove,false); 1322 ob.setAttribute('style','-ms-touch-action: pan-y pinch-zoom;'); 1323 } 1324 else{ 1325 ob.addEventListener('touchstart',P7_TP3tchStart,false); 1326 ob.addEventListener('touchend',P7_TP3tchEnd,false); 1327 ob.addEventListener('touchmove',P7_TP3tchMove,false); 1328 ob.addEventListener('touchcancel',P7_TP3tchCancel,false); 1329 } 1330} 1331function P7_TP3mark(){ 1332 p7TP3adv[p7TP3adv.length]=arguments; 1333} 1334function P7_TP3currentMark(el){ 1335 var j,i,x,wH,cm=false,mt=['',1,'',''],op,r1,k,kk,tA,aU,pp,tr,aT,aP,d,pn,im; 1336 wH=window.location.href; 1337 if(el.p7opt[10]!=1){ 1338 wH=wH.replace(window.location.search,''); 1339 } 1340 if(wH.charAt(wH.length-1)=='#'){ 1341 wH=wH.substring(0,wH.length-1); 1342 } 1343 for(k=0;k<p7TP3adv.length;k++){ 1344 if(p7TP3adv[k][0]&&p7TP3adv[k][0]==el.id){ 1345 mt=p7TP3adv[k]; 1346 cm=true; 1347 break; 1348 } 1349 } 1350 op=mt[1]; 1351 if(op<1){ 1352 return; 1353 } 1354 r1=/index\.[\S]*/i; 1355 k=-1; 1356 kk=-1; 1357 tA=[]; 1358 d=document.getElementById(el.id.replace("_","tvp_")); 1359 if(d){ 1360 aT=d.getElementsByTagName('A'); 1361 if(aT&&aT.length>0){ 1362 for(i=0;i<aT.length;i++){ 1363 tA[tA.length]=aT[i]; 1364 } 1365 } 1366 } 1367 d=document.getElementById(el.id.replace("_","cvp_")); 1368 if(d){ 1369 aP=d.getElementsByTagName('A'); 1370 if(aP&&aP.length>0){ 1371 for(i=0;i<aP.length;i++){ 1372 tA[tA.length]=aP[i]; 1373 } 1374 } 1375 } 1376 for(j=0;j<tA.length;j++){ 1377 aU=tA[j].href.replace(r1,''); 1378 if(op>0){ 1379 if(tA[j].href==wH || aU==wH){ 1380 k=j; 1381 kk=-1; 1382 } 1383 } 1384 if(op==2){ 1385 if(tA[j].firstChild){ 1386 if(tA[j].firstChild.nodeValue==mt[2]){ 1387 kk=j; 1388 } 1389 } 1390 } 1391 if(op==3&&tA[j].href.indexOf(mt[2])>-1){ 1392 kk=j; 1393 } 1394 if(op==4){ 1395 for(x=2;x<mt.length;x+=2){
1396 if(wH.indexOf(mt[x])>-1){ 1397 if(tA[j].firstChild&&tA[j].firstChild.nodeValue){ 1398 if(tA[j].firstChild.nodeValue==mt[x+1]){ 1399 kk=j; 1400 } 1401 } 1402 } 1403 } 1404 } 1405 } 1406 k=(kk>k)?kk:k; 1407 if(k>-1){ 1408 if(tA[k].tp3PanelNum){ 1409 tr=tA[k]; 1410 } 1411 else{ 1412 P7_TP3setClass(tA[k],'current_mark'); 1413 pp=tA[k].parentNode; 1414 while (pp){ 1415 if(pp.tp3Div && pp.tp3Div==el.id){ 1416 tr=el.tp3Tabs[pp.tp3PanelNum-1]; 1417 break; 1418 } 1419 pp=pp.parentNode; 1420 } 1421 } 1422 if(tr){ 1423 P7_TP3setClass(tr,'current_mark'); 1424 P7_TP3setClass(tr.parentNode,'current_mark'); 1425 P7_TP3open(tr,1); 1426 } 1427 } 1428} 1429function P7_TP3url(dv){ 1430 var i,h,s,x,d='tp3',pn,n=dv.replace("p7TP3_",""),tr; 1431 if(document.getElementById){ 1432 h=document.location.search; 1433 if(h){ 1434 h=h.replace('?',''); 1435 s=h.split(/[=&]/g); 1436 if(s&&s.length){ 1437 for(i=0;i<s.length;i+=2){ 1438 if(s[i]==d){ 1439 x=s[i+1]; 1440 if(n!=x.charAt(0)){ 1441 x=false; 1442 } 1443 if(x){ 1444 pn='p7TP3tab'+x; 1445 tr=document.getElementById(pn); 1446 if(tr){ 1447 P7_TP3open(tr,1); 1448 } 1449 } 1450 } 1451 } 1452 } 1453 } 1454 h=document.location.hash; 1455 if(h){ 1456 x=h.substring(1,h.length); 1457 if(n!=x.charAt(3)){ 1458 x=false; 1459 } 1460 if(x&&x.indexOf(d)===0){ 1461 pn='p7TP3tab'+x.substring(3); 1462 tr=document.getElementById(pn); 1463 if(tr){ 1464 P7_TP3open(tr,1); 1465 } 1466 } 1467 } 1468 } 1469} 1470function P7_TP3setCC(dd,rp,ac){ 1471 var d,tC; 1472 d=dd.replace('_',rp); 1473 tC=document.getElementById(d); 1474 if(tC){ 1475 tC.onclick=function(){ 1476 return P7_TP3control(dd,ac); 1477 }; 1478 } 1479 return tC; 1480} 1481function P7_TP3resetScroll(ob){ 1482 if(ob.scrollLeft !== 0){ 1483 ob.scrollLeft=0; 1484 } 1485 if(ob.scrollTop !== 0){ 1486 ob.scrollTop=0; 1487 } 1488} 1489function P7_TP3resetWidth(dd,li){ 1490 dd.style.width=(dd.childNodes.length*3000)+'px'; 1491 dd.style.width=(li.offsetLeft+li.offsetWidth+2000)+'px'; 1492} 1493function P7_TP3setArrowStates(d,lp,mn,mx){ 1494 var aL,aR; 1495 aL=document.getElementById(d.replace('_','tleft_')); 1496 aR=document.getElementById(d.replace('_','tright_')); 1497 if(lp>=mn){ 1498 P7_TP3setClass(aL,'off'); 1499 } 1500 else{ 1501 P7_TP3remClass(aL,'off'); 1502 } 1503 if(lp<=(mx*-1)){ 1504 P7_TP3setClass(aR,'off'); 1505 } 1506 else{ 1507 P7_TP3remClass(aR,'off'); 1508 } 1509} 1510function P7_TP3setClass(ob,cl){ 1511 if(ob){ 1512 var cc,nc,r=/\s+/g; 1513 cc=ob.className; 1514 nc=cl; 1515 if(cc&&cc.length>0){ 1516 if(cc.indexOf(cl)==-1){ 1517 nc=cc+' '+cl; 1518 } 1519 else{ 1520 nc=cc; 1521 } 1522 } 1523 nc=nc.replace(r,' '); 1524 ob.className=nc; 1525 } 1526} 1527function P7_TP3remClass(ob,cl){ 1528 if(ob){ 1529 var cc,nc; 1530 cc=ob.className; 1531 if(cc&&cc.indexOf(cl>-1)){ 1532 nc=cc.replace(cl,''); 1533 nc=nc.replace(/\s+/g,' '); 1534 nc=nc.replace(/\s$/,''); 1535 nc=nc.replace(/^\s/,''); 1536 ob.className=nc; 1537 } 1538 } 1539} 1540function P7_TP3tblfix(ob){ 1541 var pp,sc,vp,tB,h,hh,ie,m=false; 1542 ie=P7_TP3getIEver(); 1543 pp=ob.parentNode; 1544 while(pp){ 1545 if(pp.nodeName){ 1546 if(pp.nodeName=='TD'||pp.nodeName=='TABLE'){ 1547 m=true; 1548 break; 1549 } 1550 if(pp.nodeName=='BODY'){ 1551 break; 1552 } 1553 } 1554 pp=pp.parentNode; 1555 } 1556 if(m || (ie>4&&ie<7)){ 1557 h=ob.offsetWidth; 1558 ob.style.width=h+'px'; 1559 hh=ob.offsetWidth; 1560 ob.style.width=(h+(h-hh))+'px'; 1561 sc=document.getElementById(ob.id.replace('_','tvp_')); 1562 if(sc){ 1563 sc.style.width=sc.offsetWidth+'px'; 1564 } 1565 if(ob.p7opt&&ob.p7opt[3]==2){ 1566 vp=document.getElementById(ob.id.replace('_','cvp_')); 1567 if(vp){ 1568 vp.style.width=vp.offsetWidth+'px'; 1569 } 1570 } 1571 } 1572} 1573function P7_TP3getIEver(){ 1574 var j,v=-1,nv,m=false; 1575 nv=navigator.userAgent.toLowerCase(); 1576 j=nv.indexOf("msie"); 1577 if(j>-1){ 1578 v=parseFloat(nv.substring(j+4,j+8)); 1579 if(document.documentMode){ 1580 v=document.documentMode; 1581 } 1582 } 1583 return v; 1584}
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.