<link rel="icon" href="/common/imgs/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/common/imgs/favicon.ico" type="image/x-icon">
<link rel="alternate" type="application/rss+xml" title="This Week at Carnegie Hall" href="/UpcomingEvents.xml"/>
<script language = "JavaScript" type = "text/javascript" >

<!--// Preload Images-->
       function seriesTdcUrl(perfCode) {
       <%
           CHConfigReader
           clu57ConfigReader = CHConfigReader.getInstance();
           org.carnegiehall.CarnegieDBAccess cdbaSeries = new org.carnegiehall.CarnegieDBAccess();
           String clubBuyButtonUrl = null;
           String clubBrochureSeason = clu57ConfigReader.readBrochureSeason();
           String seriesBuyerCode = "ZT";
           String currpage_timestamp_series = formatTimestamp(new java.util.Date());
           String bcode_series = null;
           String seasonEndYear = "2007";

           if (session.getAttribute("AccNum") != null) {
               if (!org.carnegiehall.util.StringHelper.isEmptyString(session.getAttribute("AccNum").toString())) {
                   seriesBuyerCode = cdbaSeries.checkSubscriptionPurchase(session.getAttribute("AccNum").toString(), clubBrochureSeason);
               }
           }

           bcode_series = pcip.encryptPatronid(seriesBuyerCode + "|" + currpage_timestamp_series);
           bcode_series = URLHelper.URLEncode(bcode_series);
           if ("".equals(tck_user_context) || tck_user_context == null) {
               clubBuyButtonUrl = "\"" + clu57ConfigReader.readTDCPurchaseUrl() + "perfsubcode=" + seasonEndYear + "&patronid=" + patronidh + "&bcode=" + bcode_series + "&oid=" + tck_oid + "&jsessionid=" + session.getId() + "&perfcode=\"";
           } else {
               clubBuyButtonUrl = "\"" + clu57ConfigReader.readTDCPurchaseUrl() + "perfsubcode=" + seasonEndYear + "&patronid=" + patronidh + "&bcode=" + bcode_series + "&oid=" + tck_oid + "&user_context=" + tck_user_context + "&jsessionid=" + session.getId() + "&perfcode=\"";
           }
       %>
           var series_url = <%=clubBuyButtonUrl%> + perfCode;
           location.href = series_url;
       }

imgList = new Array ('nav_Subscriptions', 'nav_BoxOffice', 'nav_CHLogo', 'nav_DonateNow', 'nav_Podcasts', 'nav_ExploreandLearn', 'nav_Newsletter', 'nav_Calendar', 'nav_Search', 'nav_SupportTheHall', 'nav_TheBasics', 'nav_ViewCart' <%=imgArray%>);
for (i = 0; i < imgList.length; i++) {
    eval(imgList[i] + "_off = new Image; " + imgList[i] + "_off.src = '/common/imgs/" + imgList[i] + "_off.gif';");
    eval(imgList[i] + "_on = new Image; " + imgList[i] + "_on.src = '/common/imgs/" + imgList[i] + "_on.gif';");
}

function popUPcenter(url, target, w, h) {
    putItCenter = window.open(url, target, 'width=' + w + ',height=' + h + ',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=' + ((screen.availWidth - w - 10) * .5) + ',top=' + ((screen.availHeight - h - 30) * .5));
    putItCenter.focus();
}

function changeBGon(id,state){
			var cell = document.getElementById(id);
			cell.bgColor = "#E6E6E6";
			return true;
}
function changeBGoff(id,state){
			var cell = document.getElementById(id);
			cell.bgColor = "#ffffff";
			return true;
}

function promowindow(url, attrib) {
    window.open(url, '', attrib);
}

var mediaWindow = '';

function mediaPlayer(PlayerURL,PlayerName,PlayerAttributes) {
    mediaWindow = window.open(PlayerURL,PlayerName,PlayerAttributes);
    mediaWindow.focus();    
}

function changeLocation() {
    document.search_form.location[0].checked = false;
    document.search_form.location[1].checked = false;
    document.search_form.location[2].checked = false;
    document.search_form.location[3].checked = false;
    document.search_form.location[4].checked = false;
    document.search_form.location[5].checked = false;
    document.search_form.location[6].checked = false;
    document.search_form.location[7].checked = false;
    document.search_form.location[8].checked = false;
}

function changeSpace(elementnumber) {
    if (document.search_form.location[elementnumber].checked == true) {
        document.search_form.space[1].checked = true
    }
}

function roll(img) {
    eval("document.images['" + img + "'].src =" + img + "_on.src;");
}

function unroll(img) {
    eval("document.images['" + img + "'].src =" + img + "_off.src;");
}

function checkMaxLength(textarea, evt, maxLength) {
    if (textarea.selected && evt.shiftKey) {
        // ignore shift click for select
        return true;
        var allowKey = false;
        if (textarea.selected && textarea.selectedLength > 0) {
            allowKey = true;
        } else {
            var keyCode = document.layers ? evt.which : evt.keyCode;
            if (keyCode < 32 && keyCode != 13) {
                allowKey = true;
            } else {
                allowKey = textarea.value.length < maxLength;
            }
            textarea.selected = false;
            return allowKey;
        }
    }
}


function sessionUrl(perfcode, perfsubcode, patronid, bcode) {
    location.href = '/servlet/SessionInfoAppender?perfcode=' + perfcode + '&perfsubcode=' + perfsubcode + '&patronid=' + patronid + '&bcode=' + bcode;
}

//This code to format the dates

<!-- This script appends session info to TDC Url -->

function appendTdcUrl() {
<%
    String user_context = null,orderkey = null,oid = null,timestamp = null,patronid = null,url_param = null;
    try {

        if (session.isNew()) {
            timestamp = formatTimestamp(new java.util.Date());
            session.putValue("timestamp", timestamp);
            session.putValue("first_time", "yes");
            if (patronid == null)
                patronid = "0";
            patronid = patronid + "|" + timestamp;
            patronid = pcip.encryptPatronid(patronid);
            patronid = URLHelper.URLEncode(patronid);
            url_param = "perfcode=FW0630&perfsubcode=2007" + "&patronid=" + patronid + "&sessionid=" + session.getId();
        } else {
            patronid = (String)
            session.getValue("patronid");
            timestamp = (String)
            session.getValue("timestamp");
            if (timestamp == null) {
                timestamp = formatTimestamp(new java.util.Date());
                session.putValue("timestamp", timestamp);
            }
            if (patronid == null)
                patronid = "0";
            patronid = patronid + "|" + timestamp;
            patronid = pcip.encryptPatronid(patronid);
            patronid = URLHelper.URLEncode(patronid);

            if (session.getValue("first_time") != null) {
                if (session.getValue("first_time").equals("no")) {
                    orderkey = (String)
                    session.getValue("orderid");
                    oid = URLHelper.URLEncode((String)session.getValue("oid"));
                    user_context = (String)
                    session.getValue("tck_sessionid");
                    url_param = "perfcode=FW0630&perfsubcode=2007" + "&sessionid=" + session.getId() + "&patronid=" + patronid + "&orderkey=" + orderkey + "&oid=" + oid + "&usercontext=" + user_context;
                } else url_param = "perfcode=FW0630&perfsubcode=2007" + "&sessionid=" + session.getId() + "&patronid=" + patronid;
            } else
                url_param = "perfcode=FW0630&perfsubcode=2007" + "&sessionid=" + session.getId() + "&patronid=" + patronid;
        }
    } catch(Exception e) {}
%>


    var tdc_url = "http://purchase.tickets.com/buy/TicketPurchase?agency=CARNEGIE_HALL&orgid=1107&trxstate=10&" + "<%=url_param%>";
    location.href = tdc_url;
}

//WMI Scripts

<!-- This script validates registration form input -->

function WmiVerifyForm(form) {
okToSubmit = false;
		
if(form.first_name.value) {
if(form.last_name.value) {
if(form.email.value) {
if(form.company.value) {
if(form.street.value) {
if(form.zip.value) { 
if(form.phone.value) {
if(form.fax.value) {
if(form['00N30000001VMQ7'].value) {
if(form['00N30000001VMQC'].value) {
if(form['00N30000001Vfq5'].value) {
if(form['00N30000001VMVh'].value) {
if(form.email.value == form.emailConfirm.value)
{
okToSubmit = true; 
}
else { alert("Please make sure your email address matches the confirmed email address."); } 
} else { alert("Please tell us the date and time of the performance you would like to attend."); }
} else { alert("Please tell us the date and time of the workshop you would like to attend."); }
} else { alert("Please provide us with the number of chaperones in your group."); }
} else { alert("Please provide us with the number of students in your group."); }
} else { alert("Please provide us with your school's fax number."); }
} else { alert("Please provide us with your school's phone number."); }
} else { alert("Please provide us with your school's zip code."); }
} else { alert("Please provide us with your school's address."); }
} else { alert("Please provide us with your school's name."); }
} else { alert("Please provide us with your email address."); }
} else { alert("Please provide us with your last name."); }
} else { alert("Please provide us with your first name."); }
		
return(okToSubmit);
}
</script>

