// mobile.js
// Detects mobile device and redirects users from TWFF site pages
// to their mobile equivalent.

(function() {
	if (navigator.userAgent.match(/iP(od|hone)/i) || (navigator.userAgent.match(/android/i)) || (navigator.userAgent.match(/blackberry/i)))
	{
		var baseurl = "ubcle.com/twff2011/";
		if (! (window.location.href.match(baseurl + "m$") || window.location.href.match(baseurl + "m/.*")))
		{
			var currPage = window.location.href.match(baseurl + "(.*)")[1];
			location.replace("m/" + currPage);
		}
	}
})();


