function isMobile() {
- var ua = navigator.userAgent;
- var devices = ['iphone', 'ipad', 'ipod', 'droid', 'blackberry', 'mobile', 'htc', 'samsung', 'nokia', 'archos', 'galaxy', 'motorola', 'pad', 'tab', 'slate', 'motorola', 'symbian', 'phone', 'nintendo', 'playstation', 'touch', 'webos', 'ericsson'];
- var pattern;
+ var ua = navigator.userAgent;
+ var devices = ['iphone', 'ipad', 'ipod', 'droid', 'blackberry', 'mobile', 'htc', 'samsung', 'nokia', 'archos', 'galaxy', 'motorola', 'pad', 'tab', 'slate', 'motorola', 'symbian', 'phone', 'nintendo', 'playstation', 'touch', 'webos', 'ericsson'];
+ var pattern;
- if (Modernizr.ftouch) {
- return true;
- }
+ if (Modernizr.ftouch) {
+ return true;
+ }
- for (i = 0; i < devices.length; i++) {
- pattern = new RegExp(devices[i], 'i');
- if (ua.search(pattern) > -1) {
- return true;
- }
- }
- return false;
+ for (i = 0; i < devices.length; i++) {
+ pattern = new RegExp(devices[i], 'i');
+ if (ua.search(pattern) > -1) {
+ return true;
+ }
+ }
+ return false;
}
function parseGet() {
- var couples = window.location.search.substr(1).split('&');
- var res = new Array();
- var couple = new Array();
- for (var i = 0; i < couples.length; i++) {
- couple = couples[i].split('=');
- res[couple[0]] = couple[1];
- }
- return res;
+ var couples = window.location.search.substr(1).split('&');
+ var res = new Array();
+ var couple = new Array();
+ for (var i = 0; i < couples.length; i++) {
+ couple = couples[i].split('=');
+ res[couple[0]] = couple[1];
+ }
+ return res;
}
-function getBaseURL() {
- var l = window.location.toString();
- var e = l.split("#");
- var l = e[0];
- if (l.indexOf('.') != -1) {
- e = l.split('/');
- e.pop();
- l=e.join('/');
- }
- return l;
+function getBaseURL(removeQuery) {
+ if (removeQuery === undefined) {
+ removeQuery = false;
+ }
+ var l = window.location.toString();
+ var e = l.split("#");
+ var l = e[0];
+
+ if (removeQuery) {
+ e = l.split('?');
+ l = e[0];
+ }
+
+ if (l.indexOf('.') != -1) {
+ e = l.split('/');
+ e.pop();
+ l = e.join('/');
+ }
+ return l;
}
\ No newline at end of file