
function validate_form(thisform) {
        if (document.getElementById("name") && document.getElementById("name").value == '') {
                alert("Please provide your name.");
                document.getElementById("name").focus();
                return false;
        }       
        if (document.getElementById("email") && document.getElementById("email").value == '') {
                alert("Please provide your email.");
                document.getElementById("email").focus();
                return false;
        }       
        if (document.getElementById("phone") && document.getElementById("phone").value == '') {
                alert("Please provide your phone number.");
                document.getElementById("phone").focus();
                return false;
        }       
        if (document.getElementsByName("loc")) {
                myOption = -1;
                for (i=thisform.loc.length-1; i > -1; i--) { if (thisform.loc[i].checked) { myOption = i; i = -1; } }
                if (myOption == -1) { 
                        alert("Please select a location");
                        return false;
                }
                return true;
        }

        if (document.getElementById("type") && document.getElementById("type").value == '') {
                alert("Please select a donor type.");
                document.getElementById("type").focus();
                return false;
        }       
        return true;
}

function readPage(pageDisplay,arg1,arg2,arg3) {
        var xmlHttp;
        try { // Firefox, Opera 8.0+, Safari
                xmlHttp=new XMLHttpRequest();
        }
        catch (e) { // Internet Explorer
                try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } 
                catch (e) {
                        try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
                        catch (e) {
                                alert("Your browser does not support AJAX!");
                                return false;
                        }
                }
        }
        xmlHttp.onreadystatechange=function() {
                if(xmlHttp.readyState==4) {
                                document.getElementById(pageDisplay).innerHTML=xmlHttp.responseText; 
                }
        }


        if (pageDisplay == 'generate_appt') {
                xmlHttp.open("GET","./show_appt.php?appt=" + arg1 ,true);
        }       
        if (pageDisplay == 'generate_donor') {
                xmlHttp.open("GET","./show_appt.php?donor=" + arg1 ,true);
        }       
        xmlHttp.send(null);

}

