<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />

<meta property="og:image" content="https://w2.chabad.org/media/images/777/OSjf7775136.png" itemprop="image" width="150" height="150" />
<meta property="og:image:width" content="150" />
<meta property="og:image:height" content="150" />
<meta name="keywords" content="Ki,Teitzei" />
<meta name="title" content="Ki Teitzei - Chabad of the West Side" />
<meta property="og:type" content="website" />
<meta name="scope-aids" content="56130-56134-4462882-4461964-64482-66861-3045304" />
<meta name="article-keywords" content="23083-8495-23081-2170-2898-20962" />
<meta name="scope-aid" content="56130" />
<meta name="scope-aid" content="56134" />
<meta name="scope-aid" content="4462882" />
<meta name="scope-aid" content="4461964" />
<meta name="scope-aid" content="64482" />
<meta name="scope-aid" content="66861" />
<meta name="scope-aid" content="3045304" />
<meta name="article-keyword" content="23083" />
<meta name="article-keyword" content="8495" />
<meta name="article-keyword" content="23081" />
<meta name="article-keyword" content="2170" />
<meta name="article-keyword" content="2898" />
<meta name="article-keyword" content="20962" />
<meta property="og:url" content="https://www.chabadwestside.org/templates/articlecco_cdo/aid/3045304/jewish/Ki-Teitzei.htm" />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:site" content="@chabad" />
<meta property="og:title" content="Ki Teitzei - Chabad of the West Side" /><link rel="canonical" href="https://www.chabadwestside.org/templates/articlecco_cdo/aid/3045304/jewish/Ki-Teitzei.htm" />
<link rel="icon" type="image/png" href="https://www.chabadwestside.org/media/images/777/OSjf7775136.png" />
<link rel="Stylesheet" href="/css/fonts/font-awesome/font-awesome-5.css?v=2D6ABDDB" id="kfont-awesome" type="text/css"/>
<link rel="Stylesheet" href="/css/DefaultGrid.css?v=A13D74E8" id="kgrid" type="text/css"/>
<link rel="Stylesheet" href="/css/Elements.css?v=3A4C63F4" id="k6" type="text/css"/>
<link rel="Stylesheet" href="/css/vendor/ds/tokens/sites.css?v=21E88630" id="ksites-ds-css" type="text/css"/>
<link rel="Stylesheet" href="/css/new/main.css?v=BB63DD50" id="k7" type="text/css"/>
<link rel="Stylesheet" href="https://w2.chabad.org/css/cco/minisites/global.css" id="k20962" type="text/css"/>
<link rel="Stylesheet" href="/css/old/global.css?v=43DDBA77" id="k2898" type="text/css"/>
<link rel="Stylesheet" href="/css/cco/minisites/themes/holiday/holiday-minisite.css" id="k23081" type="text/css"/>
<link rel="Stylesheet" href="https://w2.chabad.org/images/Shluchim/minisites/themes/purim/purim-minisite.css?v=7/8/2026" id="k23083" type="text/css"/>
<link rel="Stylesheet" href="/css/bootstrap/grid.css?v=F4390F2B" id="kbootstrap4-grid" type="text/css"/>
<link rel="Stylesheet" href="/css/Library/reader-comments.css?v=8AB57D79" id="kCommentsStylesheet" type="text/css"/>
<link rel="Stylesheet" href="/css/inline/BookInfo.css?v=3D052243" id="kBookInfoCss" type="text/css"/>

<script>$q=[];$j=function(f){$q.push(f);}</script>
	
 
	
	<style type="text/css">
		body{margin:0;}
	</style>
	
	



<script>
	window.dataLayer = window.dataLayer || [];
	dataLayer.push({"event":"datalayer-initialized","page":{"numberOfComments":0,"publicationDate":"2015-08-27","primaryArticleId":3045304,"title":"","author":"","authorId":0,"contentLevel1":"My Site","contentLevel2":"Shul","contentLevel3":"Torah Study Opportunities","contentLevel4":"Torah for the Times","contentLevel5":"Torah Fax Archives","contentLevel6":"Ki Teitzei","siteName":"Chabad of the West Side"},"time":{"upcomingHoliday":"Rosh Hashanah","daysToUpcomingHoliday":30,"hebrewDate":"5786-05-30"}});
		dataLayer.push({ 'articleHierarchy': '-56130-56134-4462882-4461964-64482-66861-3045304-', 'keywords': '-k20962-k2898-k2170-k23081-k8495-k23083-', 'k': '-56130-56134-4462882-4461964-64482-66861-3045304--k20962-k2898-k2170-k23081-k8495-k23083-' });
	
</script>
<script>

(function(c,h,a,b,a,d){c[a]=c[a]||[];c[a].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=h.getElementsByTagName(b)[0],
j=h.createElement(b);j.async=true;
j.src='https://w6.chabad.org/mitzvah-tank.js';f.parentNode.insertBefore(j,f);
})(window,document,0,'script','dataLayer');</script>

	<!-- Start of StatCounter Code -->
	<script type="text/javascript">
	var sc_project = 1076023;var sc_partition = 1;var sc_invisible = 1;var sc_remove_link=1;var sc_security = "f304d65a";var sc_https = 1;
	</script>
	<script type="text/javascript" src="https://secure.statcounter.com/counter/counter_xhtml.js" defer async></script>
	<noscript><img src="//c2.statcounter.com/counter.php?sc_project=1076023&amp;java=0&amp;security=f304d65a&amp;invisible=1" border="0" /> </noscript>
	<!-- End of StatCounter Code -->


<meta name="google-site-verification" content="XI1CNphP9EJK1nCK8w7KoTerO0ZLWG0TS35_ivzwlSI" />

<noscript>
  <img height="1" width="1" src="https://www.facebook.com/tr?id=2531238256890008&ev=PageView&noscript=1" />
</noscript>

<style>
  #calendar.day .halachic_times .wrapper {
    display: none;
  }

  form.subscribe_box {
    display: none;
  }
</style>
<style>
  #new-campaign-ticker-wrapper ~ #header:not(.on-scroll) {
    margin-top: 100px;
  }
  @media (max-width: 1024px) {
    #new-campaign-ticker-wrapper ~ #header:not(.on-scroll) {
      margin-top: 160px;
    }
    .fs-ticker-heading-small {
      display: none;
    }
  }
  @media (max-width: 770px) {
    #new-campaign-ticker-wrapper ~ #header:not(.on-scroll) {
      margin-top: 170px;
    }
    body #new-campaign-ticker-wrapper .fs-ticker-container .fs-ticker-heading-container .fs-ticker-heading .fs-ticker-heading-large {
      font-size: 23px;
    }
    body #new-campaign-ticker-wrapper .fs-ticker-container .fs-ticker-campaign-info-container .fs-ticker-campaign-info {
      display: flex;
      align-items: stretch;
      flex-basis: 100%;
    }
    body #new-campaign-ticker-wrapper .fs-ticker-container .fs-ticker-goal-container {
      flex: 1;
      align-items: stretch;
    }
    body #new-campaign-ticker-wrapper .fs-ticker-container .fs-ticker-donate {
      display: flex;
      align-items: center;
    }
  }
</style>

<link href="https://webmk.co/sites/general/cdo-normalize.css" rel="stylesheet" />





<style>
:where(#co_content_container .co_body img) {
    height: auto;
}
.hp-table>:not(:first-child) .promo_slider .cycle-caption{ display: none !important;}

@media (max-width: 768px) {
.promo_slider .slide_wrapper {
    height: 75% !important;
}
#BodyContainer > div > div.g960 > div > div.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.g960.no_margin.g960.no_margin > div > div:nth-child(3) > div > div > div > div.slider > div.slides > div > a > img { background-size: 90% 100% !important;
}
.hp-table>:not(:first-child) .promo_slider .slider {
    height: 25vh !important;}
}
</style>




<script>
  !(function (f, b, e, v, n, t, s) {
    if (f.fbq) return;
    n = f.fbq = function () {
      n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);
    };
    if (!f._fbq) f._fbq = n;
    n.push = n;
    n.loaded = !0;
    n.version = "2.0";
    n.queue = [];
    t = b.createElement(e);
    t.async = !0;
    t.src = v;
    s = b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t, s);
  })(window, document, "script", "https://connect.facebook.net/en_US/fbevents.js");
  fbq("init", "2531238256890008");
  fbq("track", "PageView");
</script><script src="https://webmk.co/sites/westside/w-script.js"></script><script>
const isCampaignPage = window.location.pathname.includes(6449827);
if (isCampaignPage) {
    const addButton = () => {
        const modalButton = document.querySelector(".about-modal-btn");
        const reserveButton = `<div class="donate-button"><a class="donate-button-text" href="/dinner" style="display: block">Reserve for dinner</a></div>`;
        modalButton.insertAdjacentHTML("afterend", reserveButton);
    };
    document.addEventListener("DOMContentLoaded", addButton);
}
</script><script>
if (window.location.pathname.toLowerCase() === "/templates/articlecco_cdo/aid/6002444/jewish/chabad-hebrew-school.htm") {
    window.location.replace("https://chabadfamilyprograms.org/chs");
}
</script><title>
	Ki Teitzei - Chabad of the West Side
</title></head>
<body class="lang_en dir_ltr cco_body cco_templateless_page section_branch">
	
	
		<div width="100%" class="cco_templateless_template" style="z-index:100 !important;display:block !important;left:0px !important;top:0px !important;height:30px!important;width:100% !important;line-height:30px !important; position:relative !important; margin-bottom:0 !important; padding:0;text-indent: 25px;" align="Left"><a href="//www.ChabadWestside.org" style="display:block!important;font-size:14px !important;">&laquo; Back to&nbsp;Chabad of the West Side</a></div>
	
	<div class="cco_templatelates_content">
		
	<div class="co_content_container clearfix local_content" id="co_content_container">
		<div class="clearfix">
			<!-- BEGIN HEADER --><style type="text/css">

div#chabad_head .chabad_navigator_bar ul li a {

    color: #d2d2d2!important;}

.chabad_header { 
background-image:none !important;
background-color: white !important;} 

.cco_templateless_page #chabad_main_content {
background-image: none !important;}

.cco_templateless_template a {
    color: #fff;
    background-color: #00a79d !important;
}

.chabad_menu_content {
    background-color: #104098 !important;
}

#navigation li.parent a.parent, .sub_menu, .sub_menu .item {
    background-color: #104098 !important;
}
a.parent.arrow.selected {
    color: white !important;
}

#footerContainer, .footer {
 
    background-color: #00a79d !important;}

.bannerCta button {

    background: #104098 !important;
}

.chabad_header {
       height: 270px; !important;}.chabad_header .headerTitle {
  
    padding-top: 66px!important;}
</style>


<div id="chabad_body_page">
<div id="chabad_main_content">
<div id="chabad_head">

<div>
<div>
<div>
<div>

<div class="chabad_header">
<div class="headerTitle">
<span style="font-size: 48px;">Adult Education at Chabad</span></div>
<div class="centerName">
 </div>
<div class="holidayDates"></div>
</div>


<div id="navigation" class="chabad_navigator_bar">
<div class="chabad_menu_content">
<ul id="menu" class="navi">
<li class="item parent">
<a href="/article.asp?aid=4461964" class="parent">Home</a>
|
</li>
<li class="item parent">
<a href="/article.asp?aid=2641272" class="parent">Daily Study</a>
</li>

</ul>
</div>
</div>

</div>
</div>
</div>
</div>
</div>
<div id="chabad_body_content">
<div class="chabad_left_column">
<div detached="true" type="static" id="ContentArea" name="content_area" actions="edit,delete" class="chabad_left_column"><div id="content_page" class="content_page"><!-- END HEADER -->
			
			
			<div class="clearfix bh mobile-only align_right">ב"ה</div>
			
				<div class="master-content-wrapper " >
					

<header class="article-header cf ">
	
	
			<h1 class="article-header__title js-article-title js-page-title">Ki Teitzei</h1>
		
			<div>
				
			</div>
		
</header>
				</div>
			
			<div class="body_wrapper clearfix co_body">
				<div class="" id="co_body_container">
					
					<div id="ContentBody">
						
						
							<div class="content-area-parent no_margin">
								
	<div id="cco_body">
		<div class="content  no_margin no_overflow" id="co_content_container">
			
			
	

	<article class="content js-content" itemscope itemtype="http://schema.org/Article">
	



<meta itemprop="mainEntityOfPage headline name" content="" />

<meta itemprop="image" content="" />


<meta itemprop="uploadDate" content="2015-08-27T16:20:22" />
<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
	<meta itemprop="name" content="Chabad of the West Side" />
	<meta itemprop="brand" content="Chabad of the West Side" />
	<span itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
		<meta itemprop="url" content="https://w2.chabad.org/media/images/777/OSjf7775136.png" />
		<meta itemprop="height" content="150" />
		<meta itemprop="width" content="150" />
	</span>
</span>
<meta itemprop="datePublished" content="2015-08-27T16:20:22" />
			<div itemprop="articleBody">
				<co:body xmlns:co="www1.chabadonline.com/alpha1" xmlns:ext="urn:xslt-extensions">
  <div class="co_body article-body cf">
<br type="_moz">
<p class="MsoNormal" align="center" style="margin: 0px 0px 0.0001pt; font-family: Arial; font-size: 1.4rem; line-height: 25.2000007629395px; text-align: center;">
<span style="font-size: 16px; font-family: 'Palatino Linotype';">
<b>Friday - Shabbat, Aug 28 - Aug 29, 2015</b></span></p>
<p class="MsoNormal" align="center" style="margin: 0px 0px 1em; font-family: Arial; font-size: 1.4rem; line-height: 25.2000007629395px; text-align: center;"></p>
<p class="MsoNormal" style="margin: 0px 0px 0.0001pt; font-family: Arial; font-size: 1.4rem; line-height: 25.2000007629395px;"></p>
<div></div>
<div style="font-family: arial; font-size: 14px; background-color: rgb(255, 255, 255);"></div>
<div style="font-family: arial; font-size: 14px; background-color: rgb(255, 255, 255);"></div>
<p style="margin: 0px 0px 1em; font-family: Arial; font-size: 14px; line-height: 25.2000007629395px; background-color: rgb(255, 255, 255);"><strong>Torah Reading: </strong>Ki Teitzei (<a href="http://www.chabadwestside.org/9985#v10" style="color: purple;">Deuteronomy 21:10</a> - 25:19)<br>
<strong>Haftorah</strong><em> <strong>(for Ki Teitzei and R'ei)</strong></em>: <a href="http://www.chabadwestside.org/15985#v1" style="color: purple;">Isaiah 54:1</a> - 55:5<br>
<em>Note: In addition to the weekly Haftorah, we make up the Haftorah for Parshat R'ei which was replaced two weeks ago with the Haftorah of Rosh Chodesh</em><br>
<br>
<strong>Pirkei Avot</strong>: Chapters 1-2<br>
<br>
<strong>Shabbat Candle Lighting:</strong> 7:16 PM <br>
<strong>Shabbat ends: </strong>8:16 PM</p>
<p class="MsoNormal" style="margin: 0px; font-family: Arial; font-size: 14px; line-height: 25.2000007629395px; text-align: justify; background-color: rgb(255, 255, 255);">
<span style="color: rgb(0, 0, 255); font-family: 'Palatino Linotype'; font-size: 20px;">
<b><br type="_moz">
</b></span></p>
<div align="center" style="font-family: arial; font-size: 14px; background-color: rgb(255, 255, 255);"></div>
<p class="MsoNormal" align="center" style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 23.0400009155273px; text-align: center; background-color: rgb(255, 255, 255);"></p>
<p class="MsoNormal" align="center" style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 23.0400009155273px; text-align: center; background-color: rgb(255, 255, 255);"></p>
<p class="MsoNormal" align="center" style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 23.0400009155273px; text-align: center; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 26pt; line-height: 39.8666687011719px; font-family: Nyala;">Ki Teitzei</span></b></p>
<p class="MsoNormal" align="center" style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 23.0400009155273px; text-align: center; background-color: rgb(255, 255, 255);"></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The Rebellious Son and Daughter</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">One of the most troubling features of modern times is the phenomenon of the wayward child; the child who rebels against his or her parents, their values and way of life.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">This phenomenon is not new and has been addressed by the Torah; in this week’s parsha, where it discusses the “<i>ben sorer u’moreh-</i>the rebellious child.” The underlying message of this section is that moral education must start early, otherwise what seems to be a relatively mild form of rebellion can morph into a deadly form.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">In truth, the Oral tradition, as recorded in the Talmud, attaches many conditions towards becoming a full-fledged <i>ben sorer u’moreh, </i>and be “eligible” for its harsh punishment. These conditions are so onerous, that it was virtually impossible to ever mete out the punishment. This prompted our Sages to declare: “a <i>Ben sorer u’moreh</i> never existed in real life.” It seems that the Torah’s intent was to present us with a hypothetical scenario to teach us vital lessons concerning the moral education of our children.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The Talmud (end of Tractate Sukkah) records an example of a rebellious young woman, whose name was Miriam bas Bilgah, who rebelled against her people and brought disgrace and calumny on her entire family. This Miriam, converted to the pagan, Hellenic faith and married a Greek official. She entered the Temple and pounded the Altar with her shoe and declared: “Wolf wolf! You have plundered the property of the Jewish people, but you did not stand by them in their time of need!”</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Two Windows Shut Down</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Because of her radically irreverent behavior, which, the Talmud assumes, she picked up from her own parents, her entire family, was penalized.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Bilgah, was the name of one of the 24 families of priests who were privileged to serve in the Beis Hamikdash. Because of the negative influence of this family it was relegated to an inferior position in the Temple. One of the ways it was penalized, the Mishnah (the end of Tractate Sukkah) states: “its window was sealed.”</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">There are two explanations as to the meaning of “its window.” According to Maimonides’ commentary on the Mishnah, each of the 24 families had its own alcove where their priestly garments were kept. Bilgah’s family window-alcove was sealed compelling it to store its garments with some other family.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">According to the Jerusalem Talmud, however, the “window” refers to the alcove where they kept their knives needed for the slaughtering of the sacrificial animals in the Temple. This family could no longer use their own alcove.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">
<b>Does the Punishment Fit the Crime?</b></span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">A punishment must fit the crime. There must, therefore, be a connection between the punishment and the transgression of Miriam bas Bilgah and of the entire Bilgah clan. Why would removing their access to a window be a suiting punishment for disrespecting the Altar and the Temple? And what connection does the sealing of these two alcoves (where they stored the priestly garments and knives) have with Miriam bas Bilgah’s errant behavior?</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Furthermore, why does Maimonides offer an alternative explanation for the alcove that was sealed and not cite the one given by the Jerusalem Talmud (that it was the alcove where they stored the knives)?</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Melody Opens Windows</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">To understand the deeper meaning of this entire episode we ought to reflect on the spiritual dimension of “windows.”</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Rabbi Yosef Yitzchak Schneersohn (the Previous Lubavitcher Rebbe), commented on the rabbinic phrase: <i>“Kol m’orer hakavanah</i>-melody awakens concentration.” Simply put this means that when we vocalize our prayers it helps to stimulate our focus and concentration. The Previous Rebbe, however, interpreted this phrase in a novel fashion: “Melody opens up <b>windows</b>.” The Hebrew word <i>kavanah</i> is etymologically related to an Aramaic word which means windows. Music has the capacity to open windows in our soul.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Prayer is a meditative experience in which we engage the mind with the understanding of G‑d’s greatness, His providence and love for us, etc. This reflection is intended to ignite passion for G‑d in our hearts, which should ultimately affect our thought, speech and action throughout the day. What begins in the mind, passes through the heart, and extends to all of our functions.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">But, there are times when we experience a blockage between the mind and the heart. As much as the mind tries to arouse our emotions, we remain numb. When that occurs, our efforts must be directed at opening a “window” between our mind and heart.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">And then there are times when we do get inspired, but we nevertheless experience resistance when we attempt to translate that excitement into practice. Once again, we have to open a window to allow the inspiration to reach our thoughts, speech and action.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The medium that opens up these windows for us, the Previous Rebbe explained, is melody. Music, has the capacity to open up windows that allows our mind’s understanding to reach our heart’s emotions, and from there flow unobstructed to and through our entire being.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The Root Cause: Sealed Windows</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">To reveal the cause of their errant behavior the Sages of the Temple period had the windows to the members of the Bilgah family’s knives and priestly garments sealed to impress upon them, and serve as a lesson for us, that their rebellious behavior was rooted in their failure to open up two parallel windows in their own lives.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Miriam bas Bilgah was a product of exile conditions. She was under the spell of the Greek way of life. The Greek’s of that period were known for their brilliant philosophical teachings. However, their intellectual knowledge, which included sophisticated teachings about morality, rather than introducing enlightenment to the world (micro and macro), brought moral and spiritual decadence and darkness.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Miriam bas Bilgah was a product of this milieu which engendered the twin blockage between the mind and the heart and between the heart and behavior.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The window or alcove where the knives were stored was symbolic of the constricted neck area, which serves as the blockage between the mind and the heart. The knives were used to sever the head from the heart and alluded to the root cause of Miriam bas Bilgah’s behavior. There was a severance of the connection between mind and heart.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The other opinion (that the window where the priestly garments were stored was sealed) focuses on the second blockage between the heart and thought speech and action, which are referred to in the Tanya (Chapter 4) as the soul’s <b>garments</b>. Our personality consists of our intellect and emotions. Thought, speech and action are the “garments” of our soul because, as garments which lend expression to our bodies, they express our personality; our understanding and our emotions.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Jerusalem Talmud Windows</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The Jerusalem Talmud is known as the Talmud of light which represents clarity of mind. In this illuminated environment, the problem which causes rebellious behavior, must be attributed to a blockage between the mind, the source of light and enlightenment, and the heart. A person, bereft of all feelings for G‑d and Torah, will inevitably lose their desire to abide by the Torah’s directives.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">The Babylonian Talmud, by contrast, is known as the Talmud of darkness, because it was composed in the Babylonian exile and has to contend with more dismal exile conditions. In these times, our primary focus has to be on our soul’s garments; thought speech and action. While we must never give up on bringing more light to our minds and opening up windows to our hearts, what is now most crucial is the translation of our ideals into practice. Maimonides, cited by the Rebbe on numerous occasions declares: “One thought, word or action can tip the scales for the good and bring salvation to the entire world.”</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Babylusalem Talmud? A</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">As we stand today straddling the fence between Galus-exile and Geulah-Redemption we must integrate both the Babylonian Talmud model of windows (removal of the blockage that does not allow our actions to follow our feelings) and the Jerusalem Talmud paradigm (removal of the blockage between our mind and our heart).</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">How do we open both windows?</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">In addition to learning Torah (particularly the subject of Redemption and Moshiach, which will alter the way we think and bring more G‑dly light into our minds, which in turn, has a greater capacity to affect our emotions and our behavior), the Rebbe advocated increased joy.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">This is in tune (no pun intended) with the Previous Rebbe’s interpretation of the words “melody opens windows.” Spiritual Jewish music (such as Chassidic nigunim) has the capacity to break through all the blockages, especially the melodies which express true spiritual joy.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Indeed, the Rebbe Rashab (the fifth Lubavitcher Rebbe) stated, “<i>Simcha</i>-joy breaks through boundaries.”</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<b>
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Bilgah: With Joy</span></b></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">It is interesting to note that according to a 18<sup>th</sup> century Sephardic Sage, the letters of the name Bilgah, can be rearranged to read “<i>b’gilah</i>” with joy.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">When we reject the misguided exile melodies and embrace the kosher and holy joy (including the profound and spiritually uplifting Chabad Chassidic melodies) which derives from our anticipation of the imminent Geulah, we can open up all the windows in our souls and remove the curse of the sealing of Bilgah’s windows.</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">We will no longer have to witness the so-called “generation gap” which turns our youth against their elders, as in the <i>ben sorer u’moreh</i> model, because our youth will experience the joy of Judaism and of the Geulah and we will see the fulfillment of the Biblical prediction, “the hearts of the fathers will be restored through the children.”</span></p>
<p class="MsoNormal" style="margin: 0px 0px 6pt; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8000001907349px; line-height: 15.3599996566772px; background-color: rgb(255, 255, 255);">
<span style="font-size: 14pt; line-height: 22.3999996185303px; font-family: Nyala;">Even today Moshiach “watches from the windows and peers through the cracks,” but, imminently we will see the total removal of the barriers, so there will no longer be a need for windows to prevent the Miriam bas Bilgahs- singing the wrong tune (<i>b’gilah</i>). Instead even those “who repose in the earth will arise and sing,” the “tenth song” with Moshiach’s harp that will ultimately consist of ten strands!</span></p>

</div>
</co:body>
			</div>
			

			<div class="break_floats"></div>
			
	<div class="break_floats"></div>
	

<div class="content-footer">
	
	
	
	
		<div class="section-articles below-article clearfix" id="MoreInSection" data-list-name="more in this section">
			<h2 class="below-article__title">More in this section</h2>
			<div class="bs-container">
				<div class="bs-row">
					
		<div class="section-articles__column col-md-6 ">
			<ul class="small-links small-links--orange">
				
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3060651/jewish/Nitzavim.htm" data-aid="3060651">Nitzavim</a>
		</li>
		
	
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3068308/jewish/Vayeilech.htm" data-aid="3068308">Vayeilech</a>
		</li>
		
	
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3076144/jewish/Haazinu-Sukkos.htm" data-aid="3076144">Haazinu/ Sukkos</a>
		</li>
		
	
			</ul>
		</div>
	
		<div class="section-articles__column col-md-6 ">
			<ul class="small-links small-links--orange">
				
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3084811/jewish/Beraishit.htm" data-aid="3084811">Beraishit </a>
		</li>
		
	
		<li class="small-links__item ">
			
			<a class="link_item" href="/templates/articlecco_cdo/aid/3102645/jewish/Noach.htm" data-aid="3102645">Noach</a>
		</li>
		
			<li class="small-links__item small-links__item--more">
				<a href="/article.asp?aid=66861" data-aid="66861">View All  &raquo;</a>
			</li>
		
	
			</ul>
		</div>
	
				</div>
			</div> 
		</div>
	
		

	
	
</div>
	</article>

		</div>
	</div>
</div>
						
						<div class="break_floats"></div>
						
					</div>
				</div>
				
				
				
			</div>
			
			<!-- BEGIN FOOTER --></div>
<div id="border_bottom"></div>
</div>
</div>
</div>

<!-- END FOOTER -->
		</div>
		
		<aside class="page-tools-sidebar js-page-tools-sidebar hide_for_print">
<div class="page-tools js-page-tools-menu">
<div class="page-tools__section page-tools__section--share">
<a class="page-tools__tool js-share-popup page-tools__tool--facebook" data-share-url="https://www.facebook.com/dialog/share?app_id=188669250943&amp;display=popup&amp;href=https%3a%2f%2fwww.chabadwestside.org%2ftemplates%2farticlecco_cdo%2faid%2f3045304%2fjewish%2fKi-Teitzei.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dFB">
				<i class="fa fa-facebook"></i>
			</a>
<a class="page-tools__tool js-share-popup page-tools__tool--twitter" data-share-url="https://twitter.com/intent/tweet?text=Ki+Teitzei+-+Chabad+of+the+West+Side&amp;url=https%3a%2f%2fwww.chabadwestside.org%2ftemplates%2farticlecco_cdo%2faid%2f3045304%2fjewish%2fKi-Teitzei.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dtwitter&amp;via=Chabad">
				<i class="fa fa-twitter"></i>
			</a>
<a class="page-tools__tool js-share-popup page-tools__tool--whatsapp d-lg-none js-share-whatsapp" data-share-url="whatsapp://send?text=Ki+Teitzei+-+Chabad+of+the+West+Side https%3a%2f%2fwww.chabadwestside.org%2ftemplates%2farticlecco_cdo%2faid%2f3045304%2fjewish%2fKi-Teitzei.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dwhatsapp">
				<i class="fa fa-whatsapp">
					<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" fill="#128c7e" width="1em" height="1em"><path d="M25 2C12.318 2 2 12.318 2 25c0 3.96 1.023 7.854 2.963 11.29L2.037 46.73c-.096.343-.003.711.245.966.191.197.451.304.718.304.08 0 .161-.01.24-.029l10.896-2.699C17.463 47.058 21.21 48 25 48c12.682 0 23-10.318 23-23S37.682 2 25 2zm11.57 31.116c-.492 1.362-2.852 2.605-3.986 2.772-1.018.149-2.306.213-3.72-.231-.857-.27-1.957-.628-3.366-1.229-5.923-2.526-9.791-8.415-10.087-8.804-.295-.389-2.411-3.161-2.411-6.03s1.525-4.28 2.067-4.864c.542-.584 1.181-.73 1.575-.73s.787.005 1.132.021c.363.018.85-.137 1.329 1.001.492 1.168 1.673 4.037 1.819 4.33.148.292.246.633.05 1.022s-.294.632-.59.973-.62.76-.886 1.022c-.296.291-.603.606-.259 1.19s1.529 2.493 3.285 4.039c2.255 1.986 4.158 2.602 4.748 2.894.59.292.935.243 1.279-.146.344-.39 1.476-1.703 1.869-2.286s.787-.487 1.329-.292c.542.194 3.445 1.604 4.035 1.896.59.292.984.438 1.132.681.148.242.148 1.41-.344 2.771z"/></svg>
				</i>
			</a>
<a class="page-tools__tool js-share-popup page-tools__tool--pinterest d-none d-lg-block" data-share-url="http://pinterest.com/pin/create/button/?url=https%3a%2f%2fwww.chabadwestside.org%2ftemplates%2farticlecco_cdo%2faid%2f3045304%2fjewish%2fKi-Teitzei.htm%23utm_medium%3dpage_tools%26utm_content%3ddesktop%26utm_source%3dpinterest&amp;description=Ki+Teitzei+-+Chabad+of+the+West+Side">
				<i class="fa fa-pinterest"></i>
			</a>
<a class="page-tools__tool" onclick="showEmailLayer(this);">
<i class="fa fa-envelope"></i>
</a>
</div>
<div class="page-tools__section page-tools__section--other js-page-tool-other">
<div class="page-tools__tool popover-parent d-lg-block">
<div class="popover popover--right align_left nowrap">
<div class="popover__content">
<label class="bold bottom_margin block">
Print Options:
</label>
<form class="vcenter" name="print-form" onsubmit="coPrint(event, 66861);return false;">
<div>
<label><input type="checkbox" name="print-green"><span title="Save paper and ink">Print without images <i class="fa fa-leaf text-green"></i></span></label>
</div>
<br/>
<div class="center">
<button class="co-button page-tools__print-button">Print</button>
</div>
</form>
</div>
</div>
<i class="fa fa-print"></i>
</div>
</div>
</div>
<div class="js-fab-wrapper fab-wrapper">
<div class="fab">
<i class="fab-icon"></i>
</div>
</div>
</aside>
<!-- END CACHE -->
	</div>

	</div>

	<div id="BodyContainer">
		<div class="g960 footer">
			<div class="poweredby large_bottom_margin">
				


	<div class="footer3"><b>170 W 97th Street | New York, NY 10025-6450 | 212-864-5010 | 501c3 EIN 11-2735027</b></div>
	<img src="https://w2.chabad.org/images/global/spacer.gif" width="1" height="6" border="0" /><br />




Powered by <a href="https://www.chabad.org/" target="_new" class="">Chabad.org</a> &copy; 1993-2026 <a href="/4026210" target="_blank" class="privacy-link">Privacy Policy</a>




			</div>
		</div>
	</div>
	
	

	
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/os/jquery-latest.min.js?v=278824AF"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/co/dist/CoLib.js?v=CD6CB303"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/WebComponents/bundles/magen-cdo-global.js?v=C8425CA5"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/multimedia/infolayer.js?v=ED1B8531"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/article/comments/reply-form-controller.js?v=DC70C970"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/commentsloader.js?v=AD6AAB79"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/minisites.js?v=F38E4DA5"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/subscribeprompt.js?v=86D84DC2"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/modules/pagetools.js?v=930B07AB"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/custom/deprecated.js?v=D506A83E"></script>
<script type="text/javascript" src="https://w2.chabad.org/scripts/js/OverrideJSDocumentWrite.js?v=9A0227AA"></script><script>$j = $j.fn ? $j : jQuery;$j(()=>{$q.forEach(f=>{try{f.call(window);}catch(ex){console.error(ex);}});})</script>
	

<script  language="javascript" type="text/javascript"> Co.Settings      = {CacheClassName:'js-cache-default',MosadName:'Chabad of the West Side'}; Co.ArticleId     = '3045304';Co.SectionId     = 4462882;Co.PartnerSiteId = 0;Co.SiteId        = 168;Co.IsMobilePage  = false;Co.IsResponsive  = false;Co.DbDomain      = 'ChabadWestside.org';Co.LanguageCode  = '';Co.LoginStatus   = 'None';</script>
	
	












<script>
// This script applies specific CSS styles only when the user is on a designated URL.

// --- 1. Define the target URL ---
// The styles will only be added if the browser's current URL exactly matches this one.
const targetURL = 'https://www.chabadwestside.org/templates/articlecco_cdo/aid/4462882/jewish/Shul.htm';

// --- 2. Check if the current page is the target page ---
if (window.location.href === targetURL) {
    
    // --- 3. Combine all the CSS rules into a single string ---
    const styles = `
        .article_index_container .article_index.co_index .row .item:hover {
            transform: scale(1.05) !important;
            z-index: 10 !important;
        }
        .article_index_container .co_index.article_index .row .item .synopsis_icon {
            border-radius: 15px !important;
        }
        .article_index_container .article_index.co_index .row .item .title a:hover {
            background: unset !important;
        }
    `;

    // --- 4. Create a new <style> element ---
    const styleSheet = document.createElement("style");
    styleSheet.type = "text/css";
    styleSheet.innerText = styles;

    // --- 5. Add the new <style> element to the <head> of the document ---
    // This applies all the rules to the page.
    document.head.appendChild(styleSheet);
    
    console.log("Custom styles for Shul page have been applied.");

} else {
    console.log("Not on the target Shul page. Custom styles were not applied.");
}
</script><script>
    /* <-----------Upcoming Events---------> */
    // This script will only run on the exact homepage.
    if (window.location.pathname === '/' || window.location.pathname === '/default.aspx') {

        (function() {

            /**
             * Fetches and parses the events page HTML using promises.
             * @returns {Promise<Document | null>} A promise that resolves to a parsed HTML document or null on error.
             */
            function getEventsPage() {
                // Using a cache-busting parameter to ensure fresh data is fetched.
                const url = 'https://www.chabadwestside.org/templates/events.htm?t=' + new Date().getTime();
                return fetch(url)
                    .then(response => {
                        if (!response.ok) {
                            throw new Error(`HTTP error! status: ${response.status}`);
                        }
                        return response.text();
                    })
                    .then(htmlText => {
                        const parser = new DOMParser();
                        return parser.parseFromString(htmlText, 'text/html');
                    })
                    .catch(error => {
                        console.error("Error fetching events page:", error);
                        return null;
                    });
            }

            /**
             * A robust function to parse date strings like "Month Day, Year".
             * @param {string} dateStr - The date string (e.g., "July 29, 2025").
             * @returns {Date | null} A Date object or null if invalid.
             */
            function parseRobustDate(dateStr) {
                const months = {
                    january: 0,
                    february: 1,
                    march: 2,
                    april: 3,
                    may: 4,
                    june: 5,
                    july: 6,
                    august: 7,
                    september: 8,
                    october: 9,
                    november: 10,
                    december: 11
                };

                if (!dateStr) return null;

                // Clean the date string by removing commas and extra spaces.
                const cleanedStr = dateStr.replace(/,/g, '').trim().replace(/\s+/g, ' ');
                const parts = cleanedStr.split(' ');

                if (parts.length < 3) {
                    console.error("Date string could not be parsed into 3 parts:", `"${dateStr}"`, "->", `"${cleanedStr}"`);
                    return null;
                }

                const monthName = parts[0].toLowerCase();
                const day = parseInt(parts[1], 10);
                const year = parseInt(parts[2], 10);

                if (months.hasOwnProperty(monthName) && !isNaN(day) && !isNaN(year)) {
                    return new Date(year, months[monthName], day);
                } else {
                    console.error("Failed to create date from parts:", {
                        month: monthName,
                        day: day,
                        year: year
                    });
                    return null;
                }
            }
            
            /**
             * Parses a time string (e.g., "7:30pm") and applies it to a given date.
             */
            function parseTime(timeString, baseDate) {
                if (!timeString) return null;
                // Updated regex to handle uppercase AM/PM and potential missing space
                const timeMatch = timeString.toLowerCase().match(/(\d{1,2}):(\d{2})?\s*(am|pm)/);
                if (!timeMatch) return null;

                let hours = parseInt(timeMatch[1], 10);
                const minutes = timeMatch[2] ? parseInt(timeMatch[2], 10) : 0;
                const ampm = timeMatch[3];

                if (ampm === 'pm' && hours < 12) hours += 12;
                if (ampm === 'am' && hours === 12) hours = 0; // Midnight case

                const newDate = new Date(baseDate);
                newDate.setHours(hours, minutes, 0, 0);
                return newDate;
            }

            /**
             * Formats a Date object for Google Calendar links.
             */
            function formatGoogleDate(date) {
                if (!date) return '';
                return date.toISOString().replace(/-|:|\.\d{3}/g, '');
            }

            /**
             * Formats a date string like "Tuesday, July 29, 2025" to "TUESDAY JULY 29".
             * @param {string} dateStr - The raw date string from the event element.
             * @returns {string} The formatted date string.
             */
            function formatEventDate(dateStr) {
                if (!dateStr) return '';
                const parts = dateStr.split(','); // e.g., ["Tuesday", " July 29", " 2025"]
                if (parts.length < 2) return dateStr; // Fallback to original if format is unexpected
                // Combine Day (parts[0]) and Month Date (parts[1])
                return `${parts[0]}${parts[1]}`.trim().toUpperCase();
            }

            /**
             * The main function to create and inject the featured events section.
             */
            const runTransformation = () => {
                getEventsPage().then(eventsDocument => {
                    if (!eventsDocument) return;

                    const today = new Date();
                    today.setHours(0, 0, 0, 0);

                    const upcomingEvents = [];
                    // Select all date group containers
                    const allDateGroups = Array.from(eventsDocument.querySelectorAll('#calendar .list_item'));

                    for (const dateGroupEl of allDateGroups) {
                        // Stop looking for events if we already have 10
                        if (upcomingEvents.length >= 10) break;

                        const dateEl = dateGroupEl.querySelector('.date');
                        if (!dateEl) continue;

                        const dateText = dateEl.textContent.trim();
                        // Extract the part of the date string that parseRobustDate can handle (e.g., "August 2, 2025")
                        const parsableDateText = dateText.split(',').slice(1).join(',').trim();
                        const eventDate = parseRobustDate(parsableDateText);

                        // Check if the event is in the future or today
                        if (eventDate && eventDate >= today) {
                            // Find all individual events within this date group
                            const individualEventsInGroup = dateGroupEl.querySelectorAll('.category_item');
                            individualEventsInGroup.forEach(eventEl => {
                                // Add event to our list, but don't exceed 10
                                if (upcomingEvents.length < 10) {
                                    // Store the full date string on the element itself so we can retrieve it later
                                    eventEl.dataset.rawDate = dateText;
                                    // Store the date object (as string) for calendar links
                                    eventEl.dataset.eventDateObj = eventDate.toISOString();
                                    upcomingEvents.push(eventEl);
                                }
                            });
                        }
                    }
                    const featuredEvents = upcomingEvents;

                    if (featuredEvents.length === 0) {
                        console.log("No upcoming events found to display.");
                        return;
                    }

                    // Create a new 'div' element
                    const eventsSection = document.createElement('div');

                    // Set the class name for the element
                    eventsSection.className = 'injected-featured-events-section';

                    // Set the ID for the element
                    eventsSection.id = 'injected-upcoming-events-section';

                    eventsSection.innerHTML = `
                      <div class="injected-featured-events-header">
                        <h2>Upcoming Events</h2>
                        <p>Discover what's happening at Chabad Of The West Side.</p>
                      </div>
                    `;

                    const carouselContainer = document.createElement('div');
                    carouselContainer.className = 'injected-events-carousel-container';
                    const carouselWrapper = document.createElement('div');
                    carouselWrapper.className = 'injected-events-carousel-wrapper';

                    featuredEvents.forEach((eventEl) => {
                        const titleEl = eventEl.querySelector('.event_name');
                        const title = titleEl ? titleEl.textContent.trim() : 'Event Title';

                        // Retrieve the date from the dataset we attached earlier
                        const rawDate = eventEl.dataset.rawDate || '';
                        const formattedDate = formatEventDate(rawDate);
                        
                        // Retrieve the date object for calendar logic
                        const eventDateObj = new Date(eventEl.dataset.eventDateObj);

                        // Get the event time
                        const timeEl = eventEl.querySelector('.event_options > div');
                        let timeText = timeEl ? timeEl.textContent.trim().toUpperCase() : '';

                        // *** MODIFICATION: Add a space before AM/PM if it's missing ***
                        if (timeText) {
                            timeText = timeText.replace(/(\d)([AP]M)$/, '$1 $2');
                        }

                        // Combine date and time for the header
                        const cardHeader = timeText ? `${formattedDate} - ${timeText}` : formattedDate;

                        const descriptionEl = eventEl.querySelector('.event_wrapper > .event_info');
                        
                        // --- *** MODIFICATION: Get innerHTML to preserve paragraphs *** ---
                        const descriptionHTML = descriptionEl ? descriptionEl.innerHTML.trim() : '<p>Join us for a wonderful event.</p>';
                        // Get text-only description for calendar links
                        const descriptionText = descriptionEl ? descriptionEl.textContent.trim() : 'Join us for a wonderful event.';

                        const imageLinkEl = eventEl.querySelector('.more_info a');
                        const imageUrl = imageLinkEl ? imageLinkEl.href : `https://placehold.co/600x400/eee/ccc?text=Event+Image`;

                        // --- *** MODIFICATION: Add 5-digit ID check logic *** ---
                        let learnMoreUrl = '#';
                        const facebookLinkEl = eventEl.querySelector('a[href*="//www.facebook.com/events/"]');
                        if (facebookLinkEl) {
                            const fbHref = facebookLinkEl.href;
                            const match = fbHref.match(/events\/(\d+)/);
                            if (match && match[1]) {
                                const eventId = match[1];
                                if (/^\d{5}$/.test(eventId)) { // Check if ID is exactly 5 digits
                                    learnMoreUrl = `https://www.chabadwestside.org/tools/events/register_cdo/eventid/${eventId}`;
                                } else {
                                    // Original logic for other cases
                                    learnMoreUrl = `https://www.chabadwestside.org/templates/articlecco_cdo/aid/${eventId}`;
                                }
                            }
                        }

                        // --- *** MODIFICATION: Add Calendar Link Logic *** ---
                        let location = 'westside Chabad';
                        const locationEl = eventEl.querySelector('a[href*="maps.google.com"]');
                        if (locationEl) {
                            const tempDiv = document.createElement('div');
                            tempDiv.innerHTML = locationEl.innerHTML.replace(/<br\s*\/?>/gi, ' ');
                            location = tempDiv.textContent.replace(/\s+/g, ' ').trim();
                        }
                        
                        let googleCalLink = '';
                        if (timeText) {
                            const startTime = parseTime(timeText, eventDateObj);
                            if (startTime) {
                                const endTime = new Date(startTime.getTime() + 90 * 60000); // Assume 90 min duration
                                const googleDates = formatGoogleDate(startTime) + '/' + formatGoogleDate(endTime);
                                const params = new URLSearchParams({
                                    action: 'TEMPLATE',
                                    text: title,
                                    dates: googleDates,
                                    details: descriptionText,
                                    location: location,
                                });
                                googleCalLink = `https://www.google.com/calendar/render?${params.toString()}`;
                            }
                        }

                        const calendarLinkEl = eventEl.querySelector('a[href*="eventexport.asp"]');
                        const icsLink = calendarLinkEl ? `https://www.chabadwestside.org${calendarLinkEl.getAttribute('href')}` : null;
                        // --- *** END MODIFICATION *** ---


                        const card = document.createElement('div');
                        card.className = 'injected-event-card';
                        // Use the new cardHeader variable
                        card.innerHTML = `
                          <div class="event-card-header">${cardHeader}</div>
                          <div class="event-card-image">
                              <img src="${imageUrl}" alt="${title}" onerror="this.onerror=null;this.src='https://placehold.co/600x400/eee/ccc?text=Image+Not+Found';">
                          </div>
                          <div class="event-card-body">
                              <h3>${title.toUpperCase()}</h3>
                              <!-- *** MODIFICATION: Use a div to hold the description HTML *** -->
                              <div class="event-description-content">${descriptionHTML}</div>
                              
                              <!-- *** MODIFICATION: Create ONE button container *** -->
                              <div class="event-card-buttons-container">
                                <a href="${learnMoreUrl}" class="event-card-button">Learn More →</a>
                                ${googleCalLink ? `<a href="${googleCalLink}" target="_blank" class="event-card-calendar-button">Add to Google Calendar</a>` : ''}
                                ${icsLink ? `<a href="${icsLink}" class="event-card-calendar-button">Add to Apple/Outlook</a>` : ''}
                              </div>
                          </div>
                        `;
                        carouselWrapper.appendChild(card);
                    });

                    // Add the "View All Events" card at the end
                    const viewAllCard = document.createElement('a');
                    viewAllCard.className = 'injected-event-card view-all-card';
                    // --- *** MODIFICATION: Update "View All" URL *** ---
                    viewAllCard.href = 'https://www.chabadwestside.org/templates/articlecco_cdo/aid/7032786/jewish/Upcoming-Events.htm';
                    viewAllCard.innerHTML = `
                      <div class="view-all-content">
                        <h3>View All</h3>
                        <p>Upcoming Events</p>
                        <span class="view-all-arrow">→</span>
                      </div>
                    `;
                    carouselWrapper.appendChild(viewAllCard);


                    carouselContainer.appendChild(carouselWrapper);
                    eventsSection.appendChild(carouselContainer);

                    const swipeHint = document.createElement('div');
                    swipeHint.className = 'mobile-swipe-hint';
                    swipeHint.innerHTML = '<span>Swipe for more events</span> <span class="arrow">→</span>';
                    eventsSection.appendChild(swipeHint);

                    if (featuredEvents.length > 3) {
                        const prevButton = document.createElement('button');
                        prevButton.className = 'events-carousel-arrow prev';
                        prevButton.innerHTML = '❮';

                        const nextButton = document.createElement('button');
                        nextButton.className = 'events-carousel-arrow next';
                        nextButton.innerHTML = '❯';

                        carouselContainer.appendChild(prevButton);
                        carouselContainer.appendChild(nextButton);

                        let currentIndex = 0;
                        const itemsToShowDesktop = 3;
                        const totalItems = carouselWrapper.children.length;

                        const updateCarousel = () => {
                            if (carouselWrapper.children.length === 0) return;
                            const cardWidth = carouselWrapper.children[0].offsetWidth;
                            const gap = 30;
                            const totalMove = (cardWidth + gap) * currentIndex;
                            carouselWrapper.style.transform = `translateX(-${totalMove}px)`;

                            prevButton.disabled = currentIndex === 0;
                            nextButton.disabled = currentIndex >= totalItems - itemsToShowDesktop;
                        };

                        prevButton.addEventListener('click', () => {
                            if (currentIndex > 0) {
                                currentIndex--;
                                updateCarousel();
                            }
                        });

                        nextButton.addEventListener('click', () => {
                            if (currentIndex < totalItems - itemsToShowDesktop) {
                                currentIndex++;
                                updateCarousel();
                            }
                        });

                        updateCarousel();
                        // Recalculate on resize to handle responsive changes
                        window.addEventListener('resize', updateCarousel);
                    }

                    // --- *** MODIFICATION: Use a more stable selector *** ---
                    // Find the "Mailing List" widget to insert *before* it.
                    const mailingListElement = document.querySelector('div.widget-4.message.custom.feed');
                    if (mailingListElement) {
                        // Find the parent ".hp-row" container for the mailing list
                        const targetRow = mailingListElement.closest('.hp-row');
                        if (targetRow && targetRow.parentElement) {
                            // Insert the new events section *before* the mailing list row
                            targetRow.parentElement.insertBefore(eventsSection, targetRow);
                        } else {
                            console.error("Could not find parent '.hp-row' for mailing list. Appending to body as a fallback.");
                            document.body.appendChild(eventsSection);
                        }
                    } else {
                        console.error("Target element 'div.widget-4.message.custom.feed' (mailing list) not found. Appending to body as a fallback.");
                        document.body.appendChild(eventsSection);
                    }
                    // --- *** END MODIFICATION *** ---
                });
            };

            const injectCSS = () => {
                const style = document.createElement('style');
                style.textContent = `
                    @import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700;900&display=swap');

                    .injected-featured-events-section { padding: 60px 20px; background-color: #f0f2f5; font-family: 'Raleway', sans-serif; box-sizing: border-box; }
                    .injected-featured-events-header { text-align: center; margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }
                    .injected-featured-events-header h2 { font-size: 36px; font-weight: 900; color: #2F3C4D; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; font-family: 'Raleway'; }
                    .injected-featured-events-header p { font-size: 16px; color: #666; line-height: 1.6; }
                    .injected-events-carousel-container { position: relative; max-width: 1200px; margin: 0 auto; overflow: hidden; }
                    .injected-events-carousel-wrapper { display: flex; gap: 30px; transition: transform 0.5s ease-in-out; }
                    .injected-event-card { flex: 0 0 calc(33.333% - 20px); background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 25px rgba(0,0,0,0.08); box-sizing: border-box; display: flex; flex-direction: column; }
                    .event-card-header { padding: 8px 15px; font-weight: 700; font-size: 12px; color: #777; background: #f9f9f9; border-bottom: 1px solid #eee; text-align: center; white-space: nowrap; }
                    .event-card-image img { width: 100%; height: 200px; object-fit: cover; display: block; background-color: #eee; }
                    .event-card-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
                    .event-card-body h3 { font-size: 16px; font-weight: 700; color: #333; margin: 0 0 10px; height: 48px; overflow: hidden; }
                    
                    /* --- *** MODIFICATION: Replaced .event-card-body p with this block *** --- */
                    .event-description-content {
                        font-size: 15px;
                        color: #666;
                        line-height: 1.6;
                        margin: 0 0 20px;
                        flex-grow: 1;
                        /* Removed overflow: hidden to allow text to wrap and grow */
                    }
                    /* This styles any paragraphs *inside* the description */
                    .event-description-content p, .event-description-content div {
                        margin-bottom: 1em; /* Adds spacing between paragraphs */
                    }
                    .event-description-content p:last-child, .event-description-content div:last-child {
                        margin-bottom: 0; /* No margin on the very last paragraph */
                    }
                    /* --- *** END MODIFICATION *** --- */

                    /* --- *** MODIFICATION: Updated main button style *** --- */
                    .event-card-button { 
                        display: inline-block; 
                        background-color: #b99362; 
                        color: white; 
                        padding: 10px 20px; 
                        border-radius: 5px; 
                        text-decoration: none; 
                        font-weight: 800; 
                        transition: background-color 0.2s, border-color 0.2s; 
                        font-size: 13.88px; 
                        line-height: 140%; 
                        border: 1px solid #b99362;
                        text-align: center;
                    }
                    .event-card-button:hover { 
                        background-color: #a38258; 
                        border-color: #a38258;
                    }
                    
                    /* --- *** MODIFICATION: Add styles for button container & calendar buttons *** --- */
                    .event-card-buttons-container {
                        display: flex;
                        flex-wrap: wrap;
                        gap: 10px;
                        align-items: center;
                        margin-top: auto; /* Pushes the container to the bottom */
                        padding-top: 15px;
                        border-top: 1px solid #eee;
                    }
                    .event-card-calendar-button {
                        padding: 10px 20px;
                        border-radius: 5px;
                        text-align: center;
                        cursor: pointer;
                        transition: background-color 0.3s ease, border-color 0.3s ease;
                        text-decoration: none !important;
                        display: inline-block;
                        font-size: 13.88px;
                        font-weight: 800;
                        line-height: 140%;
                        color: rgb(47, 60, 77);
                        background-color: transparent;
                        border: 1px solid #ddd;
                        box-sizing: border-box;
                    }
                    .event-card-calendar-button:hover {
                       background-color: #f7f7f7;
                    }
                    /* --- *** END MODIFICATION *** --- */

                    .events-carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(255, 255, 255, 0.9); border: none; border-radius: 50%; width: 44px; height: 44px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #333; z-index: 10; transition: all 0.2s; }
                    .events-carousel-arrow:hover { background-color: white; transform: translateY(-50%) scale(1.05); }
                    .events-carousel-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
                    .events-carousel-arrow.prev { left: 0px; }
                    .events-carousel-arrow.next { right: 0px; }

                    /* Styles for the 'View All' card */
                    .view-all-card { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; background-color: #e8ebee; transition: background-color 0.3s, box-shadow 0.3s; }
                    .view-all-card:hover { background-color: #dbe0e6; box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
                    .view-all-card .view-all-content { display: flex; flex-direction: column; justify-content: center; align-items: center; }
                    .view-all-card .view-all-content h3, .view-all-card .view-all-content p { height: auto; overflow: visible; margin: 0; }
                    .view-all-card .view-all-content h3 { font-size: 24px; font-weight: 900; color: #2F3C4D; margin-bottom: 5px; text-transform: uppercase; }
                    .view-all-card .view-all-content p { font-size: 16px; color: #666; margin-bottom: 15px; }
                    .view-all-card .view-all-arrow { font-size: 36px; font-weight: bold; color: #b99362; line-height: 1; }
                    
                    .mobile-swipe-hint { display: none; text-align: center; margin-top: 20px; font-family: 'Raleway', sans-serif; color: #555; font-size: 14px; align-items: center; justify-content: center; gap: 8px; }
                    .mobile-swipe-hint .arrow { font-size: 18px; line-height: 1; font-weight: bold; }

                    @media (max-width: 1200px) {
                      .events-carousel-arrow.prev { left: 15px; }
                      .events-carousel-arrow.next { right: 15px; }
                    }
                    @media (max-width: 900px) {
                      .injected-event-card { flex-basis: calc(50% - 15px); }
                    }
                    
                    @media (max-width: 600px) {
                      .injected-featured-events-header h2 { font-size: 28px; }
                      .injected-events-carousel-container { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; padding: 0 20px; margin: 0 -20px; }
                      .injected-events-carousel-container::-webkit-scrollbar { display: none; }
                      .injected-events-carousel-wrapper { width: max-content; transform: none !important; padding-right: 20px; }
                      .injected-event-card { flex-basis: 80vw; scroll-snap-align: start; }
                      .events-carousel-arrow { display: none; }
                      .mobile-swipe-hint { display: flex; }
                      
                      /* --- *** MODIFICATION: Stack buttons on mobile *** --- */
                      .event-card-buttons-container {
                          flex-direction: column;
                          align-items: stretch;
                      }
                      .event-card-button, .event-card-calendar-button {
                          width: 100%;
                      }
                    }
                  `;
                document.head.appendChild(style);
            };

            // Wait for the DOM to be ready before running the script
            if (document.readyState === 'complete' || document.readyState === 'interactive') {
                runTransformation();
            } else {
                window.addEventListener('DOMContentLoaded', runTransformation);
            }

            injectCSS();

        })();
    }
</script><script>
document.addEventListener('DOMContentLoaded', function() {
    /**
     * This script adds a new top-level tab for "Visitor Information"
     * to the main navigation menu, placing it before the "About" tab.
     */

    // 1. Find the "About" tab, which we'll use as a reference point for insertion.
    const aboutTab = document.querySelector('td.co_menu_item[aid="4461917"]');

    // 2. Check if the "About" tab exists to ensure we're on the right page.
    if (aboutTab && aboutTab.parentNode) {
        const menuRow = aboutTab.parentNode; // This is the <tr> containing all the tabs.

        // 3. Define the properties for the new tab.
        const tabLink = "/templates/articlecco_cdo/aid/2252272/jewish/Visitor-Information.htm";
        const tabText = "Visitor Information";
        const tabAid = "2252272";

        // 4. Create the new table cell (<td>) for the "Visitor Information" tab.
        const visitorTab = document.createElement('td');
        visitorTab.className = "co_menu_item";
        visitorTab.setAttribute('aid', tabAid);
        visitorTab.setAttribute('data-menu-level', '1');
        visitorTab.setAttribute('onmouseover', "this.className += ' hover';");
        visitorTab.setAttribute('onmouseout', "this.className = this.className.replace(/\\shover/gi, '');");
        visitorTab.style.visibility = 'visible';

        // 5. Populate the new tab with the necessary HTML structure for a simple link.
        // This structure mimics the other simple tabs in the navigation bar.
        visitorTab.innerHTML = `
            <div class="co_menu_content">
                <div class="co_submenu_container" style="width:auto;display:none;clip:rect(auto auto 0px auto);">
                    <div class="wrapper">
                        <div class="column_wrapper clearfix" style="height:100%;"></div>
                        <div class="break_floats"></div>
                    </div>
                </div>
            </div>
            <span class="parent">
                <div>
                    <a href="${tabLink}" class="parent">${tabText}</a>
                </div>
            </span>
            <a href="${tabLink}" class="bg_extension js-parent-menu-link" data-aid="${tabAid}"></a>
        `;

        // 6. Create the divider that will appear after the new tab.
        const divider = document.createElement('td');
        divider.className = "co_menu_item_divider";
        divider.style.visibility = 'visible';
        divider.innerHTML = '<img src="https://w2.chabad.org/images/global/spacer.gif" width="2" height="1" border="0">';

        // 7. Insert the new tab and the new divider into the menu row right before the "About" tab.
        menuRow.insertBefore(visitorTab, aboutTab);
        menuRow.insertBefore(divider, aboutTab);

    } else {
        // Log a message for debugging if the "About" tab isn't found.
        console.log("Could not find the 'About' menu tab to insert the new tab.");
    }
});
</script>
</body>
</html>