var viewportHeight = $(window).height();
var viewportWidth = $(window).width();

var isIpad = navigator.userAgent.match(/iPad/i) != null;
var isIphone = navigator.userAgent.match(/iPhone/i) != null;
var isIpod = navigator.userAgent.match(/iPod/i) != null;
var isAndroid = navigator.userAgent.match(/Android/i) != null;

//fixme ca va chier quand 10
var isFirefoxLegacy = navigator.userAgent.match(/Firefox\/[0-3]/i) != null;
var isFirefox = navigator.userAgent.match(/Firefox\/[4-9]/i) != null;

var isFirefoxGlobal = false;
if((isFirefox == true) || (isFirefoxLegacy == true) ) {
	isFirefoxGlobal = true;
}

if ($.browser.chrome) {
  userAgent = userAgent.substring(userAgent.indexOf('chrome/') + 7);
  userAgent = userAgent.substring(0,userAgent.indexOf('.'));
  version = userAgent;
  // If it is chrome then jQuery thinks it's safari so we have to tell it it isn't
  $.browser.safari = false;
  browser = "Chrome";
}

var isMobile = false;
if((isIphone == true) || (isAndroid == true) || (isIpod == true) ) {
	isMobile = true;
}

jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
    this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
    return this;
}

