var skyForm;

function eventsInit() {
    try {
        formInit();
    } catch(e) { }
}


function formInit() {
    // create an instance of the form class
    try {
        skyForm = new DraftfcbForm(document.forms["skyEvents"]);
    } catch(e) { }

    // project-specific form properties
    skyForm.ErrorBox = $("p#eventSearchFormError");

    skyForm.Rules.push(
        { Field:  "startDate",     Method: "Required",          ErrorId: "errorDepartRequired" },
        { Field:  "endDate",       Method: "Required",          ErrorId: "errorReturnRequired" },
        { Field:  "startDate",     Method: "DateValid",         ErrorId: "errorDepartValid" },
        { Field:  "endDate",       Method: "DateValid",         ErrorId: "errorReturnValid" },
        { Field:  "startDate",     Method: "DateNotPast",       ErrorId: "errorDepartPast" },
        { Field:  "endDate",       Method: "DateNotPast",       ErrorId: "errorReturnPast" },
        { Method: "ReturnIsLater", ErrorId: "errorReturnLater", Params: { StartField: "startDate", EndField: "endDate" } }
    );
}

function formValidate() {
    return skyForm.Validate();
}

function handleSubmit() { }
