loadScript("js/yui/connection.js");

var loading = "<img src=\""+root+"/images/loading.gif\"/>";

var handle_error = function(o) {
    //alert("Oops:\n"+o.statusText);
    alert(o.statusText);
}
var process_response = function(o) {
    var root = o.responseXML.documentElement;
    var html = root.getElementsByTagName('html')[0].firstChild.nodeValue;
    var message = root.getElementsByTagName('message')[0].firstChild.nodeValue;
    var script = root.getElementsByTagName('script')[0].firstChild.nodeValue;
    var status = root.getElementsByTagName('status')[0].attributes[0].value;
    if(status=='error') {
        handle_error({'statusText':message});
        return {};
    }
    if(script && script!="") {
        try {
            eval(script);
        }
        catch(e){alert(e)};
    }
    return {'html':html,'message':message,'status':status,'argument':o.argument,'xml':root};
}

var ajax_request = function(method,uri,callback,postData) {
    YAHOO.util.Connect.asyncRequest(method,uri,callback,postData);
}