1 2function SetPictureSwitch(id, ind, count) { 3 var container = document.getElementById(id); 4 var selectedImage = document.getElementById(id + "_Image_" + ind); 5 6 container.style.backgroundImage = "url('" + selectedImage.src + "')"; 7 for (i = 0; i < count; i++) 8 if (i == ind) 9 document.getElementById(id + "_Button_" + i).className = "ImageIndSelected"; 10 else 11 document.getElementById(id + "_Button_" + i).className = "ImageInd"; 12} 13 14function PictureSwitchSheduled(id, ind, count) { 15 var NexId = (ind + 1) % count; 16 SetPictureSwitch(id, NexId, count); 17 setTimeout("PictureSwitchSheduled('" + id + "', " + NexId + ", " + count + ");", 5000); 18} 19 20function SetPictureSwitch2(container, ind) { 21 var selectedImage = $("img:eq(" + ind + ")", container)[0]; 22 23 24 container.css("background-image", "url('" + selectedImage.src + "')"); 25 26 27 for (i = 0; i < $("img", container).length; i++) 28 if (i == ind) 29 $("div:eq('" + i + "')", container).addClass("ImageIndSelected").removeClass("ImageInd"); 30 else 31 $("div:eq('" + i + "')", container).addClass("ImageInd").removeClass("ImageIndSelected"); 32} 33 34function SetPictureSwitchSheduled2(container, ind) { 35 36 var NexId = (ind + 1) % $("img", container).length; 37 38 // alert(NexId); 39 40 SetPictureSwitch2(container, NexId); 41 setTimeout(function () { SetPictureSwitchSheduled2(container, NexId); }, 5000); 42} 43 44var CaruselPageCount = 4; 45 46function SetPageButtons(id, page) { 47 48 var buttons = jQuery('#' + id + ' img'); 49 50 for (i = 0; i < buttons.length; i++) { 51 if (i == Math.ceil(page / CaruselPageCount)) 52 buttons[i].src = "/images/OldPortal/circle_icon_red.png"; 53 else 54 buttons[i].src = "/images/OldPortal/circle_icon.png"; 55 } 56} 57 58function SetCaruselCustumScroll(id, scroll, init_func, is_vertical) { 59 60 // Ride the carousel... 61 jQuery(document).ready(function () { 62 //document.getElementById(id).style.display = ""; 63 jQuery("#" + id).jcarousel({ 64 scroll: scroll, 65 vertical: is_vertical, 66 initCallback: init_func, 67 // This tells jCarousel NOT to autobuild prev/next buttons 68 buttonNextHTML: null, 69 buttonPrevHTML: null 70 71 }); 72 73 }); 74} 75 76 77function ismaxlength(obj) { 78 var mlength = obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : "" 79 if (obj.getAttribute && obj.value.length > mlength) 80 obj.value = obj.value.substring(0, mlength) 81} 82 83 84function GalleryImageLoaded() { 85 86 87 88} 89 90function TermsChecked(source, arguments) { 91 arguments.IsValid = document.getElementById('TermsCheckBox').checked; 92} 93function SendFriendTermsChecked(source, arguments) { 94 arguments.IsValid = document.getElementById('SendFriendTermsChecked').checked; 95} 96 97var currentIndex = 1; 98function SetPreviewImage(prevImage, src, index) { 99 currentIndex = index - 1; 100 prevImage.src = src; 101 document.getElementById("ImageIndex").innerHTML = index; 102 $("#PreviewImage").each(function () { 103 $(this).cjObjectScaler({ 104 method: "fit", 105 fade: 200 106 }); 107 }); 108 //document.getElementById("ImgLink").href = src; 109 document.getElementById("EnlargeImage").href = src; 110} 111 112function SetNextPreviewImage() { 113 if (currentIndex >= $(".ImgThumbs").children().length) 114 return false; 115 116 currentIndex++; 117 118 var pageInd = Math.floor(currentIndex / 8); 119 $(".TabMenuContainer .PageDot:eq(" + pageInd + ")").click(); 120 121 var currentImage = $(".ImgThumbs img:eq(" + currentIndex + ")"); 122 currentImage.click(); 123 return false; 124} 125 126function SetPrevPreviewImage() { 127 if (currentIndex <= 0) 128 return false; 129 currentIndex--; 130 131 var pageInd = Math.floor(currentIndex / 8); 132 $(".TabMenuContainer .PageDot:eq(" + pageInd + ")").click(); 133 134 var currentImage = $(".ImgThumbs img:eq(" + currentIndex + ")"); 135 currentImage.click(); 136 return false; 137} 138 139 140 141function bookmarksite(title, url) { 142 if (window.sidebar) // firefox
143 window.sidebar.addPanel(title, url, ""); 144 else if (window.opera && window.print) { // opera 145 var elem = document.createElement('a'); 146 elem.setAttribute('href', url); 147 elem.setAttribute('title', title); 148 elem.setAttribute('rel', 'sidebar'); 149 elem.click(); 150 } 151 else if (document.all)// ie 152 window.external.AddFavorite(url, title); 153} 154 155var Calendar = new Array(); 156var CurrnetDay = 0; 157var CurrentDayEvent = 0; 158 159var hideCalendar = false; 160 161function ShowCalendar(day, obj) { 162 hideCalendar = false; 163 CurrnetDay = day; 164 CurrentDayEvent = 0; 165 var calPopup = document.getElementById("CalendarPopup"); 166 calPopup.style.display = "inline"; 167 168 var dayPos = getCumulativeOffset(obj); 169 calPopup.style.top = (dayPos.y - 110) + "px"; 170 calPopup.style.left = (dayPos.x - 13) + "px"; 171 SetCalendarDayEvent(day, 0); 172} 173 174function PreserveCalendar() { 175 hideCalendar = false; 176} 177 178function ScheduleHideCalendar() { 179 hideCalendar = true; 180 setTimeout("HideCalendar()", 300); 181} 182 183function HideCalendar() { 184 if (hideCalendar) { 185 var calPopup = document.getElementById("CalendarPopup"); 186 calPopup.style.display = "none"; 187 } 188} 189 190function ShowNextItem() { 191 CurrentDayEvent++; 192 SetCalendarDayEvent(CurrnetDay, CurrentDayEvent); 193} 194 195function ShowPrevItem() { 196 CurrentDayEvent--; 197 SetCalendarDayEvent(CurrnetDay, CurrentDayEvent); 198} 199 200function SetCalendarDayEvent(day, eventInd) { 201 202 203 204 if (eventInd == 0) 205 document.getElementById("CalendarPrev").style.display = "none"; 206 else 207 document.getElementById("CalendarPrev").style.display = ""; 208 209 if (eventInd == Calendar[day].length - 1) 210 document.getElementById("CalendarNext").style.display = "none"; 211 else 212 document.getElementById("CalendarNext").style.display = ""; 213 214 document.getElementById("CalendarPopupTitle").innerHTML = day; 215 document.getElementById("CallendarContent").innerHTML = Calendar[day][eventInd][0]; 216 document.getElementById("CallendarContentDetails").innerHTML = Calendar[day][eventInd][1]; 217 218 219} 220 221 222var getCumulativeOffset = function (obj) { 223 var left, top; 224 left = top = 0; 225 if (obj.offsetParent) { 226 do { 227 left += obj.offsetLeft; 228 top += obj.offsetTop; 229 } while (obj = obj.offsetParent); 230 } 231 return { 232 x: left, 233 y: top 234 }; 235};
236 237var ShowHideDetailsActive = true; 238function ShowHideDetails(id, openbutton, row) { 239 if (!ShowHideDetailsActive) return; 240 241 var tr = document.getElementById(id); 242 if (tr.style.display == "none" || tr.style.display == "") { 243 tr.style.display = "table-row"; 244 row.lastClass = row.className; 245 row.className = "AddsRowSelected"; 246 247 document.getElementById(openbutton).click(); 248 } 249 else { 250 tr.style.display = "none"; 251 row.className = row.lastClass; 252 } 253} 254 255function TimeOutInitPictures(id) { 256 setTimeout("InitPictures('" + InitPictures(id) + "')", 100); 257 258} 259 260function InitPictures(id) { 261 var tr = document.getElementById(id); 262 var Images = eval("Images" + id); 263 var PreviewImg = document.getElementById("PreviewImg" + id); 264 PreviewImg.src = Images[0]; 265 266 tr.preloadimages = new Array(); 267 for (i = 0; i < tr.length; i++) { 268 tr.preloadimages[i] = new Image(); 269 tr.preloadimages[i].src = Images[i]; 270 } 271 272 273 ShowImages(id); 274 275 if (Images.length > 0) { 276 var PreviewLink = document.getElementById("PreviewLink" + id); 277 PreviewLink.href = Images[0]; 278 } 279 280 281 var ImagesBox = document.getElementById("ImagesBox" + id); 282 if (Images.length == 0) 283 ImagesBox.style.display = "none"; 284 285} 286 287function ShowImages(id) { 288 var Thumbid1 = document.getElementById("Thumbid1" + id); 289 var Thumbid2 = document.getElementById("Thumbid2" + id); 290 var Thumbid3 = document.getElementById("Thumbid3" + id); 291 292 var Thumbid1Link = document.getElementById("Thumbid1Link" + id); 293 var Thumbid2Link = document.getElementById("Thumbid2Link" + id); 294 var Thumbid3Link = document.getElementById("Thumbid3Link" + id); 295 296 var PreviewImg = document.getElementById("PreviewImg" + id); 297 var Images = eval("Images" + id); 298 var Selected = eval("Selected" + id); 299 300 if (Images.length > 0) { 301 Thumbid1.src = Images[Selected.value]; 302 Thumbid1Link.href = Images[Selected.value]; 303 } 304 else 305 Thumbid1.style.visibility = "hidden"; 306 307 if (Images.length > 1) { 308 Thumbid2.src = Images[Selected.value + 1]; 309 Thumbid2Link.href = Images[Selected.value + 1]; 310 } 311 else 312 Thumbid2.style.visibility = "hidden"; 313 314 if (Images.length > 2) { 315 Thumbid3.src = Images[Selected.value + 2]; 316 Thumbid3Link.href = Images[Selected.value + 2]; 317 } 318 else 319 Thumbid3.style.visibility = "hidden"; 320 321 $('#PreviewLink' + id).lightBox(); 322 $('#Thumbid1Link' + id).lightBox(); 323 $('#Thumbid2Link' + id).lightBox(); 324 $('#Thumbid3Link' + id).lightBox(); 325} 326 327 328 329function MoveRight(id) { 330 var Selected = eval("Selected" + id); 331 var Images = eval("Images" + id); 332 333 if (Selected.value + 1 <= Images.length - 3) 334 Selected.value = Selected.value + 1; 335 336 ShowImages(id); 337} 338 339function MoveLeft(id) { 340 var Selected = eval("Selected" + id); 341 var Images = eval("Images" + id); 342 343 if (Selected.value - 1 >= 0) 344 Selected.value = Selected.value - 1; 345 346 ShowImages(id); 347} 348 349function ShowImage(id, obj) { 350 var PreviewImg = document.getElementById("PreviewImg" + id); 351 PreviewImg.src = obj.src; 352 353 var PreviewLink = document.getElementById("PreviewLink" + id); 354 PreviewLink.href = obj.src; 355} 356 357function openWindow(url, width, height) { 358 window.open(url, 'mywindow', 'width=' + width + ',height=' + height + ',left=100,top=100,scrollbars=yes'); 359 360} 361 362function AllowOnlyNumeric() { 363 var key = window.event.keyCode; 364 365 // Verify if the key entered was a numeric character (0-9) or a decimal (.) 366 if ((key > 47 && key < 58) || key == 46) 367 // If it was, then allow the entry to continue 368 return; 369 else 370 // If it was not, then dispose the key and continue with entry 371 window.event.returnValue = null; 372} 373 374function ShowPopular(popularID, viewedID, popularTitleID, viewedTitleID, ShowPopular) { 375 var popular = document.getElementById(popularID); 376 var viewed = document.getElementById(viewedID); 377 378 var popularTitle = document.getElementById(popularTitleID); 379 var viewedTitle = document.getElementById(viewedTitleID); 380 381 if (ShowPopular) { 382 popular.style.height = "285px"; 383 viewed.style.height = "0px"; 384 popularTitle.className = "Button Selected"; 385 viewedTitle.className = "Button"; 386 } 387 else { 388 viewed.style.height = "285px"; 389 popular.style.height = "0px"; 390 popularTitle.className = "Button"; 391 viewedTitle.className = "Button Selected"; 392 } 393 394} 395 396function SetMostPopularCustumScroll(id, scroll, init_func, itemFirstIn_func, is_vertical) { 397 398 // Ride the carousel... 399 jQuery(document).ready(function () { 400 //document.getElementById(id).style.display = "";
401 jQuery("#" + id).jcarousel({ 402 scroll: scroll, 403 vertical: is_vertical, 404 initCallback: init_func, 405 itemFirstInCallback: itemFirstIn_func, 406 // This tells jCarousel NOT to autobuild prev/next buttons 407 buttonNextHTML: null, 408 buttonPrevHTML: null 409 410 }); 411 412 }); 413} 414 415 416function initGalleryCarusel(GalleryButtons_ClientID, LastGalleries_ClientID, mycarousel_next_scroll_ClientID, mycarousel_prev_scroll_ClientID) { 417 function mycarousel_initCallbackScroll_func(carousel) { 418 419 jQuery('#' + GalleryButtons_ClientID + ' a').bind('click', function () { 420 carousel.scroll(jQuery.jcarousel.intval((jQuery(this)[0].title - 1) * CaruselPageCount + 1)); 421 422 SetPageButtons(GalleryButtons_ClientID, (carousel.first - 1)); 423 424 return false; 425 }); 426 427 jQuery('#' + mycarousel_next_scroll_ClientID).bind('click', function () { 428 carousel.next(); 429 SetPageButtons(GalleryButtons_ClientID, (carousel.first - 1)); 430 return false; 431 }); 432 433 jQuery('#' + mycarousel_prev_scroll_ClientID).bind('click', function () { 434 carousel.prev(); 435 SetPageButtons(GalleryButtons_ClientID, (carousel.first - 1)); 436 return false; 437 }); 438 439 SetPageButtons(0); 440 }; 441 442 SetCaruselCustumScroll(LastGalleries_ClientID, 4, mycarousel_initCallbackScroll_func); 443 444} 445 446function setMostPopularCarusel(MostPopularContainer_ClientID, PopularPrevBtn_ClientID, PopularNextBtn_ClientID) { 447 function mycarousel_itemFirstInCallback_func(carousel, item, idx, state) { 448 if (idx == 1) { 449 document.getElementById(PopularPrevBtn_ClientID).className = "RecomendNextPrev_dissabled"; 450 } 451 else { 452 document.getElementById(PopularPrevBtn_ClientID).className = "RecomendNextPrev"; 453 } 454 455 if (idx == 10) { 456 document.getElementById(PopularNextBtn_ClientID).className = "RecomendNextPrev_dissabled"; 457 } 458 else { 459 document.getElementById(PopularNextBtn_ClientID).className = "RecomendNextPrev"; 460 } 461 }; 462 463 function mycarousel_initCallbackScroll_func(carousel) { 464 jQuery('#' + PopularNextBtn_ClientID).bind('click', function () { 465 carousel.next(); 466 return false; 467 }); 468 jQuery('#' + PopularPrevBtn_ClientID).bind('click', function () { 469 carousel.prev(); 470 return false; 471 }); 472 }; 473 474 SetMostPopularCustumScroll(MostPopularContainer_ClientID, 3, 475 mycarousel_itemFirstInCallback_func, mycarousel_initCallbackScroll_func, true); 476 477} 478 479 480function addCalendarEvent(day, eventInd, title, description) { 481 if (Calendar[day] == null) 482 Calendar[day] = new Array(); 483 484 Calendar[day][eventInd] = new Array(); 485 Calendar[day][eventInd][0] = title; 486 Calendar[day][eventInd][1] = description; 487 488} 489 490function setArticleImageTitle() { 491 492 // $(window).load(function () { 493 494 $(".PostContent img, .article-image").each(function () { 495 496 if ($(this).parents(".Banner").length > 0) 497 return; 498 499 if ($(this).attr("show-title-preview") === null) 500 return; 501 502 var self = $(this); 503 var fullImageUrl = self[0].dataset.lightbox; 504 //self.wrap("<a href="+fullImageUrl+" data-toggle='lightbox'></a>"); 505 self[0].onclick = function () { 506 $("#fullsizeimage").show(); 507 if (fullImageUrl != undefined) 508 $("#fullsizeImageSrc").attr("src", fullImageUrl) 509 else { 510 $("#fullsizeImageSrc").attr("src", self[0].src) 511 } 512 } 513 if (self.attr("title-set") != null) 514 return; 515 516 //$(this).load(function () { 517 518 519 self.attr("title-set", "true") 520 521 var title = self.attr("title"); 522 523 if (title == null || title == "") 524 title = self.attr("alt"); 525 526 if (title != null && title != "") { 527 self.css("margin-bottom", "0px"); 528 var element = this; 529 setTimeout(function () {
530 var div = $('<div class="image-caption" style="">' + title + '</div>'); 531 div.css("float", $(element).css("float")); 532 div.css("width", $(element).css("width")); 533 div.css("margin-left", $(element).css("margin-left")); 534 div.css("margin-right", $(element).css("margin-right")); 535 $(element).after(div); 536 var divMagnifying = $('<div class="magnifying-glass">' + "<i class='fa fa-search' aria-hidden='true'></i>" + '</div>'); 537 //divMagnifying.css("position", "absolute"); 538 //divMagnifying.css("top", "10px"); 539 //divMagnifying.css("right", "10px"); 540 divMagnifying[0].onclick = function () { 541 $("#fullsizeimage").show(); 542 if (fullImageUrl != undefined) 543 $("#fullsizeImageSrc").attr("src", fullImageUrl) 544 else { 545 $("#fullsizeImageSrc").attr("src", self[0].src) 546 } 547 }; 548 $(element).wrap("<div class='postImageContainer'></div>"); 549 $(element).after(divMagnifying); 550 }, 100) 551 552 553 //$(this).after('<div class="ImageCaption" style="height:' + $(this).height() + 'px;width:' 554 // + $(this).width() + 'px;left:' + $(this).position().left + 'px;top:' + $(this).position().top + 'px;"><div>' + title + '</div></div>'); 555 //$(this).after('<div class="ImageCaption" style="height:' + $(this).height() + 'px;width:' 556 // + $(this).width() + 'px;left:' + $(this).position().left + 'px;top:' + $(this).position().top + 'px"><div>' + title + '</div></div>'); 557 } 558 //}); 559 }); 560 561 // 562 563 564 //$(window).resize(function () { 565 566 // $(".ImageCaption").each(function () { 567 568 // var image = $(this).prev()[0]; 569 570 // //$(this).offset({ top: $(image).position().top, left: $(image).position().left }) 571 // $(this).offset({ top: "auto", left: $(image).position().left }) 572 573 574 // }); 575 //}) 576} 577 578$(document).ready(setArticleImageTitle); 579 580 581 582 583function setFloatingSharePanel() { 584 $(window).resize(function () { 585 if ($(window).width() < 1100) 586 $("#pageshare").fadeOut(250); 587 else 588 $("#pageshare").fadeIn(250); 589 }); 590 591 if ($(window).width() < 1100) 592 $("#pageshare").hide(); 593 594 $(window).scroll(function () { 595 $("#pageshare").stop() 596 $("#pageshare").animate({ 597 marginTop: ($(window).scrollTop() + 200) + "px" 598 }, 300); 599 }); 600} 601 602function setFloatingAd(Id, fromWidth, toWidth) { 603 $(window).resize(function () { 604 if ($(window).width() < 980 + fromWidth * 2 || 605 $(window).width() > 980 + toWidth * 2) 606 $("#" + Id).fadeOut(250); 607 else 608 $("#" + Id).fadeIn(250); 609 }); 610 611 612 613 if ($(window).width() < 980 + fromWidth * 2 || 614 $(window).width() > 980 + toWidth * 2) 615 $("#" + Id).hide(); 616 617 // $(window).scroll(function () { 618 // $("#FloatingAd").stop(); 619 // $("#FloatingAd").animate({ 620 // marginTop: ($(window).scrollTop() + 5) + "px" 621 // }, 300); 622 // }); 623} 624 625 626 627function setElipses(selector) { 628 console.log(selector); 629 $(selector).each(function () { 630 631 var lastDiv = $(this).children('div:last-child')[0]; 632 633 if ($(lastDiv).children().length > 0) 634 lastDiv = $(lastDiv).children('a:last-child')[0]; 635 636 var offset = Math.floor(scrollBarOffset(this) / 18); 637 638 //if (checkOverflow(this) > 0) { 639 // // $(this).children(".Cont").hide(); 640 // var charPerline = $(lastDiv).width() / 10; 641 // lastDiv.innerHTML = lastDiv.innerHTML.substring(0, lastDiv.innerHTML.length - offset * charPerline) + "..."; 642 //} 643 644 645 while (lastDiv.innerHTML.length > 10 && checkOverflow(this)) { 646 // console.log(lastDiv.innerHTML.length, checkOverflow(this)) 647 lastDiv.innerHTML = lastDiv.innerHTML.substring(0, lastDiv.innerHTML.length - 10) + "..."; 648 } 649 // console.log(lastDiv.innerHTML.length, checkOverflow(this)) 650 });
651 652 653 654} 655$(document).ready(function () { 656 setTimeout(function () { 657 setElipses(".MainArticleBlockContent"); 658 }, 100) 659 660}) 661 662function checkOverflow(el) { 663 var curOverflow = el.style.overflow; 664 665 if (!curOverflow || curOverflow === "visible") 666 el.style.overflow = "hidden"; 667 668 var isOverflowing = el.clientWidth < el.scrollWidth 669 || el.clientHeight < el.scrollHeight; 670 671 el.style.overflow = curOverflow; 672 673 return isOverflowing; 674} 675 676function HasScrollBar(item) { 677 //note: clientHeight= height of holder 678 //scrollHeight= we have content till this height 679 var _elm = $(item)[0]; 680 var _hasScrollBar = false; 681 if ((_elm.clientHeight < _elm.scrollHeight) || (_elm.clientWidth < _elm.scrollWidth - 3)) { 682 _hasScrollBar = true; 683 } 684 return _hasScrollBar; 685} 686 687function scrollBarOffset(item) { 688 //note: clientHeight= height of holder 689 //scrollHeight= we have content till this height 690 var _elm = $(item)[0]; 691 692 if (_elm.clientHeight < _elm.scrollHeight) 693 return _elm.scrollHeight - _elm.clientHeight; 694 else if (_elm.clientWidth < _elm.scrollWidth) 695 return _elm.scrollWidth - _elm.clientWidth; 696 697 return 0; 698} 699 700function setImageVote(id, title) { 701 if (document.getElementById("ImageVoteTitle") != null) { 702 document.getElementById("ImageVoteTitle").innerHTML = title; 703 document.getElementById("VoteImageId").value = id; 704 $(".VoteBtn").show(); 705 } 706} 707 708function showCommentContent(container) { 709 $(container).children(".CommentContent").each(function () { 710 $(this).show(); 711 }); 712} 713 714 715function setupDropDownLists(selector) { 716 717 $(selector).each(function () { 718 719 if ($(this).is("select") && !$(this).parent().hasClass("StyledDropDown")) { 720 721 var width = $(this).width(); 722 var height = $(this).height(); 723 724 $(this).after("<div class='StyledDropDown'><div class='LeftSide' style='width:" + (width - 27 - 5) + 725 "px'> </div><div class='RigthSide'> </div></div>"); 726 727 var mask = $(this).next(); 728 729 mask.append($(this)); 730 731 mask.width(width); 732 mask.height(height); 733 734 var dropDown = $(this); 735 mask.children(".LeftSide").click(function () { 736 dropDown[0].click(); 737 }); 738 739 $(this).change(function () { 740 mask.children(".LeftSide").text($(this).find('option').filter(':selected').text()); 741 }); 742 mask.children(".LeftSide").text($(this).find('option').filter(':selected').text()); 743 744 if ($(this).attr("disabled") == true) 745 mask.children(".LeftSide").css("color", "Gray"); 746 } 747 }); 748} 749 750 751function setupHintTextBox() { 752 $(document).ready(function () { 753 754 $(".HintTextBox").each(function () { 755 var initialText = $(this).attr("value"); 756 var initialColor = $(this).css("color"); 757 758 $(this).focus(function () { 759 if ($(this).attr("value") == initialText) { 760 $(this).attr("value", ""); 761 } 762 $(this).css("color", "black"); 763 }) 764 $(this).blur(function () { 765 if ($(this).attr("value") == "") { 766 $(this).css("color", initialColor); 767 $(this).attr("value", initialText); 768 769 } 770 }); 771 }); 772 773 $(".HintPasswordBox").each(function () { 774 var textComponent = $(this).children(".Text"); 775 var passComponent = $(this).children(".Password"); 776 777 textComponent.show(); 778 passComponent.hide(); 779 780 textComponent.focus(function () { 781 textComponent.hide(); 782 passComponent.show(); 783 passComponent.focus(); 784 }); 785 passComponent.blur(function () { 786 if (passComponent.val() == '') { 787 textComponent.show(); 788 passComponent.hide(); 789 } 790 }); 791 }); 792 793 });
794 795} 796 797 798 799function printdiv(elem) { 800 Popup($(elem).html()); 801} 802function Popup(data) { 803 var mywindow = window.open(); 804 mywindow.document.write('<html><head><title></title>'); 805 $("link").each(function () { 806 if ($(this).attr("rel") == "stylesheet") 807 mywindow.document.write('<link rel="stylesheet" href="' + $(this).attr("href") + '" type="text/css" />'); 808 }); 809 /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />'); 810 mywindow.document.write('</head><body >'); 811 mywindow.document.write("<div>" + data + "</div>"); 812 mywindow.document.write('</body></html>'); 813 mywindow.document.close(); 814 mywindow.print(); 815 return true; 816} 817 818 819//$(document).ready(function () { 820 821// function checker() { 822// $.getJSON("/Misc/Json/pikud.json", function (data) { 823// // alert(data); 824// if (data.length > 0) { 825// $(".warning_place").html(data.join()); 826// $(".pikud_haoref").show(); 827// } 828// else 829// $(".pikud_haoref").hide(); 830// }); 831// } 832 833// setInterval(checker, 3000); 834 835 836//})(); 837 838function getDocHeight(doc) { 839 doc = doc || document; 840 // stackoverflow.com/questions/1145850/ 841 var body = doc.body, html = doc.documentElement; 842 var height = Math.max(body.scrollHeight, body.offsetHeight, 843 html.clientHeight, html.scrollHeight, html.offsetHeight); 844 return height; 845} 846 847function setIframeHeight(id) { 848 var ifrm = document.getElementById(id); 849 var doc = ifrm.contentDocument ? ifrm.contentDocument : 850 ifrm.contentWindow.document; 851 ifrm.style.visibility = 'hidden'; 852 ifrm.style.height = "10px"; // reset to minimal height ... 853 // IE opt. for bing/msn needs a bit added or scrollbar appears 854 ifrm.style.height = getDocHeight(doc) + 4 + "px"; 855 ifrm.style.visibility = 'visible'; 856} 857 858function sendForm() { 859 860 if ($('#g-recaptcha-response').val() != "") 861 $('#ContactForm')[0].submit(); 862 else 863 $("#captcha-error").show(); 864 865 //if (validation()) { 866 // $.post("Home/Checkvalidation/", { recaptcha: $('#g-recaptcha-response')[0].value }).done(function (data) { 867 // if (data == true) { 868 // $("#error-validation").hide(); 869 // $('#ContactForm')[0].submit(); 870 // } 871 // else { 872 // $("#captcha-error").show(); 873 // $("#error-validation").hide(); 874 // } 875 // }) 876 //} 877 //else { 878 // $("#error-validation").show(); 879 //} 880} 881function validation() { 882 var valid = true; 883 //var fullName = $("#CommentAuthor")[0].value; 884 //if (fullName.length > 50 || fullName.length < 4) 885 // valid = false; 886 //var phoneNumber = $("#CommentPhone")[0].value; 887 //if (!(/^[0-9]{9,10}$/.test(phoneNumber))) 888 // valid = false; 889 //var Email = $("#CommentEmail")[0].value; 890 //if (!(/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(Email))) 891 // valid = false; 892 var content = $("#CommentDetails")[0].value; 893 if (content.length > 500 || content.length < 2) 894 valid = false; 895 if (valid) 896 return true; 897} 898 899function trackView(id) { 900 fetch("/website/PostView", { 901 method: "POST", 902 body: JSON.stringify({ 903 postId: id 904 }), 905 headers: { 906 "Content-type": "application/json; charset=UTF-8" 907 } 908 }) 909} 910
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.