﻿var cal = new CalendarPopup();

function EditClass(classID)
{
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "edit";
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnCID").value = classID;
    window.document.forms[0].submit();
}

function DeleteClass(classID)
{
    var ok = window.confirm("Are you sure you wish to delete this class? There is NO UNDO and if this class is applied against any time you will not be able to delete it.");
    if (ok)
    {
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "delete";
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnCID").value = classID;
        window.document.forms[0].submit();
    }
}

function EditFaculty(facultyID)
{
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "edit";
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnFID").value = facultyID;
    window.document.forms[0].submit();
}

function DeleteFaculty(facultyID)
{
    var ok = window.confirm("Are you sure you wish to delete this faculty member? There is NO UNDO and if this faculty member is applied against any time you will not be able to delete it.");
    if (ok)
    {
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "delete";
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnFID").value = facultyID;
        window.document.forms[0].submit();
    }
}

function AssignStudentClasses(studentID)
{
    window.location.href = "StudentClasses.aspx?SID=" + studentID;
}

function EditStudent(studentID)
{
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "edit";
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnSID").value = studentID;
    window.document.forms[0].submit();
}

function DeleteStudent(studentID)
{
    var ok = window.confirm("Are you sure you wish to delete this student? There is NO UNDO and if this student is applied against any time you will not be able to delete it.");
    if (ok)
    {
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "delete";
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnSID").value = studentID;
        window.document.forms[0].submit();
    }
}

function EditTime(timeID)
{
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "edit";
    window.document.getElementById("ctl00_ContentPlaceHolder1_hdnTID").value = timeID;
    window.document.forms[0].submit();
}

function DeleteTime(timeID)
{
    var ok = window.confirm("Are you sure you wish to delete this time for the selected student? There is NO UNDO!.");
    if (ok)
    {
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnMode").value = "delete";
        window.document.getElementById("ctl00_ContentPlaceHolder1_hdnTID").value = timeID;
        window.document.forms[0].submit();
    }
}

function LoadReport(reportID)
{
    //window.location.href="GenerateReport.aspx?RID=" + reportID;
    window.open("GenerateReport.aspx?RID=" + reportID, "GenReport", "width=1024,height=768,top=0,left=0,location=yes,toolbar=yes,directories=no,status=yes,scrollbars=yes,resize=yes,menubar=yes");
}




