﻿var jQ = jQuery.noConflict();
function checkForDiv(id) { var div = document.getElementById(id); if (div) { return true } else { return false } }
jQ(document).ready(function() {
    if (checkForDiv("privacy")) {
        jQ("#privacy").click(function() {
            jQ("#privacyPop").fadeIn("slow");
        });
        jQ("#privacyPop #close").click(function() {
            jQ("#privacyPop").fadeOut("slow");
        });
    }

    //Allows only numbers to be typed for input boxes with a class named 'numOnly'
    jQ('input:text').keypress(function(e) {
        if (jQ(this).hasClass('numOnly')) {
            if (e.which != 8 && (e.which < 48 || e.which > 57)) {
                return false;
            }
        }
    });

    // Request form
    jQ('select[id$=emailfield_isTicketed]').change(function() {
        var $price = jQ("#ticketPrice");

        if (jQ(this).val() == "Yes") {
            $price.removeClass('hideMe');
        } else if (jQ(this).val() == "No") {
            $price.addClass('hideMe');
        }
    });
    jQ('input[id$=emailfield_EventDate]').datepicker({ minDate: 1 });
    jQ('input[id$=emailfield_ResponseDate]').datepicker({ minDate: 1 });
    






});