rem: d=doSimpleXMLHttpRequest('services/send_email.php', 
add: d=doSimpleXMLHttpRequest(urlpath + '/services/send_email.php', 
context: sendEmailNotice = function(self,audit_id){    ih=self.innerHTML;    self=swapDOM(self,P({},'Sending', IMG({'src':'/images/spinner.gif'})));    var trim = function(str){        return str.replace(/^\s+|\s+$/g, "")    };    var tuplesplit = function(i){         if(typeof(i) == 'string'){return i.split('=')}    };    var findcoop= function(x){return  x[0] == 'coop'};    try{        cookie=filter(findcoop,                      map(tuplesplit,                           map(trim, document.cookie.split(';'))))[0][1]            } catch (e){                self.innerHTML = 'No cookies?';            }    // now the ugly no-cookie way    if(cookie == undefined){        try{            cookie=filter(findcoop,                          map(tuplesplit,                               window.location.search.slice(1).split('&')))[0][1];        } catch (e){            self.innerHTML = "Can't find cookie";        }    }    //TODO: send as a cookie header instead of passing this silly way    /// XXX also need a proper path or base_url here!!    d=doSimpleXMLHttpRequest('services/send_email.php',         {'audit_id': audit_id,        'coop' : cookie});    d.addCallback(function(data){         self.innerHTML='Done'});     d.addErrback(function(err) { self.innerHTML= 'Error!'});     return false;}
meta: 7995	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/7995/061fe291743cfaa3354e39e4dde1c73679de9c61/send_email.js/clean/web/lib/send_email.js