Of course, being synchronous, your entire application now locks up while it's waiting for the response from your server.
Declare the output variable outside the function.
var output = '';
function responseInquiryAJAX(pageElement)
{
if(req.readyState == 4)
{
if(req.status == 200)
{
output = req.responseText;
}
}
}
}
Now its scope is no longer limited to just that function.
Another option is to pass an object to the event handler, and have responseInquiryAJAX() update its properties; when responseInquiryAJAX() returns, the object will still be updated. An example would be the "pageElement" variable you're passing around (but not using). If that's an object, then that object could be changed by responseInquiryAJAX(), and those changes will remain after responseInquiryAJAX() has returned.
function responseInquiryAJAX(pageElement)
{
if(req.readyState == 4)
{
if(req.status == 200)
{
pageElement.someProperty = req.responseText;
}
}
}