// flex pass form js var prices = new Array(); var tick_count, price, hidPrice, ticketSub, hiddenTicketsSubtotal, num_tickets, donSub, hiddenDonationSubtotal, subtotalSub, hiddenSubtotal, savings, saving, hiddenSavings, totalSub, hiddenTotal; // show/date array var show_array = new Array(); show_array[0] = [""]; show_array[1] = [ // holes ["Sat, September 25, 2010 at 5:00pm","2010-09-25 17:00:00"], ["Sun, September 26, 2010 at 7:00pm","2010-09-26 19:00:00"], ["Tue, September 28, 2010 at 7:30pm","2010-09-28 19:30:00"], ["Thu, September 30, 2010 at 2:00pm","2010-09-30 14:00:00"], ["Fri, October 1, 2010 at 7:30pm","2010-10-01 19:30:00"], ["Sun, October 3, 2010 at 2:00pm","2010-10-03 14:00:00"], ["Wed, October 6, 2010 at 6:30pm","2010-10-06 18:30:00"], ["Fri, October 8, 2010 at 7:30pm","2010-10-08 19:30:00"], ["Sat, October 9, 2010 at 5:00pm","2010-10-09 17:00:00"], ["Sat, October 9, 2010 at 9:00pm","2010-10-09 21:00:00"], ["Sun, October 10, 2010 at 2:00pm","2010-10-10 14:00:00"], ["Wed, October 13, 2010 at 7:30pm","2010-10-13 19:30:00"], ["Fri, October 15, 2010 at 7:30pm","2010-10-15 19:30:00"], ["Sat, October 16, 2010 at 4:00pm","2010-10-16 16:00:00"], ["Sat, October 16, 2010 at 8:00pm","2010-10-16 20:00:00"], ["Sun, October 17, 2010 at 2:00pm","2010-10-17 14:00:00"], ["Thu, October 21, 2010 at 7:30pm","2010-10-21 19:30:00"], ["Sat, October 23, 2010 at 1:00pm","2010-10-23 13:00:00"], ["Sat, October 23, 2010 at 5:00pm","2010-10-23 17:00:00"], ["Tue, October 26, 2010 at 6:30pm","2010-10-26 18:30:00"], ["Thu, October 28, 2010 at 7:30pm","2010-10-28 19:30:00"], ["Sat, October 30, 2010 at 1:00pm","2010-10-30 13:00:00"], ["Sat, October 30, 2010 at 5:00pm","2010-10-30 17:00:00"], ["Thu, November 4, 2010 at 7:30pm","2010-11-04 19:30:00"], ["Fri, November 5, 2010 at 7:30pm","2010-11-05 19:30:00"], ["Sat, November 6, 2010 at 5:00pm","2010-11-06 17:00:00"] ]; // holes show_array[2] = [ // mary's wedding ["Wed, November 3, 2010 at 6:30pm","2010-11-03 18:30:00"], ["Thu, November 4, 2010 at 7:30pm","2010-11-04 19:30:00"], ["Fri, November 5, 2010 at 7:30pm","2010-11-05 19:30:00"], ["Sat, November 6, 2010 at 1:00pm","2010-11-06 13:00:00"], ["Sat, November 6, 2010 at 5:00pm","2010-11-06 17:00:00"], ["Sun, November 7, 2010 at 2:00pm","2010-11-07 14:00:00"], ["Tue, November 9, 2010 at 7:30pm","2010-11-09 19:30:00"], ["Thu, November 11, 2010 at 7:30pm","2010-11-11 19:30:00"], ["Fri, November 12, 2010 at 7:30pm","2010-11-12 19:30:00"], ["Sat, November 13, 2010 at 5:00pm","2010-11-13 17:00:00"], ["Sat, November 13, 2010 at 9:00pm","2010-11-13 21:00:00"], ["Sun, November 14, 2010 at 2:00pm","2010-11-14 14:00:00"], ["Thu, November 18, 2010 at 2:00pm","2010-11-18 14:00:00"], ["Thu, November 18, 2010 at 7:30pm","2010-11-18 19:30:00"], ["Fri, November 19, 2010 at 7:30pm","2010-11-19 19:30:00"], ["Sat, November 20, 2010 at 1:00pm","2010-11-20 13:00:00"], ["Sat, November 20, 2010 at 5:00pm","2010-11-20 17:00:00"], ["Sun, November 21, 2010 at 2:00pm","2010-11-21 14:00:00"], ["Tue, November 23, 2010 at 6:30pm","2010-11-23 18:30:00"], ["Fri, November 26, 2010 at 8:00pm","2010-11-26 20:00:00"], ["Sat, November 27, 2010 at 4:00pm","2010-11-27 16:00:00"], ["Sat, November 27, 2010 at 8:00pm","2010-11-27 20:00:00"], ["Sun, November 28, 2010 at 2:00pm","2010-11-28 14:00:00"], ["Sun, November 28, 2010 at 7:00pm","2010-11-28 19:00:00"], ["Wed, December 1, 2010 at 7:30pm","2010-12-01 19:30:00"], ["Thu, December 2, 2010 at 2:00pm","2010-12-02 14:00:00"], ["Thu, December 2, 2010 at 7:30pm","2010-12-02 19:30:00"], ["Fri, December 3, 2010 at 7:30pm","2010-12-03 19:30:00"], ["Sat, December 4, 2010 at 5:00pm","2010-12-04 17:00:00"] ]; // mary's wedding show_array[3] = [ // a christmas carol ["Fri, November 26, 2010 at 5:00pm","2010-11-26 17:00:00"], ["Sat, November 27, 2010 at 3:00pm","2010-11-27 15:00:00"], ["Sat, November 27, 2010 at 7:00pm","2010-11-27 19:00:00"], ["Sun, November 28, 2010 at 3:00pm","2010-11-28 15:00:00"], ["Fri, December 3, 2010 at 7:00pm","2010-12-03 19:00:00"], ["Sat, December 4, 2010 at 3:00pm","2010-12-04 15:00:00"], ["Sat, December 4, 2010 at 7:00pm","2010-12-04 19:00:00"], ["Sun, December 5, 2010 at 3:00pm","2010-12-05 15:00:00"], ["Fri, December 10, 2010 at 7:00pm","2010-12-10 19:00:00"], ["Sat, December 11, 2010 at 3:00pm","2010-12-11 15:00:00"], ["Sat, December 11, 2010 at 7:00pm","2010-12-11 19:00:00"], ["Sun, December 12, 2010 at 3:00pm","2010-12-12 15:00:00"], ["Fri, December 17, 2010 at 7:00pm","2010-12-17 19:00:00"], ["Sat, December 18, 2010 at 3:00pm","2010-12-18 15:00:00"], ["Sat, December 18, 2010 at 7:00pm","2010-12-18 19:00:00"], ["Sun, December 19, 2010 at 2:00pm","2010-12-19 14:00:00"], ["Sun, December 19, 2010 at 5:00pm","2010-12-19 17:00:00"], ["Tue, December 21, 2010 at 7:00pm","2010-12-21 17:00:00"], ["Wed, December 22, 2010 at 7:00pm","2010-12-22 19:00:00"], ["Thu, December 23, 2010 at 7:00pm","2010-12-23 19:00:00"], ["Fri, December 24, 2010 at 3:00pm","2010-12-24 15:00:00"], ["Sun, December 26, 2010 at 2:00pm","2010-12-26 14:00:00"], ["Sun, December 26, 2010 at 5:00pm","2010-12-26 17:00:00"] ]; // a christmas carol show_array[4] = [ // the diary of anne frank ["Tue, January 18, 2011 at 7:30pm","2011-01-18 19:30:00"], ["Wed, January 19, 2011 at 6:30pm","2011-01-19 18:30:00"], ["Thu, January 20, 2011 at 7:30pm","2011-01-20 19:30:00"], ["Fri, January 21, 2011 at 7:30pm","2011-01-21 19:30:00"], ["Sat, January 22, 2011 at 1:00pm","2011-01-22 13:00:00"], ["Sat, January 22, 2011 at 5:00pm","2011-01-22 17:00:00"], ["Sun, January 23, 2011 at 2:00pm","2011-01-23 14:00:00"], ["Fri, January 28, 2011 at 7:30pm","2011-01-28 19:30:00"], ["Sat, January 29, 2011 at 9:00pm","2011-01-29 21:00:00"], ["Sun, January 30, 2011 at 2:00pm","2011-01-30 14:00:00"], ["Sun, January 30, 2011 at 7:00pm","2011-01-30 19:00:00"], ["Thu, February 3, 2011 at 7:30pm","2011-02-03 19:30:00"], ["Fri, February 4, 2011 at 7:30pm","2011-02-04 19:30:00"], ["Sat, February 5, 2011 at 5:00pm","2011-02-05 17:00:00"], ["Sun, February 6, 2011 at 2:00pm","2011-02-06 14:00:00"], ["Tue, February 8, 2011 at 6:30pm","2011-02-08 18:30:00"], ["Thu, February 10, 2011 at 2:00pm","2011-02-10 14:00:00"], ["Sat, February 12, 2011 at 4:00pm","2011-02-12 16:00:00"], ["Sat, February 12, 2011 at 8:00pm","2011-02-12 20:00:00"], ["Wed, February 16, 2011 at 7:30pm","2011-02-16 19:30:00"], ["Sat, February 19, 2011 at 5:00pm","2011-02-19 17:00:00"], ["Thu, February 24, 2011 at 7:30pm","2011-02-24 19:30:00"] ]; // the diary of anne frank show_array[5] = [ // going solo: neat ["Thu, February 10, 2011 at 7:30pm","2011-02-10 19:30:00"], ["Fri, February 11, 2011 at 7:30pm","2011-02-11 19:30:00"], ["Sun, February 13, 2011 at 7:00pm","2011-02-13 19:00:00"], ["Tue, February 15, 2011 at 7:30pm","2011-02-15 19:30:00"], ["Sat, February 19, 2011 at 5:00pm","2011-02-19 17:00:00"], ["Sun, February 20, 2011 at 2:00pm","2011-02-20 14:00:00"], ["Sat, February 26, 2011 at 8:00pm","2011-02-26 20:00:00"], ["Thu, March 3, 2011 at 2:00pm","2011-03-03 14:00:00"], ["Thu, March 3, 2011 at 7:30pm","2011-03-03 19:30:00"], ["Fri, March 4, 2011 at 7:30pm","2011-03-04 19:30:00"], ["Sat, March 5, 2011 at 5:00pm","2011-03-05 17:00:00"], ["Sun, March 6, 2011 at 2:00pm","2011-03-06 14:00:00"] ]; // going solo: neat show_array[6] = [ // going solo: fire in the garden ["Sat, February 12, 2011 at 5:00pm","2011-02-12 17:00:00"], ["Wed, February 16, 2011 at 6:30pm","2011-02-16 18:30:00"], ["Fri, February 18, 2011 at 7:30pm","2011-02-18 19:30:00"], ["Sat, February 19, 2011 at 9:00pm","2011-02-19 21:00:00"], ["Sun, February 20, 2011 at 5:00pm","2011-02-20 17:00:00"], ["Tue, February 22, 2011 at 6:30pm","2011-02-22 18:30:00"], ["Wed, February 23, 2011 at 7:30pm","2011-02-23 19:30:00"], ["Thu, February 24, 2011 at 7:30pm","2011-02-24 19:30:00"], ["Sat, February 26, 2011 at 4:00pm","2011-02-26 16:00:00"], ["Sun, February 27, 2011 at 2:00pm","2011-02-27 14:00:00"], ["Sun, February 27, 2011 at 5:00pm","2011-02-27 17:00:00"] ]; // going solo: fire in the garden show_array[7] = [ // going solo: in acting shakespeare ["Sat, February 19, 2011 at 1:00pm","2011-02-19 13:00:00"], ["Fri, February 25, 2011 at 7:30pm","2011-02-25 19:30:00"], ["Sat, February 26, 2011 at 1:00pm","2011-02-26 13:00:00"], ["Thu, March 10, 2011 at 2:00pm","2011-03-10 14:00:00"], ["Thu, March 10, 2011 at 7:30pm","2011-03-10 19:30:00"], ["Sun, March 13, 2011 at 2:00pm","2011-03-13 14:00:00"] ]; // going solo: in acting shakespeare show_array[8] = [ // the gospel according to james ["Tue, March 22, 2011 at 7:30pm","2011-03-22 19:30:00"], ["Wed, March 23, 2011 at 6:30pm","2011-03-23 18:30:00"], ["Thu, March 24, 2011 at 7:30pm","2011-03-24 19:30:00"], ["Fri, March 25, 2011 at 7:30pm","2011-03-25 19:30:00"], ["Sat, March 26, 2011 at 1:00pm","2011-03-26 13:00:00"], ["Sat, March 26, 2011 at 5:00pm","2011-03-26 17:00:00"], ["Sun, March 27, 2011 at 2:00pm","2011-03-27 14:00:00"], ["Sun, March 27, 2011 at 7:00pm","2011-03-27 19:00:00"], ["Tue, March 29, 2011 at 6:30pm","2011-03-29 18:30:00"], ["Wed, March 30, 2011 at 7:30pm","2011-03-30 19:30:00"], ["Thu, March 31, 2011 at 7:30pm","2011-03-31 19:30:00"], ["Fri, April 1, 2011 at 7:30pm","2011-04-01 19:30:00"], ["Sat, April 2, 2011 at 5:00pm","2011-04-02 17:00:00"], ["Sat, April 2, 2011 at 9:00pm","2011-04-02 21:00:00"], ["Sun, April 3, 2011 at 2:00pm","2011-04-03 14:00:00"], ["Thu, April 7, 2011 at 2:00pm","2011-04-07 14:00:00"], ["Thu, April 7, 2011 at 7:30pm","2011-04-07 19:30:00"], ["Fri, April 8, 2011 at 7:30pm","2011-04-08 19:30:00"], ["Sat, April 9, 2011 at 4:00pm","2011-04-09 16:00:00"], ["Sat, April 9, 2011 at 8:00pm","2011-04-09 20:00:00"], ["Sun, April 10, 2011 at 2:00pm","2011-04-10 14:00:00"] ]; // the gospel according to james show_array[9] = [ // alfred hitchcock's the 39 steps ["Wed, April 20, 2011 at 6:30pm","2011-04-20 18:30:00"], ["Thu, April 21, 2011 at 7:30pm","2011-04-21 19:30:00"], ["Fri, April 22, 2011 at 7:30pm","2011-04-22 19:30:00"], ["Sat, April 23, 2011 at 1:00pm","2011-04-23 13:00:00"], ["Sat, April 23, 2011 at 5:00pm","2011-04-23 17:00:00"], ["Sun, April 24, 2011 at 2:00pm","2011-04-24 14:00:00"], ["Tue, April 26, 2011 at 7:30pm","2011-04-26 19:30:00"], ["Wed, April 27, 2011 at 7:30pm","2011-04-27 19:30:00"], ["Thu, April 28, 2011 at 2:00pm","2011-04-28 14:00:00"], ["Thu, April 28, 2011 at 7:30pm","2011-04-28 19:30:00"], ["Fri, April 29, 2011 at 7:30pm","2011-04-29 19:30:00"], ["Sat, April 30, 2011 at 5:00pm","2011-04-30 17:00:00"], ["Sat, April 30, 2011 at 9:00pm","2011-04-30 21:00:00"], ["Sun, May 1, 2011 at 2:00pm","2011-05-01 14:00:00"], ["Sun, May 1, 2011 at 7:00pm","2011-05-01 19:00:00"], ["Thu, May 5, 2011 at 7:30pm","2011-05-05 19:30:00"], ["Fri, May 6, 2011 at 7:30pm","2011-05-06 19:30:00"], ["Sat, May 7, 2011 at 4:00pm","2011-05-07 16:00:00"], ["Sat, May 7, 2011 at 8:00pm","2011-05-07 20:00:00"], ["Sun, May 8, 2011 at 2:00pm","2011-05-08 14:00:00"], ["Tue, May 10, 2011 at 6:30pm","2011-05-10 18:30:00"], ["Sat, May 14, 2011 at 5:00pm","2011-05-14 17:00:00"] ]; // alfred hitchcock's the 39 steps function set_count(value){ tick_count.innerHTML = value; // update num tickets in how many line price.innerHTML = prices[value]; // update price in how many section hidPrice.value = prices[value]; // update hidden field to hold price if(parseInt(num_tickets.value) > 0){ updateTicketsSubtotal(); } show_selection(value); } function show_selection(show){ var ply; var selects; var not_select = document.getElementById('not_selected'); not_select.style.display = 'none'; for(i = 1; i < 7; i++){ ply = document.getElementById('play_' + i); // play div if(i <= show){ ply.style.display = 'block'; // display play div } else { ply.style.display = 'none'; // hide play div if(document.getElementById){ selects = ply.getElementsByTagName('SELECT'); } else if (document.all){ selects = ply.all.tags('SELECT'); } for(var s in selects){ selects[s].selectedIndex = 0; // set the selects to first index if(s == 1){ selects[s].options.length = 1; // remove date select options } } } } } function populate_dates(sel_index, update_id){ var to_update = document.getElementById(update_id); to_update.options.length = 0; to_update.options[0] = new Option('Select a date', '', false, false); for(var m in show_array[sel_index]){ //var date = new Date(show_array[sel_index][m]); //to_update.options[parseInt(m) + 1] = new Option(date, show_array[sel_index][m], false, false); to_update.options[parseInt(m) + 1] = new Option(show_array[sel_index][m][0], show_array[sel_index][m][1], false, false); } to_update.options[to_update.options.length] = new Option('I will choose a date at a later time.', '', false, false); } function updateTicketsSubtotal(){ var tickets = parseInt(((document.getElementsByName('pick[tickets]')[0].value == '') ? 0 : document.getElementsByName('pick[tickets]')[0].value)) * hidPrice.value; ticketSub.innerHTML = tickets + '.00'; hiddenTicketsSubtotal.value = tickets; // update total updateTotal(); } function updateDonationSubtotal(){ var donation = parseInt(((document.getElementsByName('donation[amount]')[0].value == '') ? 0 : document.getElementsByName('donation[amount]')[0].value)); // donation subtotal + addon subtotal + package subtotal var don_subtotal = donation; // update page donSub.innerHTML = (don_subtotal) + '.00'; // update hidden field hiddenDonationSubtotal.value = donation; // update total updateTotal(); } function updateTotal(){ var total = 0; var subtotal = parseInt(document.getElementById('hiddenTicketsSubtotal').value); subtotal += parseInt(document.getElementById('hiddenDonationSubtotal').value); if(subtotal != 0){ /* if(savings.style.display == '' || savings.style.display == 'none'){ savings.style.display = 'block'; } */ // update page subtotalSub.innerHTML = (subtotal) + '.00'; // update subtotal text hiddenSubtotal = subtotal; // update subtotal hidden field /* // amount savings var totalSavings = parseInt(((document.getElementsByName('pick[tickets]')[0].value == '') ? 0 : document.getElementsByName('pick[tickets]')[0].value)) * 15; saving.innerHTML = (totalSavings) + '.00'; hiddenSavings.value = totalSavings; total = parseInt(subtotal) - parseInt(totalSavings); */ total = parseInt(subtotal); totalSub.innerHTML = (total) + '.00'; // update total text hiddenTotal.value = total; // update total hidden field } else { // savings.style.display = 'none'; } } function checkPickForm(){ var error = false; var alert_text = 'Missing required fields:\n\n'; // check passes for input var hiddenTicketsSubtotal = document.getElementById('hiddenTicketsSubtotal').value; if(hiddenTicketsSubtotal == 0){ alert_text += ' - You must add at least one ticket\n\n'; error = true; } // check donation for integer var donation = document.getElementsByName('donation[amount]')[0].value; if(parseInt(donation) == 'NaN'){ alert_text += '- The donation amount is not a number.\n'; error = true; } // check personal information var fname = document.getElementsByName('personal[fname]')[0].value; var lname = document.getElementsByName('personal[lname]')[0].value; var email = document.getElementsByName('personal[email]')[0].value; var email_check = document.getElementsByName('personal[email_check]')[0].value; var address = document.getElementsByName('personal[address]')[0].value; var city = document.getElementsByName('personal[city]')[0].value; var state = document.getElementsByName('personal[state]')[0].value; var zip = document.getElementsByName('personal[zip]')[0].value; var phone = document.getElementsByName('personal[phone]')[0].value; var cell = document.getElementsByName('personal[cell]')[0].value; if(fname == '' || fname == ' '){ alert_text += '- First name is required.\n'; error = true; } if(lname == '' || lname == ' '){ alert_text += '- Last name is required.\n'; error = true; } var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i; if (email.search(emailRegEx) == -1) { alert_text += '- Email address is not valid.\n'; error = true; } else if(email != email_check){ alert_text += '- Emails do not match.\n'; error = true; } if(address == '' || address == ' '){ alert_text += '- Address is required.\n'; error = true; } if(city == '' || city == ' '){ alert_text += '- City is required.\n'; error = true; } if(state == '' || state == ' '){ alert_text += '- State is required.\n'; error = true; } if(zip == '' || zip == ' '){ alert_text += '- Zip is required.\n'; error = true; } if((phone == '' || phone == ' ') && (cell == '' || cell == '')){ alert_text += '- A home phone or cell phone number is required.\n'; error = true; } // additional requests var add_requests = document.getElementsByName('personal[requests]')[0].value; if(error == false){ document.getElementById('subscription_form').action = "/forms/pick_submit.php"; setTimeout("document.getElementById('subscription_form').submit();",500); } else { alert(alert_text); return false; } } function limit_num(t){ var numb = "0123456789"; var w = ''; for(i=0; i < t.value.length; i++){ x = t.value.charAt(i); if(numb.indexOf(x,0) != -1){ w += x; } } t.value = w; } function _init_pick(){ prices = {6 : 197, 5 : 180, 4 : 155, 3 : 125}; price = document.getElementById('price'); hidPrice = document.getElementById('hiddenPrice'); ticketSub = document.getElementById('ticketsSubtotal'); hiddenTicketsSubtotal = document.getElementById('hiddenTicketsSubtotal'); num_tickets = document.getElementById('num_tickets'); donSub = document.getElementById('donationSubtotal'); hiddenDonationSubtotal = document.getElementById('hiddenDonationSubtotal'); subtotalSub = document.getElementById('subtotal'); hiddenSubtotal = document.getElementById('hiddenSubtotal'); savings = document.getElementById('savings'); saving = document.getElementById('saving'); hiddenSavings = document.getElementById('hiddenSavings'); totalSub = document.getElementById('total'); hiddenTotal = document.getElementById('hiddenTotal'); tick_count = document.getElementById('tick_count'); }