//Common javascript functions

//
function OnClick_Cancel()
{
    location.reload(true);
}

//
function SetHiddenField(appointmentDateClientID, txtAppointmentDate)
{
    //var hiddenControl = '<%=hiddenAppDate.ClientID %>';
    document.getElementById(appointmentDateClientID).value=txtAppointmentDate.value;

   //document.forms[0].hiddenAppDate.value = txtAppointmentDate.value;
   document.forms[0].submit();
}    

//
function ConfirmCacnel(hiddenControl, appointmentmessage, appointmentID)
{
    if(confirm('Are you sure you want to cancel the confirmed appointment \n scheduled for ' + appointmentmessage + '?'))
        {
            document.getElementById(hiddenControl).value=appointmentID;
            //document.forms[0].AppointmentID.value = appointmentID;
            document.forms[0].submit();
        }
}

//
function ConfirmCancelAppointment(appointmentClientID, actionClientID, action, appointmentmessage, appointmentID)
{

    if(action=='CON')
    {
        if(confirm('Are you sure you want to confirm the appointment \n scheduled for ' + appointmentmessage + '?'))
         {
                document.getElementById(appointmentClientID).value = appointmentID;
                document.getElementById(actionClientID).value = action;
                document.forms[0].submit();   
         }   
    }
    else
    {
        if(confirm('Are you sure you want to cancel the requested appointment \n scheduled for ' + appointmentmessage + '?'))
         {
                document.getElementById(appointmentClientID).value = appointmentID;
                document.getElementById(actionClientID).value = action;
                document.forms[0].submit();
         }
    }   
    //
    
}


