Index: schedule/Module/calendar.php
===================================================================
--- schedule/Module/calendar.php	(revision 16559)
+++ schedule/Module/calendar.php	(revision 16573)
@@ -12,6 +12,7 @@
     <script src="Module/src/js/jscal2.js"></script>
     <script src="Module/src/js/unicode-letter.js"></script>
-	<script src="Module/Graph.js"></script>
+	<script src="js/Graph.js"></script>
     <script src="Module/src/js/lang/en.js"></script>
+    <script src="js/xmlrequest.js"></script>
 <style type="text/css">
       .highlight { color: #0f0 !important; font-weight: bold; }
@@ -94,74 +95,5 @@
 					</script>
                 <script type="text/javascript">//<![CDATA[
-				var index = 0;
-				var xmlhttp = new Array();
-                var testXML;
-				var source = ['Mrk 421','Mrk 501'];
-				var sourceData = [[]];
-				var obj;
-				var day;
-				var year;
-				var month;
-				function getXML() 
-				{
-                    xmlhttp.push(new XMLHttpRequest());
-					index = xmlhttp.length - 1;
-                }
-
-				function getXMLData()
-				{
-					getXML();
-                    xmlhttp[index].onload=xmlStateChange();
 				
-					xmlhttp[index].open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true);
-					xmlhttp[index].send();
-				}
-				
-				function xmlStateChange()
-				{
-                     alert(index+" "+xmlhttp[index].readyState+" "+xmlhttp[index].status + " " + xmlhttp[index].statusText);
-					 if (xmlhttp[index].readyState==4 && xmlhttp[index].status==200)
-						{
-						//sourceData[index]= new Array(); //--> remove this if you use sourceData[[]]
-						line=xmlhttp[index].responseText.split('\n');
-							for(row=0;row<line.length;row++)
-							{
-							rows=line[row].split(',');
-							sourceData[index].push(rows[4]);
-							}
-						}
-				}
-
-				
-				function displayData() //--> you can use the content of this function in the event listener
-				{
-					for (i=0; i<source.length; i++)
-					{
-					getXMLData();
-					//display source data here sourceData[i]
-					document.getElementById('data').innerHTML=sourceData[i];
-					}	
-				}
-
-                function testData() 
-                {
-                    var url = "https://www.fact-project.org/smartfact/index.php?source=Mrk%20421&time=2012-12-10"
-                    testXML = new XMLHttpRequest();
-                    testXML.open("GET",url,true);
-                    alert ("test data");
-                    testXML.onload=function() {
-                        alert (" status: " + testXML.readyState + " " + testXML.status);
-                        if (testXML.status==200)
-						{
-                            alert ("request ok");
-                    }
-                    else
-                    {
-                        alert("status: " + testXML.statusText + " " + testXML.status);
-                    }
-                    };
-					
-                    testXML.send();
-                }
                  CAL.addEventListener("onSelect", function(){
 							 day =this.selection.print("%d").join("\n");
@@ -169,12 +101,6 @@
 							year =this.selection.print("%Y").join("\n");	
 							//document.getElementById('data').innerHTML="Calendar selected! ";
-							                       
-                        alert ("event here");
-                        //testData();
-						for (i=0; i<source.length; i++)
-                        {
-                        getXMLData();
-                        document.getElementById('data').innerHTML=sourceData[i];
-                        }	
+							 testData();                   
+                        	
                 });
 						
