Topic: newbieee... almost there with xajax


just started getting into the "AJAX world" with  xajax for one of my projects... very nice and simple.

if someone could show me how to do the following it would be greatly appreciated. I don't understand the variable exchange.

1. I have my xajax function created and works fine.. it returns the results of a table query. (its basically a stripped down version of the sample callscripttest.php.. less all the html code. I just need an array passed back to my JS function.

I have a JS function that is used to do some validation:

claims_detail_grid.Form_CustomValidate = 
function(fobj) {
     var FSCcode = elements["x_SERVCO"].value;

     <?php $results = FSCrequirements( MY JS VARIABLE FSCcode HERE...) ?>
     var IsDiagCodeRequred = "<?php echo $results['IsDiagCodeRequired'] ?>"


so, how do to i get the JS variable FSCcode to the xajax function FSCrequirements($FSCode), do i need a JS function in my xajax module... I don't understand... the xajax function is posted below my name....

any insight appreciated.

------------------------- the XAJAX CODE -----------
require_once( "library/xajax/xajax_core/" );

function FSCrequirements($FSCode)

    $SQL = "SELECT ".
        "b.FSC, b.Expand, b.Man_Review_Required, b.Diag_Required, b.Ref_Physcian_Required, ".
        "b.Hosp_Required, b.Admit_Date_Required, b.IO_Patient_Required Surgery, ".
        "b.Non_Patient_Billing, b.MRI_Excluded SLI_Required, b.Documentation_Required, b.Prior_Auth_Required ".
        "FROM billing_sob_ohip_on_ca b ".
        "WHERE b.FSC ='" .$FSCode. "'";
        global $conn;
        if (!isset($conn)) $conn = ew_Connect();       
        $result = $GLOBALS['conn']->Execute($SQL);

        $response=new xajaxResponse();     

    return ($response);

$xajax=new xajax();
$xajax->configure("debug", false);
$xajax->register(XAJAX_FUNCTION, "FSCrequirements");

$xajax->configure('javascript URI','library/xajax/');