/* Crossroads.js Released under the MIT license Author: Miller Medeiros Version: 0.7.1 - Build: 93 (2012/02/02 09:29 AM) */ (function(f){f(["signals"],function(g){function f(a,b){if(a.indexOf)return a.indexOf(b);else{for(var c=a.length;c--;)if(a[c]===b)return c;return-1}}function i(a,b){return"[object "+b+"]"===Object.prototype.toString.call(a)}function n(a){return a===null||a==="null"?null:a==="true"?!0:a==="false"?!1:a===m||a==="undefined"?m:a===""||isNaN(a)?a:parseFloat(a)}function k(){this._routes=[];this.bypassed=new g.Signal;this.routed=new g.Signal}function o(a,b,c,e){var d=i(a,"RegExp");this._router=e;this._pattern= a;this._paramsIds=d?null:h.getParamIds(this._pattern);this._optionalParamsIds=d?null:h.getOptionalParamsIds(this._pattern);this._matchRegexp=d?a:h.compilePattern(a);this.matched=new g.Signal;b&&this.matched.add(b);this._priority=c||0}var j,h,m;k.prototype={normalizeFn:null,create:function(){return new k},shouldTypecast:!1,addRoute:function(a,b,c){a=new o(a,b,c,this);this._sortedInsert(a);return a},removeRoute:function(a){var b=f(this._routes,a);b!==-1&&this._routes.splice(b,1);a._destroy()},removeAllRoutes:function(){for(var a= this.getNumRoutes();a--;)this._routes[a]._destroy();this._routes.length=0},parse:function(a){var a=a||"",b=this._getMatchedRoutes(a),c=0,e=b.length,d;if(e)for(;c