function loadReadon(){var n=$("#readon");$.ajax({url:isHebrewLetter()+"/home/PageReadon",traditional:!0,data:{tagIdArr:n.data("chosentags"),type:n.data("type"),id:n.data("id")},dataType:"html",success:function(n){$("#readon").append(n).fadeIn(500);checkLazyImgs()},error:function(n,t,i){console.log("An AJAX error occured: "+t+"\nError: "+i+"\nError detail: "+n.responseText)}})}function responseveIframe(){$("iframe,img").each(function(){$(this).height($(this).attr("height")/$(this).attr("width")*$(this).width())})}function responseveShare(){$(window).width()<520?($("#share").removeClass("shareRight").addClass("shareBottom"),$(".rrssb-print,.rrssb-reddit,.rrssb-pinterest").show(),$(window).width()>430&&$(".rrssb-print,.rrssb-reddit,.rrssb-pinterest").hide()):($("#share").removeClass("shareBottom").addClass("shareRight"),$(".rrssb-print,.rrssb-reddit,.rrssb-pinterest").show());$("#share").show()}function printIt(){var t='<div style="display:flex;justify-content:space-between;"><img src="/content/images/logofull.png" width="161" height="55"><br><small>'+window.location.href+'<\/small><\/div><article class="pageBody">',i=document.querySelector("article").innerHTML,r=document.body.innerHTML,u=document.title,n=document.querySelector("body"),f=window.getComputedStyle(n).backgroundColor,e=window.getComputedStyle(document.querySelector(".pageBody")).boxShadow;document.body.innerHTML=t+i+"<\/article>";n.style.backgroundColor="white";document.title="Palestinian Media Watch";document.querySelector(".pageBody").style.boxShadow="0 0 0 white";setTimeout(function(){window.onafterprint=function(){document.body.innerHTML=r;document.title=u;n.style.backgroundColor=f;document.querySelector(".pageBody").style.boxShadow=e};window.print()},1e3)}function prepareNotes(){function t(n){const t=n.querySelector("summary");t.addEventListener("click",t=>{t.preventDefault();let i=n.querySelector(".noteContent"),r=!0;if(i==null&&(i=document.createElement("div"),i.classList.add("noteContent"),r=!1),n.open)i.style.height=i.scrollHeight+"px",i.style.height="0",setTimeout(()=>{n.open=!1},500);else{if(!r){var u=$.ajax({async:!1,type:"POST",dataType:"text",url:isHebrewLetter()+"/Home/GetNote/",data:{id:n.id}}).responseText;i.innerHTML=u;n.appendChild(i)}n.open=!0;i.style.height=i.scrollHeight+"px"}})}let n=document.querySelectorAll("a[name=note]");n.forEach(n=>{let u=n.textContent,f=n.id,i=document.createElement("details");i.id=f;i.className="note";let r=document.createElement("summary");r.textContent=u;i.appendChild(r);t(i);n.parentNode.replaceChild(i,n)})}function youtubeThumbnailClicked(n){let t;if(n.target)t=n.target;else if(document.querySelector(`#${n.substring(1)}`))t=document.querySelector(`#${n.substring(1)}`);else return;let r="yt";t.hasAttribute("data-platform")&&(r=t.getAttribute("data-platform"));currntYTid=t.getAttribute("data-ytid")||t.id;let i=document.createElement("iframe"),u;r=="yt"?u=`https://www.youtube.com/embed/${currntYTid}?rel=0&modestbranding=1&enablejsapi=1&autoplay=1&mute=1`:r=="dm"?(u=`https://geo.dailymotion.com/player.html?video=${currntYTid}&autoplay=1&queue-enable=false&queue-autoplay-next=false&endscreen-enable=0`,i.setAttribute("allow","web-share")):r=="vm"&&(u=`https://player.vimeo.com/video/${currntYTid}?autoplay=1&muted=1`);i.setAttribute("src",u);i.id="yt_"+currntYTid;i.setAttribute("frameborder","0");i.style.cssText=t.style.cssText;window.location.href.indexOf("page")==-1?i.style.width="100%":i.setAttribute("width",t.getAttribute("width"));t.parentNode.parentNode.replaceChildren(i);window.location.hash.includes(currntYTid)&&i.scrollIntoView()}$(document).ready(function(){prepareNotes();loadReadon();responseveIframe();responseveShare()});$(window).resize(function(){responseveIframe();responseveShare()});$('<span class="pdfIframe">View pdf in full window<\/span>').insertBefore('iframe[src$=".pdf"]');$(".pdfIframe").click(function(){var n=$(this).next().attr("src");window.open(n,"pdfIframe","width="+screen.availWidth+",height="+screen.availHeight)});$("#share li").mouseenter(function(){var t=$(this).find("a").attr("href").toString(),i=$(this).hasClass("rrssb-twitter"),n=document.querySelector('meta[name="description"]').content;n=i&&n.length>230?"":n;t=t.replace("{title}",document.title).replace("{url}",window.location.href).replace("{desc}",n).replace("{media}",document.querySelector('meta[name="image"]').content).replace("{body}",n+"%0ARead at: "+window.location.href);$(this).find("a").attr("href",t)});const dialog=document.getElementById("thinkTankDialog"),openButton=document.getElementById("openDialogBtn"),closeButton=document.getElementById("closeDialogBtn"),dialogTitle=document.getElementById("dialogTitle"),dialogContent=document.getElementById("dialogContent");if(dialog){function n(n,t){dialogTitle.textContent=n;dialogContent.innerHTML=t;dialog.showModal();closeButton.addEventListener("click",()=>dialog.close(),{once:!0});const i=n=>{const t=dialog.getBoundingClientRect();(n.clientX<t.left||n.clientX>t.right||n.clientY<t.top||n.clientY>t.bottom)&&dialog.close()};dialog.addEventListener("click",i,{once:!0})}openButton&&openButton.addEventListener("click",()=>{n("Sample Dialog Title","This is a sample content for the dialog. Design is minimal and professional.")});dialog&&dialog.addEventListener("click",n=>{const t=dialog.getBoundingClientRect();(n.clientX<t.left||n.clientX>t.right||n.clientY<t.top||n.clientY>t.bottom)&&dialog.close()});window.openDialog=n}$(document).ready(()=>{window.location.hash&&document.querySelector(".yt-img-container")&&youtubeThumbnailClicked(window.location.hash)});var currntYTid;document.querySelectorAll(".yt-img").forEach(n=>{n.parentNode.onclick=n=>n.preventDefault(),n.onclick=n=>youtubeThumbnailClicked(n)})