1var youtube_url = "youtube.com"; 2var youtube_url2 = "/youtu.be"; 3var flowplayer_min_js = "/htm-webaxy/flowplayer/flowplayer-3.2.6.min.js"; 4var flowplayer_swf = "/htm-webaxy/flowplayer/flowplayer-3.2.7.swf"; 5var flowplayer_rtmp_swf ="/htm-webaxy/flowplayer/flowplayer.rtmp-3.2.3.swf"; 6 7var defaultObjectWidth = screen.availWidth ? screen.availWidth : 400; 8var defaultObjectHeight = screen.availHeight ? screen.availHeight : 300; 9//=================================================================== 10// 11// postEditors: do all the action! 12// 13//=================================================================== 14function setVideoSize(video) { 15 if (video.src.indexOf("audio") != -1) { 16 video.style.width = "400px"; 17 video.style.height = "40px"; 18 return; 19 } 20 if ((video.style.width.search(/[1-9]/) == -1) || (video.style.width.indexOf("%") != -1)) { 21 var p = video; 22 while ((p.clientWidth == 0) && (p.tagName != "BODY")) { 23 p = p.parentNode; 24 } 25 video.style.width = p.clientWidth + "px"; 26 27 } 28 29 if ((video.style.height.search(/[1-9]/) == -1) || (video.style.height.indexOf("%") != -1)) { 30 var p = video; 31 while ((p.clientHeight == 0) && (p.tagName != "BODY")) { 32 p = p.parentNode; 33 } 34 video.style.height = p.clientHeight + "px"; 35 } 36} 37//=================================================================== 38// 39// postEditors: do all the action! 40// 41//=================================================================== 42function postEditors() { 43 // openBox 44 var openBoxs = document.getElementsByTagName("div"); 45 for (var d = 0; d < openBoxs.length; d++) { 46 if (openBoxs[d].className.indexOf("openBoxDiv0") != -1) { 47 openBoxs[d].onclick = new Function("openBoxClick(this);"); 48 openBoxs[d].style.cursor = "pointer"; 49 } 50 else if (openBoxs[d].className.indexOf("openBoxDiv1") != -1) { 51 openBoxs[d].style.display = "none"; 52 openBoxs[d].onclick = new Function("openBoxClick(this);"); 53 openBoxs[d].style.cursor = "default"; 54 } 55 } 56 57 // video, audio, flash, youtube 58 var flvs = document.getElementsByName("flvImage"); 59 if (flvs) { 60 // insertFileElement(flowplayer_min_js,"js"); 61 var flvIDs = new Array(); 62 for (var flv = 0; flv < flvs.length;flv++) { 63 setImageWH(flvs[flv].id); 64 flvs[flv].id = flvs[flv].id.replace(/[\- ]/g,"_"); 65 flvIDs[flvIDs.length] = flvs[flv].id; 66 } 67 var video = null; 68 for (var flv = 0; flv < flvIDs.length; flv++) { 69 video = document.getElementById(flvIDs[flv]); 70 if (video == null) { 71 continue; 72 } 73 if (!video) { 74 continue; 75 } 76 var flvflv = video.getAttribute("flv"); 77 78 if (flvflv == null) { 79 continue; 80 } 81 if (!flvflv) { 82 continue; 83 } 84 console.log('video id='+flvIDs[flv]+' flv='+flvflv); 85 if ((flvflv.search(/^\s*</) != -1) || (flvflv.indexOf(youtube_url) != -1) || (flvflv.indexOf(youtube_url2) != -1)) { // youtube 86 embedExternalElement(video); 87 } 88 else if (flvflv.search(/\.swf$/i) != -1) { // flash banner 89 embedFlashElement(video); 90 continue; 91 } 92 else { 93 embedVideoElement(video); 94 continue; 95 } 96 97 } // for (var flv=0 98 99 100 } // if (flvs) 101 // responsive iframes like youtube 102 $("iframe").each(function() { 103 104 if ($(this).attr("whRatio")) { 105 return; 106 } 107 if ($(this).width() <= 0) { 108 return; 109 } 110 if ($(this).height() <= 0) { 111 return; 112 } 113 114 if($(this).is(":visible") && ($(this).prop("src").indexOf("-webaxy") == -1)) { // youtube and other extarnal code in iframe 115 setMobileWH(this); 116 } 117 }); 118 // make responsive 119 $(window).resize(function() { 120 $("[whRatio]").each(function() { 121 //alert(this); 122 setMobileWH(this); 123 }); 124 }); 125 126 // contacts 127 var contactViews = document.getElementsByName("contactView"); 128 if (contactViews.length) { 129 insertFileElement("/htm-webaxy/skins/standard/standard_new.css","css"); 130 if (typeof(overlib) != 'function') { 131 insertFileElement("/htm-webaxy/javascript/overlibmws/overlibmws.js","js"); 132 } 133 try { 134 $(document) 135 } catch (e) { insertFileElement("/htm-webaxy/javascript/jquery-1.3.2.min.js","js");} 136 insertFileElement("/htm-webaxy/tel/mig-tel.js","js"); 137 138 for (var contact=0; contact<contactViews.length; contact++) { 139 var telAppearence = contactViews[contact].getAttribute("telAppearence"); 140 var contactID = contactViews[contact].getAttribute("telSearchWords"); 141 insertFileElement("/Contact/tel"+telAppearence+".css","css"); 142 143 var getContactCode = "tel"+contactID+" = ''; "; 144 getContactCode += 'get_ajax_popup("", "","'+webaxyHiddenProperties+'&telID='+telAppearence+'&recordID='+contactID+'&only_data=1", "", "tel'+contactID+'","popupRecord");'; 145 waitAndRun(escape("typeof get_ajax_popup == 'function' "),escape(getContactCode),200); 146 147 contactViews[contact].onmouseout = new Function("nd(15000);"); 148 contactTitle = contactViews[contact].innerHTML; 149 contactTitle = contactTitle.replace(/\'/g,"'"); 150 //contactTitle = ''; 151 var closeimg = '<img src="/htm-webaxy/icons/close.png" border="0">'; 152 153 contactViews[contact].onmouseover = new Function("overlib(tel"+contactID+", CAPTION, '<center>
153"+contactTitle+"</center>', STICKY, CLOSETEXT, '"+closeimg+"', CLOSECLICK);FixDoar();overlibPost();"); 154 contactViews[contact].id = 'telLink-'+contactID; 155 156 } 157 } 158} 159 160//=================================================================== 161function overlibPost() { 162 163 try { 164 document.getElementById('overDiv').firstChild.cellPadding = 0; 165 document.getElementById('overDiv').firstChild.bgColor = ''; 166 //document.getElementById('overCap').bgColor = ''; 167 document.getElementById('overCap').className += ' tel-category_title'; 168 document.getElementById('overCap').parentNode.firstChild.nextSibling.cellPadding = 0; 169 document.getElementById('overCap').rows[0].cells[0].firstChild.style.color = ''; 170 document.getElementById('overCap').rows[0].cells[0].firstChild.style.fontFamily = ''; 171 document.getElementById('overCap').rows[0].cells[0].firstChild.style.fontSize = ''; 172 document.getElementById('overCap').rows[0].cells[0].firstChild.style.fontWeight = ''; 173 } catch (e){} 174 175} 176//=================================================================== 177// 178// embedExternalElement: do 179// 180//=================================================================== 181function embedExternalElement(video) { 182 183 setVideoSize(video); 184 var flvdiv = document.createElement("div"); 185 flvdiv.id = video.id+"_"; 186 flvdiv.title = video.title; 187 flvdiv.style.width = video.style.width.replace(/\s/,""); 188 flvdiv.style.height = video.style.height.replace(/\s/,""); 189 flvdiv.style.margin = "0px"; 190 191 var code = video.getAttribute("flv"); 192 var youcode = ""; 193 if ((code.indexOf(youtube_url) != -1) || (code.indexOf(youtube_url2) != -1)) { 194 195 //var youstyle = "width:"+flvdiv.style.width+"; height:"+flvdiv.style.height+"; "; 196 if (code.indexOf(youtube_url2) != -1) { 197 youcode = code.replace(/.*\//,""); 198 } 199 else if ( code.search(/v=([^&\?]+)/) != -1) { 200 youcode = RegExp.$1; 201 } 202 else if (code.search(/\/v\/([^&\?]+)/) != -1) { 203 youcode = RegExp.$1; 204 } 205 else { 206 return; 207 } 208 209 if (youcode.search(/\?/) == -1) { 210 youcode += "?fs=1&hl=en_US&rel=0"; 211 } 212 213 if (youcode.indexOf("wmode") == -1) { 214 youcode += (youcode.indexOf("?") == -1) ? "?" : "&"; 215 youcode += "wmode=transparent"; 216 } 217 218 if (code.search(/width=\D?(\d+)/i) != -1) { 219 flvdiv.style.width = RegExp.$1+"px"; 220 } 221 if (code.search(/height=\D?(\d+)/i) != -1) { 222 flvdiv.style.height = RegExp.$1+"px"; 223 } 224 //<iframe width="425" height="349" src="http://www.youtube.com/embed/oxH1xbuWxrY?rel=0" frameborder="0" allowfullscreen></iframe> 225 var youtubeObject = document.createElement("iframe"); 226 youtubeObject.style.width = flvdiv.style.width; 227 youtubeObject.style.height = flvdiv.style.height; 228 /* 229 youtubeObject.style.maxWidth = flvdiv.style.width; 230 youtubeObject.style.maxHeight = flvdiv.style.height; 231 */ 232 youtubeObject.style.maxWidth = screen.availWidth+"px"; 233 youtubeObject.style.maxHeight = screen.availHeight+"px"; 234 235 youtubeObject.setAttribute("wmode","transparent"); 236 youtubeObject.setAttribute("frameborder","0"); 237 youtubeObject.setAttribute("allowfullscreen","1"); 238 youtubeObject.src = "//www.youtube.com/embed/"+youcode; 239 240 flvdiv.appendChild(youtubeObject); 241 242 } 243 else { 244 if (code.search(/width=\D*(\d+)/i) != -1) { 245 flvdiv.style.width = RegExp.$1+"px"; 246 } 247 if (code.search(/height=\D*(\d+)/i) != -1) { 248 flvdiv.style.height = RegExp.$1+"px"; 249 } 250 flvdiv.innerHTML = code; 251 252 } 253 254 var oldContainer = video.parentNode.parentNode.parentNode.parentNode; 255 256 if (oldContainer && oldContainer.tagName == "TABLE") { // make mobile friendly 257 258 var table0 = document.getElementById("table0"); 259 260 if (typeof table0 != "undefined" && table0) { 261 table0.style.maxWidth = table0.clientWidth+"px"; 262 table0.style.width = "100%"; 263 } 264 265 var newContainer = document.createElement("div"); 266 newContainer.setAttribute("name","flvContainer"); 267 newContainer.style.overflow = "hidden"; 268 newContainer.style.maxWidth = oldContainer.clientWidth+"px"; 269 newContainer.style.maxHeight = oldContainer.clientHeight+"px"; 270 for (var tr=0; tr < oldContainer.rows.length; tr++) { 271 if (!oldContainer.rows[tr].cells.length) { 272 continue; 273 } 274 if (!oldContainer.rows[tr].cells[0].firstChild) { 275 continue; 276 } 277 278 var first = oldContainer.rows[tr].cells[0].firstChild; 279 280 if (first == video) { 281 newContainer.appendChild(flvdiv); 282 } 283 else { 284 while (first = oldContainer.rows[tr].cells[0].firstChild) { 285 newContainer.appendChild(first.parentNode.removeChild(first)); 286 } 287 } 288 } 289 oldContainer.parentNode.replaceChild(newContainer,oldContainer); 290 setMobileWH(flvdiv); 291 292 } 293 else { 294 video.parentNode.replaceChild(flvdiv,video); 295 } 296} 297 298//=================================================================== 299//
300// embedFlashElement: embed flash code to page 301// 302//=================================================================== 303function embedFlashElement(flash) { 304 var swfid = flash.id; 305 var swfurl = flash.getAttribute("flv"); 306 var swfProperties = flash.getAttribute("flvProperties"); 307 if (!swfProperties) { 308 swfProperties = ""; 309 } 310 311 var embed1 = document.createElement("embed"); 312 embed1.id = swfid+"_"; 313 embed1.setAttribute("type","application/x-shockwave-flash"); 314 embed1.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer"); 315 embed1.setAttribute("loop",(swfProperties.indexOf("loop") != -1)); 316 embed1.setAttribute("play","true"); 317 embed1.setAttribute("menu","true"); 318 embed1.setAttribute("wmode","transparent"); 319 embed1.setAttribute("src",swfurl); 320 321 if (swfProperties.indexOf("original") == -1) { 322 embed1.style.width = flash.style.width; 323 embed1.style.height = flash.style.height; 324 } 325 326 embed1.style.margin = "0px"; 327 //<embed width="500" height="80" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://www.maianot.co.il/media/newspaper_banner.swf" play="true" loop="true" menu="true"> 328 flash.parentNode.replaceChild(embed1,flash); 329} 330//=================================================================== 331// 332// name: embed video in page 333// 334//=================================================================== 335function embedVideoElement(video) { 336 337 setVideoSize(video); 338 339 var flvdiv = document.createElement("div"); 340 flvdiv.id = video.id+"_"; 341 flvdiv.title = video.title; 342 flvdiv.style.width = video.style.width.replace(/\s/,""); 343 flvdiv.style.height = video.style.height.replace(/\s/,""); 344 flvdiv.style.margin = "0px"; 345 346 // var flva = document.createElement("iframe"); 347 /* 348 flva.setAttribute("wmode","transparent"); 349 flva.setAttribute("frameborder","0"); 350 flva.setAttribute("allowfullscreen","1"); 351 flva.setAttribute("webkitallowfullscreen","1"); 352 flva.setAttribute("mozallowfullscreen","1"); 353 */ 354 //flva.setAttribute("scrolling","0"); 355 //flva.setAttribute("seamless",true); 356 //flva.style.overflow = "hidden"; 357 358 var flva = document.createElement("video"); 359 flva.setAttribute("controls","controls"); 360 flva.setAttribute("controlslist","nodownload"); 361 var flvProperties = video.getAttribute("flvProperties"); 362 if (flvProperties.indexOf("autoplay") != -1) { 363 flva.setAttribute("autoplay","autoplay"); 364 var ua = navigator.userAgent.toLowerCase(); 365 var isChromiumBased = ua.indexOf('chrome') > -1 && ua.indexOf('edg') === -1 && ua.indexOf('opr') === -1; 366 if (isChromiumBased) { 367 flva.setAttribute("muted","muted"); 368 flva.setAttribute("preload","auto"); 369 flva.setAttribute("playsinline","playsinline"); 370 371 // setTimeout("console.log('click video id="+video.id+"');"+video.id+".click();"+video.id+".play()",2000); 372 } 373 console.log("muted="+isChromiumBased); 374 } 375 if (flvProperties.indexOf("loop") != -1) { 376 flva.setAttribute("loop","loop"); 377 } 378 flva.id = video.id; 379 flva.title = video.title; 380 flva.style.width = flvdiv.style.width; 381 flva.style.height = flvdiv.style.height; 382 flva.style.maxWidth = screen.availWidth+"px"; 383 flva.style.maxHeight = screen.availHeight+"px"; 384 385 var src = document.createElement("source"); 386 // src.setAttribute("type","video/mp4"); 387 src.setAttribute("src",video.getAttribute("flv")); 388 flva.appendChild(src); 389 /* 390 var src = "/htm-webaxy/flowplayer6/webaxy.htm?"; 391 src += "flv="+encodeURIComponent(video.getAttribute("flv"))+"&"; 392 if (video.getAttribute("rtmp") && (video.getAttribute("rtmp").search(/\S/) != -1)) { 393 src += "rtmp="+encodeURIComponent(video.getAttribute("rtmp"))+"&"; 394 } 395 if (video.src.indexOf("audio") != -1) { 396 src += "audio=1&"; 397 } 398 var flvProperties = video.getAttribute("flvProperties"); 399 if (!flvProperties) { 400 flvProperties = ""; 401 } 402 src += "flvProperties="+encodeURIComponent(flvProperties); 403 flva.src = src; 404 */ 405 // alert("src="+src); 406 flvdiv.appendChild(flva); 407 408 var oldContainer = video.parentNode.parentNode.parentNode.parentNode; 409 if (oldContainer && oldContainer.tagName == "TABLE") { // make mobile friendly 410 var table0 = document.getElementById("table0"); 411 if (typeof table0 != "undefined" && table0) { 412 table0.style.maxWidth = table0.clientWidth+"px"; 413 table0.style.width = "100%"; 414 } 415 var newContainer = document.createElement("div"); 416 newContainer.setAttribute("name","flvContainer"); 417 newContainer.style.overflow = "hidden"; 418 newContainer.style.maxWidth = oldContainer.clientWidth+"px"; 419 newContainer.style.maxHeight = oldContainer.clientHeight+"px"; 420 for (var tr=0; tr < oldContainer.rows.length; tr++) { 421 if (!oldContainer.rows[tr].cells.length) { 422 continue; 423 } 424 if (!oldContainer.rows[tr].cells[0].firstChild) { 425 continue; 426 } 427 var first = oldContainer.rows[tr].cells[0].firstChild; 428 if (first == video) { 429 newContainer.appendChild(flvdiv); 430 } 431 else { 432 while (first = oldContainer.rows[tr].cells[0].firstChild) { 433 newContainer.appendChild(first.parentNode.removeChild(first)); 434 } 435 } 436 } 437 oldContainer.parentNode.replaceChild(newContainer,oldContainer); 438 setMobileWH(flvdiv); 439 } 440 else { 441 video.parentNode.replaceChild(flvdiv,video); 442 } 443 444} 445 446//=================================================================== 447//
448// startPlayer: start video player 449// 450//=================================================================== 451function startPlayer(id) { 452 var flva = document.getElementById(id); 453 454 if (flva.getAttribute("rtmp") && (flva.getAttribute("flv").indexOf(".pl?") == -1)) { 455 456 return startStreamPlayer(id); 457 } 458 var flvProperties = flva.getAttribute("flvProperties"); 459 flowplayer(flva.id, flowplayer_swf, { 460 clip: { 461 url: flva.getAttribute("flv"), 462 autoPlay: (flvProperties.indexOf("autoplay") != -1), 463 //autoBuffering: !flva.getAttribute("audio"), 464 autoBuffering: ((flva.getAttribute("audio")==0) && (flvProperties.indexOf("noimage") == -1)), 465 bufferLength: 10, 466 467 // when clip starts, do something 468 469 onLastSecond: function(clip) { 470 if (flvProperties.indexOf("loop") != -1) { 471 this.play(); 472 } 473 } 474 }, 475 play: { 476 label:"", 477 replayLabel:"", 478 fadeSpeed: 1000 479 }, 480 plugins: { controls: { 481 display: (flvProperties.indexOf("nobuttons") != -1) ? 'none' : 'block', 482 autoHide: 'never', 483 play:true, 484 volume:true, 485 mute:true, 486 time:true, 487 stop:true, 488 playlist:false, 489 fullscreen: (flvProperties.indexOf("nofullscreen") == -1) && (flva.getAttribute("audio")==0), 490 491 // scrubber is a well known nickname to the timeline/playhead combination 492 scrubber: true 493 } } 494 } 495 496 ); // flowplayer( 497} 498//=================================================================== 499// 500// startStreamPlayer: start Stream video player 501// 502//=================================================================== 503function startStreamPlayer(id) { 504 var flva = document.getElementById(id); 505 506 var flvProperties = flva.getAttribute("flvProperties"); 507 flva.setAttribute("flv",flva.getAttribute("flv").replace(/^https?\:\/\/[^\/]*/i,"")); 508 if (flva.getAttribute("flv").search(/\.mp4$/i) != -1) { 509 flva.setAttribute("flv","mp4:"+flva.getAttribute("flv")); 510 } 511 flowplayer(flva.id, flowplayer_swf, { 512 clip: { 513 url: flva.getAttribute("flv"), 514 provider: 'rtmp', 515 autoPlay: (flvProperties.indexOf("autoplay") != -1), 516 //autoBuffering: !flva.getAttribute("audio"), 517 autoBuffering: ((flva.getAttribute("audio")==0) && (flvProperties.indexOf("noimage") == -1)), 518 bufferLength: 10, 519 520 // when clip starts, do something 521 522 onLastSecond: function(clip) { 523 if (flvProperties.indexOf("loop") != -1) { 524 this.play(); 525 } 526 } 527 }, 528 play: { 529 label:"", 530 replayLabel:"", 531 fadeSpeed: 1000 532 }, 533 plugins: { 534 controls: { 535 display: (flvProperties.indexOf("nobuttons") != -1) ? 'none' : 'block', 536 autoHide: 'never', 537 play:true, 538 volume:true, 539 mute:true, 540 time:true, 541 stop:true, 542 playlist:false, 543 fullscreen:(flvProperties.indexOf("nofullscreen") == -1) && (flva.getAttribute("audio")==0), 544 545 // scrubber is a well known nickname to the timeline/playhead combination 546 scrubber: true 547 }, 548 rtmp: { 549 url: flowplayer_rtmp_swf, 550 netConnectionUrl: flva.getAttribute("rtmp") 551 } 552 } 553 } 554 555 ); // flowplayer( 556 557 558 559 560} 561//=================================================================== 562// 563// insertFileElement: insert css or js file ref into page header 564// 565//=================================================================== 566function insertFileElement(path,ext) { 567 try { 568 var headerTag = document.getElementsByTagName("head")[0]; 569 } 570 catch(no_header) { 571 return; 572 } 573 var fileObject = null; 574 if (ext == "css") { 575 fileObject = document.createElement("link"); 576 fileObject.setAttribute("comment","postEditors"); 577 fileObject.setAttribute("rel", "stylesheet"); 578 fileObject.setAttribute("type", "text/css"); 579 fileObject.setAttribute("href",path); 580 } 581 else if (ext == "js") { 582 fileObject = document.createElement("script"); 583 fileObject.setAttribute("comment","postEditors"); 584 fileObject.setAttribute("type","text/javascript"); 585 fileObject.setAttribute("src",path); 586 } 587 588 if (fileObject) { 589 590 var place = null; 591 592 for (var h=0; h < headerTag.childNodes.length; h++) { 593 if (!headerTag.childNodes[h].getAttribute) { 594 continue; 595 } 596 if (headerTag.childNodes[h].getAttribute("comment") && (headerTag.childNodes[h].getAttribute("comment") == fileObject.getAttribute("comment"))) { 597 continue; 598 } 599 600 if ((headerTag.childNodes[h].tagName == "STYLE") || (headerTag.childNodes[h].tagName == "LINK")) { 601 place = headerTag.childNodes[h]; 602 break; 603 } 604 } 605 606 if (place) { 607 headerTag.insertBefore(fileObject,place); 608 } 609 else { 610 headerTag.appendChild(fileObject); 611 } 612 613 //headerTag.appendChild(fileObject); 614 } 615 616} 617//=================================================================== 618//
619// waitAndRun: wait and run when condition is true 620// USAGE: waitAndRun(escape("get_ajax_popup"),escape(getContactCode),200); 621// 622//=================================================================== 623function waitAndRun(runIf,runCode,milisec) { 624 625 try { 626 if (eval(unescape(runIf))) { 627 eval(unescape(runCode)); 628 return; 629 } 630 } 631 catch(notyet) {} 632 self.setTimeout("waitAndRun('"+runIf+"','"+runCode+"','"+milisec+"')",milisec); 633} 634//=================================================================== 635// 636// setImageWH: set img width and height in style 637// 638//=================================================================== 639 640function setImageWH(id) { 641 var img = document.getElementById(id); 642 if (!img) { 643 return; 644 } 645 646 if (!img.style.width) { 647 img.style.width = img.clientWidth + "px"; 648 } 649 650 if (!img.style.height) { 651 img.style.height = img.clientHeight + "px"; 652 } 653} 654//=================================================================== 655// 656// name: do 657// 658//=================================================================== 659function openBoxClick(div) { 660 var div1 = null; 661 var img1 = null; 662 if (div.className != "openBoxDiv0") { 663 try { 664 event.stopPropagation(); 665 } 666 catch(err) { 667 event.cancelBubble = true; 668 } 669 return; 670 } 671 for (var c = 0; c < div.childNodes.length; c++) { 672 if (div.childNodes[c].nodeName == "DIV") { 673 if (div.childNodes[c].className.indexOf("openBoxDiv1") != -1) { 674 div1 = div.childNodes[c]; 675 } 676 } 677 else if (div.childNodes[c].nodeName == "IMG") { 678 if (div.childNodes[c].getAttribute("openBox_close")) { 679 img1 = div.childNodes[c]; 680 } 681 } 682 } 683 if (!div1) { 684 return; 685 } 686 if (div1.style.display == "none") { 687 div1.style.display = "block"; 688 img1.src = img1.getAttribute("openBox_open"); 689 } 690 else { 691 div1.style.display = "none"; 692 img1.src = img1.getAttribute("openBox_close"); 693 } 694 695} 696//=================================================================== 697// 698// name: setMobileWH set dimentions of video 699// 700//=================================================================== 701function setMobileWH(flvdiv) { 702 703 if (!$(flvdiv).attr("whRatio")) { 704 if (($(flvdiv).height() <= 0) || ($(flvdiv).width() <= 0)) { 705 //alert("video size 0"); 706 return; 707 } 708 $(flvdiv).attr("whRatio",$(flvdiv).width() / $(flvdiv).height()); 709 $(flvdiv).attr("origWidth",$(flvdiv).width()); 710 $(flvdiv).attr("origHeight",$(flvdiv).height()); 711 $(flvdiv).css("maxWidth","100%"); 712 713 try { 714 if (flvdiv.firstChild) { 715 flvdiv.firstChild.style.width = "100%"; 716 flvdiv.firstChild.style.height = "100%"; 717 } 718 } catch(err) {} 719 //alert(" width="+$(flvdiv).width()+" ration="+$(flvdiv).attr("whRatio")); 720 } 721 722 $(flvdiv).css("width",$(flvdiv).attr("origWidth") + "px"); 723 $(flvdiv).css("height",$(flvdiv).attr("origHeight") + "px"); 724 var origPos = $(flvdiv).css("position"); 725 $(flvdiv).css("position","absolute"); 726 727 var parentWidth = $("body").width(); 728 // find min parent node 729 var p0 = flvdiv; 730 while (p0 && p0.tagName && (p0.tagName != "BODY") && ((p0.tagName != "HTML"))) { 731 if ((p0.tagName != "TD") && $(p0).width() && ($(p0).width() > 150) && (parentWidth > $(p0).width())) { 732 parentWidth = $(p0).width(); 733 } 734 p0 = p0.parentNode; 735 } 736 $(flvdiv).css("position",origPos); 737 738 var newWidth = $(flvdiv).width() < parentWidth ? $(flvdiv).width() : parentWidth; 739 var newHeight = Math.ceil(newWidth / $(flvdiv).attr("whRatio")); 740 // alert("w="+newWidth+" h="+newHeight); 741 $(flvdiv).css("width",newWidth + "px"); 742 $(flvdiv).attr("width",newWidth); 743 $(flvdiv).css("height",newHeight + "px"); 744 $(flvdiv).attr("height",newHeight); 745} 746//========================== 747 748function noFixedIframe() { 749 $("iframe").each(function() { 750 if (!$(this).attr('position1')) { 751 $(this).attr('position1',$(this).css('position') ? $(this).css('position') : 'inherit'); 752 } 753 else if ($(this).css('position') != $(this).attr('position1')) { 754 $(this).css('position',$(this).attr('position1')); 755 } 756 }); 757 758} 759$(document).ready(function() { 760 if ($("iframe").length) { 761 setInterval('noFixedIframe()',3000); 762 } 763}); 764//========================== 765 766try { 767 if (postEditorsTimeout) { 768 clearTimeout(postEditorsTimeout); 769 } 770} 771catch(peError) {} 772postEditorsTimeout = setTimeout(" postEditors(); ",500);
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.