Index: js/parade.js
===================================================================
--- js/parade.js	(revision 8972)
+++ js/parade.js	(working copy)
@@ -205,6 +205,47 @@
     };
 	
 	/**
+	 * Retrieve url of xml source.
+	 * 
+	 * @param {Object} that the component itself.
+	 * @param {int} low starting point of xml source.
+	 * @param {int} high end point of xml source.
+	 * @param {String} urlParam search parameters.
+	 */
+	var getUrlSource = function (that, low, high, urlParam) {
+		var urlSource;
+		// Check on connectivity mode.
+        if (that.options.connectivity.standaloneMode) {
+			urlSource = "../data/SearchRequest_" + low + "_" + high + ".xml";
+		} else {
+			urlSource = that.options.connectivity.kettleParadeUrl + urlParam;
+		}
+		return urlSource;
+	};
+	
+	/**
+	 * Callback function to retrieve server data bloc.
+	 * 
+	 * @param {Object} that the component itself.
+	 */
+	var getBlocCallback = function (that) {
+		return {
+			success: function (data) {
+                that.dataBloc = fluid.wrap(data.documentElement);
+                processItems(that);
+                that.model.currentBloc++;
+                if (that.model.currentBloc < that.model.blocs) {
+                    getBloc(that);
+                }
+                else {
+                    // With the last data bloc at home, data can be sorted.
+                    sortItems(that);
+                }
+			}
+		};
+	};
+	
+	/**
      * Retrieve server data bloc.
      *
      * @param {Object} that the component itself.
@@ -215,25 +256,8 @@
         var low = that.model.currentBloc * 20;
         var high = (that.model.currentBloc + 1) * 20;
         var urlParam = getParamString(that, low, 20);
-		var urlSource;
-        // Check on connectivity mode.
-        if (that.options.connectivity.standaloneMode) {
-            urlSource = "/bug-parade/data/SearchRequest_" + low + "_" + high + ".xml";
-        } else {
-            urlSource = that.options.connectivity.kettleParadeUrl + urlParam;
-        }
-        $.get(urlSource, function (data) {
-            that.dataBloc = fluid.wrap(data.documentElement);
-            processItems(that);
-            that.model.currentBloc++;
-            if (that.model.currentBloc < that.model.blocs) {
-                getBloc(that);
-            }
-            else {
-                // With the last data bloc at home, data can be sorted.
-                sortItems(that);
-            }
-        });
+		var urlSource = getUrlSource(that, low, high, urlParam);
+		$.ajax({url: urlSource, dataType: "xml", success: getBlocCallback(that).success});
     };
 	
     /**
@@ -258,59 +282,42 @@
             getBloc(that);
         }
     };
-    
+
+	/**
+     * Callback function to process information headers.
+     * 
+     * @param {Object} that the component itself.
+     */
+    var getCountCallback = function (that) {
+        return {
+            success: function (data) {
+                that.dataBloc = fluid.wrap(data.documentElement);
+            
+                // Let ajax subsystems handle it's events.
+                processCountBloc(that);
+            }
+        };
+    };
+	
     /**
-     * Do the first ajax request to process information headers.
+     * Process information headers.
      *
      * @param {Object} that the component itself.
      */
     var getCount = function (that) {
         var urlParam = getParamString(that, 0, 1);
-		var urlSource;
-        // Check on connectivity mode.
-        if (that.options.connectivity.standaloneMode) {
-            urlSource = "/bug-parade/data/SearchRequest_0_1.xml";
-        } else {
-            urlSource = that.options.connectivity.kettleParadeUrl + urlParam;
-        }
-        $.get(urlSource, function (data) {
-            that.dataBloc = fluid.wrap(data.documentElement);
-            
-            // Let ajax subsystems handle it's events.
-            processCountBloc(that);
-        });
+		var urlSource = getUrlSource(that, 0, 1, urlParam);
+		$.ajax({url: urlSource, dataType: "xml", success: getCountCallback(that).success});
     };
 	
 	/**
-	 * Parse optional url parameter.
-	 * 
-	 * @param {Object} name the parameter to be parsed.
-	 */
-	var getUrlParam = function (name) {
-        var regex;
-        var regexS;
-        var results;
-        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
-        regexS = "[\\?&]" + name + "=([^&#]*)";
-        regex = new RegExp(regexS);
-        results = regex.exec(window.location.href);
-		if (results === null) {
-			return "";
-		} else {
-			return results[1];
-		}
-	};
-	
-	/**
      * Set connectivity mode (default: standaloneMode false).
      *
      * @param {Object} that the component itself.
      */
 	var setConnectivityMode = function (that) {
-		var mode = getUrlParam("mode");
-        if (mode === "standalone") {          
-            that.options.connectivity.standaloneMode = true;
-        }
+		var url = window.location;
+		that.options.connectivity.standaloneMode = url.protocol === "file:";
     };
     
     /**
