$('#ebay_getorders_button').click(function(	) {
        var source = 'THE SOURCE';

            source = new EventSource('../lexington/php/ebay_api/ebaycalls/getorders.php');
            //source = new EventSource('http://localhost/lexington_lavedo/php/ebay_api/test/task.php');
            //a message is received
            source.addEventListener('message' , function(e) 
            {
                var result = JSON.parse( e.data );
                 
                add_log(result.message);
                 
                //document.getElementById('progressor').style.width = result.progress + "%";
                 
                if(e.data.search('ENDE') != -1)
                {
                    add_log(''); // CAN BE AN END MESSAGE
                    source.close();
                }
            });
           /* // VERURSACHT WARSCHEINLICH EIN ANZEIGEFEHLER.
            source.addEventListener('error' , function(e)
            {
                add_log('Error occured');
                 
                //kill the object ?
                source.close();
            });
			*/
        });
        
        function stop_task()
        {
            source.close();
            add_log('Interrupted');
        }
         
        function add_log(message)
        {
            var r = document.getElementById('message_order');
            r.innerHTML += message + '<br>';
            r.scrollTop = r.scrollHeight;
        }
