﻿/* TOGGLE PANEL */
function togglepanel(id) {
    if (document.getElementById(id).style.display == 'none')
        document.getElementById(id).style.display = '';
    else
        document.getElementById(id).style.display = 'none';
}

/* SEND MAIL */
function sendRecommendationMail(o, userid) {    
    try {
        var to = document.getElementById(o.attributes['toBox'].value).value;
        var from = document.getElementById(o.attributes['fromBox'].value).value;        
        if ((from == '') || (to == '')) {
            alert('The \'From\' and \'To\' emails must be specified!');
            return;
        }
        JacksonHealthCare.MedicalMissions.WebSite.WebService.MainServices.SendRecommendationMail(
				userid,
				to,
				from,
				o.attributes['jobid'].value,
				document.getElementById(o.attributes['commentBox'].value).value, sendRecommendationMailCallback, sendRecommendationMailCallbackError);

        //Notify user
        //alert('The email has been sent.');

    }
    catch (err) {
        //alert(err);
        //alert(err.description);
    }

}
function sendRecommendationMailCallback() { alert('The email has been sent.'); }
function sendRecommendationMailCallbackError() { alert('An error occurred while trying to send the email.'); }

